CN115878226A - H5 offline package loading method and device - Google Patents

H5 offline package loading method and device Download PDF

Info

Publication number
CN115878226A
CN115878226A CN202310177643.2A CN202310177643A CN115878226A CN 115878226 A CN115878226 A CN 115878226A CN 202310177643 A CN202310177643 A CN 202310177643A CN 115878226 A CN115878226 A CN 115878226A
Authority
CN
China
Prior art keywords
local
version information
package
offline package
offline
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
CN202310177643.2A
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.)
Beijing Murong Information Technology Co ltd
Original Assignee
Beijing Murong Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Murong Information Technology Co ltd filed Critical Beijing Murong Information Technology Co ltd
Priority to CN202310177643.2A priority Critical patent/CN115878226A/en
Publication of CN115878226A publication Critical patent/CN115878226A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The application provides a method and a device for loading an H5 offline package, wherein the method for loading the H5 offline package is applied to a mobile terminal, and comprises the following steps: the method comprises the steps of obtaining remote version information and local version information, wherein the remote version information is the version information of the latest H5 offline package of a server side, and the local version information is the version information of a local H5 offline package in a mobile terminal; judging whether the remote version information is the same as the local version information; and if the remote version information is the same as the local version information, opening a local H5 from an H5 application in a solenoid through WebView to load an APP page. By the adoption of the method and the device, the step of online loading of the H5 application is omitted, the H5 application is directly opened locally, and the effect of improving the loading speed of the APP page is achieved.

Description

H5 offline package loading method and device
Technical Field
The application relates to the field of APP management, in particular to a method and a device for loading an H5 offline package.
Background
With the rapid development of the APP, because the H5 application can run in the APP at the same time in a cross-platform mode, the same function only needs to develop one set of codes on different platforms, and therefore the development period can be greatly shortened. Meanwhile, the H5 application is also suitable for most of the APPs which are updated and changed quickly, the APPs which are updated frequently can be adapted well, the frequency of examining and releasing the APPs in the application market is reduced, and the smooth and stable running of the APPs in various industries is facilitated.
In the prior art, a hybrid development mode is usually used for developing an APP, where the hybrid development refers to that, in a mobile-end APP, an embedded WebView container browser is used as a container for an H5 application to implement a part of application functions, and another part of functions are implemented by an APP native application, where an existing H5 application and an APP native application exist in the APP developed by the hybrid development mode. After a user starts an APP developed by using a hybrid development mode, the APP can be subjected to page loading, and H5 application needs to be loaded in the page loading process.
For the above technology, because the manner of loading the H5 application is online loading and needs network support, when the network quality is poor, the APP may have a situation that the page loading time is too long, so that the waiting time of the user is too long, resulting in poor experience of the user in using the APP.
Disclosure of Invention
In order to improve the speed of APP page loading, the application provides a method and a device for loading an H5 offline package.
In a first aspect of the present application, a method for loading an H5 offline packet is provided, where the method is applied to a mobile terminal, and the method includes:
the method comprises the steps of obtaining remote version information and local version information, wherein the remote version information is the version information of the latest H5 offline package of a server side, and the local version information is the version information of a local H5 offline package in a mobile terminal;
judging whether the remote version information is the same as the local version information;
and if the remote version information is the same as the local version information, opening a local H5 from an H5 application in a solenoid through WebView to load an APP page.
Through adopting above-mentioned technical scheme, after the user opened the APP, obtain distal end version information and local version information, judge whether distal end version information is the same with local version information, if the same, then the H5 that the server side did not upload the new version leaves the solenoid, open local H5 and leave the H5 application in the solenoid in order to carry out APP page loading, owing to omitted online loading H5 applied step, directly open H5 application locally, so reached the effect that improves APP page loading speed.
Optionally, after determining whether the remote version information is the same as the local version information, the method further includes:
if the remote version information is different from the local version information, downloading the latest H5 offline package of the server to the local to obtain a local latest H5 offline package, and opening an H5 application in the latest H5 offline package through WebView to load an APP page.
By adopting the technical scheme, if the remote version information is different from the local version information, the latest H5 offline package in the server is downloaded to the local, and then the H5 application in the local latest H5 offline package is opened to load the APP page, so that the version of the local offline package is consistent with that of the offline package of the server.
Optionally, the downloading the latest H5 offline package of the server to the local to obtain the latest H5 offline package of the local includes:
sending download request information to the server, and receiving a download address of a compressed H5 offline package sent by the server;
and downloading the latest H5 offline package compressed by the server to the local for decompression according to the download address, and deleting the original local H5 offline package to obtain the decompressed local latest H5 offline package.
By adopting the technical scheme, if the remote version information is different from the local version information, the mobile terminal sends the download request information to the server terminal, downloads the download request information according to the download address of the compressed H5 offline package, decompresses and deletes the original local H5 offline package after the download is completed, so that only one H5 offline package exists locally, and the space resource of the mobile terminal is saved.
Optionally, the opening, by WebView, the H5 application in the local H5 offline package to perform APP page loading includes:
configuring the WebView setting function to obtain an initialized WebView;
loading the H5 application in the local H5 offline package through the initialized WebView to obtain a blank H5 page;
and rendering the blank H5 page through the initialized WebView to obtain an APP page.
By adopting the technical scheme, after the WebView is initialized, the H5 application is loaded through the initialized WebView to obtain a blank H5 page, and then the blank H5 page is rendered through the initialized WebView to obtain the page of the APP, so that the page loading process of the APP is completed.
Optionally, the setting function configuration includes setting to run and load JSBridge, so that the H5 application end interacts with the APP native application end.
By adopting the technical scheme, the process of the WebView setting function configuration comprises the steps of setting and loading JSbridge, enabling the H5 application end to interact with the APP native application end through the JSbridge component, ensuring the safety, and making up the deficiency of the H5 application by using the native function of the APP native application end.
Optionally, after loading the H5 application in the local H5 offline package through the initialized WebView, the method further includes:
judging whether response information sent by the H5 application is received within preset time;
if response information sent by the H5 application is received within preset time, confirming that the H5 application is successfully loaded;
and if the response information sent by the H5 application is not received within the preset time, displaying a loading abnormity prompt.
By adopting the technical scheme, in the process of loading the H5 application, if the H5 application response information is received within the preset time, the H5 application is successfully loaded, and if the H5 application response information is not received within the preset time, the H5 application is unsuccessfully loaded, the loading abnormity prompt is displayed, so that a user carries out related operation according to the loading abnormity prompt.
Optionally, the sending the download request information to the server includes:
acquiring current time, and judging whether the current time is in a preset idle time period or not;
if the current time is within a preset idle time period, acquiring a network state, and judging whether the network state is in a network connection state;
and if the network state is in a network connection state, sending the downloading request information to a server.
By adopting the technical scheme, the time for downloading the latest H5 offline package of the server is controlled in the preset time period, the downloading is carried out when the mobile terminal is in the network connection state, the downloading process is put in the preset time period, and the downloading is not carried out immediately when the page is loaded, so that the user experience is improved.
Optionally, the downloading the latest H5 offline package compressed by the server to the local includes:
judging whether a transmission interruption phenomenon exists in the downloading process of the latest H5 offline package;
if the transmission interruption phenomenon exists in the downloading process of the latest H5 offline package, recording the breakpoint position of the transmission interruption phenomenon;
and generating feedback information according to the breakpoint position, and sending the feedback information to the server to restore the downloading process at the breakpoint position so as to download the latest H5 offline package compressed by the server to the local.
By adopting the technical scheme, if the transmission interruption phenomenon exists in the downloading process of the latest H5 off-line package, the breakpoint position of the transmission interruption phenomenon is recorded, and the mobile terminal sends feedback information to the server terminal, so that the mobile terminal restores the downloading process at the breakpoint position, and the whole H5 off-line package does not need to be downloaded again after the downloading process is interrupted unexpectedly.
Optionally, before acquiring the remote version information and the local version information based on the APP start instruction, the method further includes:
and downloading an installation package corresponding to the APP to local, wherein the installation package comprises an initial H5 offline package.
By adopting the technical scheme, the initial H5 offline package is automatically downloaded to the local through the APP installation process.
In a second aspect of the present application, there is provided an H5 offline packet loading apparatus, the apparatus including:
the system comprises an information acquisition module, a server and a server, wherein the information acquisition module is used for acquiring remote version information and local version information, the remote version information is the version information of the latest H5 offline package of the server, and the local version information is the version information of a local H5 offline package in the mobile terminal;
the version comparison module is used for judging whether the remote version information is the same as the local version information;
and the page loading module is used for opening a local H5 from an H5 application in a solenoid through WebView to load an APP page if the remote version information is the same as the local version information.
In summary, the present application includes at least one of the following beneficial technical effects:
1. by adopting the method and the device, the step of online loading of the H5 application is omitted, the H5 application is directly opened locally, and the effect of improving the loading speed of the APP page is achieved;
2. by adopting the application, the H5 application end and the APP native application end are interacted through the JSP bridge component, the safety can be guaranteed, and the native function of the APP native application end can be used for making up the deficiency of the H5 application.
Drawings
Fig. 1 is a schematic flowchart of an H5 offline package loading method according to an embodiment of the present application;
fig. 2 is a schematic flow chart of another H5 offline package loading method according to an embodiment of the present application;
fig. 3 is a flowchart illustrating downloading of H5 offline packages according to an embodiment of the present invention;
fig. 4 is a schematic block diagram of an H5 offline package loading apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Description of reference numerals: 1. an information acquisition module; 2. a version comparison module; 3. a page loading module; 1000. an electronic device; 1001. a processor; 1002. a communication bus; 1003. a user interface; 1004. a network interface; 1005. a memory.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments.
In the description of the embodiments of the present application, the words "exemplary," "such as," or "for example" are used to indicate examples, illustrations, or illustrations. Any embodiment or design described herein as "exemplary," "e.g.," or "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the words "exemplary," "such as," or "for example" are intended to present relevant concepts in a concrete fashion.
In the description of the embodiments of the present application, the term "and/or" is only one kind of association relationship describing an associated object, and means that three relationships may exist, for example, a and/or B may mean: a exists alone, B exists alone, and A and B exist at the same time. In addition, the term "plurality" means two or more unless otherwise specified. For example, the plurality of systems refers to two or more systems, and the plurality of screen terminals refers to two or more screen terminals. Furthermore, the terms "including," "comprising," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
Referring to fig. 1 and 2, an execution subject of the H5 offline packet loading method is a mobile terminal, and the H5 offline packet loading method specifically includes:
s10: and acquiring remote version information and local version information.
The remote version information is version information of a latest H5 offline package of the server, the local version information is version information of a local H5 offline package in the mobile terminal, the version information specifically can be a version number composed of numbers, letters and points, and the version number can be used for distinguishing the H5 offline packages before and after updating after the H5 offline package is updated.
An H5 offline package of the server is uploaded by an APP developer, and the H5 offline package can be understood as an H5 application and a collection of various static page resources, where the static page resources include hypertext Markup Language (HTML) of a page, javaScript (JS), cascading Style Sheets (CSS), and other resources. And after the developer updates the H5 offline package, uploading the updated H5 offline package to the server, wherein the newly uploaded H5 offline package is the latest H5 offline package.
The initial H5 leaves the solenoid for the H5 that the mobile terminal of the user downloaded for the first time, and it should be noted that, the object downloaded this time is the installation package corresponding to the whole APP, including the native application of H5 off-line package and APP and the relevant resources corresponding to the native application of APP in the installation package, and the download path of the installation package corresponding to the whole APP is specified by the user, that is, the user specifies the location where the installation package is stored.
Specifically, after the user starts the APP of the mobile terminal, the remote version information of the latest H5 offline packet in the server is obtained, and the local version information of the local H5 offline packet of the mobile terminal is obtained.
S20: and judging whether the remote version information is the same as the local version information.
Specifically, after the remote version information and the local version information are obtained, the remote version information is compared with the local version information, and whether the local H5 offline package needs to be updated is determined according to a comparison result.
S21: and if the remote version information is different from the local version information, downloading the latest H5 offline package of the server to the local to obtain the latest H5 offline package of the local.
Specifically, after the remote version information is compared with the local version information, if the comparison result shows that the remote version information is different from the local version information, the latest H5 offline package of the server is downloaded to obtain the local latest H5 offline package of the mobile terminal, and the local latest H5 offline package is kept the same as the server.
For example, the local version information shows that the version number of the H5 off-line package is v1.0, the remote version information shows that the version number of the H5 off-line package is v1.1, and after comparison, the remote version information is different from the local version information, and the H5 off-line package with the version number of the service end being v1.1 needs to be downloaded.
Referring to fig. 3, in the present embodiment, S21 specifically includes S211-S217.
S211: and if the remote version information is different from the local version information, acquiring the current time, and judging whether the current time is in a preset idle time period.
The current time is the time inquired by the mobile terminal after the comparison result that the remote version information is different from the local version information is obtained, and the current time can be obtained by directly obtaining the system time of the mobile terminal or obtaining the network standard time through networking.
The preset idle time period is a time period preset by a user, the user can flexibly select the downloading time of the H5 off-line package according to the function, so that the H5 off-line package does not need to be downloaded during page loading, and the preset idle time period can be specifically set to 1 night to 4 night.
In another embodiment, the downloading time can also be selected according to the use condition of the mobile terminal by the user, the use network condition of the background application of the mobile terminal is inquired, and if the flow of the network used by the background application is lower than a preset value, the downloading is carried out at the time.
S212: and if the current time is within the preset idle time period, acquiring the network state and judging whether the network state is in a network connection state.
Specifically, after judging whether the current time is within the preset idle time period, if the current time is not within the preset idle time period, calculating a difference value between the current time and the start time according to the start time of the idle time period to obtain a waiting time, and acquiring the network state of the mobile terminal when the time after the waiting time is within the preset idle time period.
If the current time is in the preset idle time period, directly acquiring the network state of the mobile terminal, judging whether the network state is in a network connection state, if the network state is not in the network connection state, disconnecting the network, and waiting for the network connection and downloading when the network is in the preset idle time period.
S213: and if the network state is in the network connection state, sending the downloading request information to the server.
Specifically, if the network of the mobile terminal is in a connected state within a preset idle time period, the mobile terminal sends a download request message to the server, where the download request message is a request sent by the mobile terminal to the server to download the latest encoded information of the H5 offline package.
S214: and receiving the download address of the compressed H5 offline package sent by the server.
The download address is a website link of the compressed H5 offline package, and files stored in the cloud of the website can be transmitted to the local through the network through the download address.
Specifically, a download address of the compressed H5 offline package sent by the server is received, and the compressed H5 offline package is downloaded in a website corresponding to the download address.
In this embodiment, the downloading manner of the H5 offline package is to directly download the whole compressed H5 offline package to the local.
In other embodiments, the update method of the H5 offline package (which is consistent with the effect achieved by the download method of this embodiment) may be: and acquiring an update log of the server, wherein the update log comprises a specific update position and update content of an H5 off-line package, searching a corresponding update position in the local H5 off-line package according to the update log of the server, and correspondingly changing corresponding data according to the update content, so that the data structure of the local H5 off-line package of the mobile terminal is consistent with the data structure of the latest H5 off-line package of the server.
S215: and judging whether the transmission interruption phenomenon exists in the downloading process of the latest H5 off-line package, and recording the breakpoint position of the transmission interruption phenomenon if the transmission interruption phenomenon exists in the downloading process of the latest H5 off-line package.
The method for judging whether the transmission interruption phenomenon exists in the downloading process comprises the following steps: the mobile terminal receives a plurality of groups of latest H5 off-line package data sent by the server terminal, if a new group of data is not received within the preset interrupt time, the transmission interrupt phenomenon exists in the downloading process, and if the new group of data is received within the preset interrupt time until the downloading is completed, the transmission interrupt phenomenon does not exist in the downloading process.
The breakpoint position is the position of a group of data which is received last when the transmission interruption occurs in the downloading process.
Specifically, in this embodiment, a download address of a compressed H5 offline package sent by the server is received, and after entering a download process of a latest H5 offline package according to the download address, it is determined whether a transmission interruption phenomenon exists in the download process, if the transmission interruption phenomenon does not exist in the download process, no operation is performed, and if the transmission interruption phenomenon exists in the download process, a breakpoint position of the transmission interruption phenomenon is recorded, that is, a group of data at the breakpoint position is stored in a cache.
In other embodiments, if a transmission interruption phenomenon exists in the downloading process, an update log is obtained, whether the received data includes all changed data is judged, if the received data includes all changed data, the breakpoint position of the transmission interruption phenomenon does not need to be recorded, data corresponding to the remaining data of the server side in the original data of the local H5 offline package is extracted, and the extracted data and the received data are synthesized to obtain the local H5 offline package with the same data architecture as the latest H5 offline package of the server side. If the received data does not include all the changed data, recording the breakpoint position of the transmission interruption phenomenon
S216: and generating feedback information according to the breakpoint position, and sending the feedback information to the server to restore the downloading process at the breakpoint position.
Specifically, the feedback information includes a set of data at the breakpoint position, and the mobile terminal sends the feedback information to the server terminal after generating the feedback information, so that the server terminal continues to send the data after the breakpoint position to the mobile terminal according to the feedback information, and the mobile terminal can resume the downloading process at the breakpoint position after the transmission is interrupted. After all data are downloaded, synthesizing the downloaded multiple groups of data according to the data architecture of the server side H5 off-line package to obtain a local H5 off-line package which is the same as the data architecture of the latest H5 off-line package of the server side, and storing the compressed local H5 off-line package into a local resource path preset by a user.
S217: and deleting the original local H5 offline package to obtain the decompressed local latest H5 offline package.
Specifically, after the local H5 offline package with the same data structure as that of the server-side latest H5 offline package is obtained, the compressed local H5 offline package is decompressed without reserving the compressed local H5 offline package file, and the original local H5 offline package is deleted, so that the decompressed local latest H5 offline package is obtained.
S22: and if the remote version information is the same as the local version information, configuring the WebView setting function to obtain the initialized WebView.
WebView (webpage view) is an embedded browser, the result of a network request can be displayed in WebView, the WebView setting function configuration is that WebView is initialized, and the setting function configuration comprises the steps of setting and loading JSbridge, setting font scaling, setting a cache path, setting a scaling strategy, setting a scrolling strategy and the like. Setting the functional configuration is implemented by setting corresponding code, for example, setting the operating load JSBridge to: setjavascriptenabled (true).
JSbridge is a Webview container as a medium, communication is carried out through a protocol, a mechanism of bidirectional communication between the APP native application end and the H5 application end is realized, the H5 application end can call a Java interface of the APP native application end, and the APP native application end can also call a JavaScript interface of the H5 application end through the JSbridge. The JSbridge function package is customized Webview, after the Webview is initialized, when data interaction or mutual calling is needed between the H5 application end and the APP native application end in part of service scenes, the JSbridge can be used for realizing interaction, namely, work which cannot be finished by the H5 application, such as two-dimensional code scanning, user information acquisition and the like, is carried out by moving to the APP native application end to process through native functions. For the call between APP and H5, the passing parameters and the return result between each other need to be agreed in advance.
Specifically, after the remote version information is compared with the local version information, if the comparison result is that the remote version information is the same as the local version information, an initialization instruction is issued to the WebView, the WebView is configured with the function configuration, and the initialized WebView is obtained.
S30: and loading the H5 application in the local H5 offline package through the initialized WebView to obtain a blank H5 page.
After initialization of the WebView is completed, loading an H5 application in an H5 off-line package in a local resource path through the initialized WebView, judging whether response information sent by the H5 application is received within preset time, if the response information sent by the H5 application is not received within the preset time, displaying a loading exception prompt on a display of a mobile terminal, and if the response information sent by the H5 application is received within the preset time, successfully loading the H5 application to obtain a blank H5 page (namely an HTML document in the H5 off-line package).
S40: and rendering a blank H5 page through the initialized WebView to obtain a page of the APP.
Specifically, after loading the blank H5 page, rendering the blank H5 page through the initialized WebView, combining and analyzing static page resources in the H5 off-line package to obtain the page of the APP, namely, the page of the APP is successfully loaded.
The implementation principle of the H5 offline package loading method in the embodiment of the application is as follows: the method comprises the steps of obtaining remote version information and local version information, judging whether the remote version information is the same as the local version information or not, if the remote version information is the same as the local version information, opening a local H5 application in a local H5 off-line package through WebView to load an APP page, if the remote version information is different from the local version information, downloading a latest H5 off-line package of a server to the local to obtain a latest local H5 off-line package, and opening the H5 application in the latest H5 off-line package through WebView to load the APP page. By the adoption of the method and the device, the step of online loading of the H5 application is omitted, the H5 application is directly opened locally, and the effect of improving the loading speed of the APP page is achieved.
Referring to fig. 4, an H5 offline package loading apparatus includes: the system comprises an information acquisition module 1, a version comparison module 2 and a page loading module 3.
The information acquisition module 1 is used for acquiring remote version information and local version information, wherein the remote version information is the version information of the latest H5 offline package of the server side, and the local version information is the version information of the local H5 offline package in the mobile side;
the version comparison module 2 is used for judging whether the remote version information is the same as the local version information;
and the page loading module 3 is used for opening a local H5 application in the H5 departure solenoid through WebView to load the APP page if the remote version information is the same as the local version information.
It should be noted that: in the above embodiment, when the device implements the functions thereof, only the division of the functional modules is illustrated, and in practical applications, the functions may be distributed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to implement all or part of the functions described above. In addition, the apparatus and method embodiments provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments for details, which are not described herein again.
Please refer to fig. 5, which is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. As shown in fig. 5, the electronic device 1000 may include: at least one processor 1001, at least one network interface 1004, a user interface 1003, memory 1005, at least one communication bus 1002.
Wherein a communication bus 1002 is used to enable connective communication between these components.
The user interface 1003 may include a Display screen (Display) and a Camera (Camera), and the optional user interface 1003 may also include a standard wired interface and a wireless interface.
The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), among others.
Processor 1001 may include one or more processing cores, among other things. The processor 1001 connects various parts within the entire server using various interfaces and lines, and performs various functions of the server and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 1005 and calling data stored in the memory 1005. Alternatively, the processor 1001 may be implemented in at least one hardware form of Digital Signal Processing (DSP), field-Programmable gate Array (FPGA), and Programmable Logic Array (PLA). The processor 1001 may integrate one or a combination of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing the content required to be displayed by the display screen; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 1001, but may be implemented by a single chip.
The Memory 1005 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). Optionally, the memory 1005 includes a non-transitory computer-readable medium. The memory 1005 may be used to store an instruction, a program, code, a set of codes, or a set of instructions. The memory 1005 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the various method embodiments described above, and the like; the storage data area may store the data and the like referred to above in the respective method embodiments. The memory 1005 may alternatively be at least one memory device located remotely from the processor 1001. As shown in fig. 5, the memory 1005, which is a computer storage medium, may include therein an operating system, a network communication module, a user interface module, and an application program of an H5 offline package loading method.
In the electronic device 1000 shown in fig. 5, the user interface 1003 is mainly used as an interface for providing input for a user, and acquiring data input by the user; and the processor 1001 may be configured to invoke an application program in the memory 1005 that stores an H5 offline package loading method, which when executed by the one or more processors, causes the electronic device to perform the method as described in one or more of the above embodiments.
An electronic device readable storage medium having instructions stored thereon. When executed by one or more processors, cause an electronic device to perform a method as described in one or more of the above embodiments.
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 application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. 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 for this application.
In the foregoing embodiments, 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 apparatus may be implemented in other ways. For example, 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 implementing, 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 implemented. In addition, the shown or discussed coupling or direct coupling or communication connection between each other may be through some service interfaces, indirect coupling or communication connection of devices or units, and may be electrical or in other forms.
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 application 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 unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable memory. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be embodied in the form of a software product stored in a memory, and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned memory comprises: various media capable of storing program codes, such as a U disk, a removable hard disk, a magnetic disk, or an optical disk.
The above description is only an exemplary embodiment of the present disclosure, and the scope of the present disclosure should not be limited thereby. That is, all equivalent changes and modifications made in accordance with the teachings of the present disclosure are intended to be included within the scope of the present disclosure. Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (10)

1. An H5 offline packet loading method is applied to a mobile terminal, and is characterized by comprising the following steps:
the method comprises the steps of obtaining remote version information and local version information, wherein the remote version information is the version information of the latest H5 offline package of a server side, and the local version information is the version information of a local H5 offline package in a mobile terminal;
judging whether the remote version information is the same as the local version information;
and if the remote version information is the same as the local version information, opening a local H5 application in an H5 off-line package through WebView to load an APP page.
2. The method of claim 1, wherein after determining whether the remote version information is the same as the local version information, the method further comprises:
if the remote version information is different from the local version information, downloading the latest H5 offline package of the server to the local to obtain a local latest H5 offline package, and opening an H5 application in the latest H5 offline package through WebView to load an APP page.
3. The H5 offline package loading method according to claim 2, wherein the downloading the latest H5 offline package of the server to the local to obtain the latest H5 offline package of the local comprises:
sending download request information to the server, and receiving a download address of a compressed H5 offline package sent by the server;
and downloading the latest H5 offline package compressed by the server to the local for decompression according to the download address, and deleting the original local H5 offline package to obtain the decompressed local latest H5 offline package.
4. The method for loading the H5 offline package according to claim 1, wherein the opening of the H5 application in the local H5 offline package through WebView for APP page loading comprises:
configuring the WebView setting function to obtain an initialized WebView;
loading the H5 application in the local H5 offline package through the initialized WebView to obtain a blank H5 page;
and rendering the blank H5 page through the initialized WebView to obtain an APP page.
5. The H5 offline package loading method according to claim 4, wherein the setting of the function configuration comprises setting of running and loading JSbridge so that the H5 application terminal interacts with the APP native application terminal.
6. The method for loading the H5 offline package according to claim 4, wherein after loading the H5 application in the local H5 offline package through the initialized WebView, the method further comprises:
judging whether response information sent by the H5 application is received within preset time;
if response information sent by the H5 application is received within preset time, confirming that the H5 application is successfully loaded;
and if the response information sent by the H5 application is not received within the preset time, displaying a loading abnormity prompt.
7. The H5 offline package loading method according to claim 3, wherein the sending of the download request message to the server includes:
acquiring current time, and judging whether the current time is in a preset idle time period or not;
if the current time is within a preset idle time period, acquiring a network state, and judging whether the network state is in a network connection state;
and if the network state is in a network connection state, sending the downloading request information to a server.
8. The H5 offline package loading method according to claim 3, wherein the downloading the latest H5 offline package compressed by the server to the local comprises:
judging whether a transmission interruption phenomenon exists in the downloading process of the latest H5 offline package;
if the transmission interruption phenomenon exists in the downloading process of the latest H5 offline package, recording the breakpoint position of the transmission interruption phenomenon;
and generating feedback information according to the breakpoint position, and sending the feedback information to the server to restore the downloading process at the breakpoint position so as to download the latest H5 offline package compressed by the server to the local.
9. The method of claim 1, wherein before the obtaining the remote version information and the local version information, the method further comprises:
and downloading an installation package corresponding to the APP to the local, wherein the installation package comprises an initial H5 offline package.
10. An H5 offline package loading device, characterized in that the device comprises:
the system comprises an information acquisition module (1) and a server, wherein the information acquisition module is used for acquiring remote version information and local version information, the remote version information is the version information of the latest H5 offline packet of the server, and the local version information is the local version information in the mobile terminal;
the version comparison module (2) is used for judging whether the remote version information is the same as the local version information;
and the page loading module (3) is used for opening a local H5 application in an H5 off-line package through WebView to load an APP page if the remote version information is the same as the local version information.
CN202310177643.2A 2023-02-28 2023-02-28 H5 offline package loading method and device Pending CN115878226A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310177643.2A CN115878226A (en) 2023-02-28 2023-02-28 H5 offline package loading method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310177643.2A CN115878226A (en) 2023-02-28 2023-02-28 H5 offline package loading method and device

Publications (1)

Publication Number Publication Date
CN115878226A true CN115878226A (en) 2023-03-31

Family

ID=85761692

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310177643.2A Pending CN115878226A (en) 2023-02-28 2023-02-28 H5 offline package loading method and device

Country Status (1)

Country Link
CN (1) CN115878226A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117493716A (en) * 2023-11-08 2024-02-02 中建八局第一数字科技有限公司 Display updating method and device of mobile terminal Web App, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103023941A (en) * 2011-09-26 2013-04-03 腾讯科技(深圳)有限公司 Terminal application program updating method and system based on Web page
CN113867769A (en) * 2021-10-20 2021-12-31 京东城市(北京)数字科技有限公司 H5 page display method and device, storage medium and electronic equipment
CN115080147A (en) * 2022-06-28 2022-09-20 中国平安财产保险股份有限公司 H5 page loading method, device, equipment and medium based on artificial intelligence
CN115174541A (en) * 2022-06-22 2022-10-11 平安普惠企业管理有限公司 H5 resource loading method and device, electronic equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103023941A (en) * 2011-09-26 2013-04-03 腾讯科技(深圳)有限公司 Terminal application program updating method and system based on Web page
CN113867769A (en) * 2021-10-20 2021-12-31 京东城市(北京)数字科技有限公司 H5 page display method and device, storage medium and electronic equipment
CN115174541A (en) * 2022-06-22 2022-10-11 平安普惠企业管理有限公司 H5 resource loading method and device, electronic equipment and storage medium
CN115080147A (en) * 2022-06-28 2022-09-20 中国平安财产保险股份有限公司 H5 page loading method, device, equipment and medium based on artificial intelligence

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117493716A (en) * 2023-11-08 2024-02-02 中建八局第一数字科技有限公司 Display updating method and device of mobile terminal Web App, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN108733738B (en) Page loading method, system, server and terminal
EP3465467B1 (en) Web page accelerations for web application hosted in native mobile application
CN106445583B (en) Page display method, equipment and system
KR102115057B1 (en) Graphic rendering
CN107305553B (en) Method and system for dynamically jumping Hybrid page based on Hybrid App
US10360694B2 (en) Methods and devices for image loading and methods and devices for video playback
CN106874519B (en) Page display method and device
CN109725923A (en) A kind of software light weight update method, device and equipment
CN110764805B (en) Client non-inductive upgrading method, device, terminal and storage medium
CN112256296A (en) Express delivery service APP updating method, device, equipment and storage medium based on Weex
CN111294395A (en) Terminal page transmission method, device, medium and electronic equipment
CN115878226A (en) H5 offline package loading method and device
CN113761412A (en) Application page display method and device, electronic equipment, medium and application system
CN106649581B (en) Webpage repairing method and client
CN113779458A (en) Method and device for accelerating application loading, electronic equipment and storage medium
CN112287261A (en) Resource loading method and electronic equipment
CN109885318B (en) Method and device for updating desktop icon of web application
CN114610446B (en) Method, device and system for automatically injecting probe
CN111338928A (en) Chrome-based browser testing method and device
CN115391582A (en) Card processing method, electronic device and system
CN111538553B (en) Dual-core Web desktop application access processing method and device and storage medium
CN114510667A (en) Page caching method, page display method and device and storage medium
CN112214712A (en) Automatic browser switching method and device, storage medium and electronic equipment
CN103838839B (en) A kind of the page-downloading control method and system of IE kernel browser
CN111163138B (en) Method, device and server for reducing network load during game

Legal Events

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

Application publication date: 20230331