CN110377850A - Resource file loading method, device, electronic equipment and storage medium - Google Patents
Resource file loading method, device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN110377850A CN110377850A CN201910506522.1A CN201910506522A CN110377850A CN 110377850 A CN110377850 A CN 110377850A CN 201910506522 A CN201910506522 A CN 201910506522A CN 110377850 A CN110377850 A CN 110377850A
- Authority
- CN
- China
- Prior art keywords
- resource file
- file
- app
- version number
- download
- 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
Links
- 238000011068 loading method Methods 0.000 title claims abstract description 42
- 238000000034 method Methods 0.000 claims abstract description 35
- 230000015654 memory Effects 0.000 claims description 9
- 238000004590 computer program Methods 0.000 claims description 7
- 238000010586 diagram Methods 0.000 description 14
- 230000006870 function Effects 0.000 description 5
- 230000000694 effects Effects 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 1
- 239000004744 fabric Substances 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000011084 recovery Methods 0.000 description 1
- 239000000725 suspension Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
- G06F16/9574—Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the invention provides a kind of resource file loading method, device, electronic equipment and storage mediums, wherein the described method includes: obtaining the current version number of resource file from the configuration file of App when App starting;Judge current version number whether lower than available edition number;If current version number is lower than the available edition number, from network downloading new version resource file into the resource file download directory of App;The target resource file loaded needed for being searched in resource file download directory;Load target resource file.As it can be seen that the resource file downloading that will have supported App to operate normally finishes, therefore, when App needs to load resource file, it is only necessary to be loaded directly into the target resource file downloaded and finished before really load resource file.Can timely update resource file in this way, while greatly reduce the time that user waits the operations such as App displayed page, improve the experience sense of user.
Description
Technical field
This application involves set with App development technique field more particularly to a kind of resource file loading method, device, electronics
Standby and storage medium.
Background technique
In the normal course of operation of App (Application, application software), need required all kinds of resource files
It is loaded into memory, then these resource files is read.If resource file version is inappropriate or resource is literary
The loading velocity of part is excessively slow, can all influence the normal operation of App.
In order to improve the loading velocity of resource file, usually can need to resource file to be loaded be pre-stored within App
Local resource file in.In this way when needing to load related resource file, so that it may directly from local resource file
Load improves the whole loading velocity of resource file to omit the time of resource file downloading.For example, a information nearby
Recommend App, in order to improve the displaying speed after App is opened, needs that resource file needed for the App is stored in App's in advance
In local resource file, the resource file of the App generally comprises map resource packet, information aggregate packet, picture resource packet etc..When
After opening the App, map resource packet, information aggregate packet, picture resource packet etc. are loaded directly from resource file, so that it may fast
Speed shows map interface, and recommendation information thereon and picture concerned etc..
Although the method for loading resource file from local resource file can guarantee loading velocity, due to local
The resource file stored in resource folder is usually fixed constant, with the continuous renewal of resource data, may go out
The resource file and the incompatible situation of actually required resource file stored in existing local resource file, for example, local
Resource file version number be likely lower than actually required resource file version number.In the case, in load local resource file
After the resource file stored in folder, it still will appear the case where APP is unable to operate normally.
Summary of the invention
This application provides a kind of resource file loading method, device, electronic equipment and storage mediums, to solve existing money
Source loading method can not timely update resource file the problem of.
In a first aspect, the embodiment of the invention provides a kind of resource file loading methods, comprising:
When App starting, the current version number of resource file is obtained from the configuration file of the App;
Whether the current version number is judged lower than available edition number, and the available edition number is that App can be enabled normally to transport
Version number corresponding to capable resource file;
If the current version number is lower than the available edition number, new version resource file is downloaded to described from network
In the resource file download directory of App, the new version resource file is the resource file that version number is higher than available edition number;
The target resource file loaded needed for being searched in the resource file download directory;
Load the target resource file.
In a kind of possible implementation of first aspect of the embodiment of the present invention, if the current version number is lower than available
Version number, then download new version resource file from network includes: into the resource file download directory of App
Current network environment is obtained, the current network environment includes speed of download and signal strength;
If the speed of download is lower than intensity threshold lower than threshold speed and/or signal strength, answered from network downloading
For the corresponding resource file of anxious version number into the resource file download directory of the App, the emergency version number is closest to working as
The available edition number of preceding version number.
In a kind of possible implementation of first aspect of the embodiment of the present invention, if the current version number is lower than available
Version number, then download new version resource file from network includes: into the resource file download directory of App
If current version number is lower than available edition number, obtain in presently described resource file download directory all under
The corresponding version number of resource file is carried, the resources to be downloaded file is not download the resource file finished;
Prioritized resources file is downloaded from the resource file download directory, the prioritized resources file is the resource text
Version number is higher than resources to be downloaded file corresponding to the available edition number in part download directory.
In a kind of possible implementation of first aspect of the embodiment of the present invention, the method also includes:
If all the corresponding version number of the resources to be downloaded file is below the available edition number, under network
New version resource file is carried into the resource file download directory of App.
In a kind of possible implementation of first aspect of the embodiment of the present invention, the method also includes:
If the current version number is greater than or equal to available edition number, searched in the resource file download directory
The target resource file of required load;
If the target resource file is not present in the resource file download directory, from the local money of the App
Corresponding target resource file is loaded in source folder.
In a kind of possible implementation of first aspect of the embodiment of the present invention, the method also includes:
Resource file to be deleted, the filename of the resource file to be deleted are determined in the local resource file of App
It is identical as the filename of any resource file in the resource file download directory;
The resource file to be deleted is deleted, local resource file after duplicate removal is obtained.
Second aspect, the embodiment of the invention provides a kind of resource file loading devices, comprising:
Version number obtains module, for obtaining working as resource file from the configuration file of the App when App starting
Preceding version number;
Judgment module, for whether judging the current version number lower than available edition number, the available edition number is energy
Version number corresponding to the resource file for enough enabling App operate normally;
Resource file download module, if being lower than the available edition number for the current version number, under network
New version resource file is carried into the resource file download directory of the App, the new version resource file is higher than for version number
The resource file of available edition number;
Searching module, the target resource file for being loaded needed for being searched in the resource file download directory;
Loading module, for loading the target resource file.
In a kind of possible implementation of second aspect of the embodiment of the present invention, the resource file download module includes:
Network environment obtains module, for obtaining current network environment, the current network environment include speed of download and
Signal strength;
Emergency resources file download module, if low lower than threshold speed and/or signal strength for the speed of download
In intensity threshold, then from the corresponding resource file of network loading emergency version number into the resource file download directory of the App,
The emergency version number is the available edition number closest to current version number.
In a kind of possible implementation of second aspect of the embodiment of the present invention, the resource file download module includes:
Resources to be downloaded fileversion number obtains module, if being lower than available edition number for current version number, obtains
The corresponding version number of whole resources to be downloaded file, the resources to be downloaded file are in presently described resource file download directory
The resource file finished is not downloaded;
Prioritized resources download module, it is described excellent for downloading prioritized resources file from the resource file download directory
First resource file is that version number is higher than resources to be downloaded corresponding to the available edition number in the resource file download directory
File.
In a kind of possible implementation of second aspect of the embodiment of the present invention, described device further include:
Network download module, if being below for all corresponding version numbers of the resources to be downloaded file described can use
Version number, then from network downloading new version resource file into the resource file download directory of App.
In a kind of possible implementation of second aspect of the embodiment of the present invention, described device further include:
First searching module, if being greater than or equal to available edition number for the current version number, in the resource
The target resource file loaded needed for being searched in file download catalogue;
Second searching module, if for the target resource file to be not present in the resource file download directory,
Corresponding target resource file is loaded from the local resource file of the App.
In a kind of possible implementation of second aspect of the embodiment of the present invention, described device further include:
Resource file determining module to be deleted, for determining resource file to be deleted in the local resource file of App,
The filename of the resource file to be deleted is identical as the filename of any resource file in the resource file download directory;
File removing module obtains local resource file after duplicate removal for deleting the resource file to be deleted.
The third aspect, the embodiment of the invention provides a kind of electronic equipment, comprising:
Processor, and
Memory, for storing the executable instruction of the processor;
Wherein, the processor, which is configured to execute any resource file via the executable instruction is executed, adds
Support method.
Fourth aspect, the embodiment of the invention provides a kind of computer readable storage mediums, are stored thereon with computer journey
Sequence, the computer program realize any resource file loading method when being executed by processor.
Resource file loading method, device, electronic equipment and storage medium provided in an embodiment of the present invention, wherein providing
In source file loading method, when App starting, the current version number of resource file is obtained from the configuration file of the App;Sentence
Whether the current version number that breaks is lower than available edition number;If the current version number is lower than the available edition number, from
Network downloads new version resource file into the resource file download directory of the App;In the resource file download directory
The target resource file loaded needed for searching;Load the target resource file.Once detecting a certain in the embodiment of the present invention
When App starts, the configuration file for scanning the App is begun to, and therefrom obtains the current version number of resource file, if current version
This number is lower than available edition number, then illustrates that resource file corresponding to current version number can not support App to operate normally, and needs
Resource file is updated, therefore selects to download new version resource file from network, after downloading, which just has can be normal
The condition of operation.When using the App, that is, when needing to load the resource file of the App, directly in resource file download directory
It searches and loads the target resource file downloaded and finished.As it can be seen that resource file provided by the embodiment of the present invention adds
Support method, really to before the operations such as user's displayed page, will support App just before really load resource file
The resource file downloading often run finishes, therefore, when App needs to load resource file, it is only necessary to be loaded directly into and download
Complete target resource file.Can timely update resource file in this way, while greatly reducing user and waiting App displayed page
The time of equal operations, improve the experience sense of user.
Detailed description of the invention
In order to illustrate more clearly of the technical solution of the application, letter will be made to attached drawing needed in the embodiment below
Singly introduce, it should be apparent that, for those of ordinary skills, without any creative labor,
It is also possible to obtain other drawings based on these drawings.
Fig. 1 is the flow diagram of resource file loading method provided in an embodiment of the present invention;
Fig. 2 is a kind of flow diagram of the method for down loading of new version resource file provided in an embodiment of the present invention;
Fig. 3 is a kind of flow diagram of method for downloading prioritized resources file provided in an embodiment of the present invention;
Fig. 4 is a kind of flow diagram of the selecting method of resource file loading sequence provided in an embodiment of the present invention;
Fig. 5 is a kind of flow diagram of the method for resource file duplicate removal provided in an embodiment of the present invention;
Fig. 6 is the structural schematic diagram of resource file loading device embodiment one provided in an embodiment of the present invention;
Fig. 7 is the structural schematic diagram of resource file download module embodiment one provided in an embodiment of the present invention;
Fig. 8 is the structural schematic diagram of resource file download module embodiment two provided in an embodiment of the present invention;
Fig. 9 is the hardware structural diagram of electronic equipment provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Whole description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
Fig. 1 is the flow diagram of resource file loading method provided in an embodiment of the present invention.As shown in Figure 1, this implementation
Example provide resource file loading method include:
S1, when App starting when, from the configuration file of the App obtain resource file current version number.
When App starting, the current version number of resource file, resource file are got from the configuration file of App first
Current version number can represent the status information of resource file, the status information mainly includes resource file content, with App
The matching degree of operation demand, bug quantity etc..As it can be seen that current version number, which can be used as, judges whether resource file can support App
The standard of normal operation.
Wherein, when App starts it is to be understood that the current operation of user is to open App;It is also possible to App to continue
Running background, the operation of active user do not need also to load the resource file of the App, but have been detected by the corresponding hair of resource file
The new version number etc. of cloth.
S2, whether the current version number is judged lower than available edition number, the available edition number is that App can be enabled normal
Version number corresponding to the resource file of operation.
In embodiments of the present invention, it does not need to update resource file at any time, i.e., without being consistent with newest version number,
It will increase update times in this way, increase caching rubbish etc. entrained when updating, enable the memories such as client, server occur bad
The case where occupancy, while update times excessively will affect the experience sense of user.
The version number of the resource file of one App is 1.0.0, during update, usually for its middle part
Loophole is divided to be modified, perhaps partial function is upgraded and is reinforced or is increased, deletes a certain function etc..As it can be seen that if
The update of resource file is only upgraded and is reinforced to partial function, and more new version number 1.0.a is obtained, then the resource before updating
File generally also can continue to that App is supported to operate normally;If the update of resource file is modified for part loophole, obtain
To more new version number 1.0.b, if the loophole is very small, such as some expression can not be shown, then the resource file before updating
It will not influence the normal operation of App;If the update of resource file is to increase a certain new function, and/or delete a certain original
Some functions obtain more new version number 1.0.c, and the resource file before usually updating also can continue to support the normal operation of App.
Therefore, if resource file is above-mentioned update status or other do not influence the case where updating the normal use of preceding resource file,
Resource file just is updated without rigid requirement, still using resource file corresponding to 1.0.0 version number.Once repairing
When just more serious loophole etc. influences the update of App operating status, such as has modified App and dodge the version 1.0.d for moving back bug, then
Resource file corresponding to version number before 1.0.d will be unable to that App is supported to operate normally, then needing to set 1.0.d
For available edition number.
Method provided by the embodiment of the present invention can have on the basis of guaranteeing that resource file supports App to operate normally
Effect reduces the pressure update times of resource file, to reduce update rubbish, improves user experience.
If S3, the current version number be lower than the available edition number, from network download new version resource file to
In the resource file download directory of the App, the new version resource file is the resource text that version number is higher than available edition number
Part.
If current version number is lower than available edition number, illustrate that resource file corresponding to current version number can not prop up
The normal operation of App is held, now it is necessary to which hardness downloads new version resource file from network to guarantee the normal operation of App.
New version resource file is downloaded in resource file download directory, can effectively avoid new version resource file with
The mess of the local resource file of App, convenient for the management to resource file.
S4, the target resource file loaded needed for being searched in the resource file download directory.
Save in resource file download directory is the resource file downloaded when updating every time from network, these resource files
Version number can be higher than the version number in App local resource file, that is, the version updating of resource file.But resource is literary
Meeting increasing with update times in part download directory, the resource file after saving a large amount of downloadings, therefore, it is necessary to according to version number
Target resource file to be loaded needed for being searched in resource file download directory.
Generally for convenient for searching, can be arranged in resource file download directory according to the sequence of download time from back to front
Resource file, resource file of the download time after is exactly the resource file of latest edition, if search target resource text
Part, so that it may which directly determining the uppermost resource file of resource file download directory is target resource file.
S5, the load target resource file.
When user really need operation App when, then be loaded directly into downloaded finish can support App operate normally
Target resource file.
As it can be seen that resource file loading method provided by the embodiment of the present invention really load resource file before, really
To before the operations such as user's displayed page, the resource file downloading that will have supported App to operate normally is finished, therefore, when
When App needs to load resource file, it is only necessary to be loaded directly into the target resource file downloaded and finished.It in this way can be timely
Resource file is updated, while greatly reducing the time that user waits the operations such as App displayed page, improves the experience sense of user.
The update of resource file is not in bypass the immediate leadership to update generally by version updating.Usually new version is downloaded from network
Resource file refers to the latest edition of resource file, but if corresponding to resource file of the current version number with latest edition
Version number's difference is excessive, then disposably needs to update vast resources file, enables update slower, and this process largely updated needs
The support of good network environment is wanted, if network environment is poor, is difficult to complete to update, being easy to appear can not determine that update is lost
Lose be in which version, or be easy to appear update failure when, the resource file downloaded still can not support that App is normal
Operation is enabled and being updated in vain.Therefore, the update validity and efficiency of resource file are required to strong guarantee, can guarantee App
Normal operation.
Fig. 2 illustrates a kind of method for down loading of new version resource file, comprising:
S301, current network environment is obtained, the current network environment includes speed of download and signal strength;
If S302, the speed of download are lower than intensity threshold lower than threshold speed and/or signal strength, under network
The corresponding resource file of emergency version number is carried into the resource file download directory of the App, the emergency version number is most to connect
The available edition number of nearly current version number.
If current network environment is poor, resource file is updated to latest edition without mandatory, it is only necessary to update
The minimum version number into the resource file that App can be supported to operate normally.For example, the current version number of resource file is
1.0.0, subsequent to have issued new resource file 1.0.b, 1.0.c, 1.0.d, 1.0.e and 1.0.f successively, wherein available edition
Number be 1.0.c, 1.0.d, 1.0.e and 1.0.f, it is clear that 1.0.f is latest edition number.It, can if current network environment is good
1.0.0 version is updated to 1.0.f version step by step;But if current network environment is poor, if still used step by step more
Newly to 1.0.f version, centre needs to update 5 versions, needs to expend a large amount of Internet resources, and current network environment can not prop up
It holds, it may appear that the case where updating failure.In order to adapt to current network environment, the resource file after enabling downloading can support App's
It operates normally, only can need to update 2 versions first by 1.0.0 version updating to 1.0.c version in this way, can effectively mitigate net
Network burden, raising are updated to power.On the basis of guaranteeing the normal operation of App, the renewal speed of resource file is improved.
In addition, can continue to update resource file to most on the basis of meeting an urgent need version number if network recovery is normal
New version.The above-mentioned process for continuing to update can be manual operation, or system carries out automatically.
During downloading new version resource file into the resource file download directory of App from network, it may appear that suspension,
Shutdown, manual termination etc., which enable, there is incomplete resources to be downloaded file in resource file download directory.If again from network
The case where downloading existing resources to be downloaded file in resource file download directory, then will appear repeated downloads, does not only take up money
Source, and the time of repeated downloads and re-start time of network request and can all greatly increase download time, slow down downloading effect
Rate.
Fig. 3 illustrates a kind of method for downloading prioritized resources file, comprising:
If S303, current version number are lower than available edition number, obtain complete in presently described resource file download directory
The corresponding version number of portion's resources to be downloaded file, the resources to be downloaded file are not download the resource file finished;
S304, prioritized resources file is downloaded from the resource file download directory, the prioritized resources file is described
Version number is higher than resources to be downloaded file corresponding to the available edition number in resource file download directory.
It is complete in acquisition resource file download directory first if the current version number of resource file is lower than available edition number
Resources to be downloaded file corresponding version number in portion's is higher than available edition if existed in the corresponding version number of resources to be downloaded file
Number version number, then directly continue to download the corresponding prioritized resources file of the version number in resource file download directory.
For example, available edition number is 1.0.c, there are 3 resources to be downloaded files in resource file download directory, respectively correspond version number
1.0.a, 1.0.b and 1.0.d, it is seen then that 1.0.d is higher than version number 1.0.c, then can be directly in resource file download directory
Continue to download the corresponding resource file of 1.0.d, without again to network initiated request from network download resource file.
The method of downloading prioritized resources file provided in an embodiment of the present invention, can make full use of existing resource, effectively mentions
High download efficiency, and the problem of prevent repeated downloads.
If S305, all the corresponding version number of the resources to be downloaded file is below the available edition number, from
Network downloads new version resource file into the resource file download directory of App.
If the corresponding version number of resources to be downloaded file is below available edition number, illustrate resource file download directory
In resources to be downloaded file and downloaded the resource file finished and can not support the normal operation of App, at this time, it may be necessary to from net
Network downloads new version resource file into the resource file download directory of App, to guarantee the normal operation of App.
Fig. 4 illustrates a kind of selecting method of resource file loading sequence, comprising:
If S501, the current version number are greater than or equal to available edition number, in the resource file download directory
The target resource file loaded needed for middle lookup;
If the target resource file is not present in S502, the resource file download directory, from the sheet of the App
Corresponding target resource file is loaded in ground resource folder.
Current version number is greater than or equal to available edition number, then illustrates that resource file corresponding to current version number can prop up
Support App normal operation, and according to above-mentioned statement it is found that the resource file may be by before certain downloading obtain, this
When, which should be in resource file download directory;The resource file may be that App carries version, so the resource
File should be in the local resource file of App.In general, version corresponding to resource file in resource file download directory
It number is above the version number of the resource file in the local resource file of App, therefore, in order to save the load time, preferably first
Target resource file is searched in resource file download directory, if there is no target resource texts in resource file download directory
Part, then target resource file is searched from the local resource file of App.It can not only guarantee search efficiency, and then improve money
The loading efficiency of source file is searched more added with logicality, the problem of avoiding the occurrence of under-enumeration and re-download with season.
Vast resources file in resource file download directory will appear some money in the local resource file with App
The case where filename of source file repeats is likely to occur while finding two resource files if filename repeats, can not sentence
It is disconnected which is used, or misjudgment, the case where using resource file in the local resource file of App, increase resource file
Management difficulty.
Fig. 5 illustrates a kind of method of resource file duplicate removal, comprising:
S6, resource file to be deleted, the file of the resource file to be deleted are determined in the local resource file of App
Name is identical as the filename of any resource file in the resource file download directory;
S7, the resource file to be deleted is deleted, obtains local resource file after duplicate removal.
After the duplicate resource file to be deleted of filename is deleted, the management to each resource file is easily facilitated, is had simultaneously
Effect prevents resource file from searching mistake, or the case where can not find.
Fig. 6 is the structural schematic diagram of resource file loading device embodiment one provided in an embodiment of the present invention, described device
It include: that version number obtains module 1, for obtaining the current of resource file from the configuration file of the App when App starting
Version number;Judgment module 2, for whether judging the current version number lower than available edition number, the available edition number is energy
Version number corresponding to the resource file for enough enabling App operate normally;Resource file download module 3, if being used for the current version
This number is lower than the available edition number, then the resource file download directory of new version resource file to the App is downloaded from network
In, the new version resource file is the resource file that version number is higher than available edition number;Searching module 4, in the money
The target resource file loaded needed for being searched in source file download directory;Loading module 5, for loading the target resource text
Part.
Fig. 7 is the structural schematic diagram of resource file download module embodiment one provided in an embodiment of the present invention, the resource
File download module 3 includes: that network environment obtains module 31, for obtaining current network environment, the current network environment packet
Include speed of download and signal strength;Emergency resources file download module 32, if being lower than threshold speed for the speed of download
And/or signal strength is lower than intensity threshold, then from the corresponding resource file of network loading emergency version number to the resource of the App
In file download catalogue, the emergency version number is the available edition number closest to current version number.
Fig. 8 is the structural schematic diagram of resource file download module embodiment two provided in an embodiment of the present invention, the resource
File download module 3 includes: that resources to be downloaded fileversion number obtains module 33, if being lower than available version for current version number
This number, then the corresponding version number of whole resources to be downloaded file in presently described resource file download directory is obtained, it is described under
Carrying resource file is not download the resource file finished;Prioritized resources download module 34, for downloading mesh from the resource file
Prioritized resources file is downloaded in record, the prioritized resources file is that version number can higher than described in the resource file download directory
The resources to be downloaded file corresponding to version number.
As shown in figure 8, the resource file download module 3 further include: network download module 35, if for described in whole
The corresponding version number of resources to be downloaded file is below the available edition number, then from network download new version resource file to
In the resource file download directory of App.
As shown in fig. 6, described device further include: the first searching module 6, if being higher than or waiting for the current version number
In available edition number, then the target resource file of load needed for being searched in the resource file download directory;Second searches mould
Block 7, if for the target resource file to be not present in the resource file download directory, from the local money of the App
Corresponding target resource file is loaded in source folder.
As shown in fig. 6, described device further includes 12, device according to claim 11, which is characterized in that the dress
It sets further include: resource file determining module 8 to be deleted, for determining resource text to be deleted in the local resource file of App
The file famous prime minister of any resource file in part, the filename of the resource file to be deleted and the resource file download directory
Together;File removing module 9 obtains local resource file after duplicate removal for deleting the resource file to be deleted.
Fig. 9 is the hardware structural diagram of electronic equipment provided in an embodiment of the present invention.The electronic equipment includes: memory
101 and processor 102;
Memory 101, for storing computer program;
Processor 102, for executing the computer program of memory storage, to realize the data on flows in above-described embodiment
Monitoring method.It specifically may refer to the associated description in preceding method embodiment.
Optionally, memory 101 can also be integrated with processor 102 either independent.
When the memory 101 is independently of the device except processor 102, the electronic equipment can also include:
Bus 103, for connecting the memory 101 and processor 102.
Electronic equipment provided in an embodiment of the present invention can be used for executing it is any in above-described embodiment shown in resource file add
Support method, implementation is similar with technical effect, and details are not described herein again for the embodiment of the present invention.
The embodiment of the present invention also provides a kind of readable storage medium storing program for executing, is stored with computer program in readable storage medium storing program for executing, when
When at least one processor for the device that message is sent executes the computer program, the device that message is sent executes above-described embodiment
Any resource file loading method.
Those of ordinary skill in the art will appreciate that: realize that all or part of the steps of above-mentioned each method embodiment can lead to
The relevant hardware of program instruction is crossed to complete.Program above-mentioned can store in computer-readable storage medium.The journey
When being executed, execution includes the steps that above-mentioned each method embodiment to sequence;And storage medium above-mentioned include: ROM, RAM, magnetic disk or
The various media that can store program code such as person's CD.
Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention., rather than its limitations;To the greatest extent
Present invention has been described in detail with reference to the aforementioned embodiments for pipe, those skilled in the art should understand that, according to
So be possible to modify the technical solutions described in the foregoing embodiments, or to some or all of the technical features into
Row equivalent replacement, and these are modified or replaceed, various embodiments of the present invention technology that it does not separate the essence of the corresponding technical solution
The range of scheme.
Claims (14)
1. a kind of resource file loading method, which is characterized in that the described method includes:
When App starting, the current version number of resource file is obtained from the configuration file of the App;
Whether the current version number is judged lower than available edition number, and the available edition number is that App can be enabled to operate normally
Version number corresponding to resource file;
If the current version number is lower than the available edition number, new version resource file is downloaded to the App from network
Resource file download directory in, the new version resource file be version number be higher than available edition number resource file;
The target resource file loaded needed for being searched in the resource file download directory;
Load the target resource file.
If 2. the method according to claim 1, wherein the current version number be lower than available edition number,
Include: into the resource file download directory of App from network downloading new version resource file
Current network environment is obtained, the current network environment includes speed of download and signal strength;
If the speed of download is lower than intensity threshold lower than threshold speed and/or signal strength, from network loading emergency version
For this number corresponding resource file into the resource file download directory of the App, the emergency version number is closest to current version
This number available edition number.
If 3. the method according to claim 1, wherein the current version number be lower than available edition number,
Include: into the resource file download directory of App from network downloading new version resource file
If current version number is lower than available edition number, whole moneys to be downloaded in presently described resource file download directory are obtained
The corresponding version number of source file, the resources to be downloaded file are not download the resource file finished;
Prioritized resources file is downloaded from the resource file download directory, the prioritized resources file is under the resource file
It carries version number in catalogue and is higher than resources to be downloaded file corresponding to the available edition number.
4. according to the method described in claim 3, it is characterized in that, the method also includes:
It is new from network downloading if all the corresponding version number of the resources to be downloaded file is below the available edition number
Version resource file is into the resource file download directory of App.
5. the method according to claim 1, wherein the method also includes:
If the current version number is greater than or equal to available edition number, needed for being searched in the resource file download directory
The target resource file of load;
If the target resource file is not present in the resource file download directory, from the local resource text of the App
Corresponding target resource file is loaded in part folder.
6. according to the method described in claim 5, it is characterized in that, the method also includes:
Resource file to be deleted, the filename of the resource file to be deleted and institute are determined in the local resource file of App
The filename for stating any resource file in resource file download directory is identical;
The resource file to be deleted is deleted, local resource file after duplicate removal is obtained.
7. a kind of resource file loading device, which is characterized in that described device includes:
Version number obtains module, for obtaining the current version of resource file from the configuration file of the App when App starting
This number;
Judgment module, for whether judging the current version number lower than available edition number, the available edition number is that can enable
Version number corresponding to the resource file that App is operated normally;
Resource file download module is new from network downloading if being lower than the available edition number for the current version number
For version resource file into the resource file download directory of the App, the new version resource file is version number higher than available
The resource file of version number;
Searching module, the target resource file for being loaded needed for being searched in the resource file download directory;
Loading module, for loading the target resource file.
8. device according to claim 7, which is characterized in that the resource file download module includes:
Network environment obtains module, and for obtaining current network environment, the current network environment includes speed of download and signal
Intensity;
Emergency resources file download module, if for the speed of download lower than threshold speed and/or signal strength lower than strong
Spend threshold value, then it is described from the corresponding resource file of network loading emergency version number into the resource file download directory of the App
Emergency version number is the available edition number closest to current version number.
9. device according to claim 7, which is characterized in that the resource file download module includes:
Resources to be downloaded fileversion number obtains module, if being lower than available edition number for current version number, obtains current
The corresponding version number of whole resources to be downloaded file in the resource file download directory, the resources to be downloaded file be not under
Carry the resource file finished;
Prioritized resources download module, for downloading prioritized resources file, the preferential money from the resource file download directory
Source file is that version number is higher than resources to be downloaded file corresponding to the available edition number in the resource file download directory.
10. device according to claim 9, which is characterized in that the resource file download module further include:
Network download module, if being below the available edition for all corresponding version numbers of the resources to be downloaded file
Number, then from network downloading new version resource file into the resource file download directory of App.
11. device according to claim 7, which is characterized in that described device further include:
First searching module, if being greater than or equal to available edition number for the current version number, in the resource file
The target resource file loaded needed for being searched in download directory;
Second searching module, if for the target resource file to be not present in the resource file download directory, from institute
It states and loads corresponding target resource file in the local resource file of App.
12. device according to claim 11, which is characterized in that described device further include:
Resource file determining module to be deleted, it is described for determining resource file to be deleted in the local resource file of App
The filename of resource file to be deleted is identical as the filename of any resource file in the resource file download directory;
File removing module obtains local resource file after duplicate removal for deleting the resource file to be deleted.
13. a kind of electronic equipment, which is characterized in that the electronic equipment includes:
Processor, and
Memory, for storing the executable instruction of the processor;
Wherein, the processor is configured to carry out any money of perform claim requirement 1-6 via the execution executable instruction
Source file loading method.
14. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program
Claim 1-6 any resource file loading method is realized when being executed by processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910506522.1A CN110377850A (en) | 2019-06-12 | 2019-06-12 | Resource file loading method, device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910506522.1A CN110377850A (en) | 2019-06-12 | 2019-06-12 | Resource file loading method, device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110377850A true CN110377850A (en) | 2019-10-25 |
Family
ID=68250108
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910506522.1A Pending CN110377850A (en) | 2019-06-12 | 2019-06-12 | Resource file loading method, device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110377850A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111291012A (en) * | 2020-01-16 | 2020-06-16 | 深圳市前海随手财富管理有限公司 | Rule file deployment system, method, equipment and medium |
CN112506584A (en) * | 2020-12-21 | 2021-03-16 | 北京百度网讯科技有限公司 | Resource file loading method, device, equipment, storage medium and product |
CN112783522A (en) * | 2020-12-28 | 2021-05-11 | 北京五八信息技术有限公司 | File loading method, file loading device and electronic equipment |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104052769A (en) * | 2013-03-13 | 2014-09-17 | 金蝶软件(中国)有限公司 | Method, apparatus and system for updating resources contained by mobile terminal application |
CN104301342A (en) * | 2013-07-17 | 2015-01-21 | 北京齐尔布莱特科技有限公司 | Method for downloading file in breakpoint way |
CN104598262A (en) * | 2014-11-25 | 2015-05-06 | 深圳市腾讯计算机系统有限公司 | Method and device for updating mobile application |
CN108449377A (en) * | 2018-02-02 | 2018-08-24 | 珠海金山网络游戏科技有限公司 | A kind of update method and resource packing and issuing system and method for game version |
CN108881140A (en) * | 2017-10-31 | 2018-11-23 | 北京视联动力国际信息技术有限公司 | A kind of document down loading method and device based on view networking |
CN109002314A (en) * | 2018-09-29 | 2018-12-14 | 深圳市元征科技股份有限公司 | Oftware updating method, device, electronic equipment and storage medium |
-
2019
- 2019-06-12 CN CN201910506522.1A patent/CN110377850A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104052769A (en) * | 2013-03-13 | 2014-09-17 | 金蝶软件(中国)有限公司 | Method, apparatus and system for updating resources contained by mobile terminal application |
CN104301342A (en) * | 2013-07-17 | 2015-01-21 | 北京齐尔布莱特科技有限公司 | Method for downloading file in breakpoint way |
CN104598262A (en) * | 2014-11-25 | 2015-05-06 | 深圳市腾讯计算机系统有限公司 | Method and device for updating mobile application |
CN108881140A (en) * | 2017-10-31 | 2018-11-23 | 北京视联动力国际信息技术有限公司 | A kind of document down loading method and device based on view networking |
CN108449377A (en) * | 2018-02-02 | 2018-08-24 | 珠海金山网络游戏科技有限公司 | A kind of update method and resource packing and issuing system and method for game version |
CN109002314A (en) * | 2018-09-29 | 2018-12-14 | 深圳市元征科技股份有限公司 | Oftware updating method, device, electronic equipment and storage medium |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111291012A (en) * | 2020-01-16 | 2020-06-16 | 深圳市前海随手财富管理有限公司 | Rule file deployment system, method, equipment and medium |
CN112506584A (en) * | 2020-12-21 | 2021-03-16 | 北京百度网讯科技有限公司 | Resource file loading method, device, equipment, storage medium and product |
CN112506584B (en) * | 2020-12-21 | 2023-10-03 | 北京百度网讯科技有限公司 | Resource file loading method, device, equipment, storage medium and product |
CN112783522A (en) * | 2020-12-28 | 2021-05-11 | 北京五八信息技术有限公司 | File loading method, file loading device and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3333704B1 (en) | Method and apparatus for repairing kernel vulnerability | |
CN103092665B (en) | Immediate updating device and immediate updating method | |
US11016785B2 (en) | Method and system for mirror image package preparation and application operation | |
CN110377850A (en) | Resource file loading method, device, electronic equipment and storage medium | |
US20190109920A1 (en) | Browser resource pre-pulling method, terminal and storage medium | |
CN101470645B (en) | High-speed cache data recovery method and apparatus | |
CN113032032B (en) | System management method and device, computing equipment and readable storage medium | |
MXPA06013666A (en) | Method, software and apparatus for using application state history information when re-launching applications. | |
CN101719073A (en) | Intelligent client-based on-demand downloading realization method | |
CN107783770B (en) | Page configuration updating method, device, server and medium | |
CN103136027B (en) | Immediate updating device and immediate updating method | |
JP2015018295A (en) | Application management device, application management system, and program | |
CN110532098A (en) | The GPU method and system of service are provided | |
CN110399169A (en) | Amending method, device, equipment and the readable storage medium storing program for executing of BIOS option | |
CN109445861A (en) | System start method, device, computer installation and storage medium | |
US8983908B2 (en) | File link migration for decommisioning a storage server | |
CN103699597A (en) | Method for downloading file through browser and browser | |
CN106155708B (en) | A kind of method and system of dynamically load and update content of pages | |
CN105138604A (en) | Terminal data processing method and apparatus | |
CN114780019A (en) | Electronic device management method and device, electronic device and storage medium | |
CN108664255A (en) | A kind of method for upgrading software and device | |
CN109697281A (en) | The online method, apparatus and electronic equipment for merging document | |
CN103645913B (en) | Language loading method and device in J2EE systems | |
CN114240132A (en) | Business process arrangement execution method and device, computer equipment and storage medium | |
CN106598687B (en) | Script preheating method and device |
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 |
Application publication date: 20191025 |
|
RJ01 | Rejection of invention patent application after publication |