CN112241298A - Page display method and device, storage medium and electronic device - Google Patents

Page display method and device, storage medium and electronic device Download PDF

Info

Publication number
CN112241298A
CN112241298A CN201910650245.1A CN201910650245A CN112241298A CN 112241298 A CN112241298 A CN 112241298A CN 201910650245 A CN201910650245 A CN 201910650245A CN 112241298 A CN112241298 A CN 112241298A
Authority
CN
China
Prior art keywords
target
page
offline package
offline
display
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910650245.1A
Other languages
Chinese (zh)
Inventor
周世龙
罗程
李斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910650245.1A priority Critical patent/CN112241298A/en
Publication of CN112241298A publication Critical patent/CN112241298A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Abstract

The invention discloses a page display method and device, a storage medium and an electronic device. Wherein, the method comprises the following steps: acquiring a page display instruction in a target application installed on a terminal, wherein the page display instruction is used for requesting to display a target page; analyzing a target address of a target page and determining a target offline packet identifier; acquiring a target offline package corresponding to the target offline package identifier, wherein the target offline package comprises a main page file of a target page and a resource and script file which are referred by the main page file; and loading the target offline package in the target application so as to display the target page in the target application. The invention solves the technical problem of longer page loading time in the related technology.

Description

Page display method and device, storage medium and electronic device
Technical Field
The invention relates to the field of page display, in particular to a page display method and device, a storage medium and an electronic device.
Background
With the development of mobile internet, a large number of pages exist in various application programs. There are many pagefiles in a page. When the application is used for opening a page, remote loading, analysis, rendering and other processes need to be carried out through a network access server. The user has a long waiting time, which affects the user experience.
Aiming at the problem of long page loading time, an effective solution is not provided at present.
Disclosure of Invention
The embodiment of the invention provides a page display method and device, a storage medium and an electronic device, which are used for at least solving the technical problem of long page loading time in the related technology.
According to an aspect of an embodiment of the present invention, there is provided a page display method including: acquiring a page display instruction in a target application installed on a terminal, wherein the page display instruction is used for requesting to display a target page; analyzing the target address of the target page and determining a target offline packet identifier; acquiring a target offline package corresponding to the target offline package identifier, wherein the target offline package comprises a main page file of the target page and a resource and script file referred by the main page file; and loading the target offline package in the target application so as to display the target page in the target application.
According to another aspect of the embodiments of the present invention, there is also provided a page display apparatus including: the terminal comprises a first acquisition module, a second acquisition module and a display module, wherein the first acquisition module is used for acquiring a page display instruction in a target application installed on the terminal, and the page display instruction is used for requesting to display a target page; the first determining module is used for analyzing the target address of the target page and determining the target offline packet identifier; a second obtaining module, configured to obtain a target offline package corresponding to the target offline package identifier, where the target offline package includes a main page file of the target page and a resource and a script file referred to by the main page file; the first loading module loads the target offline package in the target application so as to display the target page in the target application.
Optionally, the target page is a target page in a target interface in the target application, where the first loading module includes: the first display unit is configured to display the target interface in the target application, and display the target page obtained by loading the target offline package in a target area in the target interface, where the target area is a part or all of the target interface.
Optionally, the apparatus further comprises: a third obtaining module, configured to obtain, before obtaining the page display instruction in a target application installed on the terminal, identification information of the target offline package sent by the server; and the processing module is used for downloading the target offline package identified by the identification information from the server and storing the target offline package on the terminal.
Optionally, the target page is a target H5 page, where the apparatus further includes: a first detection module, configured to load the target offline package in the target application, so as to detect an interaction operation in the target H5 page after the target page is displayed in the target application; and the first display module is used for displaying an operation result responding to the interactive operation in the target application.
Optionally, the first loading module includes: a first generating unit, configured to generate a load address of the target offline package in the target application, where the load address includes a main page file of the target page and a storage address of a resource and a script file referred by the main page file in the terminal; a first obtaining unit, configured to obtain the main page file and the resource and script file referred by the main page file from the storage address, and load the main page file and the resource and script file referred by the main page file in the target application, so as to display the target page in the target application.
Optionally, the apparatus further comprises: a first sending module, configured to send first version information of the target offline package to the server, where the server is configured to compare the first version information with second version information, and an offline package corresponding to the second version information is an offline package to be updated of the target offline package; a second downloading module, configured to download, from the server, the binary patch to be updated for the offline package when the first version information is different from the second version information; and the updating module is used for updating the binary patch into the target offline package.
Optionally, the apparatus further comprises: a fourth obtaining module, configured to obtain encrypted information of a check information set sent by the server, where the check information set includes a first check value of the target offline packet, and the encrypted information is obtained by encrypting the check information set using a first encryption key; a second determining module, configured to decrypt the encrypted information using a first decryption key corresponding to the first encryption key to obtain the check information set; a third determining module, configured to determine that the target offline package is tampered with when a second check value of the target offline package stored on the terminal is inconsistent with the first check value; and the fourth determining module is used for determining that the target offline package is not tampered under the condition that the second check value is consistent with the first check value.
Optionally, the first determining module includes: a second obtaining unit, configured to obtain a destination address of the destination page sent by the server; and the extracting unit is used for extracting the identification information from the target address under the condition that the identification information is determined to be included in the target address so as to determine the target offline packet identifier.
According to still another aspect of the embodiments of the present invention, there is also provided a storage medium having a computer program stored therein, wherein the computer program is configured to execute the above page display method when running.
According to another aspect of the embodiments of the present invention, there is also provided an electronic apparatus, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the page display method through the computer program.
In the embodiment of the invention, a page display instruction is obtained from a target application installed on a terminal, and a target off-line packet corresponding to a target address is searched, wherein the target off-line packet comprises a main page file of a target page and a resource and script file quoted by the main page file; the method comprises the steps of analyzing a target address of a target page, determining a target offline package identification, obtaining a target offline package corresponding to the target offline package identification, loading the target offline package in a target application, and displaying the target page by loading the target offline package stored on a terminal in a mode of displaying the target page in the target application, so that the purpose of reducing the opening time of the target page is achieved, the technical effect of quickly opening the target page is achieved, and the technical problem that the page loading time is long in the related technology is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a schematic diagram of an application environment of an alternative page display method according to an embodiment of the invention;
FIG. 2 is a flowchart illustrating an alternative page display method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of an alternative social software according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating an alternative hierarchical structure of an offline package directory, in accordance with embodiments of the present invention;
fig. 5 is a flowchart of the terminal loading a target offline package in this embodiment;
FIG. 6 is a schematic diagram of an alternative load off-line package according to an embodiment of the invention;
FIG. 7 is a diagram illustrating an alternative update offline packet, in accordance with an embodiment of the present invention;
FIG. 8 is a schematic diagram of an alternative verify-off package according to an embodiment of the present invention;
FIG. 9 is a diagram of an alternative verify-off package according to an embodiment of the present invention;
FIG. 10 is a schematic structural diagram of an alternative page display apparatus according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of an alternative electronic device according to an embodiment of the invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to an aspect of the embodiments of the present invention, a page display method is provided, and optionally, as an optional implementation manner, the page display method may be applied, but not limited, to the environment shown in fig. 1.
The target application 108 in fig. 1 may be running in the terminal 102 and may display a target page. The terminal 102 includes a memory 104 for storing operational data and a target offline packet 110, and a processor 106 for processing the operational data. The terminal 102 and the server 114 can perform data interaction through the network 112. Server 114 includes database 116 for storing operational data and target offline package 110, and processing engine 118 for processing the operational data. As shown in fig. 1, a page display instruction may be obtained in a target application installed on the terminal 102, where the page display instruction is used to request to display a target page indicated by a target address in the target application; the terminal 102 may search for a target offline package 110 corresponding to the target address, where the target offline package includes a main page file of the target page and a resource and script file referred by the main page file, and the target offline package is an offline package that is downloaded by the target application from the server 114 of the target application before the target application obtains the page display instruction and is stored on the terminal 102; when the target offline package 110 is found, the terminal 102 loads the target offline package 110 in the target application 108, so as to display the target page in the target application 108.
Alternatively, the page display method may be, but is not limited to, applied to a client running on a terminal 102 capable of calculating data, the terminal 102 may be a mobile phone, a tablet computer, a notebook computer, a PC, and the like, and the network 112 may include, but is not limited to, a wireless network or a wired network. Wherein, this wireless network includes: WIFI and other networks that enable wireless communication. Such wired networks may include, but are not limited to: wide area networks, metropolitan area networks, and local area networks. The server 114 may include, but is not limited to, any hardware device capable of performing computations.
Optionally, as an optional implementation manner, as shown in fig. 2, the page display method includes:
s202: acquiring a page display instruction in a target application installed on a terminal, wherein the page display instruction is used for requesting to display a target page;
s204: analyzing a target address of a target page and determining a target offline packet identifier;
s206: acquiring a target offline package corresponding to the target offline package identifier, wherein the target offline package comprises a main page file of a target page and a resource and script file which are referred by the main page file;
s208: and loading the target offline package in the target application so as to display the target page in the target application.
Optionally, the target offline package in the above includes, but is not limited to, a compressed package including a main page file of the target page and the resources and script files referenced by the main page file. For example, the target offline package is formed by compressing and packaging html files, js files, pictures, css style files and the like together. Or, it consists of compressing and packaging large static resources (e.g. high resolution pictures, complex css styles, some js scripts). Or, a script file for dynamically loading the target page.
Optionally, the target offline packet includes, but is not limited to, a compressed packet compressed by compression software, for example, a zip compressed format, 7z or gz compressed format, and the like.
Optionally, the target application includes, but is not limited to, a native application, a page web application, a hybrid application, such as social software, music playing software, video playing software, a browser page, and the like.
Alternatively, the page display method can be applied to a scene including the H5 page, such as social software, or a scene requiring page jumping, such as a browser page. As applied to social software, the social software includes the H5 page. As shown in fig. 3, a page display instruction is obtained in social software installed on a terminal, where the page display instruction is used to request to display a target page indicated by a target address in the social software; searching a target offline package corresponding to the target address, wherein the target offline package comprises a main page file of a target page, and a resource and a script file which are quoted by the main page file, and the target offline package is an offline package which is downloaded by the social software from a server of the social software before a page display instruction is acquired and is stored on the terminal; in the case where the target offline package is found, the target offline package is loaded in the social software to display the target page in the target application, such as the content displayed in the grey frame in fig. 3.
According to the embodiment, the offline package stored on the terminal is directly loaded in the target application to display the main page file of the target page and the resources and script files referenced by the main page file included in the offline package, and the main page file of the target page and the resources and script files referenced by the main page file do not need to be downloaded and recorded again from the server. Thereby reducing the time consumption of the target application in the process from the request of downloading the target page to the rendering of the target page. The purpose of quickly opening the content displayed in the target page is achieved.
Optionally, in this embodiment, the page display instruction includes, but is not limited to, identification information of the target offline package, and a website address including the identification information of the target offline package. For example, a unique identification offid of the target offline package. Different off-line packages have different offids and different contents packaged inside the off-line packages. The offset may be included in a Uniform Resource Locator (URL) address of the target page. Query parameter identification may be used, such as, for example, $ { id }, where $ { id } indicates the identification information of the target off-line packet. For example, the address of a page is: https:// abc. com/admin/qq/index? And if 1111 is determined to be the current address, the terminal may obtain the target offline packet with the id of 1111. If html in the target page references a picture: if < img src ═ https:// def.com/node/work/server.png ">, then the picture can be compressed into an offline packet.
According to the embodiment, whether the target off-line package is stored locally is determined through the identification information of the target off-line package, so that the target off-line package can be found quickly, and the speed of displaying the target webpage is further improved.
In an optional embodiment, the target page is a target page in a target interface in the target application, wherein the loading of the target offline package in the target application to display the target page in the target application includes:
s1, displaying a target interface in the target application, and displaying a target page obtained by loading a target offline package in a target area in the target interface, wherein the target area is a part or all of the area in the target interface.
Optionally, in this embodiment, as shown in fig. 3, the displayed content in the gray frame in the target interface is a target area, and the target area may be a partial area in parts (a) and (b) in fig. 3, or may be a whole area in part (c) in fig. 3.
Optionally, the content displayed in the target area in FIG. 3 includes, but is not limited to, content of the H5 page, content in a native application. In the case where the content displayed in the target area is the content of the H5 page, the content of the H5 page may be displayed in conjunction with the content in the native application.
According to the embodiment, the target interface is displayed in the target application, the target page obtained by loading the target offline package is displayed in the target area in the target interface, and the speed of loading the main page file of the target page is improved.
In an optional embodiment, before acquiring the page display instruction in the target application installed on the terminal, the method further includes:
s1, acquiring the identification information of the target offline package sent by the server;
and S2, downloading the target offline package identified by the identification information from the server and storing the target offline package on the terminal.
Optionally, in this embodiment, the identification information may be sent from the server separately, or may be sent by being carried in website information, where the website information is sent to the target application by the server, the website information sent by the server is received in the target application, and the terminal may obtain the identification information of the target offline package from the website information. And under the condition that the website information comprises the identification information of the target offline package, the terminal downloads the target offline package from the server and stores the target offline package on the terminal.
Optionally, the server sends a website address that further includes identification information of the target offline package. For example, a unique identification offid of the target offline package. Different off-line packages have different offids and different contents packaged inside the off-line packages. The offset may be included in a Uniform Resource Locator (URL) address of the target page. Query parameter identification may be used, such as, for example, $ { id }, where $ { id } indicates the identification information of the target off-line packet. For example, the address of a page is: https:// abc. com/admin/qq/index? And if 1111 is determined to be the current address, the terminal may obtain the target offline packet with the id of 1111. If html in the target page references a picture: if < img src ═ https:// def.com/node/work/server.png ">, then the picture can be compressed into an offline packet.
By the embodiment, the target offline package identified by the identification information is downloaded from the server and stored on the terminal. When the target page is loaded, the target offline package can be directly called from the terminal, so that the loading of the target page is accelerated.
In an alternative embodiment, the target page is a target H5 page, where after loading the target offline package in the target application to display the target page in the target application, the method includes:
s1, detecting the interactive operation in the target H5 page;
and S2, displaying the operation result responding to the interactive operation in the target application.
Optionally, in this embodiment, in a case that the target page is an H5 page, the target offline package is locally acquired from the terminal, and the main page content included in the target offline package, and the resource and script file referred by the main page file are displayed in an H5 page.
With the present embodiment, by detecting an interactive operation in the target H5 page, displaying an operation result in response to the interactive operation in the target application, the speed of loading the H5 page is increased,
in an alternative embodiment, loading a target offline package in a target application to display a target page in the target application includes:
s1, generating a loading address of the target offline package in the target application, wherein the loading address comprises a main page file of a target page, and a storage address of a resource and a script file which are referred by the main page file in the terminal;
and S2, acquiring the main page file and the resources and the script files referenced by the main page file from the storage address, and loading the main page file and the resources and the script files referenced by the main page file in the target application so as to display the target page in the target application.
Optionally, in this embodiment, the terminal may download the target offline package locally when the terminal finds the target offline package. The downloaded target offline package can be in a zip compression format, and decompression is performed after the terminal finishes downloading. And after decompression, obtaining the storage structure of the file in the target offline package. Com is the name of a directory, and the irregular graphic represents a specific main page file (e.g., index. html is a specific file). FIG. 4 is an example of an offline package directory hierarchy corresponding to a load address. As shown in fig. 4, the directory is set in accordance with the structure of the url path. Where the root directory 1111 is named by the identification information offid of the target offline package. Html, the load address of index.html is abc.com/admin/qq. Html is consistent with the path in url address in server. Html, that is, the content of the main page file of the page h5, the path of the picture server.png referenced by its internal code is also set according to the path structure of url, and is not described herein again.
Optionally, fig. 5 is a flowchart of loading a target offline package by the terminal in this embodiment, a target page is described by taking an H5 page as an example, as shown in fig. 5, the method includes the following steps:
s501: starting;
s502: and determining whether the page display instruction carries identification information of the target offline package in the acquired page display instruction, for example, the page display instruction is a url-format website, and checking whether the query parameter carries an identification information offset tag of the target offline package to determine whether the current H5 page supports the offline package characteristic.
S503: when the office exists, the terminal downloads the offline package corresponding to the H5 page in the background.
Optionally, when the H5 page is opened for the first time, a network loading manner is used, and at this time, there is no corresponding target offline package locally. When the H5 page is opened again, and the target offline package is downloaded, the terminal can use the target offline package to quickly load the corresponding target offline package. The effect of quickly loading the target page is achieved.
S504: in a page display instruction is https:// abc. com/admin/qq/index? When _offid ═ 1111, the terminal locally searches a corresponding target offline package, if found, the terminal determines a loading address, for example, a loading address in a hypertext Transfer Protocol (HTTP) format, where content-type is Text/html, and returns the loading address to the target application of the terminal, thereby completing loading of the main page file in the H5 page, the resource referenced by the main page file, and the main page of the script file (the main page file may be a html file).
Optionally, in this embodiment, there may be a reference to a static resource in the main page file, for example, a reference to a static picture, and the loading address of the static picture may be < img src ═ https:// def.
S505: and if the target offline file is not found locally, loading the target page on a background server according to a network request.
Optionally, the process of loading the target offline package by the browser in the terminal is similar to the process of loading the html file in the H5 page, as shown in fig. 6, the method includes the following steps:
s601: and starting.
S602: a browser webview page in the terminal makes a resource request, for example, the requested website is: < img src ═ https:// def. com/node/work/server. png >.
S603: and extracting identification information offid of the target offline package from the website.
S604: if the office information of the target offline package is found in the website, go to S605.
S605: the terminal determines a loading address, for example, a loading address in a hypertext transfer protocol (HTTP) format, the content-type is text/html, the loading address is returned to a browser webview of the terminal, and loading of the main page file, the resources referenced by the main page file and the main page of the script file is completed.
S606: as can be seen from the website, the website does not have the office information of the target offline package. when webview is loaded, a target offline package is requested from a server through a network, the target offline package is recorded in the server, and the target offline package is downloaded to a local terminal for storage.
Optionally, the target offline package supports common static files, such as pages html, css, js, and various forms of resource pictures (< img src ═ >, < script src ═ >, < link href >). The opening speed of the specific content in the target page is improved.
According to the embodiment, under the condition that the target offline package is found, a loading address of the target offline package is generated, wherein the loading address is used for responding to a loading request of a target page sent to a server by a target application, and the loading address comprises a main page file of the target page, and a storage address of a resource and a script file which are quoted by the main page file and are in the server; receiving a load address in a target application; and loading the target offline package in the target application so as to display the target page in the target application. The loading speed of the target page is improved.
In an optional embodiment, after loading the target offline package in the target application to display the target page in the target application and determine the offline package corresponding to the web page address from the determined web page address of the page to be loaded, the method further includes:
s1, sending first version information of the target offline package to a server, wherein the server is used for comparing the first version information with second version information, and the offline package corresponding to the second version information is the offline package to be updated of the target offline package;
s2, downloading the binary patch of the offline package to be updated from the server under the condition that the first version information is different from the second version information;
and S3, updating the binary patch into the target offline packet.
Optionally, in this embodiment, when the main page file in the target page or the resource referred by the main page file, or the script file, is changed and the product requirement is iterated, the target offline package needs to be dynamically updated. As shown in fig. 7, the updating process includes the following steps:
s701: the terminal sends the identification information and version information of the target offline package to the server, for example, the identification information is offid: json version 111, in the version information: 123.
optionally, the terminal informs the server of the version number information each time the url address is opened and the offline package in the server is requested using the offid.
S702: the server checks the received offid and version information.
S703: the server stores all versions of the offline packages, and finds two corresponding offline packages according to the version requested by the terminal and the current latest version.
S704: and generating a binary patch by using the bsdiff, and issuing the offline packet with the latest version to the terminal.
Optionally, a binary patch is generated by using bsdiff, so as to save terminal traffic and server bandwidth occupation when performing offline package update. Optionally, if the terminal first requests the offline package file, the server may issue a complete zip offline package without carrying version.
By the embodiment, the latest version of the main page file and the resources and script files referenced by the main page file can be displayed in the target page in real time by updating the version of the offline package.
In an optional embodiment, before obtaining the target offline packet corresponding to the target offline packet identifier, the method further includes:
s1, acquiring encrypted information of a check information set sent by the server, wherein the check information set comprises a first check value of the target offline packet, and the encrypted information is obtained by encrypting the check information set by using a first encryption key;
s2, decrypting the encrypted information by using a first decryption key corresponding to the first encryption key to obtain a verification information set;
s3, determining that the target offline package is tampered under the condition that the second check value of the target offline package stored on the terminal is inconsistent with the first check value;
and S4, determining that the target offline package is not tampered under the condition that the second check value is consistent with the first check value.
Optionally, in this embodiment, in order to prevent the content in the target offline package from being accidentally tampered, and utilized by a hacker or the like, the security of the target offline package is verified in this embodiment, so as to prevent tampering. For example, in the offline packet directory of the target offline packet, the security of the target offline packet is verified by using the verification data exchange format verify.
Optionally, the first encryption key includes, but is not limited to, a private key, the first decryption key includes, but is not limited to, a public key, and the first encryption key and the first decryption key include, but are not limited to, being asymmetric.
As shown in fig. 8, the flow of verification includes the following steps:
s801: the server generates a MD5 Message Digest Algorithm (Message Digest Algorithm) value for the target offline package, stored in verify.
S802: signing the verify.json by using the first encryption key to generate verify.signature.
Alternatively, in verify. json, md5 values corresponding to all offline package files are saved, and the terminal can determine whether a file is modified by checking whether md5 values of each file are the same as md5 values in verify. json, as shown in fig. 9.
Json's security, optionally, is achieved by asymmetric encryption and decryption. After generating the verify, the server signs the verify by using the first encryption key, the signature result is stored in the verify, and the terminal signs the verify by using the verify and the pre-distributed first decryption key, so that the security of the verify is verified.
If the security check is not passed, the whole offline package is deleted, and the package downloading process is carried out again.
In an alternative embodiment, in a scenario where page hopping is required, the target offline package requires interaction with a native application, such as in the social software of fig. 3, the content of the interaction of the H5 page with the content in the target page in the social software. In this embodiment, the terminal loads the data of the target offline package, and is implemented by intercepting a webview network request. Therefore, there is no difference to webview itself from ordinary opening url http requests. Therefore, the interaction mode of the social software and the Native is not influenced in the technical scheme of the offline package.
The target Application provides an Interface, injects an Application programming Interface (API for short) to call the Javascript, directly executes a corresponding local Native code, and is suitable for a scene needing to perform data request through interaction.
A Uniform Resource Locator (URL) intercepts a URL Scheme request sent by a Web page, and then a Native intercepts the request and performs related operations according to the URL Scheme and parameters carried by the request.
Through the embodiment, the display of the target page can be accelerated by combining the target offline package and the native application program.
In an optional embodiment, the parsing the destination address of the destination page and determining the destination offline packet identifier includes:
s1, acquiring the target address of the target page sent by the server;
and S2, extracting the identification information from the target address to determine the target offline packet identifier under the condition that the identification information is included in the target address.
Optionally, in this embodiment, the server may send the target address of the target page to the target application by responding to the request of the target application. The server sets the identification information of the target offline package in the target address. And after receiving the target address, the target application analyzes the identification information of the target offline packet from the target address.
Through the embodiment, under the condition that the target address comprises the identification information, the identification information is extracted from the target address so as to determine the target offline packet identifier. The target off-line package can be quickly acquired.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
According to another aspect of the embodiment of the invention, a page display device for implementing the page display method is also provided. As shown in fig. 10, the apparatus includes:
a first obtaining module 1002, configured to obtain a page display instruction in a target application installed on a terminal, where the page display instruction is used to request to display a target page;
the first determining module 1004 is configured to analyze a target address of a target page and determine a target offline packet identifier;
a second obtaining module 1006, configured to obtain a target offline package corresponding to the target offline package identifier, where the target offline package includes a main page file of a target page and a resource and a script file referred by the main page file;
the first loading module 1008 is configured to load the target offline package in the target application to display the target page in the target application.
Optionally, the target page is a target page in a target interface in the target application, where the first loading module includes:
the first display unit is configured to display the target interface in the target application, and display the target page obtained by loading the target offline package in a target area in the target interface, where the target area is a part or all of the target interface.
Optionally, the apparatus further comprises:
a third obtaining module, configured to obtain, before obtaining the page display instruction in a target application installed on the terminal, identification information of the target offline package sent by the server;
and the processing module is used for downloading the target offline package identified by the identification information from the server and storing the target offline package on the terminal.
Optionally, the target page is a target H5 page, where the apparatus further includes:
a first detection module, configured to load the target offline package in the target application, so as to detect an interaction operation in the target H5 page after the target page is displayed in the target application;
and the first display module is used for displaying an operation result responding to the interactive operation in the target application.
Optionally, the first loading module includes:
a first generating unit, configured to generate a load address of the target offline package in the target application, where the load address includes a main page file of the target page and a storage address of a resource and a script file referred by the main page file in the terminal;
a first obtaining unit, configured to obtain the main page file and the resource and script file referred by the main page file from the storage address, and load the main page file and the resource and script file referred by the main page file in the target application, so as to display the target page in the target application.
Optionally, the apparatus further comprises:
a first sending module, configured to send first version information of the target offline package to the server, where the server is configured to compare the first version information with second version information, and an offline package corresponding to the second version information is an offline package to be updated of the target offline package;
a second downloading module, configured to download, from the server, the binary patch to be updated for the offline package when the first version information is different from the second version information;
and the updating module is used for updating the binary patch into the target offline package.
Optionally, the apparatus further comprises:
a fourth obtaining module, configured to obtain encrypted information of a check information set sent by the server, where the check information set includes a first check value of the target offline packet, and the encrypted information is obtained by encrypting the check information set using a first encryption key;
a second determining module, configured to decrypt the encrypted information using a first decryption key corresponding to the first encryption key to obtain the check information set;
a third determining module, configured to determine that the target offline package is tampered with when a second check value of the target offline package stored on the terminal is inconsistent with the first check value;
and the fourth determining module is used for determining that the target offline package is not tampered under the condition that the second check value is consistent with the first check value.
Optionally, the first determining module includes: a second obtaining unit, configured to obtain a destination address of the destination page sent by the server; and the extracting unit is used for extracting the identification information from the target address under the condition that the identification information is determined to be included in the target address so as to determine the target offline packet identifier.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device for implementing the page display method, as shown in fig. 11, the electronic device includes a memory 1102 and a processor 1104, the memory 1102 stores therein a computer program, and the processor 1104 is configured to execute the steps in any one of the method embodiments through the computer program.
Optionally, in this embodiment, the electronic apparatus may be located in at least one network device of a plurality of network devices of a computer network.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1: acquiring a page display instruction in a target application installed on a terminal, wherein the page display instruction is used for requesting to display a target page;
s2: analyzing a target address of a target page and determining a target offline packet identifier;
s3: acquiring a target offline package corresponding to the target offline package identifier, wherein the target offline package comprises a main page file of a target page and a resource and script file which are referred by the main page file;
s4: and loading the target offline package in the target application so as to display the target page in the target application.
Alternatively, it can be understood by those skilled in the art that the structure shown in fig. 11 is only an illustration, and the electronic device may also be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a Mobile Internet Device (MID), a PAD, and the like. Fig. 11 is a diagram illustrating a structure of the electronic device. For example, the electronic device may also include more or fewer components (e.g., network interfaces, etc.) than shown in FIG. 11, or have a different configuration than shown in FIG. 11.
The memory 1102 may be used to store software programs and modules, such as program instructions/modules corresponding to the page display method and apparatus in the embodiments of the present invention, and the processor 1104 executes various functional applications and data processing by operating the software programs and modules stored in the memory 1102, that is, implements the page display method described above. The memory 1102 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 1102 can further include memory located remotely from the processor 1104 and such remote memory can be coupled to the terminal via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof. The memory 1102 may be used for displaying information such as a page, but is not limited thereto. As an example, as shown in fig. 11, the memory 1102 may include, but is not limited to, a first obtaining module 1002, a second obtaining module 1004, and a first loading module 1006 in the page display device. In addition, other module units in the page display device may also be included, but are not limited to these, and are not described in detail in this example.
Optionally, the transmitting device 1106 is used for receiving or transmitting data via a network. Examples of the network may include a wired network and a wireless network. In one example, the transmission device 1106 includes a Network adapter (NIC) that can be connected to a router via a Network cable to communicate with the internet or a local area Network. In one example, the transmission device 1106 is a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In addition, the electronic device further includes: a display 1108 for displaying information displayed on the page; and a connection bus 1110 for connecting the respective module parts in the above-described electronic apparatus.
According to a further aspect of embodiments of the present invention, there is also provided a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above-mentioned method embodiments when executed.
Alternatively, in the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:
alternatively, in this embodiment, a person skilled in the art may understand that all or part of the steps in the methods of the foregoing embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing one or more computer devices (which may be personal computers, servers, network devices, etc.) to execute all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be 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, units or modules, and may be in an electrical 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 foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (11)

