CN107315791A - Static resource caching method, device and computer-readable recording medium - Google Patents
Static resource caching method, device and computer-readable recording medium Download PDFInfo
- Publication number
- CN107315791A CN107315791A CN201710448038.9A CN201710448038A CN107315791A CN 107315791 A CN107315791 A CN 107315791A CN 201710448038 A CN201710448038 A CN 201710448038A CN 107315791 A CN107315791 A CN 107315791A
- Authority
- CN
- China
- Prior art keywords
- static resource
- target pages
- resource
- static
- latest edition
- 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
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
- G06F16/9574—Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
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)
Abstract
The invention discloses a kind of static resource caching method, device and computer-readable recording medium, belong to field of computer technology.This method includes:Based on target pages identify and the first static resource digest value, judge the first static resource whether be latest edition static resource;Wherein, any page that target pages are opened for needs, first static resource is the current static resource for being used to render the target pages in local cache, and the digest value of the first static resource is obtained by presetting content progress computing of the template grammar to the first static resource;If the first static resource is not the static resource of latest edition, based on target pages mark, the static resource of the latest edition for rendering the target pages is obtained and cached from server.The present invention identifies the digest value with the first static resource by target pages, it is ensured that the static resource of caching is the static resource of latest edition, so as to avoid the repetition caching of static resource.
Description
Technical field
The present invention relates to field of computer technology, more particularly to a kind of static resource caching method, device and computer can
Read storage medium.
Background technology
With the development of technology, increasing smart machine has come into the life of people, such as, smart mobile phone, flat board
Computer, intelligent television etc..Wherein, user can load various application programs in smart machine, with realize it is various not
Same function.When smart machine runs application program, the static resource of the page can be rendered by generally requiring to obtain, such as, be needed
Obtain picture, JS files, CSS files etc..In order to accelerate the rendering speed of the page, rendering efficiency is improved, smart machine is usual
Need that static resource is being locally stored, so as to when carrying out page rendering, be loaded directly into the static resource being locally stored.
At present, because the static resource in server is updated often, when each application program is needed by latest edition
When this static resource carries out page rendering, smart machine can send resource acquisition request to server, and the resource acquisition please
The timestamp for indicating current time can be carried in asking.Because timestamp related to static resource in server also can be with
The change of time and change, therefore, can be according to this when server receives the resource acquisition request of smart machine transmission
The timestamp carried in resource acquisition request obtains corresponding static resource, and the static resource is sent into smart machine, by
Smart machine is cached.
However, when smart machine passage time, stamp obtained static resource from server, although timestamp is become
Change, but the static resource in server may not have and update, therefore, smart machine is obtained according to different timestamps
The content of static resource be probably identical.It that is to say, smart machine may will be obtained and cached same within a period of time
Individual static resource, so as to cause the repetition caching of static resource and the waste of smart machine network data.
The content of the invention
In order to avoid repeating that static resource is obtained from server, so as to save smart machine network data, the present invention is real
Example is applied there is provided a kind of static resource caching method, device and computer-readable recording medium.The technical scheme is as follows:
First aspect includes there is provided a kind of static resource caching method, methods described:
The digest value with the first static resource is identified based on target pages, whether judge first static resource is newest
The static resource of version;
Wherein, target pages is need any page opened, and first static resource is to be current in local cache
Static resource for rendering the target pages, the digest value of first static resource is to institute by default template grammar
The content progress computing for stating the first static resource is obtained;
If first static resource is not the static resource of latest edition, identified based on the target pages, from
The static resource of the latest edition for rendering the target pages is obtained and cached in server.
Alternatively, the digest value identified based on target pages with the first static resource, judges the described first static money
Source whether be latest edition static resource, including:
First resource is sent to the server and obtains request, and the first resource obtains in request and carries the page object
Face is identified;
The digest value for the second static resource that the server is sent is received, the digest value of second static resource is institute
State server to obtain the content progress computing of second static resource by the default template grammar, described second is static
Resource is the static resource of the latest edition for rendering the target pages stored in the server;
If the digest value of first static resource is different from the digest value of second static resource, it is determined that described
First static resource is not the static resource of latest edition.
Alternatively, when the target pages are the page that application program includes, the target pages are designated described answer
With the mark of program;When the target pages are webpage, the target pages are designated the banner of the webpage.
Alternatively, the digest value identified based on target pages with the first static resource, judges the described first static money
Source whether be latest edition static resource before, in addition to:
When detecting the opening operation of the target pages, perform and identified and the first static resource based on target pages
Digest value, judge first static resource whether be latest edition static resource operation.
Alternatively, the digest value identified based on target pages with the first static resource, judges the described first static money
Source whether be latest edition static resource before, in addition to:
The first prompt message is shown, first prompt message is used to point out whether to cache for rendering the target pages
Latest edition static resource;
When receiving determination cache instruction, the digest value based on target pages mark and the first static resource is performed, is sentenced
Break first static resource whether be latest edition static resource operation.
Second aspect includes there is provided a kind of static resource buffer storage, described device:
Judge module, for identifying the digest value with the first static resource based on target pages, judges that described first is static
Resource whether be latest edition static resource;
Wherein, target pages is need any page opened, and first static resource is to be current in local cache
Static resource for rendering the target pages, the digest value of first static resource is to institute by default template grammar
The content progress computing for stating the first static resource is obtained;
Cache module, if not being the static resource of latest edition for first static resource, based on the mesh
Page iden-tity is marked, the static resource of the latest edition for rendering the target pages is obtained and cached from server.
Alternatively, the judge module includes:
Sending submodule, obtains request, the first resource obtains request for sending first resource to the server
It is middle to carry the target pages mark;
Receiving submodule, the digest value for receiving the second static resource that the server is sent, described second is static
The digest value of resource is that the server carries out computing by the default template grammar to the content of second static resource
Obtain, second static resource is the static state of the latest edition for rendering the target pages stored in the server
Resource;
Determination sub-module, if the digest value of the digest value and second static resource for first static resource
It is different, it is determined that first static resource is not the static resource of latest edition.
Alternatively, when the target pages are the page that application program includes, the target pages are designated described answer
With the mark of program;When the target pages are webpage, the target pages are designated the banner of the webpage.
Alternatively, described device also includes:
First trigger module, for when detecting the opening operation of the target pages, triggering the judge module base
In target pages identify and the first static resource digest value, judge first static resource whether be latest edition static state
Resource.
Alternatively, described device also includes:
Display module, for showing the first prompt message, whether first prompt message is used to point out to cache for wash with watercolours
Contaminate the static resource of the latest edition of the target pages;
Second trigger module, for when receiving determination cache instruction, triggering the judge module and being based on target pages
Mark and the first static resource digest value, judge first static resource whether be latest edition static resource.
The third aspect contains computer program there is provided a kind of computer-readable recording medium, the storage medium internal memory,
The computer program realizes the method described in above-mentioned first aspect when being executed by processor.
The beneficial effect that technical scheme provided in an embodiment of the present invention is brought is:In embodiments of the present invention, target is passed through
The digest value of page iden-tity and the first static resource, it can be determined that whether first static resource is that the static of latest edition is provided
Source, and when first static resource is not the static resource of latest edition, the static money of latest edition is obtained from server
Source, so as to ensure that the static resource that the static resource that caches afterwards is latest edition, it is to avoid the repetition caching of static resource,
The static resource that network data caching is repeated is expended without smart machine, the network data of smart machine is saved.
Brief description of the drawings
Technical scheme in order to illustrate the embodiments of the present invention more clearly, makes required in being described below to embodiment
Accompanying drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the present invention, for
For those of ordinary skill in the art, on the premise of not paying creative work, other can also be obtained according to these accompanying drawings
Accompanying drawing.
Fig. 1 is a kind of structural representation of static resource caching system provided in an embodiment of the present invention;
Fig. 2 is a kind of flow chart of static resource caching method provided in an embodiment of the present invention;
Fig. 3 A are the structural representations of the first static resource buffer storage provided in an embodiment of the present invention;
Fig. 3 B are a kind of structural representations of judge module provided in an embodiment of the present invention;
Fig. 3 C are the structural representations of second of static resource buffer storage provided in an embodiment of the present invention;
Fig. 3 D are the structural representations of the third static resource buffer storage provided in an embodiment of the present invention;
Fig. 4 is a kind of structural representation of smart machine provided in an embodiment of the present invention.
Embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing to embodiment party of the present invention
Formula is described in further detail.
Before detailed explanation is carried out to the embodiment of the present invention, the first application to being related in the embodiment of the present invention
Scene and system architecture are explained respectively.
First, to the present embodiments relate to application scenarios be introduced.
When user by smart machine access webpage or operation application program when, generally require by picture, JS files,
The static resources such as CSS files carry out rendering for the page (page of the webpage of access or any page of the application program of operation).
Under normal circumstances, in order that the static resource that smart machine carries out page rendering is the static resource of latest edition, smart machine
The static resource of latest edition can be obtained from server.But sometimes the static resource in server does not occur more
Newly, in this case, if smart machine remains unchanged, continuation obtains static resource from server, causes smart machine to repeat
Cache identical static resource.In addition, tester is in order to test the static resource in server, be generally also required to from
Static resource is obtained in server.The mode provided at present is tester by constantly changing the version number of static resource, with
Newest static resource is obtained from server, it is sometimes necessary to which the static resource of test is more, and tester is from server
When obtaining static resource, operation inconvenience.Based on above-mentioned scene, it can avoid repeating caching phase the embodiments of the invention provide one kind
Same static resource, to save the static resource caching method of smart machine network data.
Finally, to the present embodiments relate to system architecture be introduced.
Fig. 1 is a kind of structural representation of static resource caching system provided in an embodiment of the present invention, and referring to Fig. 1, this is
System includes smart machine 1 and server 2, and smart machine 1 can be attached and be communicated by network with server 2.Wherein, intelligence
Various application programs can be installed in equipment 1, and when running application program or accessing webpage, pass through the page of access
The digest value of static resource that face identifies and is locally stored, judge the static resource being locally stored whether be latest edition static state
Resource, and when the static resource being locally stored is not the static resource of latest edition, is communicated with server 2 with from service
The static resource of latest edition is obtained in device 2.
Before to the operation of smart machine caching static resource carrying out that explanation is explained in detail, first smart machine is cached
The opportunity of static resource illustrates.
In embodiments of the present invention, due to being provided with various application programs in smart machine, when smart machine fortune
, it is necessary to which static resource renders the display interface for the application program for being currently needed for display during row application program, or, work as smart machine
When accessing webpage, the webpage that static resource renders access is needed also exist for, now, smart machine can perform the He of following step 201
The operation of step 202.
In addition, in order to be run in smart machine when application program or opening webpage, can be quickly through latest edition
Static resource carry out page rendering, the smart machine can also it is no operation application program or access webpage in the case of,
Each specified time interval performs the operation of following step 201 and step 202.
It should be noted that specify time interval can set in advance, such as, and this specify time interval can for 1 day, 2
It etc..
Based on the opportunity of above-mentioned smart machine caching static resource, following combination accompanying drawings 2 are provided to smart machine caching static
The operation in source carries out that explanation is explained in detail, and specifically includes following steps.
Step 201:Smart machine identifies the digest value with the first static resource based on target pages, judges the first static money
Source whether be latest edition static resource.
Wherein, target pages is need any page opened, and first static resource is the current use in local cache
In the static resource for rendering the target pages, the digest value of the first static resource is to first static state by default template grammar
The content of resource carries out computing and obtained.It that is to say, the digest value of the first static resource can be that server or smart machine pass through
Default template grammar carries out computing to the content of first static resource and obtained.Because smart machine is carrying out this static resource
Before the operation of caching, the caching of a static resource may be carried out, therefore, the digest value of first static resource may
When being last progress static resource caching, the content of first static resource is entered according to presetting module plate grammer by server
After row computing is obtained, smart machine is sent to, afterwards, first static resource is stored by smart machine.
From the foregoing, when smart machine runs application program or accesses webpage, it is required for progress webpage to render, because
This, in embodiments of the present invention, when smart machine runs application program, it is determined that being currently needed for the page of the application program of display
For target pages, when smart machine accesses webpage, the webpage for determining the access is target pages.Also, when the target pages
During the page included for application program, the target pages are designated the mark of the application program;When the target pages are webpage,
The target pages are designated the banner of the webpage.In addition, the application program mark can for the application program title,
Version number etc., the banner can be address, title of the webpage etc..
It should be noted that the digest value of first static resource can be the MD5 (Message- of first static resource
Digest Algorithm 5, message digest algorithm 5) value, cryptographic Hash etc..In addition, default template grammar can be set in advance
The module board grammer put, the default template grammar, which defines smart machine or server, needs operation to be performed, such as, this is preset
Module board grammer is that smart machine or server are needed by MD5 algorithms when calculating the digest value of static resource by MD5 algorithms
The digest value of the first static resource is calculated, when default template grammar is to calculate the digest value of static resource by hash algorithm,
Smart machine or server need to calculate digest value of the first static resource etc. by hash algorithm.
In addition, smart machine identifies the digest value with the first static resource based on target pages, the first static resource is judged
Whether it is that the operation of static resource of latest edition can be:First resource, which is sent, to server obtains request, the first resource
Obtain and target pages mark is carried in request;Server receives the first resource and obtained after request, by presetting template language
Method carries out computing to the content of the second static resource, obtains the digest value of the second static resource, and by second static resource
Digest value is sent to the smart machine;The digest value for the second static resource that smart machine the reception server is sent;If first
The digest value of static resource is different from the digest value of the second static resource, it is determined that the first static resource is not the quiet of latest edition
State resource;If the digest value of the first static resource is identical with the digest value of the second static resource, it is determined that the first static resource
It is the static resource of latest edition.
What deserves to be explained is, because the digest value of the first static resource is used for the content of the first static resource of description, second
The digest value of static resource is used for the content for describing the second static resource, when the digest value of the first static resource and the second static money
When the digest value in source is differed, illustrate that the second static resource in server changes compared to the first static resource content,
Second static resource for update after static resource (i.e. the static resource of latest edition), therefore, smart machine can by than
Whether compared with the digest value and the digest value of the second static resource of the first static resource, it is latest edition to judge first static resource
Static resource.
Furthermore, when smart machine does not calculate the digest value of the first static resource, the first static resource is not previously stored yet
Digest value when, first resource that smart machine is sent to server, which is obtained, not only carries target pages mark in request, also
Carry the device identification of smart machine;When server receive the first resource obtain request after, by device identification obtain away from
The first static resource sent from current time the last time to smart machine, and provided by the way that default template grammar is static to first
The content in source and the content of the second static resource carry out computing, respectively obtain the digest value and the second static money of the first static resource
The digest value in source.Afterwards, the digest value of the digest value of first static resource and the second static resource is sent to the intelligence and set
It is standby;The digest value and the digest value of the second static resource for the first static resource that smart machine the reception server is sent;If the
The digest value of one static resource is different from the digest value of the second static resource, it is determined that the first static resource is not latest edition
Static resource;If the digest value of the first static resource is identical with the digest value of the second static resource, it is determined that the first static money
Source is the static resource of latest edition.
Wherein, due to before the operation of this static resource caching is carried out, static resource may have been carried out
Caching, therefore, server can not only calculate the digest value of the first static resource by presetting template algorithm, in practical application
In, the server can also directly obtain the digest value of the first static resource of last storage.
It should be noted that the device identification is for the unique mark smart machine, and the device identification can be the intelligence
The internet protocol address (Internet Protocol Address, IP) of energy equipment, media access control address (Media
Access Control, MAC) etc..
In embodiments of the present invention, can be smart machine judge first static resource whether be latest edition static state
Resource or server judge first static resource whether be latest edition static resource.It is following that server is sentenced
Whether first static resource that breaks is that the operation of static resource of latest edition is explained.
Wherein, server judge first static resource whether be latest edition static resource operation can include such as
Lower three kinds of modes.
(1), when smart machine does not calculate the digest value of the first static resource, the first static resource is not previously stored yet
During digest value, the first resource that smart machine is sent to server, which is obtained, not only carries target pages mark in request, also take
Device identification with smart machine;After server, which receives the first resource, obtains request, pass through device identification and page object
Face is identified, and obtains the first static resource sent apart from current time the last time to smart machine, and by presetting template language
Method carries out computing to the content of the first static resource and the content of the second static resource, respectively obtains the summary of the first static resource
The digest value of value and the second static resource, if the digest value of the first static resource is different from the digest value of the second static resource,
It is not the static resource of latest edition then to determine the first static resource;If the digest value of the first static resource and the second static money
The digest value in source is identical, it is determined that the first static resource is the static resource of latest edition.
What deserves to be explained is, when judging whether first static resource is that the static of latest edition is provided by first way
During source, because server can directly determine the digest value of the first static resource, and determine whether first static resource is most
The static resource of redaction, so as to reduce interacting between smart machine, it is to avoid the resource of smart machine and server
Waste.
(2), smart machine sends first resource to server and obtains request, and the first resource obtains in request and carries target
The digest value of page iden-tity and the first static resource;Server receives the first resource and obtained after request, by presetting template
Grammer carries out computing to the content of the second static resource, obtains the digest value of the second static resource, if the first static resource
Digest value is different from the digest value of the second static resource, it is determined that the first static resource is not the static resource of latest edition;Such as
Really the digest value of the first static resource is identical with the digest value of the second static resource, it is determined that the first static resource is latest edition
Static resource.
What deserves to be explained is, when judging whether first static resource is that the static of latest edition is provided by the second way
During source, because server can directly determine whether first static resource is the static resource of latest edition, so as to reduce
Interacting between smart machine, it is to avoid the wasting of resources of smart machine and server.
(3), smart machine sends first resource to server and obtains request, and the first resource obtains in request and carries target
Page iden-tity and the first static resource;Server receives the first resource and obtained after request, by default template grammar to the
The content of one static resource and the content of the second static resource carry out computing, respectively obtain the digest value and the of the first static resource
The digest value of two static resources, if the digest value of the first static resource is different from the digest value of the second static resource, it is determined that
First static resource is not the static resource of latest edition;If the digest value of the first static resource is plucked with the second static resource
It is worth identical, it is determined that the first static resource is the static resource of latest edition.
What deserves to be explained is, because the data of the first static resource are larger, first is carried when first resource is obtained in request
During static resource, the network data of smart machine may be wasted, therefore, it is generally the case that when by server judge this first
When whether static resource is the static resource of latest edition, the first resource, which is obtained, would generally carry target pages mark in request
With the digest value of the first static resource.Because the summary Value Data of target pages mark and the first static resource is smaller, so as to keep away
The waste to smart machine network data is exempted from.
Further, sometimes user may more be accustomed to the page that the static resource of legacy version is rendered, it is undesirable that intelligence
Energy equipment carries out page rendering using the static resource of redaction, now, when smart machine detects the opening of the target pages
During operation, the first prompt message can be shown, first prompt message is used to point out whether to cache for rendering the target pages
Latest edition static resource;When receiving determination cache instruction, the operation of step 201 is performed;Cancel slow when receiving
, can be according to the first static resource caching of target page when depositing instruction.
It should be noted that determine that cache instruction is used for the static resource for determining to obtain latest edition, and the determination is cached
Instruction can be triggered by user by assigned operation, and the assigned operation can be clicking operation, slide, voice operating etc.
Deng.The cancellation cache instruction is used to cancel the caching to the static resource of latest edition, and the cancellation cache instruction can be by user
Triggered by assigned operation.
In addition, when smart machine detects the opening operation of the target pages, the first prompt message can not also be shown,
But directly perform the operation of step 201.
Step 202:If the first static resource is not the static resource of latest edition, smart machine is based on the page object
Face is identified, and the static resource of the latest edition for rendering the target pages is obtained and cached from server.
From above-mentioned steps 201, the first static resource can be determined by smart machine whether in embodiments of the present invention
For the static resource of latest edition, can also be judged by server the first static resource whether be latest edition static resource.
Therefore, smart machine is identified based on the target pages, is obtained and is cached for rendering the newest of the target pages from server
The mode of the static resource of version can include following two ways.
First way, when by smart machine, to determine the first static resource be not the static resource of latest edition, intelligence
Equipment, which can send Secondary resource to server and obtain, asks, can be by when server receives the Secondary resource and obtains request
Second static resource is sent to smart machine;Smart machine receives second static resource, and caches second static resource.
What deserves to be explained is, by user may more be accustomed to the page that the static resource of legacy version is rendered, it is undesirable that
Smart machine carries out page rendering using the static resource of redaction, therefore, when the first static resource is not the quiet of latest edition
During state resource, the smart machine can show the second prompt message, and second prompt message is used to point out whether obtain latest edition
This static resource, when receiving determination cache instruction, the second static resource cache request is sent to server;When receiving
, can be according to the first static resource caching of target page when cancelling cache instruction.
The second way, when it is not the static resource of latest edition that server, which determines the first static resource, the server
The second static resource directly can be sent to smart machine, smart machine receives second static resource, and it is second quiet to cache this
State resource.
Certainly in actual applications, server first can also send the 3rd prompt message, the 3rd prompting to smart machine
Information is used for the static resource for pointing out the first static resource not to be latest edition, if the static resource of caching latest edition;When
When smart machine receives determination cache instruction based on the 3rd prompt message, send information resources to server and obtain request, when
Server receive information resources obtain request when, to smart machine send the second static resource, smart machine receive this second
Static resource, and cache second static resource.
In embodiments of the present invention, smart machine can identify the digest value with the first static resource by target pages,
Judge first static resource whether be latest edition static resource, and first static resource be latest edition it is quiet
During state resource, the static resource of latest edition is obtained from server, so as to ensure that the static resource cached afterwards is newest
The static resource of version, it is to avoid the repetition caching of static resource, without smart machine expend that network data caching repeats it is quiet
State resource, saves the network data of smart machine.Tester is obtaining static resource with to static resource progress simultaneously
During test, without the version number of manual modification static resource, it is to avoid lead to not obtain static resource because of artificial error, from
And improve the acquisition efficiency of static resource.
Fig. 3 A are a kind of block diagram of static resource buffer storage provided in an embodiment of the present invention, referring to Fig. 3 A, static state money
Source cache device being implemented in combination with by software, hardware or both.The device includes judge module 301 and cache module
302。
Judge module 301, for identifying the digest value with the first static resource based on target pages, judges the first static money
Source whether be latest edition static resource;
Wherein, target pages is need any page opened, and the first static resource is current being used in local cache
The static resource of the target pages is rendered, the digest value of the first static resource is to the first static money by default template grammar
The content in source carries out computing and obtained;
Cache module 302, if not being the static resource of latest edition for the first static resource, based on the page object
Face is identified, and the static resource of the latest edition for rendering the target pages is obtained and cached from server.
Alternatively, referring to Fig. 3 B, the judge module 301 includes:
Sending submodule 3011, obtains request, first resource is obtained in request for sending first resource to the server
Carry target pages mark;
Receiving submodule 3012, the digest value of the second static resource for receiving server transmission, second static state
The digest value of resource is that the server is obtained by the default template grammar to the content progress computing of the second static resource, second
Static resource is the static resource of the latest edition for rendering the target pages stored in the server;
Determination sub-module 3013, if for the first static resource digest value and the second static resource digest value not
Together, it is determined that the first static resource is not the static resource of latest edition.
Alternatively, when the target pages are the page that application program includes, the target pages are designated the application program
Mark;When the target pages are webpage, the target pages are designated the banner of the webpage.
Alternatively, referring to Fig. 3 C, the device also includes:
First trigger module 303, for when detecting the opening operation of the target pages, triggering the judge module and being based on
Target pages identify and the first static resource digest value, judge the first static resource whether be latest edition static resource.
Alternatively, referring to Fig. 3 D, the device also includes:
Display module 304, for showing the first prompt message, whether the first prompt message is used to point out to cache for rendering
The static resource of the latest edition of the target pages;
Second trigger module 305, for when receiving determination cache instruction, triggering the judge module and being based on target pages
Mark and the first static resource digest value, judge the first static resource whether be latest edition static resource.
In summary, in embodiments of the present invention, smart machine can pass through target pages mark and the first static resource
Digest value, judge first static resource whether be latest edition static resource, and in first static resource for most
During the static resource of redaction, the static resource of latest edition is obtained from server, so as to ensure that the static state cached afterwards
Resource is the static resource of latest edition, it is to avoid the repetition caching of static resource, expends network data without smart machine and delays
The static resource of repetition is deposited, the network data of smart machine is saved.Tester is obtaining static resource with quiet to this simultaneously
When state resource is tested, without the version number of manual modification static resource, it is to avoid lead to not obtain because of artificial error
Static resource, so as to improve the acquisition efficiency of static resource.
Fig. 4 is a kind of block diagram of smart machine 400 according to an exemplary embodiment.For example, smart machine 400 can
To be mobile phone, computer, digital broadcasting smart machine, messaging devices, game console, tablet device, medical treatment is set
It is standby, body-building equipment, personal digital assistant etc..
Reference picture 4, smart machine 400 can include following one or more assemblies:Processing assembly 402, memory 404,
Power supply module 406, multimedia groupware 408, audio-frequency assembly 410, the interface 412 of input/output (I/O), sensor cluster 414,
And communication component 416.
The integrated operation of the generally control smart machine 400 of processing assembly 402, such as with display, call, data are led to
Letter, the camera operation operation associated with record operation.Processing assembly 402 can include one or more processors 420 to hold
Row instruction, to complete all or part of step of above-mentioned method.In addition, processing assembly 402 can include one or more moulds
Block, is easy to the interaction between processing assembly 402 and other assemblies.For example, processing assembly 402 can include multi-media module, with
Facilitate the interaction between multimedia groupware 408 and processing assembly 402.
Memory 404 is configured as storing various types of data supporting the operation in smart machine 400.These data
Example include the instruction of any application program or method for being used to operate on smart machine 400, contact data, telephone directory
Data, message, picture, video etc..Memory 404 can by any kind of volatibility or non-volatile memory device or it
Combination realize that such as static RAM (SRAM), Electrically Erasable Read Only Memory (EEPROM) is erasable
Except programmable read only memory (EPROM), programmable read only memory (PROM), read-only storage (ROM), magnetic memory, soon
Flash memory, disk or CD.
Power supply module 406 provides power supply for the various assemblies of smart machine 400.Power supply module 406 can include power supply pipe
Reason system, one or more power supplys, and other components associated with generating, managing and distributing power supply for smart machine 400.
Multimedia groupware 408 is included in the screen of one output interface of offer between the smart machine 400 and user.
In certain embodiments, screen can include liquid crystal display (LCD) and touch panel (TP).If screen includes touch surface
Plate, screen may be implemented as touch-screen, to receive the input signal from user.Touch panel includes one or more touch
Sensor is with the gesture on sensing touch, slip and touch panel.The touch sensor can not only sensing touch or slip
The border of action, but also the detection duration related to the touch or slide and pressure.In certain embodiments,
Multimedia groupware 408 includes a front camera and/or rear camera.When smart machine 400 is in operator scheme, such as clap
When taking the photograph pattern or video mode, front camera and/or rear camera can receive the multi-medium data of outside.It is each preposition
Camera and rear camera can be a fixed optical lens systems or with focusing and optical zoom capabilities.
Audio-frequency assembly 410 is configured as output and/or input audio signal.For example, audio-frequency assembly 410 includes a Mike
Wind (MIC), when smart machine 400 is in operator scheme, when such as call model, logging mode and speech recognition mode, microphone
It is configured as receiving external audio signal.The audio signal received can be further stored in memory 404 or via logical
Letter component 416 is sent.In certain embodiments, audio-frequency assembly 410 also includes a loudspeaker, for exports audio signal.
I/O interfaces 412 is provide interface between processing assembly 402 and peripheral interface module, above-mentioned peripheral interface module can
To be keyboard, click wheel, button etc..These buttons may include but be not limited to:Home button, volume button, start button and lock
Determine button.
Sensor cluster 414 includes one or more sensors, the state for providing various aspects for smart machine 400
Assess.For example, sensor cluster 414 can detect opening/closed mode of smart machine 400, the relative positioning of component, example
As described component be smart machine 400 display and keypad, sensor cluster 414 can also detect smart machine 400 or
The position of 400 1 components of smart machine changes, the existence or non-existence that user contacts with smart machine 400, smart machine 400
The temperature change of orientation or acceleration/deceleration and smart machine 400.Sensor cluster 414 can include proximity transducer, be configured
For the presence of object near being detected in not any physical contact.Sensor cluster 414 can also include optical sensor,
Such as CMOS or ccd image sensor, for being used in imaging applications.In certain embodiments, the sensor cluster 414 may be used also
With including acceleration transducer, gyro sensor, Magnetic Sensor, pressure sensor or temperature sensor.
Communication component 416 is configured to facilitate the communication of wired or wireless way between smart machine 400 and other equipment.
Smart machine 400 can access the wireless network based on communication standard, such as WiFi, 2G or 3G, or combinations thereof.Show at one
In example property embodiment, communication component 416 receives broadcast singal or broadcast from external broadcasting management system via broadcast channel
Relevant information.In one exemplary embodiment, the communication component 416 also includes near-field communication (NFC) module, short to promote
Cheng Tongxin.For example, radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra wide band can be based in NFC module
(UWB) technology, bluetooth (BT) technology and other technologies are realized.
In the exemplary embodiment, smart machine 400 can be by one or more application specific integrated circuits (ASIC), number
Word signal processor (DSP), digital signal processing appts (DSPD), PLD (PLD), field programmable gate array
(FPGA), controller, microcontroller, microprocessor or other electronic components are realized, are carried for performing above-mentioned embodiment illustrated in fig. 2
The method of confession.
In the exemplary embodiment, a kind of non-transitorycomputer readable storage medium including instructing, example are additionally provided
Such as include the memory 404 of instruction, above-mentioned instruction can be performed to complete the above method by the processor 420 of smart machine 400.Example
Such as, the non-transitorycomputer readable storage medium can be ROM, it is random access memory (RAM), CD-ROM, tape, soft
Disk and optical data storage devices etc..
A kind of non-transitorycomputer readable storage medium, when the instruction in the storage medium is by the processing of smart machine
When device is performed so that intelligent movable equipment is able to carry out the method that above-mentioned embodiment illustrated in fig. 2 is provided.
It should be noted that:Above-described embodiment provide static resource buffer storage in caching static resource, only more than
The division progress of each functional module is stated for example, in practical application, as needed can distribute above-mentioned functions by difference
Functional module complete, i.e., the internal structure of device is divided into different functional modules, with complete it is described above whole or
Person's partial function.In addition, the static resource buffer storage that above-described embodiment is provided belongs to static resource caching method embodiment
Same design, it implements process and refers to embodiment of the method, repeats no more here.
One of ordinary skill in the art will appreciate that realizing that all or part of step of above-described embodiment can be by hardware
To complete, the hardware of correlation can also be instructed to complete by program, described program can be stored in a kind of computer-readable
In storage medium, storage medium mentioned above can be read-only storage, disk or CD etc..
The foregoing is only presently preferred embodiments of the present invention, be not intended to limit the invention, it is all the present invention spirit and
Within principle, any modification, equivalent substitution and improvements made etc. should be included in the scope of the protection.
Claims (11)
1. a kind of static resource caching method, it is characterised in that methods described includes:
The digest value with the first static resource is identified based on target pages, whether judge first static resource is latest edition
Static resource;
Wherein, target pages is need any page opened, and first static resource is current being used in local cache
Render the static resource of the target pages, the digest value of first static resource is to described the by default template grammar
The content of one static resource carries out computing and obtained;
If first static resource is not the static resource of latest edition, based on target pages mark, from service
The static resource of the latest edition for rendering the target pages is obtained and cached in device.
2. the method as described in claim 1, it is characterised in that described to be identified based on target pages and the first static resource is plucked
Be worth, judge first static resource whether be latest edition static resource, including:
First resource is sent to the server and obtains request, and the first resource obtains in request and carries the target pages mark
Know;
The digest value for the second static resource that the server is sent is received, the digest value of second static resource is the clothes
Business device carries out computing to the content of second static resource by the default template grammar and obtained, second static resource
For the static resource for being used to render the latest edition of the target pages stored in the server;
If the digest value of first static resource is different from the digest value of second static resource, it is determined that described first
Static resource is not the static resource of latest edition.
3. the method as described in claim 1, it is characterised in that when the target pages are the page that application program includes,
The target pages are designated the mark of the application program;When the target pages are webpage, the target pages mark
For the banner of the webpage.
4. the method as described in claim 1, it is characterised in that described to be identified based on target pages and the first static resource is plucked
Be worth, judge first static resource whether be latest edition static resource before, in addition to:
When detecting the opening operation of the target pages, the summary identified based on target pages with the first static resource is performed
Value, judge first static resource whether be latest edition static resource operation.
5. the method as described in claim 1, it is characterised in that described to be identified based on target pages and the first static resource is plucked
Be worth, judge first static resource whether be latest edition static resource before, in addition to:
The first prompt message is shown, first prompt message is used to point out whether to cache for rendering the target pages most
The static resource of redaction;
When receiving determination cache instruction, the digest value based on target pages mark and the first static resource is performed, institute is judged
State the first static resource whether be latest edition static resource operation.
6. a kind of static resource buffer storage, it is characterised in that described device includes:
Judge module, for identifying the digest value with the first static resource based on target pages, judges first static resource
Whether be latest edition static resource;
Wherein, target pages is need any page opened, and first static resource is current being used in local cache
Render the static resource of the target pages, the digest value of first static resource is to described the by default template grammar
The content of one static resource carries out computing and obtained;
Cache module, if not being the static resource of latest edition for first static resource, based on the page object
Face is identified, and the static resource of the latest edition for rendering the target pages is obtained and cached from server.
7. device as claimed in claim 6, it is characterised in that the judge module includes:
Sending submodule, obtains request, the first resource is obtained to be taken in request for sending first resource to the server
With target pages mark;
Receiving submodule, the digest value for receiving the second static resource that the server is sent, second static resource
Digest value computing carried out to the content of second static resource by the default template grammar for the server obtained,
Second static resource is the static resource of the latest edition for rendering the target pages stored in the server;
Determination sub-module, if for first static resource digest value and second static resource digest value not
Together, it is determined that first static resource is not the static resource of latest edition.
8. device as claimed in claim 6, it is characterised in that when the target pages are the page that application program includes,
The target pages are designated the mark of the application program;When the target pages are webpage, the target pages mark
For the banner of the webpage.
9. device as claimed in claim 6, it is characterised in that described device also includes:
First trigger module, mesh is based on for when detecting the opening operation of the target pages, triggering the judge module
The digest value of page iden-tity and the first static resource is marked, whether judge first static resource is that the static of latest edition is provided
Source.
10. device as claimed in claim 6, it is characterised in that described device also includes:
Display module, for showing the first prompt message, whether first prompt message is used to point out to cache for rendering institute
State the static resource of the latest edition of target pages;
Second trigger module, for when receiving determination cache instruction, triggering the judge module and being identified based on target pages
With the digest value of the first static resource, judge first static resource whether be latest edition static resource.
11. a kind of computer-readable recording medium, it is characterised in that the storage medium internal memory contains computer program, described
Claim 1-5 any described methods are realized when computer program is executed by processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710448038.9A CN107315791A (en) | 2017-06-14 | 2017-06-14 | Static resource caching method, device and computer-readable recording medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710448038.9A CN107315791A (en) | 2017-06-14 | 2017-06-14 | Static resource caching method, device and computer-readable recording medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107315791A true CN107315791A (en) | 2017-11-03 |
Family
ID=60183636
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710448038.9A Pending CN107315791A (en) | 2017-06-14 | 2017-06-14 | Static resource caching method, device and computer-readable recording medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107315791A (en) |
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107992557A (en) * | 2017-11-28 | 2018-05-04 | 平安养老保险股份有限公司 | Static resource update method, device, storage medium and computer equipment |
CN109299414A (en) * | 2018-09-26 | 2019-02-01 | 深圳壹账通智能科技有限公司 | A kind of method and terminal of loading page |
CN109634925A (en) * | 2019-02-20 | 2019-04-16 | 平安科技(深圳)有限公司 | Resource file downloading method, device, computer equipment and storage medium |
CN109902244A (en) * | 2019-01-17 | 2019-06-18 | 平安城市建设科技(深圳)有限公司 | Page loading method, device, equipment and computer readable storage medium |
CN110069729A (en) * | 2017-11-15 | 2019-07-30 | 百度在线网络技术(北京)有限公司 | A kind of offline cache method and system of application |
CN110457628A (en) * | 2019-07-05 | 2019-11-15 | 平安国际智慧城市科技股份有限公司 | Webpage edition correcting method, device, equipment and storage medium |
CN110795649A (en) * | 2019-09-18 | 2020-02-14 | 北京你财富计算机科技有限公司 | Target page display method, device and system and electronic equipment |
CN110866198A (en) * | 2019-09-27 | 2020-03-06 | 上海硬通网络科技有限公司 | Static resource caching method, system, device, computer equipment and storage medium |
CN111708594A (en) * | 2020-06-09 | 2020-09-25 | 北京达佳互联信息技术有限公司 | Page rendering method and device, electronic equipment and storage medium |
CN111783005A (en) * | 2020-07-08 | 2020-10-16 | 中国工商银行股份有限公司 | Method, apparatus and system for displaying web page, computer system and medium |
CN112966205A (en) * | 2021-04-21 | 2021-06-15 | 平安好医投资管理有限公司 | Webpage opening method and device, electronic equipment and storage medium |
CN113158098A (en) * | 2020-01-07 | 2021-07-23 | 百度在线网络技术(北京)有限公司 | Page generation method, device, equipment and medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104376122A (en) * | 2014-12-08 | 2015-02-25 | 浪潮通用软件有限公司 | Method for browser client to obtain static file and server |
CN105808305A (en) * | 2016-03-29 | 2016-07-27 | 北京小米移动软件有限公司 | Static resource loading method and device |
CN106021300A (en) * | 2016-05-04 | 2016-10-12 | 北京思特奇信息技术股份有限公司 | Static resource real-time effecting method and system |
-
2017
- 2017-06-14 CN CN201710448038.9A patent/CN107315791A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104376122A (en) * | 2014-12-08 | 2015-02-25 | 浪潮通用软件有限公司 | Method for browser client to obtain static file and server |
CN105808305A (en) * | 2016-03-29 | 2016-07-27 | 北京小米移动软件有限公司 | Static resource loading method and device |
CN106021300A (en) * | 2016-05-04 | 2016-10-12 | 北京思特奇信息技术股份有限公司 | Static resource real-time effecting method and system |
Cited By (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110069729A (en) * | 2017-11-15 | 2019-07-30 | 百度在线网络技术(北京)有限公司 | A kind of offline cache method and system of application |
CN107992557A (en) * | 2017-11-28 | 2018-05-04 | 平安养老保险股份有限公司 | Static resource update method, device, storage medium and computer equipment |
CN109299414A (en) * | 2018-09-26 | 2019-02-01 | 深圳壹账通智能科技有限公司 | A kind of method and terminal of loading page |
CN109902244A (en) * | 2019-01-17 | 2019-06-18 | 平安城市建设科技(深圳)有限公司 | Page loading method, device, equipment and computer readable storage medium |
CN109634925A (en) * | 2019-02-20 | 2019-04-16 | 平安科技(深圳)有限公司 | Resource file downloading method, device, computer equipment and storage medium |
CN109634925B (en) * | 2019-02-20 | 2024-06-14 | 平安科技(深圳)有限公司 | Resource file downloading method, device, computer equipment and storage medium |
CN110457628A (en) * | 2019-07-05 | 2019-11-15 | 平安国际智慧城市科技股份有限公司 | Webpage edition correcting method, device, equipment and storage medium |
CN110795649A (en) * | 2019-09-18 | 2020-02-14 | 北京你财富计算机科技有限公司 | Target page display method, device and system and electronic equipment |
CN110866198A (en) * | 2019-09-27 | 2020-03-06 | 上海硬通网络科技有限公司 | Static resource caching method, system, device, computer equipment and storage medium |
CN113158098A (en) * | 2020-01-07 | 2021-07-23 | 百度在线网络技术(北京)有限公司 | Page generation method, device, equipment and medium |
CN113158098B (en) * | 2020-01-07 | 2024-03-19 | 百度在线网络技术(北京)有限公司 | Page generation method, device, equipment and medium |
CN111708594A (en) * | 2020-06-09 | 2020-09-25 | 北京达佳互联信息技术有限公司 | Page rendering method and device, electronic equipment and storage medium |
CN111708594B (en) * | 2020-06-09 | 2023-08-29 | 北京达佳互联信息技术有限公司 | Page rendering method and device, electronic equipment and storage medium |
CN111783005B (en) * | 2020-07-08 | 2024-03-15 | 中国工商银行股份有限公司 | Method, device and system for displaying web page, computer system and medium |
CN111783005A (en) * | 2020-07-08 | 2020-10-16 | 中国工商银行股份有限公司 | Method, apparatus and system for displaying web page, computer system and medium |
CN112966205A (en) * | 2021-04-21 | 2021-06-15 | 平安好医投资管理有限公司 | Webpage opening method and device, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107315791A (en) | Static resource caching method, device and computer-readable recording medium | |
CN105847430B (en) | Mix application page data access method and device | |
JP7166294B2 (en) | Audio processing method, device and storage medium | |
CN106126685B (en) | Page loading method and device | |
CN107391063A (en) | Method for information display, device and computer-readable recording medium | |
CN113783774B (en) | Cross-cluster network configuration method and device, communication equipment and storage medium | |
CN107357613A (en) | Using update method, device and computer-readable recording medium | |
EP4203604A1 (en) | Ranging capacity request method and apparatus, ranging capacity sending method and apparatus, and ranging capacity receiving method and apparatus | |
CN107423394A (en) | Page display method and device | |
CN109565753A (en) | Control the method and device of wave beam failure recovery process | |
RU2665300C2 (en) | Method and device for processing point reporting of touch screen | |
CN105930213A (en) | Application running method and apparatus | |
RU2742605C1 (en) | Method and device for touch signal processing and data medium | |
CN106528385A (en) | System fluency monitoring method and apparatus, and terminal | |
RU2616592C2 (en) | Method and apparatus for determining location | |
CN112489653B (en) | Speech recognition method, device and storage medium | |
CN105786561B (en) | Method and device for calling process | |
CN114430410B (en) | System access method, device and equipment based on virtual domain name | |
CN107395724A (en) | Network request method and device | |
CN112532789B (en) | Ring tone processing method and device, terminal and storage medium | |
CN107463833A (en) | The method of calibration and device of Web applications | |
CN114531493B (en) | Request processing method and device, electronic equipment and storage medium | |
CN112201236B (en) | Terminal awakening method and device and computer readable storage medium | |
CN107784224B (en) | Permission adaptation method and device and electronic equipment | |
EP4180987A1 (en) | Multimodal data sending method and apparatus, and multimodal data processing method and apparatus |
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 | ||
CB02 | Change of applicant information |
Address after: 510660 Guangzhou City, Guangzhou, Guangdong, Whampoa Avenue, No. 315, self - made 1-17 Applicant after: Guangzhou KuGou Networks Co., Ltd. Address before: 510000 B1, building, No. 16, rhyme Road, Guangzhou, Guangdong, China 13F Applicant before: Guangzhou KuGou Networks Co., Ltd. |
|
CB02 | Change of applicant information | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20171103 |
|
RJ01 | Rejection of invention patent application after publication |