CN110968815A - Page refreshing method, device, terminal and storage medium - Google Patents

Page refreshing method, device, terminal and storage medium Download PDF

Info

Publication number
CN110968815A
CN110968815A CN201911228689.2A CN201911228689A CN110968815A CN 110968815 A CN110968815 A CN 110968815A CN 201911228689 A CN201911228689 A CN 201911228689A CN 110968815 A CN110968815 A CN 110968815A
Authority
CN
China
Prior art keywords
page
web
web page
terminal
instruction
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
CN201911228689.2A
Other languages
Chinese (zh)
Other versions
CN110968815B (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.)
Reach Best Technology Co Ltd
Original Assignee
Reach Best Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Reach Best Technology Co Ltd filed Critical Reach Best Technology Co Ltd
Priority to CN201911228689.2A priority Critical patent/CN110968815B/en
Publication of CN110968815A publication Critical patent/CN110968815A/en
Application granted granted Critical
Publication of CN110968815B publication Critical patent/CN110968815B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure relates to a page refreshing method, a page refreshing device, a terminal and a storage medium, and belongs to the technical field of electronic equipment. The method comprises the following steps: receiving an operation instruction for executing a first page operation on a web page; if the residual memory resources in the web container corresponding to the web page are enough to execute the first page operation, executing the first page operation according to the operation instruction, and storing first operation data of the first page operation into a cache region; if the residual memory resources in the web container are not enough to execute the first page operation, the web page is reset, historical operation data are read from the cache region, and the web page is restored to the state when the operation instruction is received based on the historical operation data. In the disclosure, after the web page is reset, the web page can be restored to the state when the operation instruction is received based on the historical operation data, and the user does not need to execute the operation executed in the history again, so that the efficiency of executing the page operation can be improved.

Description

Page refreshing method, device, terminal and storage medium
Technical Field
The present disclosure relates to the field of electronic devices, and in particular, to a page refreshing method, apparatus, terminal, and storage medium.
Background
In electronic devices such as computers, mobile phones and tablet computers, a web (web page) page is usually run in a browser of the electronic device or a web container such as WebView. And the web page runs in the web container, which occupies the memory resource of the web container. If the memory resources occupied by the web page are not released in time and all the memory resources of the web container are occupied, the memory leakage of the web container is caused. Therefore, in order to avoid memory leakage of the web container, the electronic device may refresh the web page when the occupied memory resource of the web container reaches the upper limit.
In the related art, when the electronic device refreshes a web page, the page of the initial state of the web page is directly shown. For example, the current web page is an information filling page, and when the electronic device refreshes the web page during the process that the user fills in the user information in the web page, the electronic device displays the web page without filling in the user information.
Disclosure of Invention
The embodiment of the disclosure provides a page refreshing method, a page refreshing device, a terminal and a storage medium, which can solve the problem that after a web page is reset, a user needs to manually execute a historical page operation again, and the efficiency of executing the page operation is low. The technical scheme is as follows:
according to an aspect of the embodiments of the present disclosure, there is provided a page refreshing method, including:
receiving an operation instruction for executing a first page operation on a web page;
if the remaining memory resources in the web container corresponding to the web page are enough to execute the first page operation, executing the first page operation in the web page according to the operation instruction, and storing first operation data of the first page operation in a cache region;
if the remaining memory resources in the web container corresponding to the web page are not enough to execute the first page operation, resetting the web page, reading historical operation data from the cache region, and restoring the web page to the state when the operation instruction is received based on the historical operation data, wherein the historical operation data comprises second operation data of at least one second page operation, and the second page operation is a page operation executed on the web page before the operation instruction is received.
In a possible implementation manner, the resetting the web page if the remaining memory resources in the web container corresponding to the web page are not enough to execute the first page operation includes:
if the residual memory resources in the web container corresponding to the web page are not enough to execute the first page operation, releasing the memory resources occupied by a plurality of web pages in a target window, wherein the target window is the web window where the web page is located;
and resetting the web page through the released memory resource based on the script file corresponding to the web page.
In another possible implementation manner, including a form option in the web page, and restoring the web page to a state when the operation instruction is received based on the historical operation data includes:
for second operation data of each second page operation in the historical operation data, acquiring operation parameters corresponding to the second page operation from the second operation data;
and assigning the operation parameters to form options corresponding to the second page operation.
In another possible implementation manner, after the restoring the web page to the state when the operation instruction is received based on the historical operation data, the method further includes:
determining a page operation interface corresponding to the operation instruction from a script file corresponding to the web page according to the operation instruction;
and executing the first page operation according to the operation instruction and the page operation interface.
In another possible implementation manner, the method further includes:
acquiring a first operation frequency of a second page operation which is executed on the web page in a historical way;
adding one to the first operation times to obtain a second operation time;
and if the second operation times reach the maximum operation times corresponding to the web container, determining that the residual memory resources in the web container corresponding to the web page are not enough to execute the first page operation.
In another possible implementation manner, the method further includes:
and acquiring first configuration information from a script file corresponding to the web page, wherein the first configuration information comprises the maximum operation times.
In another possible implementation manner, the method further includes:
obtaining the numerical value of the memory resource which is not released in the web container;
and if the value of the memory resources which are not released reaches a preset resource value, determining that the residual memory resources in the web container corresponding to the web page are not enough to execute the first page operation.
In another possible implementation manner, the method further includes:
and acquiring second configuration information from the script file corresponding to the web page, wherein the second configuration information comprises the preset resource numerical value.
In another possible implementation manner, the method further includes:
if the storage time length of the historical operation data in the cache region reaches a preset time length, deleting the historical operation data; alternatively, the first and second electrodes may be,
and if the residual memory resources in the web container are enough to execute the first page operation and the operation instruction of the first page operation is used for triggering the web page to jump to the next web page, executing the first page operation in the web page according to the operation instruction, and deleting the historical operation data corresponding to the web page in the cache region.
According to another aspect of the embodiments of the present disclosure, there is provided a page refreshing apparatus, including:
the receiving module is configured to receive an operation instruction for executing a first page operation on a web page;
the execution module is configured to execute the first page operation in the web page according to the operation instruction if the remaining memory resources in the web container corresponding to the web page are enough to execute the first page operation;
a storage module configured to perform storing first operation data of the first page operation into a cache region;
the resetting module is configured to reset the web page if the residual memory resources in the web container corresponding to the web page are not enough to execute the first page operation;
and the recovery module is configured to read historical operation data from the cache region, and recover the web page to a state when the operation instruction is received based on the historical operation data, wherein the historical operation data comprises second operation data of at least one second page operation, and the second page operation is a page operation executed on the web page before the operation instruction is received.
In a possible implementation manner, the resetting module is further configured to release the memory resources occupied by the multiple web pages in the target window if the remaining memory resources in the web container corresponding to the web page are not enough to execute the first page operation, where the target window is the web window where the web page is located; and resetting the web page through the released memory resource based on the script file corresponding to the web page.
In another possible implementation manner, the web page includes a form option, and the recovery module is further configured to execute second operation data for each second page operation in the historical operation data, and obtain an operation parameter corresponding to the second page operation from the second operation data; and assigning the operation parameters to form options corresponding to the second page operation.
In another possible implementation manner, the execution module is further configured to execute, according to the operation instruction, determining a page operation interface corresponding to the operation instruction from a script file corresponding to the web page; and executing the first page operation according to the operation instruction and the page operation interface.
In another possible implementation manner, the apparatus further includes:
a first acquisition module configured to execute a first operation number of acquiring a second page operation historically executed on the web page;
the counting module is configured to execute adding one to the first operation times to obtain a second operation time;
and the first determining module is configured to determine that the remaining memory resources in the web container corresponding to the web page are not enough to execute the first page operation if the second operation times reaches the maximum operation times corresponding to the web container.
In another possible implementation manner, the first obtaining module is further configured to perform obtaining of first configuration information from a script file corresponding to the web page, where the first configuration information includes the maximum operation times.
In another possible implementation manner, the apparatus further includes:
a second obtaining module configured to perform obtaining a value of the memory resource that is not released in the web container;
and the second determining module is configured to determine that the residual memory resources in the web container corresponding to the web page are not enough to execute the first page operation if the value of the memory resources which are not released reaches a preset resource value.
In another possible implementation manner, the second obtaining module is further configured to perform obtaining of second configuration information from a script file corresponding to the web page, where the second configuration information includes the preset resource value.
In another possible implementation manner, the apparatus further includes:
the deleting module is configured to delete the historical operation data if the storage duration of the historical operation data in the cache region reaches a preset duration; alternatively, the first and second electrodes may be,
the deleting module is further configured to execute the first page operation in the web page according to the operation instruction if the remaining memory resources in the web container are enough to execute the first page operation and the operation instruction of the first page operation is used for triggering the web page to jump to a next web page, and delete the historical operation data corresponding to the web page in the cache region.
According to another aspect of the embodiments of the present disclosure, there is provided a terminal, where the terminal includes a processor and a memory, where the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the page refresh method according to any one of the foregoing possible implementation manners.
According to another aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium, where at least one instruction is stored, and the at least one instruction is loaded and executed by a processor to implement the page refreshing method according to any one of the foregoing possible implementation manners.
According to another aspect of the embodiments of the present disclosure, there is provided a computer program product, wherein at least one instruction of the computer program product, when executed by a processor of a terminal, enables the terminal to perform the page refresh method described in any one of the above possible implementations.
In the embodiment of the disclosure, the terminal can reset the web page when the remaining memory resources of the web container are insufficient to execute the first page operation, release the memory resources, and prevent the memory leakage of the web container, and the terminal can read the historical operation data from the cache region when resetting the web page, and recover the second page operation executed in the history in the web page, so that the user does not need to execute the second page operation again after resetting the web page, and the efficiency of executing the page operation can be improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present disclosure, and it is obvious for those skilled in the art to obtain other drawings based on the drawings without creative efforts.
FIG. 1 is a schematic diagram of an implementation environment shown in accordance with an exemplary embodiment;
FIG. 2 is a flow diagram illustrating a page refresh method in accordance with an exemplary embodiment;
FIG. 3 is a flow diagram illustrating a page refresh method in accordance with an exemplary embodiment;
FIG. 4 is a flowchart illustrating a page refresh method in accordance with an exemplary embodiment;
FIG. 5 is a block diagram illustrating a page refresh apparatus in accordance with an exemplary embodiment;
fig. 6 is a block diagram illustrating a terminal according to an example embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The user information to which the present disclosure relates may be information authorized by the user or sufficiently authorized by each party.
FIG. 1 is a schematic diagram of an implementation environment provided by embodiments of the present disclosure. Referring to fig. 1, the implementation environment includes a terminal 101 and a server 102; the terminal 101 and the server 102 are connected via a wireless or wired network. Moreover, a client that the server 102 provides services may be installed on the terminal 101, and a user corresponding to the terminal 101 may implement functions such as data transmission and message interaction through the client.
The terminal 101 may be a computer, a mobile phone, a tablet computer or other electronic devices. The client may be any client installed on the terminal 101; the client may be a client in the operating system of the terminal 101, or may be a client provided by a third party. For example, the client may be a browser or any application that includes a WebView control. For example, any application that includes a WebView control may be a news application or a social application, among others. Any application that includes WebView may expose a web page through a WebView control. The server 102 may be a background server corresponding to the client. Accordingly, the server 102 may be a browser server 102, a news application server 102, or a social application server 102, among others.
FIG. 2 is a flow diagram illustrating a page refresh method in accordance with an exemplary embodiment. Referring to fig. 2, the page refresh method includes the steps of:
in step S201, an operation instruction for performing a first page operation on a web page is received.
In step S202, if the remaining memory resources in the web container corresponding to the web page are sufficient to execute the first page operation, the first page operation is executed in the web page according to the operation instruction.
In step S203, first operation data of the first page operation is stored into the buffer area.
It should be noted that step S202 and step S203 do not have a strict chronological order; step S202 may be executed first, and then step S203 may be executed; step S203 may be executed first, and then step S202 may be executed; step S202 and step S203 may also be performed simultaneously; in the embodiment of the present disclosure, the execution order of step S202 and step S203 is not particularly limited.
In step S204, if the remaining memory resources in the web container corresponding to the web page are not enough to execute the first page operation, the web page is reset.
In step S205, historical operation data is read from the buffer, and the web page is restored to the state when the operation instruction is received based on the historical operation data, where the historical operation data includes second operation data of at least one second page operation, and the second page operation is a page operation performed on the web page before the operation instruction is received.
In the embodiment of the disclosure, the terminal can reset the web page when the remaining memory resources of the web container are insufficient to execute the first page operation, release the memory resources, and prevent the memory leakage of the web container, and the terminal can read the historical operation data from the cache region when resetting the web page, and recover the second page operation executed in the history in the web page, so that the user does not need to execute the second page operation again after resetting the web page, and the efficiency of executing the page operation can be improved.
FIG. 3 is a flow chart illustrating a page refresh method in accordance with an exemplary embodiment. Referring to fig. 3, the page refresh method includes the steps of:
in step S301, the terminal receives an operation instruction for performing a first page operation on a web page.
The user can trigger the first page operation in the web page, the terminal can receive an operation instruction of the first page operation, and the first page operation is executed in the web page according to the operation instruction. For example, a user performs input, query or submission in a web page by means of clicking, sliding, gesture operation or the like, the terminal may receive an operation instruction of an operation such as input, query or submission triggered by the user, and execute a corresponding input, query or submission event in the web page according to the operation instruction.
Form options may be included in the web page, which may be text boxes, password boxes, hidden fields, multi-line text boxes, check boxes, radio boxes, drop-down selection boxes, or file upload boxes, among others. Form buttons may also be included in the web page, which are used to trigger operations. For example, the form button may be a submit button, and when the terminal receives an operation instruction to perform a trigger operation on the submit button, the data in the form option is transmitted to the server.
The first page operation may be a click operation on a form button, an input or selection operation on a form option, or the like. When a user triggers a click operation on a form button, an input operation or a selection operation on a form option on a web page, the terminal can receive an operation instruction for executing a first page operation on the web page.
For example, a text box for filling in a name and a submit button, etc. are included in the web page. The user can input the name 'Liquan' in a text box in the web page, the terminal receives the operation instruction of the 'Liquan' input in the text box, and the 'Liquan' is written into the text box. When a user clicks a submit button, the terminal receives an operation instruction for uploading the Liquan in the text box in the web page to the server, and the Liquan in the text box is uploaded to the server.
It should be noted that before the terminal receives the operation instruction for executing the first page operation on the web page, it is further required to obtain a script file corresponding to the web page, and render the web page based on the script file.
The terminal can obtain the script file through the server and render the web page based on the script file. Correspondingly, the step of rendering the web page by the terminal may be: a web container on the terminal sends a request to a server through a Uniform Resource Locator (URL) of a web page; the server returns an HTML (HyperText markup language) file; and the terminal analyzes the HTML file, and when the HTML file comprises the script file corresponding to the web page, the terminal renders the web page based on the script file.
And the web page obtained by rendering based on the script file is the initialization state corresponding to the web page. For example, the input box is included in the web page, and the input box in the initialization state corresponding to the web page is empty.
The script file at least comprises page data corresponding to the web page; the page data is used to render a web interface. The script file may also include a page refresh method. The script file may be developed in the form of a js (javascript, an interpreted scripting language) script file or an npm (Node Package Manager, a Package Manager based on a javascript operating environment) Package.
Fig. 4 is a flowchart illustrating a page refreshing method according to an exemplary embodiment, and referring to fig. 4, the terminal first obtains a script file corresponding to the web page, and renders the web page based on the script file, i.e., performs page initialization. The manner of page initialization may be to initialize a script instance and load configuration items. The script instance may be an HTML file corresponding to the web page.
In step S302, if the remaining memory resources in the web container corresponding to the web page are sufficient to execute the first page operation, the terminal executes the first page operation in the web page according to the operation instruction.
The terminal can determine a page operation interface corresponding to the operation instruction from the script file corresponding to the web page according to the operation instruction; and executing the first page operation according to the operation instruction and the page operation interface.
For example, a form button included in the web page is a submit button, and the page operation interface may be a submit interface. The user clicks the submission button to trigger the submission of the data in the form options in the web page; the method comprises the steps that a terminal receives an operation instruction used for submitting data in a menu option in a web page, and a submission interface corresponding to the operation instruction is determined from a script file according to the operation instruction; and according to the operation instruction and the submission interface, executing submission operation on the data in the menu option in the web page.
The web page on which the terminal executes the first page operation may be a web page on which page initialization is performed for the first time and rendering is completed. The web page on which the terminal performs the first page operation may also be a web page on which page initialization is performed again after reset. If the web page is a web page rendered for the first time, continuing with fig. 4, the first operation data of the first page operation is not stored in the cache region, that is, the filtering item of the current page does not exist in the local cache, and the terminal executes step 303. Moreover, the terminal can receive an operation instruction for executing the page operation on the web page, that is, the user can continue to input the form screening item in the web page and execute the form query operation.
If the web page is the web page which is initialized again after being reset, the historical operation data corresponding to the web page is stored in the cache region, namely the screening item of the current page exists in the local cache, the terminal can acquire the historical operation data from the cache region, and restore the state of the web page before being reset based on the historical operation data, namely the screening item in the cache region is assigned to the form data. And after the terminal recovers the state before the web page is reset, the terminal can also continue to receive the operation instruction for executing the page operation on the web page, that is, the user can continue to input the form screening item in the web page and execute the form query operation.
Before the terminal executes the first page operation in the web page according to the operation instruction, it may first determine whether the remaining memory resources of the web container are sufficient to execute the first page operation.
In one possible implementation manner, the terminal may determine whether the remaining memory resources of the web container are sufficient to execute the first page operation according to the number of page operations executed by the web window where the web page is located. Accordingly, the step of the terminal determining whether the remaining memory resources of the web container are sufficient to execute the first page operation may be: the terminal acquires a first operation frequency of a second page operation which is executed on a web page in a historical manner; adding one to the first operation times to obtain a second operation time; and if the second operation times reach the maximum operation times corresponding to the web container, determining that the residual memory resources in the web container are not enough to execute the first page operation. And if the second operation times do not reach the maximum operation times corresponding to the web container, determining that the residual memory resources in the web container are enough to execute the first page operation.
The terminal may record a first operation number of page operations performed on the web page by introducing a counter. The terminal performs a page operation on the web page once, so that the counter is increased by 1. Referring to fig. 4, a user performs a form query operation in a web page; the form query operation is successful; the terminal can obtain the current inquired screening item and trigger the counter; storing the queried screening items in a cache region, namely storing the queried screening items to a local storage; the counter is incremented by 1. Wherein, the terminal may increment the counter by 1 after storing the queried filter item in the buffer. The terminal may also increment the counter by 1 while storing the queried filter in the buffer. The terminal may also increment the counter by 1 when the counter is triggered. The terminal may also increment the counter by 1 after triggering the counter and before storing the queried filter in the buffer. In the embodiment of the present disclosure, the form query operation is successful, i.e., the count is completed, and the specific time for adding 1 to the counter is not specifically limited.
With continued reference to fig. 4, the terminal determines whether the second operation frequency reaches the maximum operation frequency corresponding to the web container, that is, whether the set query frequency is reached. And if the second operation times reach the maximum operation times corresponding to the web container, namely the set query times, executing the page refreshing operation. And if the second operation times do not reach the maximum operation times corresponding to the web container, namely the set query times, skipping the refreshing of the web page without executing the page refreshing operation, namely ending.
The script file corresponding to the web page may include first configuration information, where the first configuration information includes a maximum number of operations. The terminal can obtain first configuration information from the script file corresponding to the web page, and obtain the maximum operation times according to the first configuration information.
The maximum number of operations may be the number of page operations performed when the web container is leaking memory. The maximum number of operations may be a maximum number of operations obtained according to a result of the test for the memory leak of the web container. For example, a test result of memory leakage of a web container shows that the web container crashes when the number of page operations performed by the web container reaches 200 times. The maximum number of operations of the web container may be 190. The maximum number of operations may also be a maximum number of operations corresponding to the web container determined by the big data and machine learning method. In the embodiment of the present disclosure, the method for determining the maximum operation number is not particularly limited.
In another possible implementation manner, the terminal may determine whether the remaining memory resources of the web container are sufficient to perform the page operation according to the memory resources that are not released in the web window where the web page is located. Correspondingly, the step of the terminal determining whether the remaining memory resources of the web container are enough to execute the first page operation may further be: the terminal acquires the numerical value of the memory resource which is not released in the web container; and if the value of the memory resource which is not released reaches the preset resource value, determining that the residual memory resource in the web container is not enough to execute the first page operation. And if the value of the memory resource which is not released does not reach the preset resource value, determining that the residual memory resource in the web container is enough to execute the first page operation.
The preset resource value may be determined according to a memory capacity of the web container. The memory resource value that the web container can allocate to a web window may be used as the preset resource value.
The script file corresponding to the web page may include second configuration information, where the second configuration information includes a preset resource value. The terminal can obtain second configuration information from the script file corresponding to the web page, and obtain a preset resource value according to the second configuration information.
In another possible implementation manner, the terminal may further determine whether the remaining memory resources of the web container are sufficient to execute the first page operation according to the memory resources that are not released in the web window where the web page is located and the memory resources that are needed to execute the first page operation. Accordingly, the step of the terminal determining whether the remaining memory resources of the web container are sufficient to execute the first page operation may be: the terminal acquires a first resource value of the memory resource which is not released in a web window where the web page is located, and a second resource value of the memory resource which is needed to be used for executing the first page operation; and obtaining a third resource value by subtracting the preset resource value from the first resource value. And if the third resource value is smaller than the second resource value, determining that the residual memory resources in the web container are not enough to execute the first page operation. And if the third resource value is larger than the second resource value, determining that the residual memory resources in the web container are enough to execute the first page operation.
For example, the preset resource value that the web container can allocate to one web window is 100, the second resource value of the memory resource that may be occupied for executing the first page operation is 8, the first resource value of the memory resource that is not released by the web window where the web page is located is 95, the difference between the preset resource value and the first resource value is 5, which is smaller than the second resource value 8 of the memory resource that may be occupied for executing the first page operation, and it is determined that the remaining memory resource in the web container is not enough for executing the first page operation.
In another possible implementation manner, the terminal may further determine whether the remaining memory resources of the web container are sufficient to perform the first page operation according to the unoccupied memory resources of the web container. Accordingly, the step of the terminal determining whether the remaining memory resources of the web container are sufficient to execute the first page operation may be: and the terminal acquires a fourth resource value of the unoccupied memory resource of the web container. If the fourth resource value is less than the second resource value that may be occupied by performing the first page operation, it is determined that the remaining memory resources in the web container are insufficient to perform the first page operation. If the fourth resource value is greater than the second resource value that may be occupied by performing the first page operation, it is determined that the remaining memory resources in the web container are sufficient to perform the first page operation.
The terminal may determine whether the remaining memory resources in the web container are sufficient to perform the first page operation through any of the possible implementations described above. The manner of determining whether the remaining memory resources in the web container are sufficient to execute the first page operation in any of the above possible implementations may also be configured as a configuration item in the script file. The terminal may perform the step of determining whether the memory resources remaining in the web container are sufficient to perform the first page operation according to the configuration item of the script file.
In the embodiment of the present disclosure, a service party applying the page refreshing method provided by the embodiment of the present disclosure may configure a manner of determining whether the remaining memory resources in the web container are sufficient to execute the first page operation according to the actual service situation, so that the service implementation is more flexible, and the usability of the page refreshing method is improved.
In step S303, the terminal stores the first operation data of the first page operation in the buffer.
The first operation data comprises an operation object and an operation parameter corresponding to the first page operation. For example, a first page operation performed by the user in the web page is to input "lie four" in the name text box, the first operation data of the first page operation includes an operation object of the name text box, and the first page operation includes an operation parameter of the input "lie four".
The form option is included in the web page, and the first page operation may be an input operation or a click operation performed by a user on the form option in the web page. The first operation data of the first page operation includes an operation object corresponding to the first page operation, that is, a form option corresponding to the first page operation and an operation parameter corresponding to the first page operation.
The operating parameter may be user input or may be user selected from a plurality of options. For example, the form option is a password box, and the operation parameter may be a password entered in the password box. For another example, if the form option is a drop-down selection box, the operation parameter may be any option selected in the drop-down selection box.
The terminal may perform the first page operation in the web page according to the first operation data of the first page operation. Correspondingly, the step of the terminal performing the first page operation in the web page may be: the terminal obtains the form options corresponding to the first page operation and the operation parameters corresponding to the first page operation from the first operation data of the first page operation, writes the operation parameters corresponding to the first page operation in the form options corresponding to the first page operation, and executes the first page operation.
For example, the first page operation is an input operation, and the form option in the web page is a text box. The user clicks on a text box in the web page, triggering an input operation in the text box. The terminal receives input operation of a user and calls an interface for acquiring user input. The user inputs the name "Liquan" through the input method and clicks "Liquan" among the candidate contents in the input method. The terminal obtains the 'Lifours' input by the user through the interface for obtaining the content input by the user; taking "Liquan" as an operating parameter; and writing an operation parameter in the form option of the web page, namely writing 'Liquan' in the text box of the web page.
The form options of the web page can also be pull-down selection boxes, and a user can select required pull-down options from the pull-down options of the pull-down selection boxes by clicking the pull-down selection boxes to filter required data. The pull-down option selected by the user is the target screening option to be written into the pull-down selection box by the terminal. Correspondingly, the step of writing the operation parameters corresponding to the first page operation in the form option corresponding to the first page operation by the terminal may be: when the pull-down selection frame is triggered, the terminal displays a plurality of screening items corresponding to the pull-down selection frame; and acquiring a selected target screening item in the plurality of screening items, and writing the target screening item in the pull-down selection frame.
For example, the web page includes personal information of 10 users, and the personal information of the users includes names, ages, and sexes of the users. Also, a drop-down selection box is included in the web page, and the screen items included in the drop-down selection box are "male" and "female". The user clicks the drop-down selection box, the terminal receives the trigger operation of the drop-down selection box, and a plurality of screening items 'male' and 'female' corresponding to the drop-down selection box are displayed; referring to fig. 4, the user clicks the screening item "male", that is, the user inputs the form screening item, the terminal acquires that the selected target screening item is "male", and the target screening item is written in the drop-down selection box.
In a possible implementation manner, the terminal may obtain first operation data of the first page operation, and store the first operation data in a cache region corresponding to the web container. Correspondingly, the step of the terminal storing the first operation data of the first page operation in the buffer area may be: the terminal obtains a first cache address corresponding to the web container and stores the first operation data into a cache region corresponding to the first cache address. And the first cache address points to a cache region allocated for the web container by the terminal.
In the embodiment of the disclosure, the operation data of the page operation is stored in the cache region, so that historical operation data can be acquired from the cache region when the page is reset, and the page is restored to the state before the page is reset based on the historical operation data, so that the consistency of the data can be ensured, a user does not sense refreshing of the page, and the user experience degree is improved.
In another possible implementation manner, the cache address corresponding to the cache region may be configured in the script file as configuration information, and the terminal may store the operation data in the cache region corresponding to the configuration information according to the configuration information. Correspondingly, the step of the terminal storing the first operation data of the first page operation in the buffer area may be: the terminal acquires third configuration information from the script file; acquiring a second cache address according to the third configuration information; and storing the operation data in a cache region corresponding to the second cache address. The second cache address may point to any cache region of the terminal.
In the embodiment of the present disclosure, the specific location of the cache area for storing the operation data may be configured through the configuration information, so that the method and the device can adapt to more service scenarios, and the service implementation is more flexible.
When the terminal receives the operation instruction of the first page operation, the terminal can store the first operation data into the cache region and then judge whether the remaining memory resources of the web container are enough to execute the first page operation. The terminal can also first determine whether the remaining memory resources of the web container are sufficient to execute the first page operation, and if the remaining memory resources of the web container are sufficient to execute the first page operation, the terminal directly executes the first page operation. And if the residual memory resources of the web container are not enough to execute the first page operation, the terminal stores the first operation data of the first page operation into the cache region.
It should be noted that the first configuration information, the second configuration information, and the third configuration information may be configured in the script file as configuration items. The configuration items can be written in the script file when the script file is developed. The configuration item can also be configured by a service party applying the script file, and the service party can configure the configuration item according to service requirements through a specific terminal or a specific client on the terminal. The terminal can obtain the configuration item corresponding to the script file while obtaining the script file, and loads the configuration item into the script file so as to realize the service requirement of the service party.
The configuration items can also comprise page operation interfaces corresponding to the form buttons, data types of operation data stored in the cache area and the like. In the embodiments of the present disclosure, no specific limitation is imposed.
In the embodiment of the disclosure, the configuration item is introduced into the script file for executing the page refresh, the script file for executing the page refresh can interact with other page operations through the configuration item, and the page refresh operation and other page operations can be introduced and interacted through the configuration item, so that the page refresh operation is decoupled from other page operations, and the script file can be better maintained. And the parameter configurability is realized through the configuration items, and the usability of the script file as a page refreshing tool is improved.
It should be noted that step S302 and step S303 do not have a strict chronological order; step S302 may be performed first, and then step S303 may be performed; step S303 may be executed first, and then step S302 may be executed; step S302 and step S303 may also be performed simultaneously; in the embodiment of the present disclosure, the execution order of step S302 and step S303 is not particularly limited.
In step S304, if the remaining memory resources in the web container corresponding to the web page are not enough to execute the first page operation, the terminal resets the web page.
Continuing to refer to fig. 4, if the remaining memory resources in the web container corresponding to the web page are not enough to execute the first page operation, a page refresh operation is executed, that is, the terminal resets the web page, and releases the occupied memory resources. Correspondingly, the steps can be as follows: the terminal releases memory resources occupied by a plurality of web pages in a target window, wherein the target window is the web window where the web pages are located; and resetting the web page through the released memory resource based on the script file corresponding to the web page.
The reset web page is the initialization state corresponding to the web page. For example, the input box is included in the web page, and the input box in the initialization state corresponding to the web page is empty. The step of resetting the web page by the terminal based on the script file corresponding to the web page through the released memory resource is similar to the step of rendering the web page by the terminal in step S301, and details are not repeated here.
The insufficient memory resources remaining in the web container to perform the first page operation is due to the background existence of web pages in the web container that do not need to be displayed but do not release memory resources. And when the terminal resets the web page based on the script file corresponding to the web page, the unreleased resources in the web window where the web page is located are released.
In a possible implementation manner, the terminal may release the memory resources occupied by all web pages in the target window, where the memory resources are not released.
In another possible implementation manner, the terminal may also release the memory resources occupied by the multiple web pages which do not release the memory resources and have the largest difference between the last refresh time and the current time in the target window. Correspondingly, the step of the terminal releasing the memory resources occupied by the multiple web pages in the target window may be: for each web page without the memory resource released in the target window, the terminal acquires the last refreshing time of the web page without the memory resource released, and obtains the difference value between the last refreshing time and the current time; sorting the difference values corresponding to the web pages without the released memory resources from large to small to obtain a sorting result; and releasing the memory resources occupied by the web pages corresponding to the plurality of difference values at the top of the sequencing result. The number of the time differences from the current time may be 2, 3, or 5, and the like, which is not limited in the embodiment of the present disclosure.
In another possible implementation manner, the terminal may further release the memory resource occupied by a portion of the web page in the target window where the memory resource is not released, and after the terminal releases the memory resource occupied by the portion of the web page, the remaining memory resource in the target window is sufficient to execute the first page operation. Correspondingly, the step of the terminal releasing the memory resources occupied by the multiple web pages in the target window may be: for each web page which does not release the memory resources in the target window, the terminal sequentially releases the memory resources occupied by the web page which does not release the memory resources, acquires a fifth resource value of the released memory resources, and acquires a sixth resource value of the memory resources required for executing the first page operation; and if the fifth resource value is larger than the sixth resource value, the terminal stops releasing the memory resource occupied by the web page.
In step S305, the terminal reads the historical operation data from the cache region, and restores the web page to the state when the operation instruction is received, based on the historical operation data.
The historical operation data comprises second operation data of at least one second page operation, and the second page operation is a page operation executed on the web page before the operation instruction is received.
The historical operation data in the cache region comprises second operation data of at least one second page operation in a period from the rendering of the web page by the terminal to the receiving of the operation instruction for executing the first page operation. And the terminal reads the historical operation data from the cache region and restores the web page to the state when the operation instruction is received based on the historical operation data.
The web page includes a form option, and the step of the terminal restoring the web page to the state when the operation instruction is received based on the historical operation data may be: for second operation data of each second page operation in the historical operation data, acquiring operation parameters corresponding to the second page operation from the second operation data; and assigning the operation parameters to form options corresponding to the second page operation.
For example, the form option is a text box, and the second operation data of a second page operation in the historical operation data includes "lie four" input in the text box. The terminal may read second operation data of the second page operation from the historical operation data, write "lie four" in the text box of the web page based on the second operation data, and restore the state of the text box before the page reset.
In the embodiment of the disclosure, when the terminal resets the web page, the state before the web page is reset can be reserved based on the second operation data of the second page operation, so that zero perception of page refreshing by a user is realized, and the user experience can be improved.
The terminal may automatically perform the first page operation after restoring the web page to the state when the operation instruction is received. Correspondingly, the step of the terminal automatically executing the first page operation may be: determining a page operation interface corresponding to the operation instruction from a script file corresponding to the web page according to the operation instruction; and executing the first page operation according to the operation instruction and the page operation interface.
In the embodiment of the disclosure, after the terminal resets the page, the terminal can continue to execute the corresponding page operation according to the operation instruction, automatically execute the page operation triggered by the user, and can jump to the page to be jumped by the user before the page refresh without triggering the page operation again by the user, so that the user has zero perception on the page refresh, and the experience of the user is improved.
Another point to be noted is that the operation data stored in the cache region is lifecycle, and the operation data stored in the cache region may be deleted periodically or the operation data stored in the cache region may be deleted when a specific condition is satisfied.
In a possible implementation manner, if the storage duration of the historical operation data in the cache region reaches a preset duration, the terminal deletes the historical operation data. The preset time period may be any time period such as 1 minute or 1 hour. The preset duration can also be configured in the script file as a configuration item of the script file. The terminal may start timing when the operation data is stored in the buffer, and delete the operation data when the storage duration of the operation data in the buffer reaches a preset duration.
In another possible implementation manner, if the first page operation triggers the web page to jump to the next web page, the terminal may delete the historical operation data corresponding to the web page corresponding to the first page operation stored in the cache region. Correspondingly, the step of deleting the historical operation data in the buffer by the terminal may be: and if the residual memory resources in the web container are enough to execute the first page operation and the operation instruction of the first page operation is used for triggering the web page corresponding to the first page operation to jump to the next web page, the terminal executes the first page operation in the web page corresponding to the first page operation according to the operation instruction and deletes the historical operation data corresponding to the web page corresponding to the first page operation in the cache region.
For example, the web page includes a form option and a submit button, the first page operation is a click operation on the submit button, when the terminal receives an operation instruction of the first page operation, data corresponding to the form option is submitted to the server, and the next web page is jumped to. And after the data in the web page corresponding to the first page operation is submitted to the server and the next web page is jumped to, the terminal does not need to acquire the historical operation data corresponding to the web page from the cache region any more and recovers the web page, so that the terminal can delete the historical operation data corresponding to the web page.
In another possible implementation manner, if the web window where the web page is located is closed, the terminal may delete the operation data corresponding to the web page stored in the cache region.
The terminal may delete the operation data in the buffer by any of the possible implementations described above. The manner of deleting the operation data in the cache area in any of the above possible implementations may also be configured in the script file as a configuration item. The terminal can execute the step of deleting the operation data in the cache region according to the configuration item of the script file.
In the embodiment of the present disclosure, the operation data stored in the buffer area is deleted, so as to avoid data overflow of the buffer area caused by excessive operation data buffered in the buffer area.
In the embodiment of the disclosure, the terminal can reset the web page when the remaining memory resources of the web container are insufficient to execute the first page operation, release the memory resources, and prevent the memory leakage of the web container, and the terminal can read the historical operation data from the cache region when resetting the web page, and recover the second page operation executed in the history in the web page, so that the user does not need to execute the second page operation again after resetting the web page, and the efficiency of executing the page operation can be improved.
All the above optional technical solutions may be combined arbitrarily to form the optional embodiments of the present disclosure, and are not described herein again.
FIG. 5 is a block diagram illustrating a page refresh apparatus according to an example embodiment. Referring to fig. 5, the apparatus includes:
a receiving module 501 configured to execute receiving an operation instruction for executing a first page operation on a web page;
an execution module 502 configured to execute, if the remaining memory resources in the web container corresponding to the web page are sufficient to execute the first page operation, the first page operation in the web page according to the operation instruction;
a storage module 503 configured to perform storing first operation data of the first page operation into the buffer;
a reset module 504 configured to reset the web page if the remaining memory resources in the web container corresponding to the web page are not sufficient to execute the first page operation;
and the recovery module 505 is configured to read historical operation data from the cache region, and recover the web page to a state when the operation instruction is received based on the historical operation data, wherein the historical operation data comprises second operation data of at least one second page operation, and the second page operation is a page operation executed on the web page before the operation instruction is received.
In another possible implementation manner, the resetting module 504 is further configured to release the memory resources occupied by the multiple web pages in the target window if the remaining memory resources in the web container corresponding to the web page are not enough to execute the first page operation, where the target window is the web window where the web page is located; and resetting the web page through the released memory resource based on the script file corresponding to the web page.
In another possible implementation manner, the web page includes a form option, and the recovery module 505 is further configured to execute second operation data for each second page operation in the historical operation data, and obtain an operation parameter corresponding to the second page operation from the second operation data; and assigning the operation parameters to form options corresponding to the second page operation.
In another possible implementation manner, the execution module 502 is further configured to determine, according to the operation instruction, a page operation interface corresponding to the operation instruction from a script file corresponding to the web page; and executing the first page operation according to the operation instruction and the page operation interface.
In another possible implementation manner, the apparatus further includes:
a first acquisition module configured to execute a first operation number of acquiring a second page operation historically executed on a web page;
the counting module is configured to perform addition of one to the first operation times to obtain a second operation time;
and the first determining module is configured to determine that the residual memory resources in the web container corresponding to the web page are not enough to execute the first page operation if the second operation times reaches the maximum operation times corresponding to the web container.
In another possible implementation manner, the first obtaining module is further configured to perform obtaining of first configuration information from a script file corresponding to the web page, where the first configuration information includes the maximum number of operations.
In another possible implementation manner, the apparatus further includes:
the second acquisition module is configured to execute acquisition of the numerical value of the unreleased memory resource in the web container;
and the second determining module is configured to determine that the residual memory resources in the web container corresponding to the web page are not enough to execute the first page operation if the value of the memory resources which are not released reaches the preset resource value.
In another possible implementation manner, the second obtaining module is further configured to perform obtaining of second configuration information from a script file corresponding to the web page, where the second configuration information includes a preset resource value.
In another possible implementation manner, the deleting module is configured to delete the historical operation data if the storage duration of the historical operation data in the cache region reaches a preset duration; or the deleting module is further configured to execute the first page operation in the web page according to the operation instruction if the remaining memory resources in the web container are enough to execute the first page operation and the operation instruction of the first page operation is used for triggering the web page to jump to the next web page, and delete the historical operation data corresponding to the web page in the cache region.
In the embodiment of the disclosure, the terminal can reset the web page when the remaining memory resources of the web container are insufficient to execute the first page operation, release the memory resources, and prevent the memory leakage of the web container, and the terminal can read the historical operation data from the cache region when resetting the web page, and recover the second page operation executed in the history in the web page, so that the user does not need to execute the second page operation again after resetting the web page, and the efficiency of executing the page operation can be improved.
It should be noted that: the page refreshing apparatus provided in the foregoing embodiment is only illustrated by dividing the functional modules when a page is refreshed, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the terminal is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the page refreshing apparatus and the page refreshing method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
Fig. 6 is a block diagram illustrating a terminal 600 according to an example embodiment. The terminal 600 may be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, motion video Experts compression standard Audio Layer 3), an MP4 player (Moving Picture Experts Group Audio Layer IV, motion video Experts compression standard Audio Layer 4), a notebook computer, or a desktop computer. The terminal 600 may also be referred to by other names such as user equipment, portable terminal, laptop terminal, desktop terminal, etc.
In general, the terminal 600 includes: a processor 601 and a memory 602.
The processor 601 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so on. The processor 601 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 601 may also include a main processor and a coprocessor, where the main processor is a processor for processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 601 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the display screen. In some embodiments, processor 601 may also include an AI (Artificial Intelligence) processor for processing computational operations related to machine learning.
The memory 602 may include one or more computer-readable storage media, which may be non-transitory. The memory 602 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in the memory 602 is used to store at least one instruction for execution by the processor 601 to implement the page refresh method provided by the method embodiments of the present disclosure.
In some embodiments, the terminal 600 may further optionally include: a peripheral interface 603 and at least one peripheral. The processor 601, memory 602, and peripheral interface 603 may be connected by buses or signal lines. Various peripheral devices may be connected to the peripheral interface 603 via a bus, signal line, or circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 604, a touch screen display 605, a camera assembly 606, an audio circuit 607, a positioning component 608, and a power supply 609.
The peripheral interface 603 may be used to connect at least one peripheral related to I/O (Input/Output) to the processor 601 and the memory 602. In some embodiments, the processor 601, memory 602, and peripheral interface 603 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 601, the memory 602, and the peripheral interface 603 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
The Radio Frequency circuit 604 is used for receiving and transmitting RF (Radio Frequency) signals, also called electromagnetic signals. The radio frequency circuitry 604 communicates with communication networks and other communication devices via electromagnetic signals. The rf circuit 604 converts an electrical signal into an electromagnetic signal to transmit, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 604 comprises: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and so forth. The radio frequency circuitry 604 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocols include, but are not limited to: metropolitan area networks, various generation mobile communication networks (2G, 3G, 4G, and 5G), Wireless local area networks, and/or WiFi (Wireless Fidelity) networks. In some embodiments, the radio frequency circuit 604 may also include NFC (Near Field Communication) related circuits, which are not limited by this disclosure.
The display 605 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display screen 605 is a touch display screen, the display screen 605 also has the ability to capture touch signals on or over the surface of the display screen 605. The touch signal may be input to the processor 601 as a control signal for processing. At this point, the display 605 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, the display 605 may be one, providing the front panel of the terminal 600; in other embodiments, the display 605 may be at least two, respectively disposed on different surfaces of the terminal 600 or in a folded design; in still other embodiments, the display 605 may be a flexible display disposed on a curved surface or on a folded surface of the terminal 600. Even more, the display 605 may be arranged in a non-rectangular irregular pattern, i.e., a shaped screen. The Display 605 may be made of LCD (liquid crystal Display), OLED (Organic Light-Emitting Diode), and the like.
The camera assembly 606 is used to capture images or video. Optionally, camera assembly 606 includes a front camera and a rear camera. Generally, a front camera is disposed at a front panel of the terminal, and a rear camera is disposed at a rear surface of the terminal. In some embodiments, the number of the rear cameras is at least two, and each rear camera is any one of a main camera, a depth-of-field camera, a wide-angle camera and a telephoto camera, so that the main camera and the depth-of-field camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize panoramic shooting and VR (Virtual Reality) shooting functions or other fusion shooting functions. In some embodiments, camera assembly 606 may also include a flash. The flash lamp can be a monochrome temperature flash lamp or a bicolor temperature flash lamp. The double-color-temperature flash lamp is a combination of a warm-light flash lamp and a cold-light flash lamp, and can be used for light compensation at different color temperatures.
Audio circuitry 607 may include a microphone and a speaker. The microphone is used for collecting sound waves of a user and the environment, converting the sound waves into electric signals, and inputting the electric signals to the processor 601 for processing or inputting the electric signals to the radio frequency circuit 604 to realize voice communication. For the purpose of stereo sound collection or noise reduction, a plurality of microphones may be provided at different portions of the terminal 600. The microphone may also be an array microphone or an omni-directional pick-up microphone. The speaker is used to convert electrical signals from the processor 601 or the radio frequency circuit 604 into sound waves. The loudspeaker can be a traditional film loudspeaker or a piezoelectric ceramic loudspeaker. When the speaker is a piezoelectric ceramic speaker, the speaker can be used for purposes such as converting an electric signal into a sound wave audible to a human being, or converting an electric signal into a sound wave inaudible to a human being to measure a distance. In some embodiments, audio circuitry 607 may also include a headphone jack.
The positioning component 608 is used to locate the current geographic location of the terminal 600 to implement navigation or LBS (location based Service). The positioning component 608 can be a positioning component based on the GPS (global positioning System) in the united states, the beidou System in china, the graves System in russia, or the galileo System in the european union.
Power supply 609 is used to provide power to the various components in terminal 600. The power supply 609 may be ac, dc, disposable or rechargeable. When the power supply 609 includes a rechargeable battery, the rechargeable battery may support wired or wireless charging. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, the terminal 600 also includes one or more sensors 610. The one or more sensors 610 include, but are not limited to: acceleration sensor 611, gyro sensor 612, pressure sensor 613, fingerprint sensor 614, optical sensor 615, and proximity sensor 616.
The acceleration sensor 611 may detect the magnitude of acceleration in three coordinate axes of the coordinate system established with the terminal 600. For example, the acceleration sensor 611 may be used to detect components of the gravitational acceleration in three coordinate axes. The processor 601 may control the touch screen display 605 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 611. The acceleration sensor 611 may also be used for acquisition of motion data of a game or a user.
The gyro sensor 612 may detect a body direction and a rotation angle of the terminal 600, and the gyro sensor 612 and the acceleration sensor 611 may cooperate to acquire a 3D motion of the user on the terminal 600. The processor 601 may implement the following functions according to the data collected by the gyro sensor 612: motion sensing (such as changing the UI according to a user's tilting operation), image stabilization at the time of photographing, game control, and inertial navigation.
The pressure sensor 613 may be disposed on a side frame of the terminal 600 and/or on a lower layer of the touch display screen 605. When the pressure sensor 613 is disposed on the side frame of the terminal 600, a user's holding signal of the terminal 600 can be detected, and the processor 601 performs left-right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 613. When the pressure sensor 613 is disposed at the lower layer of the touch display screen 605, the processor 601 controls the operability control on the UI interface according to the pressure operation of the user on the touch display screen 605. The operability control comprises at least one of a button control, a scroll bar control, an icon control and a menu control.
The fingerprint sensor 614 is used for collecting a fingerprint of a user, and the processor 601 identifies the identity of the user according to the fingerprint collected by the fingerprint sensor 614, or the fingerprint sensor 614 identifies the identity of the user according to the collected fingerprint. Upon identifying that the user's identity is a trusted identity, the processor 601 authorizes the user to perform relevant sensitive operations including unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings, etc. The fingerprint sensor 614 may be disposed on the front, back, or side of the terminal 600. When a physical button or vendor Logo is provided on the terminal 600, the fingerprint sensor 614 may be integrated with the physical button or vendor Logo.
The optical sensor 615 is used to collect the ambient light intensity. In one embodiment, processor 601 may control the display brightness of touch display 605 based on the ambient light intensity collected by optical sensor 615. Specifically, when the ambient light intensity is high, the display brightness of the touch display screen 605 is increased; when the ambient light intensity is low, the display brightness of the touch display screen 605 is turned down. In another embodiment, the processor 601 may also dynamically adjust the shooting parameters of the camera assembly 606 according to the ambient light intensity collected by the optical sensor 615.
A proximity sensor 616, also known as a distance sensor, is typically disposed on the front panel of the terminal 600. The proximity sensor 616 is used to collect the distance between the user and the front surface of the terminal 600. In one embodiment, when the proximity sensor 616 detects that the distance between the user and the front surface of the terminal 600 gradually decreases, the processor 601 controls the touch display 605 to switch from the bright screen state to the dark screen state; when the proximity sensor 616 detects that the distance between the user and the front surface of the terminal 600 gradually becomes larger, the processor 601 controls the touch display 605 to switch from the breath screen state to the bright screen state.
Those skilled in the art will appreciate that the configuration shown in fig. 6 is not intended to be limiting of terminal 600 and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components may be used.
In an exemplary embodiment, a computer-readable storage medium is further provided, in which at least one instruction is stored, and the at least one instruction is executable by a processor in a terminal to complete the page refresh method in the above-described embodiment. For example, the computer-readable storage medium may be a ROM (Read-Only Memory), a RAM (Random Access Memory), a CD-ROM (Compact Disc Read-Only Memory), a magnetic tape, a floppy disk, an optical data storage device, and the like.
The present disclosure also provides a computer program product, wherein when at least one instruction in the computer program product is executed by a processor of a terminal, the terminal is enabled to implement the page refreshing method provided by the above method embodiments.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A method for page refresh, the method comprising:
receiving an operation instruction for executing a first page operation on a web page;
if the remaining memory resources in the web container corresponding to the web page are enough to execute the first page operation, executing the first page operation in the web page according to the operation instruction, and storing first operation data of the first page operation in a cache region;
if the remaining memory resources in the web container corresponding to the web page are not enough to execute the first page operation, resetting the web page, reading historical operation data from the cache region, and restoring the web page to the state when the operation instruction is received based on the historical operation data, wherein the historical operation data comprises second operation data of at least one second page operation, and the second page operation is a page operation executed on the web page before the operation instruction is received.
2. The method of claim 1, wherein resetting the web page if the remaining memory resources in the web container corresponding to the web page are insufficient to perform the first page operation comprises:
if the residual memory resources in the web container corresponding to the web page are not enough to execute the first page operation, releasing the memory resources occupied by a plurality of web pages in a target window, wherein the target window is the web window where the web page is located;
and resetting the web page through the released memory resource based on the script file corresponding to the web page.
3. The method of claim 1, wherein a form option is included in the web page, and wherein restoring the web page to a state when the operation instruction is received based on the historical operation data comprises:
for second operation data of each second page operation in the historical operation data, acquiring operation parameters corresponding to the second page operation from the second operation data;
and assigning the operation parameters to form options corresponding to the second page operation.
4. The method of claim 1, wherein after restoring the web page to the state at the time the operation instruction was received based on the historical operation data, the method further comprises:
determining a page operation interface corresponding to the operation instruction from a script file corresponding to the web page according to the operation instruction;
and executing the first page operation according to the operation instruction and the page operation interface.
5. The method of claim 1, further comprising:
acquiring a first operation frequency of a second page operation which is executed on the web page in a historical way;
adding one to the first operation times to obtain a second operation time;
and if the second operation times reach the maximum operation times corresponding to the web container, determining that the residual memory resources in the web container corresponding to the web page are not enough to execute the first page operation.
6. The method of claim 1, further comprising:
obtaining the numerical value of the memory resource which is not released in the web container;
and if the value of the memory resources which are not released reaches a preset resource value, determining that the residual memory resources in the web container corresponding to the web page are not enough to execute the first page operation.
7. The method of claim 1, further comprising:
if the storage time length of the historical operation data in the cache region reaches a preset time length, deleting the historical operation data; alternatively, the first and second electrodes may be,
and if the residual memory resources in the web container are enough to execute the first page operation and the operation instruction of the first page operation is used for triggering the web page to jump to the next web page, executing the first page operation in the web page according to the operation instruction, and deleting the historical operation data corresponding to the web page in the cache region.
8. A page refresh apparatus, the apparatus comprising:
the receiving module is configured to receive an operation instruction for executing a first page operation on a web page;
the execution module is configured to execute the first page operation in the web page according to the operation instruction if the remaining memory resources in the web container corresponding to the web page are enough to execute the first page operation;
a storage module configured to perform storing first operation data of the first page operation into a cache region;
the resetting module is configured to reset the web page if the residual memory resources in the web container corresponding to the web page are not enough to execute the first page operation;
and the recovery module is configured to read historical operation data from the cache region, and recover the web page to a state when the operation instruction is received based on the historical operation data, wherein the historical operation data comprises second operation data of at least one second page operation, and the second page operation is a page operation executed on the web page before the operation instruction is received.
9. A terminal, characterized in that the terminal comprises a processor and a memory, the memory having stored therein at least one instruction, the at least one instruction being loaded and executed by the processor to implement the page refresh method according to any one of claims 1-7.
10. A computer-readable storage medium having stored therein at least one instruction, which is loaded and executed by a processor, to implement the page refresh method of any one of claims 1-7.
CN201911228689.2A 2019-12-04 2019-12-04 Page refreshing method, device, terminal and storage medium Active CN110968815B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911228689.2A CN110968815B (en) 2019-12-04 2019-12-04 Page refreshing method, device, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911228689.2A CN110968815B (en) 2019-12-04 2019-12-04 Page refreshing method, device, terminal and storage medium

Publications (2)

Publication Number Publication Date
CN110968815A true CN110968815A (en) 2020-04-07
CN110968815B CN110968815B (en) 2023-06-20

Family

ID=70032849

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911228689.2A Active CN110968815B (en) 2019-12-04 2019-12-04 Page refreshing method, device, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN110968815B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112559922A (en) * 2020-12-08 2021-03-26 歌尔科技有限公司 Page rendering method, terminal device and storage medium
CN112799948A (en) * 2021-02-03 2021-05-14 网易(杭州)网络有限公司 Webpage data processing method and device, electronic equipment and storage medium
CN113590052A (en) * 2021-09-29 2021-11-02 深圳市信润富联数字科技有限公司 Information storage method, device, equipment and storage medium

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1836268A (en) * 2003-06-20 2006-09-20 汤姆森普罗梅特里克公司 System and method for computer based testing using cache and cacheable objects to expand functionality of a test driver application
US20070112913A1 (en) * 2005-11-17 2007-05-17 Bales Christopher E System and method for displaying HTML content from portlet as a page element in a communites framework
US20090210631A1 (en) * 2006-09-22 2009-08-20 Bea Systems, Inc. Mobile application cache system
CN102779177A (en) * 2012-06-27 2012-11-14 优视科技有限公司 Back-up method, restoring method and device of browse history of browser
CN104050253A (en) * 2014-06-12 2014-09-17 北京金山网络科技有限公司 Webpage display method and browser
US20170289186A1 (en) * 2016-03-31 2017-10-05 Stuart Staniford System and method to protect a webserver against application exploits and attacks
CN108959455A (en) * 2018-06-15 2018-12-07 上海陆家嘴国际金融资产交易市场股份有限公司 Single page Web application implementation method, device, computer equipment and storage medium
CN109117274A (en) * 2018-08-28 2019-01-01 Oppo广东移动通信有限公司 Applied to the EMS memory management process of browser, device, terminal and storage medium
CN109948087A (en) * 2017-12-05 2019-06-28 广东欧珀移动通信有限公司 Acquisition methods, device and the terminal of web page resources
CN110109665A (en) * 2018-10-18 2019-08-09 神思旭辉医疗信息技术有限责任公司 A kind of front end UI system and method based on container encapsulation
CN110110262A (en) * 2019-05-07 2019-08-09 海信电子科技(深圳)有限公司 Browser EMS memory management process, device and equipment
CN110209966A (en) * 2019-04-15 2019-09-06 优信拍(北京)信息科技有限公司 A kind of webpage method for refreshing, Web page system and electronic equipment

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1836268A (en) * 2003-06-20 2006-09-20 汤姆森普罗梅特里克公司 System and method for computer based testing using cache and cacheable objects to expand functionality of a test driver application
US20070112913A1 (en) * 2005-11-17 2007-05-17 Bales Christopher E System and method for displaying HTML content from portlet as a page element in a communites framework
US20090210631A1 (en) * 2006-09-22 2009-08-20 Bea Systems, Inc. Mobile application cache system
CN102779177A (en) * 2012-06-27 2012-11-14 优视科技有限公司 Back-up method, restoring method and device of browse history of browser
CN104050253A (en) * 2014-06-12 2014-09-17 北京金山网络科技有限公司 Webpage display method and browser
US20170289186A1 (en) * 2016-03-31 2017-10-05 Stuart Staniford System and method to protect a webserver against application exploits and attacks
CN109948087A (en) * 2017-12-05 2019-06-28 广东欧珀移动通信有限公司 Acquisition methods, device and the terminal of web page resources
CN108959455A (en) * 2018-06-15 2018-12-07 上海陆家嘴国际金融资产交易市场股份有限公司 Single page Web application implementation method, device, computer equipment and storage medium
CN109117274A (en) * 2018-08-28 2019-01-01 Oppo广东移动通信有限公司 Applied to the EMS memory management process of browser, device, terminal and storage medium
CN110109665A (en) * 2018-10-18 2019-08-09 神思旭辉医疗信息技术有限责任公司 A kind of front end UI system and method based on container encapsulation
CN110209966A (en) * 2019-04-15 2019-09-06 优信拍(北京)信息科技有限公司 A kind of webpage method for refreshing, Web page system and electronic equipment
CN110110262A (en) * 2019-05-07 2019-08-09 海信电子科技(深圳)有限公司 Browser EMS memory management process, device and equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
THOMAS STEINER等: "what is in a web view an analysis of progressive web app feature when the means of web access is not a web browser", COMPANION PROCEEDINGS OF THE WEB CONFERENCE *
付冉;杨燕;王帅;徐罡;卢彬;: "基于交互逻辑复用的页面集成框架设计", 计算机工程与设计 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112559922A (en) * 2020-12-08 2021-03-26 歌尔科技有限公司 Page rendering method, terminal device and storage medium
CN112559922B (en) * 2020-12-08 2022-11-22 歌尔科技有限公司 Page rendering method, terminal device and storage medium
CN112799948A (en) * 2021-02-03 2021-05-14 网易(杭州)网络有限公司 Webpage data processing method and device, electronic equipment and storage medium
CN113590052A (en) * 2021-09-29 2021-11-02 深圳市信润富联数字科技有限公司 Information storage method, device, equipment and storage medium
CN113590052B (en) * 2021-09-29 2022-01-07 深圳市信润富联数字科技有限公司 Information storage method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN110968815B (en) 2023-06-20

Similar Documents

Publication Publication Date Title
CN110674022B (en) Behavior data acquisition method and device and storage medium
CN110308956B (en) Application interface display method and device and mobile terminal
CN111880712B (en) Page display method and device, electronic equipment and storage medium
CN108132790B (en) Method, apparatus and computer storage medium for detecting a garbage code
CN110288689B (en) Method and device for rendering electronic map
CN110968815B (en) Page refreshing method, device, terminal and storage medium
CN112749362B (en) Control creation method, device, equipment and storage medium
CN111159604A (en) Picture resource loading method and device
CN111290896A (en) Server pressure testing method, device, equipment and medium
CN111625315A (en) Page display method and device, electronic equipment and storage medium
CN110889060A (en) Webpage display method and device, computer equipment and storage medium
CN112148499A (en) Data reporting method and device, computer equipment and medium
CN112770177B (en) Multimedia file generation method, multimedia file release method and device
CN111241451A (en) Webpage processing method and device, computer equipment and storage medium
CN108132817B (en) Object management method and device
CN110569064A (en) interface identifier generation method, device, equipment and storage medium
CN114140105A (en) Resource transfer method, device, equipment and computer readable storage medium
CN110519319B (en) Method and device for splitting partitions
CN113836426A (en) Information pushing method and device and electronic equipment
CN113301422A (en) Method, terminal and storage medium for acquiring video cover
CN109189525B (en) Method, device and equipment for loading sub-page and computer readable storage medium
CN113312249A (en) Log data generation method, log data display method and device
CN112597417A (en) Page updating method and device, electronic equipment and storage medium
CN112181442A (en) Unloaded page display method, device, terminal, server and storage medium
CN115379274B (en) Picture-based interaction 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