1. A page display method, comprising:
acquiring a page display instruction in a target application installed on a terminal, wherein the page display instruction is used for requesting to display a target page;
analyzing the target address of the target page and determining a target offline packet identifier;
acquiring a target offline package corresponding to the target offline package identifier, wherein the target offline package comprises a main page file of the target page and a resource and script file referred by the main page file;
and loading the target offline package in the target application so as to display the target page in the target application.
2. The method of claim 1, wherein the target page is a target page in a target interface of the target application, and wherein loading the target offline package in the target application to display the target page in the target application comprises:
and displaying the target interface in the target application, and displaying the target page obtained by loading the target offline package in a target area in the target interface, wherein the target area is a part or all of the target interface.
3. The method according to claim 1, wherein before the page display instruction is obtained in a target application installed on the terminal, the method further comprises:
acquiring identification information of the target offline package sent by a server;
and downloading the target offline package identified by the identification information from the server and storing the target offline package on the terminal.
4. The method of claim 1, wherein the target page is a target H5 page, and wherein loading the target offline package in the target application to display the target page in the target application comprises:
detecting an interaction operation in the target H5 page;
and displaying an operation result responding to the interactive operation in the target application.
5. The method of claim 1, wherein loading the target offline package in the target application to display the target page in the target application comprises:
generating a loading address of the target offline package in the target application, wherein the loading address comprises a main page file of the target page and storage addresses of resources and script files referenced by the main page file in the terminal;
and acquiring the main page file and the resources and script files referenced by the main page file from the storage address, and loading the main page file and the resources and script files referenced by the main page file in the target application so as to display the target page in the target application.
6. The method of claim 1, wherein after loading the target offline package in the target application to display the target page in the target application, the method further comprises:
sending first version information of the target offline package to a server, wherein the server is used for comparing the first version information with second version information, and an offline package corresponding to the second version information is an offline package to be updated of the target offline package;
downloading the binary patch of the offline package to be updated from the server under the condition that the first version information is different from the second version information;
and updating the binary patch into the target offline packet.
7. The method of claim 1, wherein prior to obtaining a target offline package corresponding to the target offline package identification, the method further comprises:
acquiring encrypted information of a check information set sent by a server, wherein the check information set comprises a first check value of the target offline packet, and the encrypted information is obtained by encrypting the check information set by using a first encryption key;
decrypting the encrypted information by using a first decryption key corresponding to the first encryption key to obtain the check information set;
determining that the target offline package is tampered under the condition that a second check value of the target offline package stored on the terminal is inconsistent with the first check value;
and under the condition that the second check value is consistent with the first check value, determining that the target offline package is not tampered.
8. The method of claim 1, wherein parsing the destination address of the destination page to determine the destination offline packet identifier comprises:
acquiring a target address of the target page sent by the server;
and under the condition that the target address comprises identification information, extracting the identification information from the target address to determine the target offline packet identification.
9. A page display apparatus, comprising:
the terminal comprises a first acquisition module, a first display module and a second display module, wherein the first acquisition module is used for acquiring a page display instruction in a target application installed on the terminal, and the page display instruction is used for requesting to display a target page;
the first determining module is used for analyzing the target address of the target page and determining a target offline packet identifier;
the second obtaining module is used for obtaining a target offline package corresponding to the target offline package identifier, wherein the target offline package comprises a main page file of the target page and a resource and a script file which are referred by the main page file;
the first loading module is used for loading the target offline package in the target application so as to display the target page in the target application.
10. A storage medium comprising a stored program, wherein the program when executed performs the method of any of claims 1 to 8.
11. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of any of claims 1 to 8 by means of the computer program.
CN201910650245.1A 2019-07-18 2019-07-18 Page display method and device, storage medium and electronic device Pending CN112241298A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910650245.1A CN112241298A (en) 2019-07-18 2019-07-18 Page display method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910650245.1A CN112241298A (en) 2019-07-18 2019-07-18 Page display method and device, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN112241298A true CN112241298A (en) 2021-01-19

Family

ID=74168171

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910650245.1A Pending CN112241298A (en) 2019-07-18 2019-07-18 Page display method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN112241298A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113297453A (en) * 2021-06-17 2021-08-24 北京有竹居网络技术有限公司 Network request response method and device, electronic equipment and storage medium
CN113656739A (en) * 2021-09-03 2021-11-16 中国联合网络通信集团有限公司 Website data storage method and device
CN116070048A (en) * 2023-03-06 2023-05-05 江苏苏宁银行股份有限公司 H5 page display method, device and equipment

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108345632A (en) * 2017-12-29 2018-07-31 中国平安财产保险股份有限公司 Call method, device, equipment and the computer readable storage medium of the H5 pages

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108345632A (en) * 2017-12-29 2018-07-31 中国平安财产保险股份有限公司 Call method, device, equipment and the computer readable storage medium of the H5 pages

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113297453A (en) * 2021-06-17 2021-08-24 北京有竹居网络技术有限公司 Network request response method and device, electronic equipment and storage medium
CN113656739A (en) * 2021-09-03 2021-11-16 中国联合网络通信集团有限公司 Website data storage method and device
CN116070048A (en) * 2023-03-06 2023-05-05 江苏苏宁银行股份有限公司 H5 page display method, device and equipment

Similar Documents

Publication Publication Date Title
CN107729352B (en) Page resource loading method and terminal equipment
CN108052334B (en) Page jump method, device, computer equipment and storage medium
US11569982B2 (en) Blockchain compression using summary and padding blocks
CN109408750A (en) Page display method, device, computer equipment and storage medium
CN106874471B (en) Information pushing method and device
CN107291759B (en) Method and device for processing browser page resources
CN110688598B (en) Service parameter acquisition method and device, computer equipment and storage medium
CN111143869B (en) Application package processing method and device, electronic equipment and storage medium
CN107181779B (en) Method, device and system for processing access request
CN104111944A (en) Page processing method and device and page generating method and device
CN105357323A (en) HTML5 page debugging method and device in APP
CN112241298A (en) Page display method and device, storage medium and electronic device
CN103139761B (en) The method and communication terminal of a kind of information real-time show
US20150373150A1 (en) Server, client, system and method for preloading browsed page in browser
CN110502602B (en) Data storage method, device, equipment and computer storage medium
CN107547524A (en) A kind of page detection method, device and equipment
CN112947981A (en) Application program resource updating method and device, terminal equipment and server
CN112199622A (en) Page jump method, system and storage medium
CN113656713B (en) Network resource processing method, device and system
CN111222075A (en) Data transmission method based on multiple Webviews, server and storage medium
CN102724212B (en) Read-later server realization method, read-later server realization system and read-later read server
CN111552643A (en) Multi-browser webpage access synchronization method and system
CN110851794A (en) Media file uplink method and device, storage medium and electronic device
CN108460116B (en) Search method, search device, computer equipment, storage medium and search system
CN114039801B (en) Short link generation method, short link analysis system, short link analysis equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40037803

Country of ref document: HK

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination