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

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

Info

Publication number
CN113282354A
CN113282354A CN202110722083.5A CN202110722083A CN113282354A CN 113282354 A CN113282354 A CN 113282354A CN 202110722083 A CN202110722083 A CN 202110722083A CN 113282354 A CN113282354 A CN 113282354A
Authority
CN
China
Prior art keywords
data
project
application program
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.)
Granted
Application number
CN202110722083.5A
Other languages
Chinese (zh)
Other versions
CN113282354B (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

Abstract

The application belongs 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-digit 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 H5 page loading speed.

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 program.
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 publishing, fast version iteration and the like, so that loading the H5 page is a common way in the industry, for example, developing the mobile application usually employs an H5 bearer service, a Native bearer basic component service (for example, an H5 page provides a network request component, and an H5 page displays data).
However, compared with the native page, since all H5 resources need to be downloaded to render the page when the application program is accessed by logging in each time, the H5 page loading speed is slower than that of the native page, and the efficiency is lower.
Disclosure of Invention
The application mainly aims to provide an application program H5 page loading method, device, equipment and storage medium, so as to improve the H5 page loading speed.
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 H5 pages with the first N-digit order 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 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, which are depended by the H5 page to be loaded, and filtering the plurality of static resource files according to file names, types 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 also 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 is determined to access the application program historically according to user information in the login request, accessing the H5 page with the first N-bit in the number of times to obtain an H5 page to be loaded; wherein N is a positive integer;
the determining module is used for acquiring the items required to be pulled by 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, the memory storing a computer program, the processor implementing the steps of any 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 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 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 an 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 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; 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 situation that 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, and 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 flowchart illustrating 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 block diagram illustrating 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, wherein 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 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-digit access times to obtain an H5 page to be loaded; wherein N is a positive integer;
s12, acquiring the items required to be pulled of the H5 page to be loaded, and determining 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;
s13, comparing the data of the JSON file with local data stored locally 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 the comparison result;
and S14, 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.
As described in the above 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, the top page of the access times, i.e. the important page for the user, is the top page to be loaded as the H5 page. For example, the access times of each page accessed by the user in the process of accessing the application program can be extracted from the local database, all pages of the current application program are sorted according to the access times, 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 designated by the user, for example, a data table may be constructed for each application, information such as a website and a title of the H5 page selected by the user in each application is recorded in advance through the data table, and when the user needs to log in the application, 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, json (javascript Object notification) is a lightweight data exchange format, which is easy to read and write, and is also easy for machine parsing and generation. It is based on a subset of JavaScript Programming Language, Standard ECMA-2623 rd 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, in this step, local data locally stored in the application program is extracted, the data of the JSON file is compared with the local data locally stored in 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 has changed according to the comparison result, and if the project contains local data in the application program and the version number of the project has not changed, the data of the project does not need to be downloaded from the server, and the data of the project is extracted directly using the local data locally stored in the application program for loading the page.
As described in step S14, when it is determined that the item has no local data in the application program or the version number of the item has 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, 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, and an 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 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; 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 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, and 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.
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, which are depended by the H5 page to be loaded, and filtering the plurality of static resource files according to file names, types and sizes to obtain a target static resource file;
and writing the link of the target static resource file into the JSON file.
In this embodiment, when a JSON file is constructed in advance, different types of items are packaged in advance, and a to-be-loaded H5 page generated after the packaging is analyzed and packaged is obtained, then a plurality of static resource files on which the page depends and links of the static resource files are obtained, and the static resource files are filtered according to file names, categories and sizes to obtain a target static resource file, and if a static resource file of which the file name does not meet naming requirements is removed, or a static resource file of which the file size exceeds a preset file size is removed, the remaining static resource file is 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 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 next 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 obtaining module 11 is configured to obtain an H5 page to be loaded in response to a login request of an application;
the determining module 12 is 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 when the user historically accesses the application program according to the user information in the login request, pages with the front row of access times, namely important pages for the user, are taken as H5 pages to be loaded. For example, the access times of each page accessed by the user in the process of accessing the application program can be extracted from the local database, all pages of the current application program are sorted according to the access times, 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 designated by the user, for example, a data table may be constructed for each application, information such as a website and a title of the H5 page selected by the user in each application is recorded in advance through the data table, and when the user needs to log in the application, 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 lightweight data exchange format, which is easy to read and write, and also easy to parse and generate by a machine. It is based on a subset of JavaScript Programming Language, Standard ECMA-2623 rd 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.
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 changes, 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 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.
As described above, it can be understood that each component of the H5 page loading apparatus for the application program provided in the present application may implement the function of any one of the above H5 page loading methods for the 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 an H5 page loading method for 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 H5 pages with the first N-digit order 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 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 implementing H5 page loading of an application program includes 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 according to user information in the login request, accessing H5 pages with the first N-digit order 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 situation that the user successfully logs in the application program is monitored.
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 can be implemented by a computer program, which can be stored in a computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the computer program is executed. 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), double-rate SDRAM (SSRSDRAM), Enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and bus dynamic RAM (RDRAM).
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 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 an 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 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; 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 situation that 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, and 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 an … …" does not exclude the presence of other like elements in a process, apparatus, article, or method that includes 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 (10)

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 according to user information in the login request, accessing H5 pages with the first N-digit order 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 situation that the user successfully logs in the application program is monitored.
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, which are depended by the H5 page to be loaded, and filtering the plurality of static resource files according to file names, types 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 of claim 1, wherein the step of downloading the data of the item according to the link comprises:
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.
4. The method of claim 3, wherein after the step of saving the data of the downloaded item to the local database, further comprising:
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.
5. The method according to claim 1, wherein when it is determined that the item of data to be downloaded is plural, the step of downloading the data of the item according to the link 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.
6. The method according to claim 5, 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.
7. The method according to claim 1, wherein 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:
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.
8. An H5 page loading device 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 H5 pages with the first N-bit access times to obtain H5 pages to be loaded; wherein N is a positive integer;
the determining module is used for acquiring the items required to be pulled by 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.
9. 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 the H5 page loading method of an application program according to any one of claims 1 to 7.
10. 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, carries out the H5 page loading method of an application program according to any one of claims 1-7.
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 true CN113282354A (en) 2021-08-20
CN113282354B 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)

Cited By (2)

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

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120317244A1 (en) * 2011-01-14 2012-12-13 Guangzhou Ucweb Computer Technology Co., Ltd Webpage pre-reading method, transfer server and webpage pre-reading system
US8402359B1 (en) * 2010-06-30 2013-03-19 International Business Machines Corporation Method and apparatus for managing recent activity navigation in web applications
US20150200994A1 (en) * 2012-05-29 2015-07-16 Google Inc. Preloading resources of a web page
CN109376318A (en) * 2018-09-03 2019-02-22 中国平安人寿保险股份有限公司 A kind of page loading method, computer readable storage medium and terminal device
CN109408750A (en) * 2018-09-26 2019-03-01 中国平安财产保险股份有限公司 Page display method, device, computer equipment and storage medium
CN110244962A (en) * 2019-04-29 2019-09-17 北京辰森世纪科技股份有限公司 Load application file and device, system, storage medium, electronic device
CN111666497A (en) * 2020-06-16 2020-09-15 腾讯科技(上海)有限公司 Application program loading method and device, electronic equipment and readable storage medium
WO2020233059A1 (en) * 2019-05-21 2020-11-26 深圳壹账通智能科技有限公司 Login processing method based on data processing and related apparatus
CN112612552A (en) * 2020-12-31 2021-04-06 五八有限公司 Application program resource loading method and device, electronic equipment and readable storage medium
CN112905939A (en) * 2021-02-25 2021-06-04 平安普惠企业管理有限公司 HTML5 page resource loading method, device, equipment and storage medium

Patent Citations (10)

* 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
US20120317244A1 (en) * 2011-01-14 2012-12-13 Guangzhou Ucweb Computer Technology Co., Ltd Webpage pre-reading method, transfer server and webpage pre-reading system
US20150200994A1 (en) * 2012-05-29 2015-07-16 Google Inc. Preloading resources of a web page
CN109376318A (en) * 2018-09-03 2019-02-22 中国平安人寿保险股份有限公司 A kind of page loading method, computer readable storage medium and terminal device
CN109408750A (en) * 2018-09-26 2019-03-01 中国平安财产保险股份有限公司 Page display method, device, computer equipment and storage medium
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
CN111666497A (en) * 2020-06-16 2020-09-15 腾讯科技(上海)有限公司 Application program loading method and device, electronic equipment and readable storage medium
CN112612552A (en) * 2020-12-31 2021-04-06 五八有限公司 Application program resource loading method and device, electronic equipment and readable storage medium
CN112905939A (en) * 2021-02-25 2021-06-04 平安普惠企业管理有限公司 HTML5 page resource loading method, device, equipment and storage medium

Cited By (3)

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

Also Published As

Publication number Publication date
CN113282354B (en) 2023-04-07

Similar Documents

Publication Publication Date Title
US8745341B2 (en) Web server cache pre-fetching
US9641591B1 (en) Modifying web content at a client
US9509764B1 (en) Updating cached web content
CN113282354B (en) H5 page loading method, device and equipment of application program and storage medium
US9571601B2 (en) Method and an apparatus for performing offline access to web pages
US9401949B1 (en) Client web content cache purge
WO2013178094A1 (en) Page display method and device
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
CN111881150A (en) Web application program offline data processing method and device
CN112612982A (en) Webpage preloading method and device and computer equipment
CN105183890B (en) Webpage loading method based on browser and browser device
CN111460254B (en) Webpage crawling method and device based on multithreading, storage medium and equipment
CN110147258B (en) Method and device for improving program loading efficiency, computer equipment and storage medium
CN109542501B (en) Browser table compatibility method and device, computer equipment and storage medium
CN112181532B (en) Page resource loading method and device, electronic equipment and readable storage medium
CN112417336B (en) Page display method and device, electronic equipment and storage medium
CN111177600B (en) Built-in webpage loading method and device based on mobile application
EP2998885A1 (en) Method and device for information search
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
CN114491344B (en) Webpage resource downloading type determining method, device, equipment and medium
US10599740B1 (en) Program code streaming
CN113934954A (en) Webpage first screen rendering method and device in application program

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