CN107729352B - Page resource loading method and terminal equipment - Google Patents

Page resource loading method and terminal equipment Download PDF

Info

Publication number
CN107729352B
CN107729352B CN201710761478.XA CN201710761478A CN107729352B CN 107729352 B CN107729352 B CN 107729352B CN 201710761478 A CN201710761478 A CN 201710761478A CN 107729352 B CN107729352 B CN 107729352B
Authority
CN
China
Prior art keywords
page
resource
plug
cache
loading
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.)
Active
Application number
CN201710761478.XA
Other languages
Chinese (zh)
Other versions
CN107729352A (en
Inventor
黄伟淦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
OneConnect Smart Technology Co Ltd
Original Assignee
OneConnect Financial Technology Co Ltd Shanghai
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by OneConnect Financial Technology Co Ltd Shanghai filed Critical OneConnect Financial Technology Co Ltd Shanghai
Priority to CN201710761478.XA priority Critical patent/CN107729352B/en
Priority to PCT/CN2018/077044 priority patent/WO2019041766A1/en
Publication of CN107729352A publication Critical patent/CN107729352A/en
Application granted granted Critical
Publication of CN107729352B publication Critical patent/CN107729352B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a page resource loading method and terminal equipment, which are suitable for the technical field of mobile application, and the method comprises the following steps: when a page loading event is triggered, intercepting a page loading request and acquiring a page address carried by the page loading request; determining a page resource plug-in matched with the site based on the site corresponding to the page address, wherein the page resource plug-in is pre-stored in an installation package of an application program; running the page resource plug-in to obtain a plurality of locally stored static cache resources under the site; and loading the static cache resources matched with the page addresses in the application program according to a preset network view. The invention ensures that the Hybrid App can quickly load the page resources from the local even under the condition of loading the page resources for the first time, thereby reducing the frequency of requesting the page resources from the second server, greatly reducing the loading time of the page resources and improving the performance of the Hybrid App.

Description

Page resource loading method and terminal equipment
Technical Field
The invention belongs to the technical field of mobile application, and particularly relates to a page resource loading method and terminal equipment.
Background
With the continuous update of technology, the application programs of the mobile terminal are gradually developing along the direction of a localized application (Native App), a WEB-based application (WEB App), and a Hybrid application (Hybrid App), wherein the Hybrid App is an application written based on a WEB page language and a program language, and the interface of the Hybrid App is similar to the Native App from the user perspective, but actually, the mobile application displays pages based on the HTM L5.
In the development process of the Hybrid App, if the HTM L5 page is not optimized perfectly, under the condition of poor network environment, a user usually needs a large amount of time to obtain the page resource when using the Hybrid App and loading the page resource for the first time.
Disclosure of Invention
In view of this, the embodiment of the present invention provides a page resource loading method and a terminal device, so as to solve the problem that the Hybrid App in the prior art consumes a large amount of time when loading a page resource for the first time.
A first aspect of an embodiment of the present invention provides a page resource loading method, including:
when a page loading event is triggered, intercepting a page loading request and acquiring a page address carried by the page loading request;
determining a page resource plug-in matched with the site based on the site corresponding to the page address, wherein the page resource plug-in is pre-stored in an installation package of an application program;
running the page resource plug-in to obtain a plurality of locally stored static cache resources under the site;
and loading the static cache resources matched with the page addresses in the application program according to a preset network view.
A second aspect of the embodiments of the present invention provides a terminal device, including a memory and a processor, where the memory stores a computer program that is executable on the processor, and when the processor executes the computer program, the method includes:
when a page loading event is triggered, intercepting a page loading request and acquiring a page address carried by the page loading request;
determining a page resource plug-in matched with the site based on the site corresponding to the page address, wherein the page resource plug-in is pre-stored in an installation package of an application program;
running the page resource plug-in to obtain a plurality of locally stored static cache resources under the site;
and loading the static cache resources matched with the page addresses in the application program according to a preset network view.
A third aspect of embodiments of the present invention provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of:
when a page loading event is triggered, intercepting a page loading request and acquiring a page address carried by the page loading request;
determining a page resource plug-in matched with the site based on the site corresponding to the page address, wherein the page resource plug-in is pre-stored in an installation package of an application program;
running the page resource plug-in to obtain a plurality of locally stored static cache resources under the site;
and loading the static cache resources matched with the page addresses in the application program according to a preset network view.
In the embodiment of the invention, the page resource plug-ins matched with the multiple sites are stored in the application program installation package of the Hybrid App, and the Hybrid App operates the page resource plug-ins stored locally when intercepting the page loading request so as to load the static cache resources matched with the page loading request, thereby ensuring that the Hybrid App can quickly load the page resources from the local even under the condition that the page resources are loaded for the first time, reducing the times of requesting the page resources from a remote server, greatly reducing the time consumption for loading the page resources and further improving the performance of the Hybrid App.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a flowchart illustrating an implementation of a page resource loading method according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating an implementation of a page resource loading method according to another embodiment of the present invention;
FIG. 3 is a flowchart illustrating an implementation of a page resource loading method according to another embodiment of the present invention;
fig. 4 is a flowchart illustrating a specific implementation of the page resource loading method S104 according to an embodiment of the present invention;
fig. 5 is a block diagram of a page resource loading apparatus according to an embodiment of the present invention;
fig. 6 is a block diagram illustrating a structure of a page resource loading apparatus according to another embodiment of the present invention;
fig. 7 is a block diagram illustrating a structure of a page resource loading apparatus according to another embodiment of the present invention;
fig. 8 is a schematic diagram of a terminal device according to an embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
In the embodiments of the present invention, the execution subject of the process is an application program running on the mobile terminal, which is referred to as a mobile application for short. The mobile application is a Hybrid App.
In order to explain the technical means of the present invention, the following description will be given by way of specific examples.
Fig. 1 shows an implementation process of a page resource loading method provided by an embodiment of the present invention, where the method process includes steps S101 to S104. The specific implementation principle of each step is as follows.
S101: when a page loading event is triggered, a page loading request is intercepted, and a page address carried by the page loading request is obtained.
The moment when the mobile application loads the page resource comprises the moment when the mobile application is started and the moment when a resource selection instruction sent by a user is received in the running process of the mobile application. In the above case, the page load event is triggered. At this point, the mobile application generates a page load request. When the interceptor preset in the mobile application detects the page loading request, the page loading request is intercepted and captured, so that the page loading request cannot normally reach the destination address of the page loading request, that is, the page loading request cannot be sent to the remote server and cannot request to load the page resource on the remote network.
The page address can be, for example, a UR L (Uniform resource locator) address of a page resource stored on a remote server.
For example, the page address carried by the intercepted page load request may be: local:// www.abc.com/item/url/110640.
Preferably, the network transmission protocol corresponding to the native page resource of the mobile application is generally a file protocol, and since the file protocol cannot be identified and intercepted, the network transmission protocol corresponding to the native page resource is uniformly changed into a local protocol in the development process of the mobile application. And intercepting the page loading request only when detecting that the protocol of the page address carried by the page loading request is a local protocol.
S102: and determining a page resource plug-in matched with the site based on the site corresponding to the page address, wherein the page resource plug-in is pre-stored in an installation package of an application program.
A site represents a virtual directory that organizes, maintains, and manages multiple page resources. And according to the page address obtained in the step S101, determining an IP address part or a domain name address part in the page address as a site corresponding to the page address.
For example, in the page address http:// www.abc.com/item/url/110640, the domain name address obtained by the analysis is "www.abc.com", so the site corresponding to the page address is www.abc.com site.
In the embodiment of the invention, before the mobile application is started, the mobile application needs to be installed based on the pre-downloaded installation package of the mobile application. And storing the page resource plug-ins of the plurality of sites in the downloaded installation package. Specifically, before the installation package of the mobile application is issued, the page resources of each site related to the mobile application are integrated into an hfcache plug-in, and the hfcache plug-ins are packaged into the installation package of the mobile application.
And when the mobile application is successfully installed, acquiring each page resource plug-in from the installation package. And determining the page resource plug-in matched with the site from all the page resource plug-ins integrated in the installation package according to the plug-in name of each page resource plug-in and the site corresponding to the page loading request.
S103: and operating the page resource plug-in to obtain a plurality of locally stored static cache resources under the site.
When each hfcache plug-in unit runs, a compression packet and a cache file list corresponding to the hfcache plug-in unit are called. The file format of the compressed package includes, but is not limited to, a.zip format or a.rar format. The compressed packet contains various static cache resources of the site, such as js files, css files, pictures, audio and other files in the site. The cache file list is used for recording resource names of all static cache resources in the compressed package and an MD5 value corresponding to each static cache resource. Each static cache resource will compute its MD5 value through a pre-set algorithm when it is issued. In the process of integrating the static cache resources into the hfcache plug-in, the MD5 value is recorded in the cache file list corresponding to the hfcache plug-in.
And decompressing the compressed packet corresponding to the hfcache plug-in, so as to obtain the static cache resources under each storage path.
S104: and loading the static cache resources matched with the page addresses in the application program according to a preset network view.
And analyzing a resource path and a resource file name of the page resource required to be loaded by the current mobile application from the page address carried by the page loading request. And determining the static cache resources matched with the resource path and the resource file name in each static cache resource obtained by decompression.
WebView is a webkit-based engine and controls for rendering web pages. In the embodiment of the invention, the determined static cache resources are analyzed through the WebView preset in the mobile application to generate the corresponding Web page, so that the page resources required by the page loading request are displayed.
In the embodiment of the invention, the page resource plug-ins matched with the multiple sites are stored in the application program installation package of the Hybrid App, and when the Hybrid App intercepts the page loading request, the page resource plug-ins stored in the local are decompressed to load the static cache resources matched with the page loading request, so that the Hybrid App can quickly load the page resources from the local even under the condition that the page resources are loaded for the first time, the frequency of requesting the page resources from a remote server is reduced, the time consumption for loading the page resources is greatly reduced, and the performance of the Hybrid App is improved.
As another embodiment of the present invention, as shown in fig. 2, after the step S104, the method further includes:
s105: and sending a plug-in updating detection request to the first server at preset time intervals.
The static cache resources of different sites are usually maintained and updated by different teams, and in order to facilitate mobile application to update the locally stored static cache resources of each site, the embodiment of the invention provides a static cache resource publishing platform. And after the page resource plug-in is uploaded to the static cache resource publishing platform, the updating and publishing of the page resource plug-in is completed. For ease of understanding and distinction from the remote servers mentioned below, the static caching resource publishing platform described above is referred to as the first server.
The mobile application sends a plug-in update detection request to the first server at intervals of a preset time interval so as to detect whether the locally stored static cache resources are updated at the current moment.
As an embodiment of the present invention, the step S105 specifically includes:
sending a plug-in updating detection request to a first server at a preset time interval, wherein the plug-in updating detection request comprises an identification number of the page resource plug-in, so that the first server extracts the static cache resource issued at the current moment from a plug-in resource page bound with the identification number, and returns the first cache file list related to the static cache resource.
In the embodiment of the invention, each locally stored page resource plug-in is pre-allocated with an identification number, namely an ID number for uniquely identifying the page resource plug-in. And at every preset time interval, the mobile application needs to determine whether each page resource plug-in has a new version. Based on the ID number of the page resource plug-in needing to be detected, the mobile application sends a plug-in update detection request carrying the ID number to the first server.
When the first server receives the plug-in updating detection request, the ID number of the page resource plug-in carried by the plug-in updating detection request is analyzed. And the first server screens out the page resource plug-ins corresponding to the ID number from all the page resource plug-ins issued at the current moment. According to the static cache resources called by the screened page resource plug-in, the first server generates a first cache file list so as to record the resource names and the MD5 values of all the static cache resources in the first cache file list, and returns the first cache file list to the mobile application as response information of the plug-in update detection request.
Preferably, the first server stores resource homepage addresses corresponding to the ID numbers, and when the preset time interval is reached, the first server crawls page resources in the resource homepage addresses according to the stored resource homepage addresses, integrates crawling results into a new page resource plug-in, and issues the page resource plug-in. In the embodiment of the invention, the manager of the site does not need to manually log in the static cache resource publishing platform and manually upload the updated page resource plug-in, and only needs to store the resource homepage address of the site in the first server, so that the automatic crawling and the timed updating of the page resource plug-in can be realized, and the operation complexity of the page resource plug-in the updating and publishing process is reduced.
S106: and receiving a first cache file list returned by the first server according to the plug-in update detection request, wherein the first cache file list comprises the MD5 value of each static cache resource.
S107: and reading the MD5 value of each static cache resource in a second cache file list obtained by running the page resource plug-in.
After the locally stored page resource plug-in is operated, a cache file list can be obtained as well, and in order to distinguish from the cache file list returned by the first server, the cache file list obtained after the locally stored page resource plug-in is operated is called a second cache file list. In step S103, the second cache file list records resource names of the static cache resources in the compressed package corresponding to the page resource plug-in and MD5 values corresponding to each static cache resource.
S108: for each static cache resource, if the MD5 value in the first cache file list is different from the MD5 value in the second cache file list, updating the static cache resource, and updating the second cache file list to the first cache file list.
And sequentially reading the MD5 value corresponding to each resource name in the first cache file list. When the MD5 value corresponding to each resource name is read, the MD5 value corresponding to the resource name is found in the second cache file list. If the values of the two MD5 are not the same, it is determined that the static cache resource corresponding to the resource name issues a new version.
Specifically, if a certain resource name in the first cache file list does not exist in the second cache file list, it is also determined that the static cache resource corresponding to the resource name issues a new version.
And when determining that a certain static cache resource issues a new version, downloading the static cache resource from the first server to update the static cache resource stored locally by the mobile application. And deleting the first cache file list originally stored by the mobile application so as to update the second cache file list into the first cache file list.
Preferably, when the static cache resource locally stored by the mobile application is updated, only the incremental part data of the static cache resource is downloaded from the first server, so as to reduce the data amount required to be downloaded by the mobile application, thereby improving the updating efficiency of the static cache resource.
In the embodiment of the invention, whether the static cache resource in the mobile application issues a new version can be rapidly detected by regularly acquiring the first cache file list related to the newly issued static cache resource and judging whether the MD5 value of the static cache resource in the second locally stored cache file list is the same as the MD5 value in the first cache file list, so that the detection efficiency is improved; when the MD5 value of a certain static cache resource in the first cache file list is different from the MD5 value of the certain static cache resource in the second cache file list, the static cache resource is updated, so that the downloading of the whole page resource plug-in with large information amount can be avoided, and the updating efficiency of the static cache resource is improved.
As another embodiment of the present invention, as shown in fig. 3, after S103, the method further includes:
s109: and acquiring a preset decryption algorithm.
S110: and decrypting the plurality of locally stored static cache resources under the site through the decryption algorithm.
In the embodiment of the invention, the page resource plug-ins packaged into the installation package of the mobile application, the static cache resources corresponding to each page resource plug-in and the cache file list are all file data encrypted based on an Advanced Encryption Standard (AES). When the mobile application is in the running state and a page loading request is intercepted, a decryption algorithm obtaining event is triggered to read a decryption algorithm pre-stored in the mobile application. And decrypting each encrypted static cache resource through the decryption algorithm to decrypt the compressed packet, the cache file list and each static cache resource corresponding to the page resource plug-in.
In the embodiment of the invention, when the page resource plug-in and the application program are packaged, the static cache resources and other data files are encrypted, so that the static cache resources can be stored in the mobile terminal in an encrypted form. The page loading request is intercepted only when the mobile application runs, and the decryption algorithm for decrypting the page resource plug-in can be obtained, so that even if the static cache resource is intercepted by other lawless persons, the static cache resource cannot be decrypted as long as the mobile application is not in a running state, and the code safety of the static cache resource is ensured.
As an embodiment of the present invention, as shown in fig. 5, the S104 specifically includes:
s1041: and acquiring the static cache resources matched with the page address from the plurality of static cache resources, and calculating the MD5 value of the static cache resources.
In the embodiment of the invention, according to the page address carried by the page loading request, the static cache resource matched with the page address is searched in each decompressed static cache resource. And processing the searched static cache resources through an MD5 algorithm prestored in the local to calculate the MD5 value of the static cache resources at the current moment. Wherein the locally stored MD5 algorithm is the same as the MD5 algorithm used by the first server in distributing the page resource plug-ins.
S1042: and reading the MD5 value corresponding to the static cache resource from the MD5 values recorded in the second cache file list in advance.
According to the resource name of the static cache resource, the MD5 value corresponding to the resource name is searched in a locally stored cache file list to determine whether the MD5 value obtained by searching is the same as the MD5 value calculated in real time at the current moment.
S1043: and if the read MD5 value is the same as the calculated MD5 value, loading the static cache resource in the application program according to a preset network view.
S1044: and if the read MD5 value is different from the calculated MD5 value, sending the page loading request to a second server to load the network page resource based on the page address.
Different data contents, which have different MD5 values calculated by the same MD5 algorithm. Therefore, if the static cache resource stored locally at the current time is changed, or the MD5 value of the static cache resource recorded in the cache file list is the latest published MD5 value, the MD5 value calculated by the MD5 algorithm is different from the MD5 value stored in the cache file list, so that it can be determined whether the locally stored static cache resource is tampered or is the latest version of page resource.
If the MD5 value obtained by calculation is the same as the MD5 value read from the second cache file list, it can be determined that the locally stored static cache resource is the latest issued page resource and has not been tampered with, so that the static cache resource is directly loaded through the preset WebView.
If the MD5 value obtained by calculation is different from the MD5 value read from the second cache file list, it can be determined that the locally stored static cache resource is an old version of a page resource or has been illegally tampered. At the moment, the intercepted page loading request is sent to the resource server corresponding to the carried page address again to request for online acquisition of page resources.
In the embodiment of the invention, the real-time MD5 value of the static cache resource is calculated by using an MD5 algorithm, and whether the MD5 value is the same as the MD5 value in the cache file list is compared, so that the tamper-proof check of the static cache resource is realized; because the cache file list may be updated before the files of the static cache resources, if the MD5 value obtained by calculation is different from the MD5 value in the cache file list, it may be preliminarily determined that the locally stored static cache resources may be different from the static cache resources of the latest version, so that by online loading the page resources in real time, the mobile application is ensured to be able to maximally increase the loading speed of the page resources, and the page resources of the latest version are displayed, thereby improving the reliability of the mobile application.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
Corresponding to the page resource loading method described in the foregoing embodiment, fig. 5 shows a structural block diagram of a page resource loading apparatus provided in the embodiment of the present invention, and for convenience of description, only a part related to the embodiment of the present invention is shown.
Referring to fig. 5, the apparatus includes:
the intercepting unit 501 is configured to intercept a page loading request when a page loading event is triggered, and obtain a page address carried by the page loading request.
A determining unit 502, configured to determine, based on the site corresponding to the page address, a page resource plug-in matched with the site, where the page resource plug-in is stored in an installation package of an application in advance.
The decompressing unit 503 is configured to run the page resource plug-in to obtain a plurality of locally stored static cache resources under the site.
A loading unit 504, configured to load, in the application program, the static cache resource that is matched with the page address according to a preset network view.
Optionally, as shown in fig. 6, the page resource loading apparatus further includes:
a requesting unit 505, configured to send a plug-in update detection request to the first server at preset time intervals.
A receiving unit 506, configured to receive a first cache file list returned by the first server according to the plug-in update detection request, where the first cache file list includes an MD5 value of each static cache resource.
The reading unit 507 is configured to read an MD5 value of each static cache resource in a second cache file list obtained by running the page resource plug-in.
An updating unit 508, configured to, for each static cache resource, if the MD5 value in the first cache file list is different from the MD5 value in the second cache file list, update the static cache resource and update the second cache file list to the first cache file list.
Optionally, the requesting unit 507 includes:
the request subunit is configured to send a plug-in update detection request to the first server at preset time intervals, where the plug-in update detection request includes an identification number of the page resource plug-in, so that the first server extracts a static cache resource issued at a current time from a plug-in resource page bound to the identification number, and returns the first cache file list related to the static cache resource to the first server.
Optionally, as shown in fig. 7, the page resource loading apparatus further includes:
an obtaining unit 509, configured to obtain a preset decryption algorithm.
A decryption unit 510, configured to decrypt, through the decryption algorithm, the locally stored multiple static cache resources under the site.
Optionally, the loading unit 504 includes:
and the calculating subunit is configured to obtain, from the multiple static cache resources, the static cache resource that matches the page address, and calculate an MD5 value of the static cache resource.
And an obtaining subunit, configured to read, from the MD5 values recorded in the second cache file list in advance, an MD5 value corresponding to the static cache resource.
And the loading subunit is configured to load the static cache resource according to a preset network view in the application program if the read MD5 value is the same as the calculated MD5 value.
And the sending subunit is configured to send the page loading request to a second server to load a network page resource based on the page address if the read MD5 value is different from the calculated MD5 value.
In the embodiment of the invention, the page resource plug-ins matched with the multiple sites are stored in the application program installation package of the Hybrid App, and when the Hybrid App intercepts the page loading request, the page resource plug-ins stored in the local are decompressed to load the static cache resources matched with the page loading request, so that the Hybrid App can quickly load the page resources from the local even under the condition that the page resources are loaded for the first time, the frequency of requesting the page resources from a remote server is reduced, the time consumption for loading the page resources is greatly reduced, and the performance of the Hybrid App is improved.
Fig. 8 is a schematic diagram of a terminal device according to an embodiment of the present invention. As shown in fig. 8, the terminal device 8 of this embodiment includes: a processor 80, a memory 81, and a computer program 82, such as a page resource loader, stored in the memory 81 and operable on the processor 80. The processor 80, when executing the computer program 82, implements the steps in the various embodiments of the page resource loading method described above, such as the steps 101 to 104 shown in fig. 1. Alternatively, the processor 80, when executing the computer program 82, implements the functions of the modules/units in the device embodiments, such as the functions of the units 51 to 54 shown in fig. 5.
Illustratively, the computer program 82 may be partitioned into one or more modules/units that are stored in the memory 81 and executed by the processor 80 to implement the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 82 in the terminal device 8.
The terminal device 8 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The terminal device may include, but is not limited to, a processor 80, a memory 81. Those skilled in the art will appreciate that fig. 8 is merely an example of a terminal device 8 and does not constitute a limitation of terminal device 8 and may include more or fewer components than shown, or some components may be combined, or different components, e.g., the terminal device may also include input-output devices, network access devices, buses, etc.
The Processor 80 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 81 includes at least one type of computer readable storage medium, and may be an internal storage unit of the terminal device 8, such as a hard disk or a memory of the terminal device 8. The memory 81 may also be an external storage device of the terminal device 8, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal device 8. Further, the memory 81 may also include both an internal storage unit and an external storage device of the terminal device 8. The memory 81 is used for storing the computer program and other programs and data required by the terminal device. The memory 81 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. . Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (8)

1. A page resource loading method is characterized by comprising the following steps:
when a page loading event is triggered, when the protocol of a page address carried by a page loading request is detected to be a local protocol, intercepting the page loading request and acquiring the page address carried by the page loading request; in the development process of the mobile application, uniformly changing a network transmission protocol corresponding to the native page resource into a local protocol;
determining a page resource plug-in matched with the site based on the site corresponding to the page address, wherein the page resource plug-in is pre-stored in an installation package of an application program;
running the page resource plug-in to obtain a plurality of locally stored static cache resources under the site; when each page resource plug-in runs, calling a compressed package and a cache file list corresponding to the page resource plug-in; the compressed packet comprises various static cache resources of the site; the cache file list is used for recording resource names of all static cache resources in the compressed package and MD5 values corresponding to all static cache resources;
loading the static cache resource matched with the page address in the application program according to a preset network view;
sending a plug-in updating detection request to a first server at preset time intervals;
receiving a first cache file list returned by the first server according to the plug-in update detection request, wherein the first cache file list comprises an MD5 value of each static cache resource;
reading the MD5 value of each static cache resource in a second cache file list obtained by running the page resource plug-in;
for each static cache resource, if the MD5 value in the first cache file list is different from the MD5 value in the second cache file list, updating the static cache resource, and updating the second cache file list to the first cache file list.
2. The page resource loading method according to claim 1, wherein said sending a plug-in update detection request to the first server at preset time intervals comprises:
sending a plug-in updating detection request to a first server at a preset time interval, wherein the plug-in updating detection request comprises an identification number of the page resource plug-in, so that the first server extracts the static cache resource issued at the current moment from a plug-in resource page bound with the identification number, and returns the first cache file list related to the static cache resource.
3. The method for loading page resources according to claim 1, wherein after said running said page resource plug-in to obtain a plurality of static cache resources under said site stored locally, further comprising:
acquiring a preset decryption algorithm;
and decrypting the plurality of locally stored static cache resources under the site through the decryption algorithm.
4. The method for loading page resources according to claim 1, wherein the loading, in the application program, the static cache resources matched with the page addresses according to a preset network view includes:
obtaining the static cache resources matched with the page address from the plurality of static cache resources, and calculating the MD5 value of the static cache resources;
reading an MD5 value corresponding to the static cache resource from each MD5 value recorded in the second cache file list in advance;
if the read MD5 value is the same as the calculated MD5 value, loading the static cache resource in the application program according to a preset network view;
and if the read MD5 value is different from the calculated MD5 value, sending the page loading request to a second server to load the network page resource based on the page address.
5. A terminal device comprising a memory and a processor, the memory having stored therein a computer program operable on the processor, wherein the processor, when executing the computer program, implements the steps of:
when a page loading event is triggered, when the protocol of a page address carried by a page loading request is detected to be a local protocol, intercepting the page loading request and acquiring the page address carried by the page loading request; in the development process of the mobile application, uniformly changing a network transmission protocol corresponding to the native page resource into a local protocol;
determining a page resource plug-in matched with the site based on the site corresponding to the page address, wherein the page resource plug-in is pre-stored in an installation package of an application program;
running the page resource plug-in to obtain a plurality of locally stored static cache resources under the site; when each page resource plug-in runs, calling a compressed package and a cache file list corresponding to the page resource plug-in; the compressed packet comprises various static cache resources of the site; the cache file list is used for recording resource names of all static cache resources in the compressed package and MD5 values corresponding to all static cache resources;
loading the static cache resource matched with the page address in the application program according to a preset network view;
sending a plug-in updating detection request to a first server at preset time intervals;
receiving a first cache file list returned by the first server according to the plug-in update detection request, wherein the first cache file list comprises an MD5 value of each static cache resource;
reading the MD5 value of each static cache resource in a second cache file list obtained by running the page resource plug-in;
for each static cache resource, if the MD5 value in the first cache file list is different from the MD5 value in the second cache file list, updating the static cache resource, and updating the second cache file list to the first cache file list.
6. The terminal device of claim 5, wherein the step of sending a plug-in update detection request to the first server at preset time intervals specifically includes:
sending a plug-in updating detection request to a first server at a preset time interval, wherein the plug-in updating detection request comprises an identification number of the page resource plug-in, so that the first server extracts the static cache resource issued at the current moment from a plug-in resource page bound with the identification number, and returns the first cache file list related to the static cache resource.
7. The terminal device according to claim 5, wherein the step of loading, in the application program, the static cache resource that matches the page address according to a preset network view specifically includes:
obtaining the static cache resources matched with the page address from the plurality of static cache resources, and calculating the MD5 value of the static cache resources;
reading an MD5 value corresponding to the static cache resource from each MD5 value recorded in the second cache file list in advance;
if the read MD5 value is the same as the calculated MD5 value, loading the static cache resource in the application program according to a preset network view;
and if the read MD5 value is different from the calculated MD5 value, sending the page loading request to a second server to load the network page resource based on the page address.
8. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 4.
CN201710761478.XA 2017-08-30 2017-08-30 Page resource loading method and terminal equipment Active CN107729352B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201710761478.XA CN107729352B (en) 2017-08-30 2017-08-30 Page resource loading method and terminal equipment
PCT/CN2018/077044 WO2019041766A1 (en) 2017-08-30 2018-02-23 Page resource loading method and apparatus, terminal device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710761478.XA CN107729352B (en) 2017-08-30 2017-08-30 Page resource loading method and terminal equipment

Publications (2)

Publication Number Publication Date
CN107729352A CN107729352A (en) 2018-02-23
CN107729352B true CN107729352B (en) 2020-07-31

Family

ID=61205544

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710761478.XA Active CN107729352B (en) 2017-08-30 2017-08-30 Page resource loading method and terminal equipment

Country Status (2)

Country Link
CN (1) CN107729352B (en)
WO (1) WO2019041766A1 (en)

Families Citing this family (30)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108804082A (en) * 2018-05-10 2018-11-13 北京酷我科技有限公司 A kind of implementation method of plug-in unit JSBridge
CN110825990A (en) * 2018-07-23 2020-02-21 优视科技有限公司 Page access method, client, server and system
CN110874445A (en) * 2018-08-31 2020-03-10 中国移动通信集团浙江有限公司 Webpage loading method, client and business service center
CN109324838B (en) * 2018-08-31 2022-05-10 深圳市元征科技股份有限公司 Execution method and execution device of single chip microcomputer program and terminal
CN109257426B (en) * 2018-09-26 2022-10-14 平安普惠企业管理有限公司 Service line resource loading method and device, computer equipment and storage medium
CN109446449B (en) * 2018-10-09 2022-05-10 南京尚网网络科技有限公司 Method and equipment for refreshing information page content in advance
CN109408232B (en) * 2018-10-17 2020-08-14 山东易通发展集团有限公司 Transaction flow-based componentized bus calling execution system
CN109582889A (en) * 2018-10-17 2019-04-05 平安普惠企业管理有限公司 Picture loading method, device, computer equipment and storage medium
CN109697069B (en) * 2018-11-26 2022-07-26 福建天泉教育科技有限公司 Packing method and terminal for H5 application
CN111310084A (en) * 2018-12-12 2020-06-19 北京嘀嘀无限科技发展有限公司 Page loading method, device and system, user terminal and readable storage medium
CN109800367A (en) * 2018-12-13 2019-05-24 平安科技(深圳)有限公司 Webpage loading method, device, computer equipment and storage medium
CN109710870A (en) * 2018-12-27 2019-05-03 北京微播视界科技有限公司 Loading method, device, electronic equipment and the readable storage medium storing program for executing of the H5 page
CN109857960A (en) * 2019-01-14 2019-06-07 厦门美柚信息科技有限公司 A kind of method, equipment, system and its storage medium that page data updates
CN109934014B (en) * 2019-02-15 2021-06-25 福建天泉教育科技有限公司 Method and terminal for detecting correctness of resource file
CN110059276A (en) * 2019-03-12 2019-07-26 天津五八到家科技有限公司 Method for updating pages, device, equipment and storage medium
CN110058873B (en) * 2019-03-12 2021-09-17 天津五八到家科技有限公司 Application page updating method, device, equipment and storage medium
CN110008118B (en) * 2019-03-13 2023-03-10 深圳壹账通智能科技有限公司 Page data testing method and device, computer equipment and storage medium
CN110119290A (en) * 2019-04-12 2019-08-13 平安科技(深圳)有限公司 The spare page switching method of application program, device, computer equipment and storage medium
CN110377360A (en) * 2019-07-12 2019-10-25 深圳市酷开网络科技有限公司 Method, display terminal and the computer readable storage medium that webview is quickly loaded
CN110362770A (en) * 2019-07-17 2019-10-22 吉旗(成都)科技有限公司 A method of solving mobile terminal web data offline cache
CN110825603A (en) * 2019-11-01 2020-02-21 北京博睿宏远数据科技股份有限公司 Page first loading time determining method and device, electronic equipment and storage medium
CN112487322B (en) * 2020-12-16 2024-05-28 Vidaa美国公司 Third party application Loading page loading method and display device
CN112751917A (en) * 2020-12-28 2021-05-04 锐捷网络股份有限公司 Resource file loading method, network device, electronic device and storage medium
CN113590618B (en) * 2021-07-19 2023-10-13 上海淇玥信息技术有限公司 Zero access amount page resource cleaning method and device and electronic equipment
CN113626106A (en) * 2021-08-19 2021-11-09 吉林亿联银行股份有限公司 Method and system for realizing data interception
CN114398099A (en) * 2022-01-04 2022-04-26 北京金山云网络技术有限公司 Program resource loading method, device, equipment and storage medium
CN114416212A (en) * 2022-01-30 2022-04-29 中国工商银行股份有限公司 Mobile terminal application program data resource processing method and device
CN114528529A (en) * 2022-02-15 2022-05-24 广州经传多赢投资咨询有限公司 Memory xml file encryption method
CN115242775A (en) * 2022-07-04 2022-10-25 中国银联股份有限公司 Resource file acquisition method, device, equipment, medium and product
CN117407115B (en) * 2023-12-15 2024-02-20 江苏金融租赁股份有限公司 Interface display method and device based on dynamic loading plug-in

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104572777A (en) * 2013-10-28 2015-04-29 腾讯科技(深圳)有限公司 Webpage loading method and device based on UIWebView component
CN105208127A (en) * 2015-10-09 2015-12-30 上海瀚银信息技术有限公司 Webpage caching processing method and system and intelligent terminal
CN105630981A (en) * 2015-12-25 2016-06-01 小米科技有限责任公司 Network resource loading and configuration method and device
CN105653933A (en) * 2016-01-06 2016-06-08 北京京东尚科信息技术有限公司 Plugin loading method and device
CN106209925A (en) * 2015-04-29 2016-12-07 阿里巴巴集团控股有限公司 Page loading method, client and system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8972513B2 (en) * 2013-08-05 2015-03-03 Iboss, Inc. Content caching
CN105988846B (en) * 2015-03-03 2019-11-05 腾讯科技(深圳)有限公司 Page loading method and page loading device
CN106951323A (en) * 2017-03-09 2017-07-14 深圳峰创智诚科技有限公司 Application program local cache method and apparatus
CN107291519A (en) * 2017-08-09 2017-10-24 四川长虹电器股份有限公司 A kind of cross-platform image cache implementation method of webview based on mobile terminal

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104572777A (en) * 2013-10-28 2015-04-29 腾讯科技(深圳)有限公司 Webpage loading method and device based on UIWebView component
CN106209925A (en) * 2015-04-29 2016-12-07 阿里巴巴集团控股有限公司 Page loading method, client and system
CN105208127A (en) * 2015-10-09 2015-12-30 上海瀚银信息技术有限公司 Webpage caching processing method and system and intelligent terminal
CN105630981A (en) * 2015-12-25 2016-06-01 小米科技有限责任公司 Network resource loading and configuration method and device
CN105653933A (en) * 2016-01-06 2016-06-08 北京京东尚科信息技术有限公司 Plugin loading method and device

Also Published As

Publication number Publication date
CN107729352A (en) 2018-02-23
WO2019041766A1 (en) 2019-03-07

Similar Documents

Publication Publication Date Title
CN107729352B (en) Page resource loading method and terminal equipment
CN102135892B (en) Application program running method, device and system
CN113489713B (en) Network attack detection method, device, equipment and storage medium
CN109391673B (en) Method, system and terminal equipment for managing update file
TW201642135A (en) Detecting malicious files
US9607145B2 (en) Automated vulnerability and error scanner for mobile applications
US8621613B1 (en) Detecting malware in content items
CN111163095B (en) Network attack analysis method, network attack analysis device, computing device, and medium
CN103793649A (en) Method and device for cloud-based safety scanning of files
CN111163094B (en) Network attack detection method, network attack detection device, electronic device, and medium
CN110708335A (en) Access authentication method and device and terminal equipment
CN112241298A (en) Page display method and device, storage medium and electronic device
US10291492B2 (en) Systems and methods for discovering sources of online content
CN106878345A (en) A kind of method and device for distorting protection
CN113343312A (en) Page tamper-proofing method and system based on front-end point burying technology
CN113469866A (en) Data processing method and device and server
CN113259494B (en) File storage method and device, electronic equipment and storage medium
CN113312577B (en) Webpage resource processing method and device, electronic equipment and storage medium
CN110806913A (en) Webpage screenshot method, device and equipment
US9348977B1 (en) Detecting malware in content items
CN113542418A (en) File management method and device, electronic equipment and storage medium
CN105224880B (en) Information acquisition method and device
CN111611585A (en) Terminal device monitoring method and device, electronic device and medium
US20220084048A1 (en) Server apparatus, method of controlling server apparatus, computer-readable medium, genuine product determining system, and method of controlling genuine product determining system
CN113542185B (en) Method and device for preventing hijacking of page, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20180611

Address after: 518000 Room 201, building A, 1 front Bay Road, Shenzhen Qianhai cooperation zone, Shenzhen, Guangdong

Applicant after: Shenzhen one ledger Intelligent Technology Co., Ltd.

Address before: 200000 Xuhui District, Shanghai Kai Bin Road 166, 9, 10 level.

Applicant before: Shanghai Financial Technologies Ltd

TA01 Transfer of patent application right
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 1250070

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant