CN113282354B - H5 page loading method, device and equipment of application program and storage medium - Google Patents

H5 page loading method, device and equipment of application program and storage medium Download PDF

Info

Publication number
CN113282354B
CN113282354B CN202110722083.5A CN202110722083A CN113282354B CN 113282354 B CN113282354 B CN 113282354B CN 202110722083 A CN202110722083 A CN 202110722083A CN 113282354 B CN113282354 B CN 113282354B
Authority
CN
China
Prior art keywords
data
application program
project
page
item
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110722083.5A
Other languages
Chinese (zh)
Other versions
CN113282354A (en
Inventor
陶超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China 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 Ping An Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN202110722083.5A priority Critical patent/CN113282354B/en
Publication of CN113282354A publication Critical patent/CN113282354A/en
Application granted granted Critical
Publication of CN113282354B publication Critical patent/CN113282354B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application relates to the technical field of data processing, and provides a method, a device, equipment and a storage medium for loading an H5 page of an application program, wherein the method comprises the following steps: responding to a login request of a user, and when the user accesses an application program historically according to user information in the login request, accessing an H5 page with the first N-bit access times to obtain an H5 page to be loaded; acquiring a project required to be pulled of an H5 page to be loaded, and determining a JSON file corresponding to the project according to the project; comparing the data of the JSON file with local data stored locally by the application program, and judging whether the project has no local data in the application program or whether the version number of the project is changed according to the comparison result; and if the project has no local data or the version number of the project is changed in the application program, downloading the data of the project, and loading the H5 page to be loaded by using the downloaded data. The application improves the loading speed of the H5 page.

Description

H5 page loading method, device, equipment and storage medium of application program
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a method, an apparatus, a device, and a storage medium for loading an H5 page of an application.
Background
With the development of the mobile internet, the mobile application has become the largest traffic channel of the mobile internet, and in the application, the H5 page has the advantages of flexible release, fast version iteration and the like, so that loading the H5 page is a general way in the industry, for example, the development of the mobile application usually adopts an H5 bearer service, a Native bearer basic component service (for example, the H5 page provides a network request component, the H5 page displays data and the like).
However, compared with the native page, since the rendering is completed only after all H5 resources are downloaded each time the application program is logged in and accessed, the speed of loading the H5 page is slower than that of the native page, and the efficiency is lower.
Disclosure of Invention
The application mainly aims to provide a method, a device, equipment and a storage medium for loading an H5 page of an application program, so as to improve the loading speed of the H5 page.
In order to achieve the above object, the present application provides an H5 page loading method for an application program, which includes the following steps:
responding to a login request of a user for logging in an application program, and determining that when the user historically accesses the application program according to user information in the login request, accessing the H5 page with the first N-bit access times to obtain an H5 page to be loaded; wherein N is a positive integer;
acquiring a project required to be pulled of the H5 page to be loaded, and determining a JSON file corresponding to the project according to the project; each JSON file corresponds to an item and is used for recording the storage state or version number updating state of the item in an application program;
comparing the data of the JSON file with local data locally stored by an application program, and judging whether the project has no local data in the application program or whether the version number of the project is changed according to a comparison result;
and if the project has no local data in the application program or the version number of the project changes, acquiring a link of a target static resource file of the JSON file, downloading the data of the project according to the link, and loading the H5 page to be loaded by using the downloaded data when the situation that the user successfully logs in the application program is monitored.
Further, before the step of determining the JSON file corresponding to the project according to the project, the method further includes:
acquiring a plurality of static resource files and links of the static resource files, on which the H5 page to be loaded depends, and filtering the plurality of static resource files according to file names, categories and sizes to obtain a target static resource file;
and writing the link of the target static resource file into the JSON file.
Preferably, the step of downloading the data of the item according to the link includes:
acquiring the running state of the application program at preset time intervals;
judging whether the running state is in a busy state or not;
and if so, suspending downloading the data of the project according to the link until the running state is in an idle state, resuming downloading the data of the project according to the link, and storing the downloaded data of the project to a local database.
Further, after the step of saving the data of the downloaded project to the local database, the method further includes:
responding to a click instruction of a user on a target item of the H5 page to be loaded, and acquiring target data of the target item clicked by the user from the local database;
and loading the target item of the H5 page to be loaded by using the target data, and displaying.
Preferably, when it is determined that there are a plurality of items of data to be downloaded, the step of downloading the data of the items according to the link includes:
sorting the items of the data to be downloaded according to the levels preset for the items;
and sequentially downloading the data of each project according to the sequencing result.
Further, before the step of sorting the items of the data to be downloaded according to the levels preset for the items, the method further includes:
acquiring the browsing amount of each item in historical browsing;
determining the grade of each item according to the browsing amount; wherein the level of each item is positively correlated with the browsing volume.
Further, before the step of obtaining the link of the target static resource file of the JSON file and downloading the data of the project according to the link, the method further includes:
acquiring the login duration of the application program;
judging whether the login time length exceeds a preset time length or not;
and when the login duration is determined to exceed the preset duration, executing the link for obtaining the target static resource file of the JSON file, and downloading the data of the project according to the link.
The present application further provides an H5 page loading apparatus for an application, which includes:
the response module is used for responding to a login request of a user for logging in an application program, and when the user accesses the application program historically, accessing the H5 pages with the first N-bit access times according to user information in the login request to obtain the H5 pages to be loaded; wherein N is a positive integer;
the determining module is used for acquiring the items required to be pulled of the H5 page to be loaded and determining the JSON files corresponding to the items according to the items; each JSON file corresponds to an item and is used for recording the storage state or version number updating state of the item in an application program;
the comparison module is used for comparing the data of the JSON file with local data locally stored by an application program and judging whether the project has no local data in the application program or whether the version number of the project changes according to a comparison result;
and the loading module is used for acquiring a link of a target static resource file of the JSON file when the project is determined to have no local data in an application program or the version number of the project is changed, downloading the data of the project according to the link, and loading the H5 page to be loaded by using the downloaded data when the situation that the user successfully logs in the application program is monitored.
The present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above methods when executing the computer program.
The present application also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of any of the methods described above.
According to the H5 page loading method, device, equipment and storage medium of the application program, firstly, a login request of a user for logging in the application program is responded, and when the user accesses the application program historically, the H5 page with the first N-bit access times is determined according to user information in the login request, so that the H5 page to be loaded is obtained; acquiring a project required to be pulled of an H5 page to be loaded, and determining a JSON file corresponding to the project according to the project; each JSON file corresponds to an item and is used for recording the storage state or version number updating state of the item in an application program; comparing the data of the JSON file with local data stored locally in an application program, and judging whether the project has no local data or whether the version number of the project is changed in the application program according to the comparison result; if the project has no local data in the application program or the version number of the project changes, acquiring a link of a target static resource file of the JSON file, downloading the data of the project according to the link, and when the user successfully logs in the application program is monitored, loading the H5 page to be loaded by using the downloaded data, so that before the user accesses an important page in the application program, whether the data is downloaded or not is determined by comparing the data of the JSON file with the local data, the data to be downloaded is downloaded in advance, the data to be loaded of the important page is downloaded in advance, after the user successfully logs in the application program, the cached data can be directly used to access the important page, and the loading speed of the H5 page is greatly improved.
Drawings
Fig. 1 is a schematic flowchart of an H5 page loading method of an application according to an embodiment of the present application;
fig. 2 is a schematic block diagram illustrating a structure of an H5 page loading apparatus of an application according to an embodiment of the present application;
fig. 3 is a schematic block diagram of a structure of a computer device according to an embodiment of the present application.
The implementation, functional features and advantages of the objectives of the present application will be further explained with reference to the accompanying drawings.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
Referring to fig. 1, the present application provides an H5 page loading method for an application program, which is used to improve the loading efficiency of an H5 page of the application program, in which in an embodiment, the H5 page loading method for the application program includes the following steps:
s11, responding to a login request of a user for logging in an application program, and when the user accesses the application program historically according to user information in the login request, accessing the first N-bit H5 pages to obtain H5 pages to be loaded; wherein N is a positive integer;
s12, acquiring a project required to be pulled of the H5 page to be loaded, and determining a JSON file corresponding to the project according to the project; each JSON file corresponds to an item and is used for recording the storage state or version number updating state of the item in an application program;
s13, comparing the data of the JSON file with local data stored locally in an application program, and judging whether the project has no local data in the application program or whether the version number of the project changes according to a comparison result;
and S14, if no local data exists in the application program of the project or the version number of the project changes, acquiring a link of a target static resource file of the JSON file, downloading the data of the project according to the link, and loading the H5 page to be loaded by using the downloaded data when the situation that the user successfully logs in the application program is monitored.
As described in step S11, when the user logs in the application, the client extracts the user information in the login request in response to the login request of the application, and determines that the user has historically accessed the application according to the user information in the login request, and the page with the top row of access times, that is, the important page for the user, is the page to be loaded in the top row, which is the H5 page. For example, the number of times of access to each page by the user in the process of accessing the application program may be extracted from the local database, all pages of the current application program are sorted according to the number of times of access, and the pages ranked in the top ten are used as pages to be loaded.
Of course, the H5 page to be loaded may also be an H5 page specified by the user, for example, a data table may be constructed for each application program, information such as a website and a title of the H5 page selected by the user in each application program is recorded in advance through the data table, and when the user needs to log in the application program, the H5 page selected by the user in the data table is extracted as the H5 page to be loaded. The item is content loaded to a page, and may include a picture, a text, a video, and the like, and the client may be a terminal such as a mobile phone, a tablet, a computer device, and the like.
As described in step S12 above, JSON (JavaScript Object notification) is a lightweight data exchange format, which is convenient for reading and writing, and is also convenient for machine parsing and generation. It is based on a subset of JavaScript Programming Language, standard ECMA-262 3rd Edition-Decumber 1999. JSON takes a text format that is completely language independent, but also uses conventions similar to the C language family (including C, C + +, C #, java, javaScript, perl, python, etc.). These properties make JSON an ideal data exchange language.
The JSON file of the present embodiment is stored in the local database, and is used to manage the storage state or version number update state of each item described in the page in the application program, for example, whether each item does not store data in the local database or the version number of each item is determined to be the latest version. In addition, the JSON file and the items are in a one-to-one relationship, one JSON file stores the storage state or version number update state of one item, and each item can be managed by deletion, modification, update and the like.
As described in step S13 above, in this step, local data locally stored by the application program is extracted, the data of the JSON file is compared with the local data locally stored by the application program, and it is determined whether there is no local data in the application program for the project or whether the version number of the project changes according to the comparison result, and if the project contains local data in the application program and the version number of the project does not change, the data of the project does not need to be downloaded from the server again, and the data of the project is extracted directly by using the local data locally stored by the application program for loading the page.
As described in step S14 above, when it is determined that the item has no local data in the application program or the version number of the item is changed, a data obtaining request is initiated to the server, so that the server extracts the data of the item from the database based on the data obtaining request and the link of the target static resource file prestored in the JSON file, and caches the extracted data of the item to the local database of the client, that is, the data of the item needs to be downloaded again. After the data is downloaded, the data can be stored in a Prefetch mode, wherein the Prefetch is a Prefetch folder and is used for storing the Prefetch information of the files accessed by the system. In addition, after the data downloading of the project is finished, the data downloading can be not executed, when the situation that the user successfully logs in the application program and selects the project needing to be loaded is monitored, the data loading of the project is executed, after the data downloading is successful, the data state can be set to be downloaded, when the user needs to browse the project, the project of the page to be loaded is rendered by the downloaded data, and the rendered page to be loaded is displayed.
The application program H5 page loading method includes the steps that firstly, a login request of a user for logging in an application program is responded, when the user historically accesses the application program, the H5 page with the first N-bit access times is determined according to user information in the login request, and the H5 page to be loaded is obtained; acquiring a project required to be pulled of an H5 page to be loaded, and determining a JSON file corresponding to the project according to the project; each JSON file corresponds to an item and is used for recording the storage state or version number updating state of the item in an application program; comparing the data of the JSON file with local data stored locally in an application program, and judging whether the project has no local data or whether the version number of the project is changed in the application program according to the comparison result; if the project has no local data in the application program or the version number of the project changes, acquiring a link of a target static resource file of the JSON file, downloading data of the project according to the link, and when it is monitored that the user successfully logs in the application program, loading an H5 page to be loaded by using the downloaded data, so that before the user accesses an important page in the application program, whether the data is downloaded or not is determined by comparing the data of the JSON file with the local data, the data to be downloaded is downloaded in advance, the data to be loaded of the important page is downloaded in advance, and after the user successfully logs in the application program, the cached data can be directly used to access the important page, thereby greatly improving the loading speed of the H5 page.
In an embodiment, in step S11, before the step of determining, according to the item, a JSON file corresponding to the item, the method may further include:
acquiring a plurality of static resource files and links of the static resource files, on which the H5 page to be loaded depends, and filtering the plurality of static resource files according to file names, categories and sizes to obtain a target static resource file;
and writing the link of the target static resource file into the JSON file.
In the embodiment, when a JSON file is constructed in advance, different types of projects are packaged in advance, an H5 page to be loaded, which is generated after the packaging, is analyzed, then a plurality of static resource files on which the page depends and links of the static resource files are obtained, the static resource files are filtered according to file names, categories and sizes, a target static resource file is obtained, and if the static resource files of which the file names do not meet naming requirements are removed or the static resource files of which the file sizes exceed the preset file sizes are removed, the remaining static resource files are used as the target static resource file; and finally, writing the link of the target static resource file into the JSON file so as to acquire the data of the project by using the link of the target static resource file prestored in the JSON file when the data of the project is downloaded. The static resource file is a front-end fixed page and comprises HTML, CSS, JS, pictures and the like, a database does not need to be searched, program processing is not needed, the page can be displayed directly, and the access efficiency is high.
Different projects of the embodiment are simple to access, and only one packaged and identified file needs to be introduced to modify a page path to be downloaded, so that a new JSON file can be automatically generated during packaging.
In an embodiment, before the step of obtaining the link of the target static resource file of the JSON file and downloading the data of the project according to the link, the method further includes:
acquiring the login duration of the application program;
judging whether the login time length exceeds a preset time length or not;
and when the login duration is determined to exceed the preset duration, executing the link for obtaining the target static resource file of the JSON file, and downloading the data of the project according to the link.
In this embodiment, the login duration of the application program may also be obtained, whether the login duration of the application program exceeds the preset duration is judged, when it is determined that the login duration of the application program exceeds the preset duration, the link of the target static resource file of the JSON file is obtained, the data of the project is downloaded according to the link, otherwise, the link of the target static resource file of the JSON file is temporarily stopped from being obtained in advance, the data of the project is downloaded according to the link, and after the user successfully logs in the application program, the data of the project is directly pulled from the server, so that flexible data downloading is realized.
In an embodiment, in step S14, the step of downloading the data of the item according to the link may specifically include:
s141, acquiring the running state of the application program every preset time;
s142, judging whether the running state is in a busy state;
and S143, if yes, suspending downloading the data of the project according to the link, resuming to download the data of the project according to the link until the operating state is in an idle state, and storing the downloaded data of the project to a local database.
In step S141, the task completion amount of the application program may be obtained every preset time such as 3S or 5S, the total task amount is obtained, the ratio of the task completion amount to the total task amount is calculated to obtain the task completion rate of the current application program, and the running state of the application program is determined based on the task completion rate, for example, if the task completion rate of the current application program is lower than 30%, it indicates that more tasks still need to be processed by the current application program, and the running state is in a busy state; if the task completion rate of the current application program is higher than 90%, it indicates that the current application program needs fewer tasks to be processed, and the running state is in a more idle state.
In step S142, it may be determined whether the running status is in a busy status according to the task completion rate, for example, when the application is executing a plurality of tasks, the running status is in a busy status, and when the application is executing fewer tasks or no tasks are executed, the running status is in an idle status.
In step S143, when it is determined that the application program is in a busy state, suspending downloading the data of the project according to the link until the running state is in an idle state, resuming downloading the data of the project according to the link, and storing the data of the project that is downloaded to the local database, so that idle time of the application program is fully utilized to load the data, network congestion is avoided, and user experience is improved.
In an embodiment, in step S143, after the step of saving the data of the downloaded item to the local database, the method may further include:
s144, responding to a click instruction of the user on the target item of the H5 page to be loaded, and acquiring target data of the target item clicked by the user from the local database;
and S145, loading the target item of the H5 page to be loaded by using the target data, and displaying.
In this embodiment, a user may arbitrarily select one or more items to perform loading display, so as to avoid downloading data of items that need not be used and affecting loading efficiency. Specifically, a user can click any item in the H5 page to be loaded, the client responds to a click instruction of the user, determines the item selected by the user, obtains target data of the item clicked by the user from the local database, renders the page to be loaded by using the target data, and displays the rendered page to be loaded, so that all items in the page do not need to be loaded, resources are saved, and loading efficiency is improved.
In an embodiment, when it is determined that there are a plurality of items of data to be downloaded, in step S14, the step of downloading the data of the items according to the link may specifically include:
sorting the items of the data to be downloaded according to the levels preset for the items;
and sequentially downloading the data of each project according to the sequencing result.
In this embodiment, a level may also be set for each item, and data may be downloaded preferentially for items with higher levels, thereby improving user experience. Specifically, the present embodiment may set the level of the item according to the type of the item, for example, the item is the highest level of the text, the second level of the picture, and the lowest video. And then when the data of the items are downloaded, the items of the data to be downloaded are sorted according to the levels preset for the items, and the data are downloaded preferentially for the items arranged in the front row, so that the user experience is improved.
In an embodiment, before the step of sorting the items of the data to be downloaded according to the levels preset for the items, the method may further include:
acquiring the browsing amount of each item in historical browsing;
determining the grade of each item according to the browsing amount; wherein the level of each item is positively correlated with the browsing volume.
In this embodiment, when the user accesses each page historically, the number of times of accessing the item of each page may be recorded, the browsing amount of each item in the historical browsing is obtained, the level of each item is determined according to the browsing amount of the item in the historical browsing, and the higher the browsing amount is, the higher the level corresponding to the item is, the higher the downloading of data for the item with the higher browsing amount is prioritized. For example, when the browsing volume of an item in the history browsing is 10000 or more, the browsing volume is high, and the level of the corresponding item is high; when the browsing amount of the item in the history browsing is less than 10000, the browsing amount is low, the level of the corresponding item is low, and when downloading the data of the item, the data is downloaded preferentially for the item with the browsing amount of more than 10000.
Referring to fig. 2, an embodiment of the present application further provides an H5 page loading apparatus for an application program, including:
the acquisition module 11 is configured to respond to a login request of an application program and acquire an H5 page to be loaded;
a determining module 12, configured to obtain a project that needs to be pulled by the H5 page to be loaded, and determine, according to the project, a JSON file corresponding to the project; each JSON file corresponds to an item and is used for recording the storage state or version number updating state of the item in an application program;
a comparison module 13, configured to compare the data of the JSON file with local data locally stored in an application program, and determine whether the project has no local data in the application program or whether the version number of the project changes according to a comparison result;
and the loading module 14 is configured to, when it is determined that the project has no local data in the application program or the version number of the project changes, obtain a link of a target static resource file of the JSON file, download the data of the project according to the link, and load the H5 page to be loaded with the downloaded data.
When a user logs in an application program, a client responds to a login request of the application program, extracts user information in the login request, determines that the user accesses the application program historically according to the user information in the login request, and takes pages with the front row of access times, namely important pages for the user, as H5 pages to be loaded. For example, the number of times of access to each page by the user in the process of accessing the application program may be extracted from the local database, all pages of the current application program are sorted according to the number of times of access, and the pages ranked in the top ten are used as pages to be loaded.
Certainly, the H5 page to be loaded may also be an H5 page specified by the user, for example, a data table may be constructed for each application program, information such as a website and a title of the H5 page selected by the user in each application program is recorded in advance through the data table, and when the user needs to log in the application program, the H5 page selected by the user in the data table is extracted as the H5 page to be loaded. The item is content loaded to a page, and may include a picture, a text, a video, and the like, and the client may be a terminal such as a mobile phone, a tablet, a computer device, and the like.
JSON (JavaScript Object Notification) is a light-weight data exchange format, which is convenient for reading and writing, and is also convenient for machine analysis and generation. It is based on a subset of JavaScript Programming Language, standard ECMA-262 3rd Edition-December 1999. JSON takes a text format that is completely language independent, but also uses conventions similar to the C language family (including C, C + +, C #, java, javaScript, perl, python, etc.). These properties make JSON an ideal data exchange language.
The JSON file of the present embodiment is stored in the local database, and is used to manage the storage state or version number update state of each item described in the page in the application program, for example, whether each item does not store data in the local database or the version number of each item is determined to be the latest version. In addition, the JSON file and the items are in a one-to-one relationship, one JSON file stores the storage state or version number update state of one item, and each item can be managed by deletion, modification, update and the like.
In addition, in this embodiment, local data locally stored by the application program may also be extracted, the data of the JSON file is compared with the local data locally stored by the application program, whether there is no local data in the application program for the project or whether the version number of the project changes is determined according to the comparison result, if the project contains local data in the application program and the version number of the project does not change, the data of the project does not need to be downloaded from the server again, and the data of the project is extracted by directly using the local data locally stored by the application program and used for loading the page.
And when determining that the project has no local data in the application program or the version number of the project is changed, initiating a data acquisition request to the server, so that the server extracts the data of the project from the database based on the data acquisition request and the link of the target static resource file prestored in the JSON file, and caches the extracted data of the project to the local database of the client, namely, the data of the project needs to be downloaded again. After downloading the data, it can also adopt Prefetch mode to store, where Prefetch is a preread folder used to store the preread information of the file that the system has accessed. In addition, after the data downloading of the project is finished, the data downloading can be not executed, when the situation that the user successfully logs in the application program and selects the project needing to be loaded is monitored, the data loading of the project is executed, after the data downloading is successful, the data state can be set to be downloaded, when the user needs to browse the project, the project of the page to be loaded is rendered by the downloaded data, and the rendered page to be loaded is displayed.
As described above, it can be understood that each component of the H5 page loading apparatus for an application program provided in the present application may implement the function of any one of the above-described H5 page loading methods for an application program, and a detailed structure is not described again.
Referring to fig. 3, an embodiment of the present application further provides a computer device, and an internal structure of the computer device may be as shown in fig. 3. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the computer designed processor is used to provide computational and control capabilities. The memory of the computer device comprises a storage medium and an internal memory. The storage medium stores an operating system, a computer program, and a database. The memory provides an environment for the operation of the operating system and computer programs in the storage medium. The database of the computer device is used for storing data of projects, user information and the like. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method of H5 page loading of an application.
The processor executes the H5 page loading method of the application program, including:
responding to a login request of a user for logging in an application program, and determining that when the user historically accesses the application program according to user information in the login request, accessing the H5 page with the first N-bit access times to obtain an H5 page to be loaded; wherein N is a positive integer;
acquiring a project required to be pulled of the H5 page to be loaded, and determining a JSON file corresponding to the project according to the project; each JSON file corresponds to an item and is used for recording the storage state or version number updating state of the item in an application program;
comparing the data of the JSON file with local data locally stored by an application program, and judging whether the project has no local data in the application program or whether the version number of the project is changed according to a comparison result;
and if the project has no local data in the application program or the version number of the project changes, acquiring a link of a target static resource file of the JSON file, downloading the data of the project according to the link, and loading the H5 page to be loaded by using the downloaded data when the situation that the user successfully logs in the application program is monitored.
An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method for loading an H5 page of an application program is implemented, including the steps of:
responding to a login request of a user for logging in an application program, and determining that when the user historically accesses the application program, accessing H5 pages with the first N-bit order according to user information in the login request to obtain H5 pages to be loaded; wherein N is a positive integer;
acquiring a project required to be pulled of the H5 page to be loaded, and determining a JSON file corresponding to the project according to the project; each JSON file corresponds to an item and is used for recording the storage state or version number updating state of the item in an application program;
comparing the data of the JSON file with local data locally stored by an application program, and judging whether the project has no local data in the application program or whether the version number of the project is changed according to a comparison result;
and if the project has no local data in the application program or the version number of the project changes, acquiring a link of a target static resource file of the JSON file, downloading the data of the project according to the link, and loading the H5 page to be loaded by using the downloaded data when the user is monitored to successfully log in the application program.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above may be implemented by hardware instructions of a computer program, and the computer program may be stored in a computer-readable storage medium, and when executed, may include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium provided herein and used in the examples may include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (SSRDRAM), enhanced SDRAM (ESDRAM), synchronous Link (SLDRAM), rambus (Rambus) direct RAM (RDRAM), direct Rambus Dynamic RAM (DRDRAM), and Rambus Dynamic RAM (RDRAM), among others.
To sum up, the most beneficial effect of this application lies in:
according to the method, the device, the equipment and the storage medium for loading the H5 page of the application program, firstly, a login request of a user for logging in the application program is responded, and when the user historically accesses the application program, the H5 page with the first N-bit access times is determined according to user information in the login request, so that the H5 page to be loaded is obtained; acquiring a project required to be pulled of an H5 page to be loaded, and determining a JSON file corresponding to the project according to the project; each JSON file corresponds to an item and is used for recording the storage state or version number updating state of the item in an application program; comparing the data of the JSON file with local data stored locally in an application program, and judging whether the project has no local data or whether the version number of the project is changed in the application program according to the comparison result; if the project has no local data in the application program or the version number of the project changes, acquiring a link of a target static resource file of the JSON file, downloading the data of the project according to the link, and when the user successfully logs in the application program is monitored, loading the H5 page to be loaded by using the downloaded data, so that before the user accesses an important page in the application program, whether the data is downloaded or not is determined by comparing the data of the JSON file with the local data, the data to be downloaded is downloaded in advance, the data to be loaded of the important page is downloaded in advance, after the user successfully logs in the application program, the cached data can be directly used to access the important page, and the loading speed of the H5 page is greatly improved.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, apparatus, article, or method that comprises the element.
The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application, or which are directly or indirectly applied to other related technical fields, are also included in the scope of the present application.

Claims (7)

1. An H5 page loading method of an application program is characterized by comprising the following steps:
responding to a login request of a user for logging in an application program, and determining that when the user historically accesses the application program, accessing H5 pages with the first N-bit order according to user information in the login request to obtain H5 pages to be loaded; wherein N is a positive integer;
acquiring a project required to be pulled of the H5 page to be loaded, and determining a JSON file corresponding to the project according to the project; each JSON file corresponds to an item and is used for recording the storage state or version number updating state of the item in an application program;
comparing the data of the JSON file with local data locally stored by an application program, and judging whether the project has no local data in the application program or whether the version number of the project is changed according to a comparison result;
if the project has no local data in an application program or the version number of the project changes, acquiring a link of a target static resource file of the JSON file, and downloading the data of the project according to the link, wherein the method comprises the following steps: acquiring the running state of the application program at preset time intervals; judging whether the running state is in a busy state or not; if so, suspending downloading the data of the project according to the link until the running state is in an idle state, resuming downloading the data of the project according to the link, and storing the downloaded data of the project to a local database; responding to a click instruction of a user to the target item of the H5 page to be loaded, and acquiring target data of the target item clicked by the user from the local database; loading the target item of the H5 page to be loaded by using the target data, and displaying the target item; when the situation that the user successfully logs in the application program is monitored, loading the H5 page to be loaded by using the downloaded data;
before the step of obtaining the link of the target static resource file of the JSON file and downloading the data of the project according to the link, the method further comprises the following steps:
acquiring the login duration of the application program;
judging whether the login time length exceeds a preset time length or not;
and when the login duration is determined to exceed the preset duration, executing the link for obtaining the target static resource file of the JSON file, and downloading the data of the project according to the link.
2. The method according to claim 1, wherein before the step of determining the JSON file corresponding to the project according to the project, the method further comprises:
acquiring a plurality of static resource files and links of the static resource files, on which the H5 page to be loaded depends, and filtering the plurality of static resource files according to file names, categories and sizes to obtain a target static resource file;
and writing the link of the target static resource file into the JSON file.
3. The method according to claim 1, wherein when it is determined that there are a plurality of items of data to be downloaded, the step of downloading the data of the items according to the links comprises:
sorting the items of the data to be downloaded according to the levels preset for the items;
and sequentially downloading the data of each project according to the sequencing result.
4. The method according to claim 3, wherein before the step of sorting the items of data to be downloaded according to the levels set in advance for the respective items, the method further comprises:
acquiring the browsing amount of each item in historical browsing;
determining the grade of each item according to the browsing amount; wherein the level of each item is positively correlated with the browsing volume.
5. An apparatus for loading an H5 page of an application program, comprising:
the response module is used for responding to a login request of a user for logging in an application program, and when the user accesses the application program historically according to user information in the login request, accessing the H5 page with the first N-bit access times to obtain the H5 page to be loaded; wherein N is a positive integer;
the determining module is used for acquiring the items required to be pulled of the H5 page to be loaded and determining the JSON files corresponding to the items according to the items; each JSON file corresponds to an item and is used for recording the storage state or version number updating state of the item in an application program;
the comparison module is used for comparing the data of the JSON file with local data locally stored by an application program and judging whether the project has no local data in the application program or whether the version number of the project changes according to a comparison result;
a loading module, configured to, when it is determined that the item has no local data in an application program or that the version number of the item changes, obtain a link of a target static resource file of the JSON file, and download data of the item according to the link, where the loading module includes: acquiring the running state of the application program at preset time intervals; judging whether the running state is in a busy state or not; if so, suspending downloading the data of the project according to the link until the running state is in an idle state, resuming downloading the data of the project according to the link, and storing the downloaded data of the project to a local database; responding to a click instruction of a user to the target item of the H5 page to be loaded, and acquiring target data of the target item clicked by the user from the local database; loading the target item of the H5 page to be loaded by using the target data, and displaying the target item; when the situation that the user successfully logs in the application program is monitored, loading the H5 page to be loaded by using the downloaded data;
before the step of obtaining the link of the target static resource file of the JSON file and downloading the data of the project according to the link, the method further includes:
acquiring the login duration of the application program;
judging whether the login duration exceeds a preset duration or not;
and when the login duration is determined to exceed the preset duration, executing the link for obtaining the target static resource file of the JSON file, and downloading the data of the project according to the link.
6. A computer device, comprising:
a processor;
a memory;
a computer program, wherein the computer program is stored in the memory and configured to be executed by the processor, the computer program being configured to perform a method of H5 page loading of an application program according to any of claims 1 to 4.
7. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, implements the H5 page loading method of an application program according to any one of claims 1 to 4.
CN202110722083.5A 2021-06-28 2021-06-28 H5 page loading method, device and equipment of application program and storage medium Active CN113282354B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110722083.5A CN113282354B (en) 2021-06-28 2021-06-28 H5 page loading method, device and equipment of application program and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110722083.5A CN113282354B (en) 2021-06-28 2021-06-28 H5 page loading method, device and equipment of application program and storage medium

Publications (2)

Publication Number Publication Date
CN113282354A CN113282354A (en) 2021-08-20
CN113282354B true CN113282354B (en) 2023-04-07

Family

ID=77285933

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110722083.5A Active CN113282354B (en) 2021-06-28 2021-06-28 H5 page loading method, device and equipment of application program and storage medium

Country Status (1)

Country Link
CN (1) CN113282354B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114416195B (en) * 2021-12-24 2023-08-18 青岛海尔科技有限公司 H5 page loading method and device, intelligent terminal and server
CN114995861B (en) * 2022-08-02 2022-09-30 中航信移动科技有限公司 Weex-based application program updating method, storage medium and electronic equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110244962A (en) * 2019-04-29 2019-09-17 北京辰森世纪科技股份有限公司 Load application file and device, system, storage medium, electronic device
WO2020233059A1 (en) * 2019-05-21 2020-11-26 深圳壹账通智能科技有限公司 Login processing method based on data processing and related apparatus

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8402359B1 (en) * 2010-06-30 2013-03-19 International Business Machines Corporation Method and apparatus for managing recent activity navigation in web applications
CN102123168B (en) * 2011-01-14 2012-07-18 广州市动景计算机科技有限公司 Web page pre-reading and integration method and system based on relay server
US9756108B2 (en) * 2012-05-29 2017-09-05 Google Inc. Preloading resources of a web page
CN109376318B (en) * 2018-09-03 2023-07-21 中国平安人寿保险股份有限公司 Page loading method, computer readable storage medium and terminal equipment
CN109408750A (en) * 2018-09-26 2019-03-01 中国平安财产保险股份有限公司 Page display method, device, computer equipment and storage medium
CN111666497B (en) * 2020-06-16 2023-06-06 腾讯科技(上海)有限公司 Application program loading method and device, electronic equipment and readable storage medium
CN112612552B (en) * 2020-12-31 2023-05-23 五八有限公司 Application resource loading method and device, electronic equipment and readable storage medium
CN112905939B (en) * 2021-02-25 2024-01-23 杭州思亿欧科技集团股份有限公司 HTML5 page resource loading method, device, equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110244962A (en) * 2019-04-29 2019-09-17 北京辰森世纪科技股份有限公司 Load application file and device, system, storage medium, electronic device
WO2020233059A1 (en) * 2019-05-21 2020-11-26 深圳壹账通智能科技有限公司 Login processing method based on data processing and related apparatus

Also Published As

Publication number Publication date
CN113282354A (en) 2021-08-20

Similar Documents

Publication Publication Date Title
CN113282354B (en) H5 page loading method, device and equipment of application program and storage medium
US9641591B1 (en) Modifying web content at a client
CN102880616B (en) browser page loading method and device
US9571601B2 (en) Method and an apparatus for performing offline access to web pages
US20120060083A1 (en) Method for Use in Association With A Multi-Tab Interpretation and Rendering Function
CN112905939B (en) HTML5 page resource loading method, device, equipment and storage medium
CN107957837B (en) Method and device for generating shortcut of webpage application program and terminal equipment
CN107679077B (en) Paging implementation method and device, computer equipment and storage medium
CN105183890B (en) Webpage loading method based on browser and browser device
CN112181532B (en) Page resource loading method and device, electronic equipment and readable storage medium
CN111881150A (en) Web application program offline data processing method and device
CN112612982A (en) Webpage preloading method and device and computer equipment
CN112685669A (en) Page rendering method and system
CN110147258B (en) Method and device for improving program loading efficiency, computer equipment and storage medium
CN117421499A (en) Front-end processing method, front-end processing device, terminal equipment and storage medium
US10095791B2 (en) Information search method and apparatus
CN111177600B (en) Built-in webpage loading method and device based on mobile application
CN112433784A (en) Page loading method, device, equipment and storage medium
CN109101429B (en) Method and device for debugging browser page of set top box
CN103258055A (en) Device and method for file downloading
CN112672187B (en) Page generation method and device, computer equipment and readable storage medium
US10599740B1 (en) Program code streaming
CN114827271A (en) Multi-level cache online control method and related device
CN113934954A (en) Webpage first screen rendering method and device in application program
CN113391855A (en) Information processing method and device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant