CN109376323B - Application running method, device, computer device and storage medium - Google Patents

Application running method, device, computer device and storage medium Download PDF

Info

Publication number
CN109376323B
CN109376323B CN201811056829.8A CN201811056829A CN109376323B CN 109376323 B CN109376323 B CN 109376323B CN 201811056829 A CN201811056829 A CN 201811056829A CN 109376323 B CN109376323 B CN 109376323B
Authority
CN
China
Prior art keywords
application
html5
terminal
offline
code
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
CN201811056829.8A
Other languages
Chinese (zh)
Other versions
CN109376323A (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 Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201811056829.8A priority Critical patent/CN109376323B/en
Publication of CN109376323A publication Critical patent/CN109376323A/en
Application granted granted Critical
Publication of CN109376323B publication Critical patent/CN109376323B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The invention provides an application running method, which comprises the following steps: when a terminal runs an application, detecting the network state of the terminal; judging whether the network state of the terminal meets a preset network condition or not; when the network state of the terminal meets the preset network condition, online loading an online html5 code of the application to display an html5 page of the application, and downloading an offline html5 code of the application from a server of the application to the terminal; and when the network state of the terminal does not meet the preset condition, acquiring the offline html5 code of the application stored by the terminal, and displaying the html5 page of the application according to the offline html5 code of the application. The invention also discloses an application running device, a computer device and a computer readable storage medium. The method and the device can avoid the problem that the html5 page of the application cannot be used when no network exists, improve the smoothness of the application in running and improve the user experience.

Description

Application running method, device, computer device and storage medium
Technical Field
The present invention relates to the field of terminal technologies, and in particular, to an application running method, an application running device, a computer device, and a storage medium.
Background
Currently, the pages running on the terminal may contain some html5 pages, and when the application runs, the connection network is required to download html5 codes from the server of the application to display the html5 pages. However, when the terminal is not connected to the network or the network state is not good, the html5 page may not be displayed, so that the user may not normally use the application, and inconvenience is brought to the use of the user.
Disclosure of Invention
In view of the foregoing, it is necessary to provide an application running method, an application running device, a computer device and a storage medium, which can avoid the problem that an html5 page of an application cannot be used without a network, improve the smoothness of the application during running, and improve the user experience.
The invention provides an application running method, which comprises the following steps:
when a terminal runs an application, detecting the network state of the terminal;
judging whether the network state of the terminal meets a preset network condition or not;
when the network state of the terminal meets the preset network condition, online loading an online html5 code of the application to display an html5 page of the application, and downloading an offline html5 code of the application from a server of the application to the terminal;
And when the network state of the terminal does not meet the preset condition, acquiring the offline html5 code of the application stored by the terminal, and displaying the html5 page of the application according to the offline html5 code of the application.
In a preferred practice of the invention, the method further comprises:
acquiring planned journey information from the terminal;
acquiring an expected network environment of the terminal according to the journey place contained in the planned journey information;
when the expected network environment does not meet the preset network condition, sending a message for reminding downloading the offline html5 code of the application;
and after receiving an instruction for determining to download the offline html5 code of the application, downloading the offline html5 code of the application.
In a preferred embodiment of the present invention, before the detecting the network state of the terminal, the method further includes:
acquiring the type of the application;
and if the application is a web page application or a mixed application, executing the operation of detecting the network state of the terminal.
In a preferred implementation of the present invention, after the online html5 code of the application is loaded online to display an html5 page of the application, the method further includes:
if the terminal has saved the offline html5 code of the application, judging whether the offline html5 code of the application in the server of the application is the same as the offline html saved by the terminal;
And if the offline html5 code of the application in the application server is different from the offline html stored in the terminal, executing the operation of downloading the offline html5 code of the application from the application server and storing the offline html5 code to the terminal.
In a preferred practice of the invention, the method further comprises:
acquiring offline html5 codes of at least two applications stored on the terminal;
acquiring an application with the use frequency lower than a preset use frequency in the at least two applications;
and deleting the offline html5 codes corresponding to the application with the use frequency lower than the preset use frequency from the terminal.
In a preferred embodiment of the present invention, after the displaying the html5 page of the application according to the offline html5 code of the application, the method further includes:
acquiring input information of an html5 page of the application;
and saving the input information.
In a preferred embodiment of the invention, the method further comprises:
acquiring an offline html5 code stored by the terminal;
acquiring offline html5 codes with loading times lower than preset times, and obtaining html5 codes to be deleted;
and deleting the html5 code to be deleted from the offline html5 code.
The invention also provides an application running device, which comprises the following steps:
The detection module is used for detecting the network state of the terminal when the terminal runs the application;
the judging module is used for judging whether the network state of the terminal meets the preset network condition;
the first display module is used for loading the online html5 code of the application on line to display the html5 page of the application when the network state of the terminal meets the preset network condition, and downloading the offline html5 code of the application from the server of the application to the terminal;
and the second display module is used for acquiring the offline html5 code of the application stored by the terminal when the network state of the terminal does not meet the preset condition, and displaying the html5 page of the application according to the offline html5 code of the application.
In a preferred embodiment of the present invention, the apparatus further includes a reminder module, where the reminder module is configured to:
acquiring planned journey information from the terminal;
acquiring an expected network environment of the terminal according to the journey place contained in the planned journey information;
when the expected network environment does not meet the preset network condition, sending a message for reminding downloading the offline html5 code of the application;
And after receiving an instruction for determining to download the offline html5 code of the application, downloading the offline html5 code of the application.
In a preferred embodiment of the present invention, the apparatus further comprises a triggering module, the triggering module further being configured to:
the detection module acquires the type of the application before detecting the network state of the terminal;
and if the application is a webpage application or a mixed application, triggering a detection module to detect the network state of the terminal.
In a preferred embodiment of the present invention, the judging module is further configured to:
if the terminal has stored the offline html5 code of the application, after online loading the online html5 code of the application to display the html5 page of the application, judging whether the offline html5 code of the application in the server of the application is the same as the offline html stored by the terminal;
and the triggering module is further configured to trigger the first display module to download the offline html5 code of the application from the server of the application to store the offline html5 code of the application in the terminal if the offline html5 code of the application in the server of the application is different from the offline html stored in the terminal.
In a preferred embodiment of the invention, the apparatus further comprises a first cleaning module for:
Acquiring offline html5 codes of at least two applications stored on the terminal;
acquiring an application with the use frequency lower than a preset use frequency in the at least two applications;
and deleting the offline html5 codes corresponding to the application with the use frequency lower than the preset use frequency from the terminal.
In a preferred embodiment of the present invention, the apparatus further comprises a saving module for:
after an html5 page of the application is displayed according to the offline html5 code of the application, acquiring input information of the html5 page of the application;
and saving the input information.
In a preferred embodiment of the invention, the apparatus further comprises a second cleaning module for:
acquiring an offline html5 code stored by the terminal;
acquiring offline html5 codes with loading times lower than preset times, and obtaining html5 codes to be deleted;
and deleting the html5 code to be deleted from the offline html5 code.
The present invention also provides a computer apparatus comprising a memory for storing at least one instruction and a processor for executing the at least one instruction to implement the application execution method of any of the embodiments.
The present invention also provides a computer readable storage medium storing at least one instruction that when executed by a processor implements the method of executing an application as described in any of the embodiments.
According to the technical scheme, when the terminal runs the application, the network state of the terminal is detected; judging whether the network state of the terminal meets a preset network condition or not; when the network state of the terminal meets the preset network condition, online loading an online html5 code of the application to display an html5 page of the application, and downloading an offline html5 code of the application from a server of the application to the terminal; and when the network state of the terminal does not meet the preset condition, acquiring the offline html5 code of the application stored by the terminal, and displaying the html5 page of the application according to the offline html5 code of the application. And when the network state is good, displaying the html5 page and synchronously downloading the offline html5 code of the application, and when the network state is bad, displaying the html5 page of the application through the offline html5 of the application. Therefore, the problem that the html5 page of the application cannot be used when no network exists can be avoided, the smoothness of the application in running is improved, and the user experience is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present invention, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of an application running method provided in an embodiment of the present invention;
FIG. 2 is a functional block diagram of an application running device according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a computer device implementing a preferred embodiment of the application running method of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In order that the above-recited objects, features and advantages of the present invention will become more readily apparent, a more particular description of the invention will be rendered by reference to the appended drawings and appended detailed description.
As shown in fig. 1, fig. 1 is a flowchart of an application running method according to an embodiment of the present invention. The order of the steps in the flowchart may be changed and some steps may be omitted according to various needs.
S11, when the terminal runs the application, detecting the network state of the terminal.
The application running method is applied to the terminal, and various applications (such as social application, reading application, video application and the like) can be run on the terminal. Specifically, the terminal may be a portable smart device such as a smart phone or a smart tablet.
The above-mentioned detecting the network state of the terminal may specifically be detecting whether the terminal is connected to the network or not, and the signal strength of the network to which the terminal is connected. For example, when the terminal is connected to the wifi network, the network signal strength of the wifi network can be obtained; alternatively, when the terminal is connected to the mobile network, the network signal strength of the mobile network may be acquired.
In a specific implementation, the network state of the terminal may be obtained according to an operating system of the terminal using a corresponding function. For example, if the terminal is a terminal of an android operating system, the network state of the terminal may be obtained through a ConnectivityManager object.
Meanwhile, the application may be any application running on the terminal.
Further, in another embodiment of the present invention, the method further comprises:
before detecting the network state of the terminal, acquiring the type of the application;
and if the application is a web page application or a mixed application, executing the operation of detecting the network state of the terminal.
The web page application may be called a web app, and the hybrid application may be called a hybrid app. When the application is a web page class application, an html5 page must be loaded, and when the application is a mixed class application, the probability of adding the html5 page is higher.
Because some applications may not contain html5 pages, the operation of detecting the network state of the terminal is only executed when the applications are the two types of applications, further the subsequent operation is executed, the running flow of the applications is improved, the method of the invention is not applied to unnecessary applications, and the method has certain pertinence when the method is used, and unnecessary resource consumption is also avoided.
S12: and judging whether the network state of the terminal meets the preset network condition.
The preset network condition may be a preset network state. Specifically, the above-mentioned determination whether the network state of the terminal meets the preset network condition is used for determining whether the network state of the terminal is better, and whether the data transmission through the network is smooth.
For example, the preset network condition is to connect a wifi network; or the preset network condition is that the mobile network is connected, and the network signal strength of the mobile network is greater than-60 dbm.
S13: and when the network state of the terminal meets the preset network condition, loading the online html5 code of the application on line to display the html5 page of the application, and downloading the offline html5 code of the application from the server of the application to the terminal.
The above-mentioned on-line html5 code is a code that needs to be loaded when an application displays a page of the application when the terminal is networked.
The offline html5 code of the application is a code which needs to be loaded when an html5 page contained in the application is displayed in an offline state.
When the online html5 code of the application is loaded online, the online html5 code is obtained from the server of the application, loaded and displayed on the display interface of the terminal. When downloading offline html5 code of an application, the application is also obtained from the application's server and downloaded. The offline html5 code of the application is pre-stored at the server.
When the application is run, the offline html5 codes corresponding to all html5 pages in the application running process can be downloaded and stored.
Meanwhile, when the application is run, the on-line html5 codes of the application can be loaded and the corresponding off-line html5 codes can be downloaded, so that when the user opens the application next time, the page can be displayed rapidly even if the network state of the terminal is bad (for example, the terminal is not connected).
Further, in another embodiment of the present invention, after the online loading of the online html5 code of the application to display the html5 page of the application, the method further includes:
if the terminal has saved the offline html5 code of the application, judging whether the offline html5 code of the application in the server of the application is the same as the offline html saved by the terminal;
and if the offline html5 code of the application in the application server is different from the offline html stored in the terminal, executing the operation of downloading the offline html5 code of the application from the application server and storing the offline html5 code to the terminal.
In this embodiment, before downloading the offline html code of the application, if the terminal has saved the offline html5 code of the application, it is first determined whether the code saved in the terminal is the latest code, that is, whether the offline html5 code of the application in the server of the application is the same as the offline html saved in the terminal.
Specifically, code comparison can be performed, or code version or code update time can be determined, so as to determine whether offline html5 codes applied in an application server are updated.
If the offline html5 code of the application in the application server is different from the offline html stored in the terminal, the offline html5 code on the application server may be the latest html5. Therefore, the operation of storing the offline html5 code of the application downloaded from the application server to the terminal is executed, so that the latest offline html5 code is stored in the terminal, and the latest html5 page is displayed when the display is needed.
Further, in other embodiments of the present invention, the method further includes:
if the offline html5 code of the application contains pictures with the size larger than the preset size, the sizes of the pictures are compressed, and the compressed pictures are stored in the terminal.
The preset size can be set as required.
When the picture is larger, more memory space may be occupied on the terminal. Therefore, in this embodiment, by compressing the picture, the memory space can be saved without affecting the accuracy of the display content.
Further, the offline html5 code of the application stored in the terminal may be cleaned, and in another embodiment of the present invention, the method further includes:
acquiring an offline html5 code stored by the terminal;
Acquiring offline html5 codes with loading times lower than preset times, and obtaining html5 codes to be deleted;
and deleting the html5 code to be deleted from the offline html5 code.
The specific value of the preset loading times can be set according to the requirement.
The offline html5 codes with the loading times lower than the preset loading times are obtained and used for screening offline html5 with the fewer offline loading times, and the codes are determined to be the html5 codes to be deleted.
When the offline loading times are less, the html5 page corresponding to the code is displayed less. Therefore, through the embodiment, the offline html5 with fewer offline loading times can be cleaned on the basis of ensuring the running smoothness of the application, so that the memory space of the terminal is saved.
Furthermore, the offline html5 codes of the plurality of applications stored in the terminal may also be cleaned, and in another embodiment of the present invention, the method further includes:
acquiring offline html5 codes of at least two applications stored on the terminal;
acquiring an application with the use frequency lower than a preset use frequency in the at least two applications;
and deleting the offline html5 codes corresponding to the application with the use frequency lower than the preset use frequency from the terminal.
The preset use frequency can be set according to the needs, and the preset use frequencies of different applications can be different.
When the frequency of use of a certain application is low, the possibility of displaying html5 pages through offline html5 codes is not high. And when the use frequency of an application is low, the possibility of updating the offline html5 code of the application is also higher, and even if the offline html5 code of the application is stored, the offline html5 code of the application may still need to be updated in the next use.
Therefore, in this embodiment, the offline html5 code corresponding to the application with the use frequency lower than the preset use frequency is deleted from the terminal, so that the storage space of the terminal can be saved without affecting the use of the user.
And S14, when the network state of the terminal does not meet the preset condition, acquiring the offline html5 code of the application stored by the terminal, and displaying the html5 page of the application according to the offline html5 code of the application.
When the network state of the terminal is not smooth, the offline html5 code is directly loaded from the terminal, so that the application can be displayed completely and run smoothly, and the user experience is prevented from being reduced.
Further, in another embodiment of the present invention, the method further includes:
The method further comprises the following steps of:
acquiring input information of an html5 page of the application;
and saving the input information.
The input information is information input in an html5 page of the application. The html5 page of the application may be one or more pages associated with a jump.
For example, the html5 page of the application displays a plurality of form pages with precedence relation, the input information is the content filled in the form, at this time, the information input by the user in the form in the off-line state is saved, the filled content can be directly displayed after the terminal is connected with the network, the filled content does not need to be filled again, and the input information can be loaded.
According to the embodiment, the html5 page of the application can be displayed under the condition of poor network state, and information input by the html5 page of the application is stored, so that frequent input of a user is avoided.
Further, in another embodiment of the present invention, the method further includes:
acquiring planned journey information from the terminal;
acquiring an expected network environment of the terminal according to the journey place contained in the planned journey information;
When the expected network environment does not meet the preset network condition, sending a message for reminding downloading the offline html5 code of the application;
and after receiving an instruction for determining to download the offline html5 code of the application, downloading the offline html5 code of the application.
The planned travel information may be travel information of the user stored in the terminal in advance, and specifically, the planned travel information may include a travel location and may include a travel time.
For example, the trip location is a railway station, and the expected network environment (such as no wifi network and low download rate of the 4G network) when the railway station is connected is obtained according to the historical networking record of the user. And if the expected network environment does not meet the preset network condition, sending a message for reminding the downloading of the offline html5 code of the application.
By the embodiment, the situation that the network condition is poor and the html5 page cannot be opened when the user runs the application for the first time can be prevented. By pre-judging and reminding, the offline html5 code of the application is downloaded, so that the user can completely display and smoothly operate when the user needs to use the html5 code, and the user experience is prevented from being reduced.
When a terminal runs an application, the application running method provided by the invention detects the network state of the terminal; judging whether the network state of the terminal meets a preset network condition or not; when the network state of the terminal meets the preset network condition, online loading an online html5 code of the application to display an html5 page of the application, and downloading an offline html5 code of the application from a server of the application to the terminal; and when the network state of the terminal does not meet the preset condition, acquiring the offline html5 code of the application stored by the terminal, and displaying the html5 page of the application according to the offline html5 code of the application. And when the network state is good, displaying the html5 page and synchronously downloading the offline html5 code of the application, and when the network state is bad, displaying the html5 page of the application through the offline html5 of the application. Therefore, the problem that the html5 page of the application cannot be used when no network exists can be avoided, the smoothness of the application in running is improved, and the user experience is improved.
As shown in fig. 2, fig. 2 is a functional block diagram of an application running device according to an embodiment of the present invention. The application running device includes a detection module 210, a judgment module 220, a first display module 230 and a second display module 240. The module referred to in the present invention refers to a series of computer program segments capable of being executed by a processor of a computer device and of accomplishing a fixed function, which are stored in a memory of the computer device. In the present embodiment, the functions of the respective modules will be described in detail in the following embodiments.
The detecting module 210 is configured to detect a network state of the terminal when the terminal runs the application.
The terminal of the invention can run various applications (such as social application, reading application, video application, etc.). Specifically, the terminal may be a portable smart device such as a smart phone or a smart tablet.
The above-mentioned detecting the network state of the terminal may specifically be detecting whether the terminal is connected to the network or not, and the signal strength of the network to which the terminal is connected. For example, when the terminal is connected to the wifi network, the network signal strength of the wifi network can be obtained; alternatively, when the terminal is connected to the mobile network, the network signal strength of the mobile network may be acquired.
In a specific implementation, the network state of the terminal may be obtained according to an operating system of the terminal using a corresponding function. For example, if the terminal is a terminal of an android operating system, the network state of the terminal may be obtained through a ConnectivityManager object.
Meanwhile, the application may be any application running on the terminal.
Further, in another embodiment of the present invention, the apparatus further includes a triggering module, where the triggering module is further configured to:
the method comprises the steps that before a detection module detects the network state of the terminal, the type of the application is obtained; and if the application is a webpage application or a mixed application, triggering a detection module to detect the network state of the terminal.
The web page application may be called a web app, and the hybrid application may be called a hybrid app. When the application is a web page class application, an html5 page must be loaded, and when the application is a mixed class application, the probability of adding the html5 page is higher.
Since some applications may not include html5 pages, the detection module 210 is triggered to detect the network state of the terminal only when the applications are the two types of applications, and further, the subsequent operation is performed through other modules, so that the running flow of the applications is improved, the device of the invention is prevented from being applied to unnecessary applications, and unnecessary resource consumption is avoided.
A judging module 220, configured to judge whether the network state of the terminal meets a preset network condition.
The preset network condition may be a preset network state. Specifically, the above-mentioned determination whether the network state of the terminal meets the preset network condition is used for determining whether the network state of the terminal is better, and whether the data transmission through the network is smooth.
For example, the preset network condition is to connect a wifi network; or the preset network condition is that the mobile network is connected, and the network signal strength of the mobile network is greater than-60 dbm.
A first display module 230, configured to load online html5 codes of the application online to display an html5 page of the application when the network state of the terminal meets the preset network condition, and download offline html5 codes of the application from a server of the application to the terminal.
The above-mentioned on-line html5 code is a code that needs to be loaded when an application displays a page of the application when the terminal is networked.
The offline html5 code of the application is a code which needs to be loaded when an html5 page contained in the application is displayed in an offline state.
When the online html5 code of the application is loaded online, the online html5 code is obtained from the server of the application, loaded and displayed on the display interface of the terminal. When downloading offline html5 code of an application, the application is also obtained from the application's server and downloaded. The offline html5 code of the application is pre-stored at the server.
When the application is run, the offline html5 codes corresponding to all html5 pages in the application running process can be downloaded and stored.
Meanwhile, when the application is run, the on-line html5 codes of the application can be loaded and the corresponding off-line html5 codes can be downloaded, so that when the user opens the application next time, the page can be displayed rapidly even if the network state of the terminal is bad (for example, the terminal is not connected).
Further, in another embodiment of the present invention, the determining module 220 is further configured to:
if the terminal has stored the offline html5 code of the application, after online loading the online html5 code of the application to display the html5 page of the application, judging whether the offline html5 code of the application in the server of the application is the same as the offline html stored by the terminal;
and the triggering module is further configured to trigger the first display module to download the offline html5 code of the application from the server of the application to store the offline html5 code of the application in the terminal if the offline html5 code of the application in the server of the application is different from the offline html stored in the terminal.
In this embodiment, before downloading the offline html code of the application, if the terminal has saved the offline html5 code of the application, it is first determined whether the code saved in the terminal is the latest code, that is, whether the offline html5 code of the application in the server of the application is the same as the offline html saved in the terminal.
Specifically, code comparison can be performed, or code version or code update time can be determined, so as to determine whether offline html5 codes applied in an application server are updated.
If the offline html5 code of the application in the application server is different from the offline html stored in the terminal, the offline html5 code on the application server may be the latest html5. Therefore, the first display module is triggered to download the offline html5 codes of the application from the server of the application to the terminal, so that the latest offline html5 codes are stored in the terminal, and the latest html5 pages are displayed when the latest html5 codes need to be displayed.
Further, in other embodiments of the present invention, the apparatus further includes a compression module, where the compression module is configured to:
if the offline html5 code of the application contains pictures with the size larger than the preset size, the sizes of the pictures are compressed, and the compressed pictures are stored in the terminal.
The preset size can be set as required.
When the picture is larger, more memory space may be occupied on the terminal. Therefore, in this embodiment, by compressing the picture, the memory space can be saved without affecting the accuracy of the display content.
Further, the offline html5 code of the application stored in the terminal may be cleaned, and in another embodiment of the present invention, the apparatus further includes a first cleaning module, where the first cleaning module is configured to:
acquiring an offline html5 code stored by the terminal;
acquiring offline html5 codes with loading times lower than preset times, and obtaining html5 codes to be deleted;
and deleting the html5 code to be deleted from the offline html5 code.
The specific value of the preset loading times can be set according to the requirement.
The offline html5 codes with the loading times lower than the preset loading times are obtained and used for screening offline html5 with the fewer offline loading times, and the codes are determined to be the html5 codes to be deleted.
When the offline loading times are less, the html5 page corresponding to the code is displayed less. Therefore, through the embodiment, the offline html5 with fewer offline loading times can be cleaned on the basis of ensuring the running smoothness of the application, so that the memory space of the terminal is saved.
Further, the offline html5 codes of the plurality of applications stored in the terminal may also be cleaned, and in another embodiment of the present invention, the apparatus further includes a second cleaning module, where the second cleaning module is configured to:
Acquiring offline html5 codes of at least two applications stored on the terminal;
acquiring an application with the use frequency lower than a preset use frequency in the at least two applications;
and deleting the offline html5 codes corresponding to the application with the use frequency lower than the preset use frequency from the terminal.
The preset use frequency can be set according to the needs, and the preset use frequencies of different applications can be different.
When the frequency of use of a certain application is low, the possibility of displaying html5 pages through offline html5 codes is not high. And when the use frequency of an application is low, the possibility of updating the offline html5 code of the application is also higher, and even if the offline html5 code of the application is stored, the offline html5 code of the application may still need to be updated in the next use.
Therefore, in this embodiment, the offline html5 code corresponding to the application with the use frequency lower than the preset use frequency is deleted from the terminal, so that the storage space of the terminal can be saved without affecting the use of the user.
And the second display module 240 is configured to obtain an offline html5 code of the application stored by the terminal when the network state of the terminal does not meet the preset condition, and display an html5 page of the application according to the offline html5 code of the application.
When the network state of the terminal is not smooth, the offline html5 code is directly loaded from the terminal, so that the application can be displayed completely and run smoothly, and the user experience is prevented from being reduced.
Further, in another embodiment of the present invention, the apparatus further includes a saving module, where the saving module is configured to:
after an html5 page of the application is displayed according to the offline html5 code of the application, acquiring input information of the html5 page of the application;
and saving the input information.
The input information is information input in an html5 page of the application. The html5 page of the application may be one or more pages associated with a jump.
For example, the html5 page of the application displays a plurality of form pages with precedence relation, the input information is the content filled in the form, at this time, the information input by the user in the form in the off-line state is saved, the filled content can be directly displayed after the terminal is connected with the network, the filled content does not need to be filled again, and the input information can be loaded.
According to the embodiment, the html5 page of the application can be displayed under the condition of poor network state, and information input by the html5 page of the application is stored, so that frequent input of a user is avoided.
Further, in another embodiment of the present invention, the apparatus further includes a reminder module, where the reminder module is configured to:
acquiring planned journey information from the terminal;
acquiring an expected network environment of the terminal according to the journey place contained in the planned journey information;
when the expected network environment does not meet the preset network condition, sending a message for reminding downloading the offline html5 code of the application;
and after receiving an instruction for determining to download the offline html5 code of the application, downloading the offline html5 code of the application.
The planned travel information may be travel information of the user stored in the terminal in advance, and specifically, the planned travel information may include a travel location and may include a travel time.
For example, the trip location is a railway station, and the expected network environment (such as no wifi network and low download rate of the 4G network) when the railway station is connected is obtained according to the historical networking record of the user. And if the expected network environment does not meet the preset network condition, sending a message for reminding the downloading of the offline html5 code of the application.
By the embodiment, the situation that the network condition is poor and the html5 page cannot be opened when the user runs the application for the first time can be prevented. By pre-judging and reminding, the offline html5 code of the application is downloaded, so that the user can completely display and smoothly operate when the user needs to use the html5 code, and the user experience is prevented from being reduced.
The application running device provided by the invention detects the network state of the terminal when the terminal runs the application; judging whether the network state of the terminal meets a preset network condition or not; when the network state of the terminal meets the preset network condition, online loading an online html5 code of the application to display an html5 page of the application, and downloading an offline html5 code of the application from a server of the application to the terminal; and when the network state of the terminal does not meet the preset condition, acquiring the offline html5 code of the application stored by the terminal, and displaying the html5 page of the application according to the offline html5 code of the application. And when the network state is good, displaying the html5 page and synchronously downloading the offline html5 code of the application, and when the network state is bad, displaying the html5 page of the application through the offline html5 of the application. Therefore, the problem that the html5 page of the application cannot be used when no network exists can be avoided, the smoothness of the application in running is improved, and the user experience is improved.
The integrated units implemented in the form of software functional modules described above may be stored in a computer readable storage medium. The software functional modules described above are stored in a storage medium and include instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform some of the steps of the methods described in the various embodiments of the invention.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a computer device according to a preferred embodiment of the present invention for implementing an application running method. The computer means comprise at least one transmitting means 31, at least one memory 32, at least one processor 33, at least one receiving means 34 and at least one communication bus. Wherein the communication bus is used to enable connection communication between these components.
The computer apparatus is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and its hardware includes, but is not limited to, a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a programmable gate array (Field-Programmable Gate Array, FPGA), a digital processor (Digital Signal Processor, DSP), an embedded device, and the like. The computer apparatus may also include a network device and/or a user device. Wherein the network device includes, but is not limited to, a single network server, a server group composed of a plurality of network servers, or a Cloud based Cloud Computing (Cloud Computing) composed of a large number of hosts or network servers, wherein Cloud Computing is one of distributed Computing, and is a super virtual computer composed of a group of loosely coupled computer sets.
The computer device may be, but is not limited to, any electronic product that can perform man-machine interaction with a user through a keyboard, a touch pad, or a voice control device, for example, a terminal such as a tablet computer, a smart phone, or a monitoring device.
The network in which the computer device is located includes, but is not limited to, the internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (Virtual Private Network, VPN), and the like.
The receiving means 34 and the transmitting means 31 may be wired transmission ports, or may be wireless devices, for example, including antenna means for performing data communication with other devices.
The memory 32 is used for storing program codes. The Memory 32 may be a circuit with a Memory function, such as a RAM (Random-Access Memory), a FIFO (First In First Out, first-in first-out Memory), etc., which is not in physical form in the integrated circuit. Alternatively, the memory 32 may be a physical memory, such as a memory bank, a TF Card (Trans-flash Card), a smart media Card (smart media Card), a secure digital Card (secure digital Card), a flash memory Card (flash Card), or the like.
The processor 33 may comprise one or more microprocessors, digital processors. The processor 33 may call program code stored in the memory 32 to perform the relevant functions. For example, the various elements described in FIG. 3 are program code stored in the memory 32 and executed by the processor 33 to implement an application execution method. The processor 33 is also called a central processing Unit (CPU, central Processing Unit), which is a very large scale integrated circuit and is an operation Core (Core) and a Control Unit (Control Unit).
In the several embodiments provided in the present invention, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units can be realized in a form of hardware or a form of hardware and a form of software functional modules.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof. The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned. Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. A plurality of units or means recited in the system claims can also be implemented by means of software or hardware by means of one unit or means. The terms second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention.

Claims (8)

1. An application running method, characterized in that the method comprises:
when a terminal runs an application, acquiring the type of the application; if the application is a web page application or a mixed application, detecting the network state of the terminal, wherein the application is a plurality of applications running on the terminal;
judging whether the network state of the terminal meets a preset network condition or not;
when the network state of the terminal meets the preset network condition, online loading an online html5 code of the application to display an html5 page of the application, and downloading an offline html5 code of the application from a server of the application to the terminal;
when the network state of the terminal does not meet the preset network condition, acquiring an offline html5 code of the application stored by the terminal, and displaying an html5 page of the application according to the offline html5 code of the application; acquiring input information of an html5 page of the application; and saving the input information.
2. The method of claim 1, wherein the method further comprises:
acquiring planned journey information from the terminal;
acquiring an expected network environment of the terminal according to the journey place contained in the planned journey information;
when the expected network environment does not meet the preset network condition, sending a message for reminding downloading the offline html5 code of the application;
and after receiving an instruction for determining to download the offline html5 code of the application, downloading the offline html5 code of the application.
3. The method of claim 1 or 2, wherein after loading the online html5 code of the application online to display the html5 page of the application, further comprising:
if the terminal has saved the offline html5 code of the application, judging whether the offline html5 code of the application in the server of the application is the same as the offline html saved by the terminal;
and if the offline html5 code of the application in the application server is different from the offline html stored in the terminal, executing the operation of downloading the offline html5 code of the application from the application server and storing the offline html5 code to the terminal.
4. The method of claim 1 or 2, wherein the method further comprises:
Acquiring offline html5 codes of at least two applications stored on the terminal;
acquiring an application with the use frequency lower than a preset use frequency in the at least two applications;
and deleting the offline html5 codes corresponding to the application with the use frequency lower than the preset use frequency from the terminal.
5. The method of claim 1 or 2, wherein the method further comprises:
acquiring an offline html5 code stored by the terminal;
acquiring offline html5 codes with loading times lower than preset times, and obtaining html5 codes to be deleted;
and deleting the html5 code to be deleted from the offline html5 code.
6. An application running apparatus, the apparatus comprising:
the detection module is used for acquiring the type of the application when the terminal runs the application; if the application is a web page application or a mixed application, detecting the network state of the terminal, wherein the application is a plurality of applications running on the terminal;
the judging module is used for judging whether the network state of the terminal meets the preset network condition;
the first display module is used for loading the online html5 code of the application on line to display the html5 page of the application when the network state of the terminal meets the preset network condition, and downloading the offline html5 code of the application from the server of the application to the terminal;
The second display module is used for acquiring the offline html5 code of the application stored by the terminal when the network state of the terminal does not meet the preset network condition, and displaying the html5 page of the application according to the offline html5 code of the application; acquiring input information of an html5 page of the application; and saving the input information.
7. A computer device comprising a memory for storing at least one instruction and a processor for executing the at least one instruction to implement the application execution method of any one of claims 1 to 5.
8. A computer-readable storage medium having stored thereon computer instructions, characterized by: the computer instructions, when executed by a processor, implement the application running method of any one of claims 1 to 5.
CN201811056829.8A 2018-09-11 2018-09-11 Application running method, device, computer device and storage medium Active CN109376323B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811056829.8A CN109376323B (en) 2018-09-11 2018-09-11 Application running method, device, computer device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811056829.8A CN109376323B (en) 2018-09-11 2018-09-11 Application running method, device, computer device and storage medium

Publications (2)

Publication Number Publication Date
CN109376323A CN109376323A (en) 2019-02-22
CN109376323B true CN109376323B (en) 2023-06-16

Family

ID=65405572

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811056829.8A Active CN109376323B (en) 2018-09-11 2018-09-11 Application running method, device, computer device and storage medium

Country Status (1)

Country Link
CN (1) CN109376323B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114007245A (en) * 2021-10-29 2022-02-01 维沃移动通信有限公司 Data processing method and device and electronic equipment

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105208127A (en) * 2015-10-09 2015-12-30 上海瀚银信息技术有限公司 Webpage caching processing method and system and intelligent terminal

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104572710B (en) * 2013-10-18 2019-06-28 腾讯科技(深圳)有限公司 The processing method and processing device of webpage information
CN105446750B (en) * 2014-05-30 2019-12-03 阿里巴巴集团控股有限公司 The method and apparatus that WebApp starting runs, generates image file
CN104021218B (en) * 2014-06-23 2018-01-19 贝壳网际(北京)安全技术有限公司 A kind of method for information display and device
CN105808282A (en) * 2014-12-31 2016-07-27 北京神州泰岳软件股份有限公司 Method and device for updating webpage contents of application program
CN107864173A (en) * 2017-06-26 2018-03-30 平安普惠企业管理有限公司 Terminal page caching method, system and readable storage medium storing program for executing
CN108040088A (en) * 2017-11-26 2018-05-15 上海爱优威软件开发有限公司 Event arrangement method and system based on stroke route

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105208127A (en) * 2015-10-09 2015-12-30 上海瀚银信息技术有限公司 Webpage caching processing method and system and intelligent terminal

Also Published As

Publication number Publication date
CN109376323A (en) 2019-02-22

Similar Documents

Publication Publication Date Title
CN110808922B (en) Message processing method and device, storage medium and electronic equipment
US20140149877A1 (en) Method and terminal device for displaying push message
CN107908487B (en) Task control management method, device and equipment and computer readable storage medium
CN109298960A (en) Application crashes processing method, device, computer installation and storage medium
CN110765208B (en) Data synchronization method and device, electronic equipment and storage medium
CN109376323B (en) Application running method, device, computer device and storage medium
CN115470432A (en) Page rendering method and device, electronic equipment and computer readable medium
CN111240952B (en) Log acquisition method and device
CN111783010B (en) Webpage blank page monitoring method, device, terminal and storage medium
CN110442059B (en) Controlled equipment expanding method and device and control equipment
CN108549557A (en) Using storing method, terminal and storage medium
CN112882833A (en) Data acquisition method and device, computer equipment and storage medium
CN111083145A (en) Message sending method and device and electronic equipment
CN110765386A (en) Webpage image monitoring method and device, electronic equipment and readable storage medium
CN104951325B (en) A kind of information display method and electronic equipment
CN114995914A (en) Picture data processing method and device, computer equipment and storage medium
CN106648729B (en) Application freezing method and system
CN111290812B (en) Display method, device, terminal and storage medium of application control
CN110764995B (en) Method, device, medium and electronic equipment for detecting file access abnormality
CN111193717A (en) FTP black and white list control method and device and electronic equipment
CN110795670A (en) Webpage image monitoring method and device, electronic equipment and readable storage medium
CN112732568B (en) System log acquisition method and device, storage medium and terminal
CN112684878B (en) Data transmission method and electronic equipment
CN111163138B (en) Method, device and server for reducing network load during game
CN114138397B (en) Page display method and device, electronic equipment 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