CN-122019020-A - Webpage offline package loading control method and device and electronic equipment
Abstract
The embodiment of the specification discloses a method and a device for controlling loading of a webpage offline package and electronic equipment. The method comprises the steps of determining a first application to be loaded and controlled in an authorized terminal, downloading a webpage offline package corresponding to each first webpage of the first application from a web packaging platform, and transmitting a webpage resource file in the first webpage offline package corresponding to a second webpage to a webpage assembly of the first application when a webpage loading instruction aiming at the second webpage is detected. According to the embodiment of the specification, the offline package of the webpage is not bound with the application package while the offline loading page is ensured, the webpage can be updated at any time according to the needs, and the volume of the application package when the user installs the application software is reduced.
Inventors
- Lei Lifu
- WANG GUOLIN
- XU ZHANGMING
- REN FUJIA
Assignees
- 杭州老板电器股份有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20241112
Claims (10)
- 1. A method for controlling loading of an offline package of a web page, the method comprising: Determining a first application to be loaded and controlled in an authorized terminal, and downloading a webpage offline package corresponding to each first page of the first application from a web packaging platform, wherein the first page is a page with offline package configuration enabled; When a webpage loading instruction aiming at a second webpage is detected, transmitting a webpage resource file in a first webpage offline package corresponding to the second webpage to a webpage component of the first application, wherein the second webpage is a first webpage to be loaded currently.
- 2. The method of claim 1, wherein after detecting the web page load instruction for the second page, further comprising: And checking the update information of the first webpage offline package at the web packaging platform, and downloading the latest first webpage offline package when the update exists in the first webpage offline package.
- 3. The method according to claim 1, wherein the method further comprises: Determining a third page and a second application corresponding to the third page, wherein the third page is a first page marked with real-time requirements; and when the second application is started, checking updating information of a second webpage offline package corresponding to the third page on the web packaging platform, and downloading the latest second webpage offline package when the second webpage offline package is updated.
- 4. The method according to claim 1, wherein the method further comprises: Configuring online access links corresponding to each page of the first application from a web packaging platform; And when a webpage loading instruction aiming at the fourth webpage is detected, sending the online access link to a webpage component of the first application, wherein the fourth webpage is a webpage with offline package configuration not enabled.
- 5. The method according to claim 4, wherein the method further comprises: when a web page load instruction for the second page is detected and a first web page offline package does not exist, the online access link is sent to a page component of the first application.
- 6. The method of claim 5, wherein the sending the online access link to the page component of the first application when a web page load instruction for the second page is detected and there is no first web page offline package comprises: when a webpage loading instruction aiming at the second page is detected and a first webpage offline package does not exist, determining forced refreshing permission of the second page; When the second page has the forced refreshing right, transmitting the downloaded page resource file in the first webpage offline package to the page component of the first application; And when the second page does not have the forced refreshing right, sending the online access link to a page component of the first application.
- 7. The method according to claim 1, wherein the method further comprises: For any downloaded webpage offline package, clearing a temporary folder corresponding to a first webpage, decompressing the webpage offline package to the temporary folder, and inquiring a current loading folder for use in next loading; when the current loading folder exists, renaming the temporary folder into an updated folder, deleting the current loading folder when the page is loaded next time, and renaming the updated folder into the current loading folder; And when the current loading folder does not exist, renaming the temporary folder as the current loading folder.
- 8. A device for controlling loading of an offline package of web pages, said device comprising: The first determining module is used for determining a first application to be loaded and controlled in the authorized terminal, downloading a webpage offline package corresponding to each first page of the first application from the web packaging platform, wherein the first page is a page with offline package configuration enabled; The transmission module is used for transmitting the page resource file in the first webpage offline package corresponding to the second webpage to the page component of the first application when the webpage loading instruction aiming at the second webpage is detected, wherein the second webpage is the first webpage needing to be loaded currently.
- 9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1-7 when the computer program is executed.
- 10. A computer readable storage medium having stored thereon a computer program having instructions stored therein, which when run on a computer or processor, cause the computer or processor to perform the steps of the method according to any of claims 1-7.
Description
Webpage offline package loading control method and device and electronic equipment Technical Field One or more embodiments of the present disclosure relate to web page loading technology, and in particular, to a method and apparatus for controlling loading of an offline package of a web page, and an electronic device. Background In each application software, the use scenes (such as equipment control, activity introduction and the like) of the webpages such as HTML4, HTML5 and the like are more and more, and the loading speed of the webpages becomes a pain spot which afflicts users. At present, the loading speed is generally improved in a webpage offline package mode, and the existing webpage offline package scheme is to package the offline package in an application program package of application software, and load the offline package according to requirements in the use process. However, since the offline package of the web page is packaged in the application package, the content of the offline package is fixed, the update is not timely, and the volume of the application package is seriously affected when the content of the offline package is more or the number of the offline packages is more. Disclosure of Invention In order to solve the above problems, one or more embodiments of the present disclosure describe a method, an apparatus, and an electronic device for controlling loading of an offline package of a web page. According to a first aspect, there is provided a method for controlling loading of an offline package of a web page, the method comprising: Determining a first application to be loaded and controlled in an authorized terminal, and downloading a webpage offline package corresponding to each first page of the first application from a web packaging platform, wherein the first page is a page with offline package configuration enabled; When a webpage loading instruction aiming at a second webpage is detected, transmitting a webpage resource file in a first webpage offline package corresponding to the second webpage to a webpage component of the first application, wherein the second webpage is a first webpage to be loaded currently. Preferably, after detecting the web page load instruction for the second page, the method further includes: And checking the update information of the first webpage offline package at the web packaging platform, and downloading the latest first webpage offline package when the update exists in the first webpage offline package. Preferably, the method further comprises: Determining a third page and a second application corresponding to the third page, wherein the third page is a first page marked with real-time requirements; and when the second application is started, checking updating information of a second webpage offline package corresponding to the third page on the web packaging platform, and downloading the latest second webpage offline package when the second webpage offline package is updated. Preferably, the method further comprises: Configuring online access links corresponding to each page of the first application from a web packaging platform; And when a webpage loading instruction aiming at the fourth webpage is detected, sending the online access link to a webpage component of the first application, wherein the fourth webpage is a webpage with offline package configuration not enabled. Preferably, the method further comprises: when a web page load instruction for the second page is detected and a first web page offline package does not exist, the online access link is sent to a page component of the first application. Preferably, the sending the online access link to the page component of the first application when the web page loading instruction for the second page is detected and the first web page offline package does not exist includes: when a webpage loading instruction aiming at the second page is detected and a first webpage offline package does not exist, determining forced refreshing permission of the second page; When the second page has the forced refreshing right, transmitting the downloaded page resource file in the first webpage offline package to the page component of the first application; And when the second page does not have the forced refreshing right, sending the online access link to a page component of the first application. Preferably, the method further comprises: For any downloaded webpage offline package, clearing a temporary folder corresponding to a first webpage, decompressing the webpage offline package to the temporary folder, and inquiring a current loading folder for use in next loading; when the current loading folder exists, renaming the temporary folder into an updated folder, deleting the current loading folder when the page is loaded next time, and renaming the updated folder into the current loading folder; And when the current loading folder does not exist, renaming the temporary folder as the current loading fold