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

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

Info

Publication number
CN110968815B
CN110968815B CN201911228689.2A CN201911228689A CN110968815B CN 110968815 B CN110968815 B CN 110968815B CN 201911228689 A CN201911228689 A CN 201911228689A CN 110968815 B CN110968815 B CN 110968815B
Authority
CN
China
Prior art keywords
page
web
web page
execute
terminal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911228689.2A
Other languages
Chinese (zh)
Other versions
CN110968815A (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.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information 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 Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information 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 page refreshing terminal and a page refreshing 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 the cache region; if the remaining memory resources in the web container are insufficient to perform the first page operation, resetting the web page, reading historical operation data from the cache region, and restoring the web page to a state when the operation instruction is received based on the historical operation data. In the method, 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, the user does not need to execute the operation executed by the history again, and the efficiency of executing the page operation can be improved.

Description

Page refreshing method, device, terminal and storage medium
Technical Field
The disclosure relates to the technical field of electronic equipment, and in particular relates to a page refreshing method, a page refreshing device, a page refreshing terminal and a storage medium.
Background
In electronic devices such as computers, mobile phones, tablet computers, web pages are typically run in a web container such as a browser or WebView of the electronic device. And the web page runs in the web container, so that the memory resource of the web container is occupied. 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 can be caused. Therefore, to avoid memory leakage of the web container, the electronic device may refresh the web page when the memory resources occupied by the web container reach an upper limit.
In the related art, when an electronic device refreshes a web page, the page of the initial state of the web page is directly displayed. For example, the current web page is an information filling page, and when the electronic device refreshes the web page in the process that the user fills in the user information in the web page, the electronic device displays the web page without the user information.
Disclosure of Invention
The embodiment of the disclosure provides a page refreshing method, a 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 page operation executed by a history 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 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 in the web page 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 corresponding to the web page are insufficient to execute the first page operation, resetting the web page, reading historical operation data from the buffer area, and recovering 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 performed on the web page before the operation instruction is received.
In one possible implementation manner, if the remaining memory resources in the web container corresponding to the web page are insufficient to perform the first page operation, resetting the web page includes:
If the residual memory resources in the web container corresponding to the web page are insufficient 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 in which 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 recovering 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 recovering the web page to the state when the operation instruction is received based on the historical operation data, the method further includes:
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, the method further includes:
acquiring a first operation frequency of a second page operation historically executed on the web page;
adding one to the first operation times to obtain second operation times;
and if the second operation times reach the maximum operation times corresponding to the web containers, determining that the residual memory resources in the web containers corresponding to the web pages are insufficient to execute the first page operation.
In another possible implementation, 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, the method further includes:
acquiring the numerical value of the unreleased memory resource in the web container;
and if the value of the unreleased memory resource reaches a preset resource value, determining that the residual memory resource in the web container corresponding to the web page is insufficient to execute the first page operation.
In another possible implementation, 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 value.
In another possible implementation, the method further includes:
if the storage time length of the historical operation data in the cache area reaches the preset time length, deleting the historical operation data; or,
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:
a receiving module configured to perform receiving an operation instruction for performing 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 residual 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;
a resetting module configured to execute resetting the web page if the remaining memory resources in the web container corresponding to the web page are insufficient to execute the first page operation;
and the recovery module is configured to execute the reading of the historical operation data from the cache area, 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 the page operation executed on the web page before the operation instruction is received.
In a possible implementation manner, the reset module is further configured to execute if the remaining memory resources in the web container corresponding to the web page are insufficient to execute the first page operation, release the memory resources occupied by the plurality of web pages in the target window, 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 of each second page operation in the historical operation data, and acquire 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 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, the apparatus further includes:
a first acquisition module configured to perform a first number of operations of acquiring a second page operation historically performed on the web page;
the counting module is configured to perform one-plus-one operation of the first operation times to obtain second operation times;
and the first determining module is configured to execute the determination that the remaining memory resources in the web container corresponding to the web page are insufficient to execute the first page operation if the second operation number reaches the maximum operation number corresponding to the web container.
In another possible implementation manner, the first obtaining module is further configured to obtain first configuration information from a script file corresponding to the web page, where the first configuration information includes the maximum operation number.
In another possible implementation, the apparatus further includes:
a second obtaining module configured to obtain a value of a memory resource not released in the web container;
and the second determining module is configured to execute the determination that the residual memory resources in the web container corresponding to the web page are insufficient to execute the first page operation if the value of the unreleased memory resources reaches the preset resource value.
In another possible implementation manner, the second obtaining module is further configured to obtain 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, the apparatus further includes:
the deleting module is configured to execute the step of deleting the historical operation data if the storage duration of the historical operation data in the cache area reaches the preset duration; or,
The deleting module is further configured to execute the operation instruction for triggering the web page to jump to the next web page if the remaining memory resources in the web container are enough to execute the first page operation, execute the first page operation in the web page according to the operation instruction, 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, including a processor and a memory, where at least one instruction is stored in the memory, where the at least one instruction is loaded and executed by the processor, so as to implement a page refreshing method according to any one of the possible implementations described above.
According to another aspect of the embodiments of the present disclosure, there is provided a computer readable storage medium having stored therein at least one instruction that is loaded and executed by a processor to implement the page refresh method described in any one of the possible implementations.
According to another aspect of the disclosed embodiments, a computer program product is provided, which when at least one instruction in the computer program product is executed by a processor of a terminal, enables the terminal to perform the page refresh method described in any one of the possible implementations.
In the embodiment of the disclosure, when the remaining memory resources of the web container are insufficient to execute the first page operation, the terminal can reset the web page, release the memory resources and prevent the memory leakage of the web container, and when the web page is reset, the terminal can read the historical operation data from the cache region and recover the second page operation executed in the history in the web page, so that a user does not need to execute the second page operation again after the web page is reset, 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 of the embodiments of the present disclosure, the drawings required for the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present disclosure, and other drawings may be obtained according to these drawings without inventive effort for a person of ordinary skill in the art.
FIG. 1 is a schematic diagram of an implementation environment, shown in accordance with an exemplary embodiment;
FIG. 2 is a flow chart illustrating a method of page refresh according to an exemplary embodiment;
FIG. 3 is a flowchart illustrating a method of page refresh according to an exemplary embodiment;
FIG. 4 is a flowchart illustrating a method of page refresh according to an exemplary embodiment;
FIG. 5 is a block diagram illustrating a page refresh device according to an exemplary embodiment;
fig. 6 is a block diagram of a terminal according to an exemplary embodiment.
Detailed Description
In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions of 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 foregoing figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the disclosure described herein may be capable of operation in sequences other than those illustrated or described herein. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
The user information referred to in the present disclosure may be information authorized by the user or sufficiently authorized by each party.
FIG. 1 is a schematic illustration 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 by a wireless or wired network. In addition, a client for providing services by the server 102 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 device. The client may be any client installed on the terminal 101; and, the client may be a client in an operating system of the terminal 101, and may also 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, or the like. Any application, including WebView, can expose web pages through WebView controls. Server 102 may be a backend server to which the client corresponds. 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 chart illustrating a method of page refresh according to 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 memory resources remaining in the web container corresponding to the web page are sufficient to perform the first page operation, the first page operation is performed in the web page according to the operation instruction.
In step S203, first operation data of a first page operation is stored in the buffer.
It should be noted that, there is no strict time sequence between the step S202 and the step S203; step S202 may be performed first, and then step S203 may be performed; step S203 may be performed first, and then step S202 may be performed; 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 memory resources remaining in the web container corresponding to the web page are insufficient to perform the first page operation, the web page is reset.
In step S205, the history 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 history operation data, where the history operation data includes at least one second operation data of a second page operation that is a page operation performed on the web page before the operation instruction is received.
In the embodiment of the disclosure, when the remaining memory resources of the web container are insufficient to execute the first page operation, the terminal can reset the web page, release the memory resources and prevent the memory leakage of the web container, and when the web page is reset, the terminal can read the historical operation data from the cache region and recover the second page operation executed in the history in the web page, so that a user does not need to execute the second page operation again after the web page is reset, and the efficiency of executing the page operation can be improved.
FIG. 3 is a flowchart illustrating a method of page refresh according to an exemplary embodiment. Referring to fig. 3, the page refreshing 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 the 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, the user performs input, query or submission in the web page in a clicking, sliding or gesture operation mode, the terminal can receive an operation instruction of the input, query or submission operation triggered by the user, and according to the operation instruction, a corresponding input, query or submission event is executed in the web page.
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 for triggering 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, data in the form option is transmitted to the server.
The first page operation may be a click operation of a form button, an input of a form option, a selection operation, or the like. When the user triggers a clicking operation of a form button, an input of a form option or a selection operation on the web page, the terminal may receive an operation instruction for performing a first page operation on the web page.
For example, a text box for filling in a name, a submit button, and the like are included in the web page. The user can input a name of 'Liqu' in a text box in the web page, the terminal receives an operation instruction of 'Liqu' input in the text box, and writes 'Liqu' in the text box. When the user clicks the submit button, the terminal receives an operation instruction for uploading the 'Li four' in the text box in the web page to the server, and uploads the 'Li four' in the text box 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 acquire the script file through the server, and render the web page based on the script file. Accordingly, the step of rendering the web page by the terminal may be: the web container on the terminal sends a request to the server through the URL (Uniform Resource Locator ) of the web page; the server returns an HTML (HyperText Markup Language ) file; and the terminal analyzes the HTML file, and when the HTML file comprises a script file corresponding to the web page, the terminal renders the web page based on the script file.
And rendering the web page based on the script file to obtain an initialization state corresponding to the web page. For example, the web page includes an input box therein, and the input box in the initialized 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 the web interface. The script file may also include a page refresh method. The script file may be developed in the form of js (javascript, an interpreted script language) script file or npm (Node Package Manager, a package manager based on javascript execution environment) package.
Fig. 4 is a flowchart illustrating a page refreshing method according to an exemplary embodiment, referring to fig. 4, a terminal first acquires a script file corresponding to a web page, and renders the web page based on the script file, i.e., performs page initialization. The page initialization may be by initializing a script instance and loading configuration items. The script instance may be an HTML file corresponding to the web page.
In step S302, if the memory resources remaining 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 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.
For example, the form buttons included in the web page are submit buttons and the page operations interface may be a submit interface. Clicking the submit button by the user to trigger the submission of the data in the form options in the web page; the terminal receives an operation instruction for submitting data in form options in the web page, and determines a submitting interface corresponding to the operation instruction from a script file according to the operation instruction; and executing the submitting operation of the data in the form options in the web page according to the operation instruction and the submitting interface.
The web page where the terminal executes the first page operation may be a web page where the page initialization is performed for the first time and the rendering is completed. The web page where the terminal executes the first page operation may also be a web page that is initialized again after being reset. If the web page is the first rendered web page, with continued reference to fig. 4, the cache area does not store the first operation data of the first page operation, i.e. there is no filtering item of the current page in the local cache, and the terminal performs step 303. And, the terminal may receive an operation instruction for performing a page operation on the web page, that is, the user may continue to input a form screening option in the web page, and perform a form query operation.
If the web page is the web page which is initialized again after being reset, the buffer area stores historical operation data corresponding to the web page, namely, the screening item of the current page exists in the local buffer, the terminal can acquire the historical operation data from the buffer area, and based on the historical operation data, the state of the web page before being reset is restored, namely, the screening item in the buffer area is assigned to the form data. And after the terminal resumes 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 option in the web page and execute the form query operation.
The terminal may first determine whether the memory resources remaining in the web container are sufficient to perform the first page operation before performing the first page operation in the web page according to the operation instruction.
In one possible implementation, the terminal may determine whether the remaining memory resources of the web container are sufficient to perform the first page operation according to the number of page operations that have been performed by the web window in which the web page is located. Accordingly, the step of determining, by the terminal, whether the remaining memory resources of the web container are sufficient to perform the first page operation may be: the terminal acquires first operation times of second page operations historically executed on the web page; adding one to the first operation times to obtain second operation times; 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 insufficient to execute the first page operation. If the second operation times do not reach the maximum operation times corresponding to the web container, determining that the remaining memory resources in the web container are enough to execute the first page operation.
The terminal may record the first operation number of the page operations performed on the web page by introducing a counter. The terminal performs a page operation on the web page once, i.e. the counter is incremented by 1. Referring to fig. 4, a user performs a form query operation in a web page; the form inquiry operation is successful; the terminal can acquire the currently queried screening item and trigger a counter; storing the queried screening items in a cache region, namely storing the queried screening items into a local storage; the counter is incremented by 1. The terminal may increment the counter by 1 after storing the queried filtering term in the buffer. The terminal may also increment the counter by 1 while storing the queried screening term in the buffer. The terminal may also increment the counter by 1 when it is triggered. The terminal may also increment the counter by 1 after triggering the counter before storing the queried screening item in the buffer. In the embodiment of the present disclosure, the form query operation may be counted after successful, 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 number reaches the maximum operation number corresponding to the web container, that is, whether the set query number is reached. And if the second operation times reach the maximum operation times corresponding to the web container, namely the set inquiry times are reached, executing the page refreshing operation. If the second operation times do not reach the maximum operation times corresponding to the web container, namely the set query times, the page refreshing operation is not needed to be executed, and the web page refreshing operation is skipped, namely the operation is finished.
The script file corresponding to the web page can include first configuration information, and the first configuration information includes the maximum operation times. 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 by the web container when memory is about to leak. The maximum number of operations may be a maximum number of operations obtained based on a test result of a memory leak in the web container. For example, as a result of a test for a leak in the memory of a web container, the web container crashes up to 200 times the web container performs a page operation. The web container may be 190 operations at maximum. The maximum number of operations may also be a maximum number of operations corresponding to the web container determined by the machine learning method through big data. In the embodiment of the present disclosure, the method for determining the maximum number of operations 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 unreleased memory resources in the web window in which the web page is located. Accordingly, the step of determining, by the terminal, whether the remaining memory resources of the web container are sufficient to perform the first page operation may further be: the terminal acquires the value of the unreleased memory resource in the web container; if the value of the unreleased memory resource reaches the preset resource value, determining that the remaining memory resource in the web container is insufficient to perform the first page operation. If the value of the unreleased memory resource does not reach the preset resource value, determining that the remaining memory resource in the web container is sufficient to perform the first page operation.
The preset resource value may be determined based on the 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 can include second configuration information, and the second configuration information includes a preset resource value. The terminal can acquire second configuration information from the script file corresponding to the web page, and acquire the 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 perform the first page operation according to the unreleased memory resources in the web window in which the web page is located and the memory resources required to perform the first page operation. Accordingly, the step of determining, by the terminal, whether the remaining memory resources of the web container are sufficient to perform the first page operation may be: the method comprises the steps that a terminal obtains a first resource value of memory resources which are not released in a web window where a web page is located, and a second resource value of memory resources which are needed for executing a first page operation; and obtaining a third resource value by subtracting the preset resource value from the first resource value. If the third resource value is less than the second resource value, determining that the remaining memory resources in the web container are insufficient to perform the first page operation. If the third resource value is greater than the second resource value, determining that memory resources remaining in the web container are sufficient to perform the first page operation.
For example, the web container can be allocated to a web window with a preset resource value of 100, a second resource value of 8 for memory resources that may be occupied by executing the first page operation, a first resource value of 95 for memory resources that are not released by the web window in which the web page is located, a difference between the preset resource value and the first resource value of 5, and a second resource value of 8 that is less than the memory resources that may be occupied by executing the first page operation, and it is determined that the remaining memory resources in the web container are insufficient for executing the first page operation.
In another possible implementation, the terminal may further determine whether the memory resources remaining in the web container are sufficient to perform the first page operation based on the memory resources not occupied by the web container. Accordingly, the step of determining, by the terminal, whether the remaining memory resources of the web container are sufficient to perform 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, determining that memory resources remaining 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, determining that memory resources remaining in the web container are sufficient to perform the first page operation.
The terminal may determine, through any of the possible implementations described above, whether the memory resources remaining in the web container are sufficient to perform the first page operation. The manner in which it is determined whether the memory resources remaining in the web container are sufficient to perform the first page operation in any of the possible implementations described above may also be configured in the script file as a configuration item. 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 based on the configuration item of the script file.
In the embodiment of the disclosure, the service party applying the page refreshing method provided by the embodiment of the disclosure can determine whether the residual memory resources in the web container are enough to execute the first page operation according to the service actual condition configuration, so that the service implementation is more flexible, and the usability of the page refreshing method is improved.
In step S303, the terminal stores first operation data of a 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 "li four" in the name text box, the first operation data of the first page operation including an operation object of the name text box, and the first page operation including an operation parameter of "li four" input.
The web page includes form options, and the first page operation may be an input operation or a clicking operation performed by a user on the form options in the web page. The first operation data of the first page operation comprises an operation object corresponding to the first page operation, namely a form option corresponding to the first page operation and an operation parameter corresponding to the first page operation.
The operating parameters may be user entered or may be user selected from a plurality of options. For example, the form option is a password box and the operating parameter may be a password entered in the password box. For another example, the form option is a drop down selection box, and the operating parameter may be any of the options 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. Accordingly, the step of the terminal performing the first page operation in the web page may be: the terminal acquires form options corresponding to the first page operation and operation parameters corresponding to the first page operation from 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. And the terminal receives the input operation of the user and invokes an interface for acquiring the input of the user. The user inputs the name "Lifour" through the input method, clicks "Lifour" in the candidate contents in the input method. The terminal acquires 'Lifour' input by the user through an interface for acquiring the content input by the user; "Lifour" is taken as an operation parameter; writing a parameter in a form option of the web page, i.e. "Lifour" is written in a text box of the web page.
The form options of the web page can also be drop-down selection boxes, and the user can select a required drop-down option from the drop-down options of the drop-down selection boxes by clicking the drop-down selection boxes to screen data required by the user. The drop-down option selected by the user is the target screening option of the drop-down selection frame to be written into by the terminal. Correspondingly, the step of writing the operation parameter corresponding to the first page operation in the form option corresponding to the first page operation by the terminal may be: when the drop-down selection frame is triggered, the terminal displays a plurality of screening options corresponding to the drop-down selection frame; the selected target screening item in the plurality of screening items is obtained, and the target screening item is written in the drop-down selection frame.
For example, 10 pieces of personal information of the user are included in the web page, and the personal information of the user includes the name, age, and sex of the user. Also, a drop down selection box is included in the web page, and the screen options included in the drop down selection box are "male" and "female". The user clicks the drop-down selection frame, the terminal receives triggering operation of the drop-down selection frame, and a plurality of screening options 'men' and 'women' corresponding to the drop-down selection frame are displayed; referring to fig. 4, the user clicks the screen item "man", i.e., the user inputs the form screen item, the terminal acquires the selected target screen item as "man", and writes the target screen item in the drop-down selection box.
In one possible implementation manner, the terminal may acquire first operation data of the first page operation, and store the first operation data in a buffer area 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 acquires a first cache address corresponding to the web container, and stores first operation data into a cache region corresponding to the first cache address. The first cache address points to a cache area allocated by the terminal for the web container.
In the embodiment of the disclosure, the operation data of the page operation is stored in the cache region, so that the history operation data can be obtained 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 history operation data, so that the consistency of the data can be ensured, the refreshing of the page by a user is not perceived, and the user experience is improved.
In another possible implementation manner, the buffer address corresponding to the buffer area may be configured in the script file as configuration information, and the terminal may store the operation data into the buffer area 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 buffer area corresponding to the second buffer address. The second buffer address may point to any buffer area of the terminal.
In the embodiment of the disclosure, the specific position of the buffer area for storing the operation data can be configured through the configuration information, so that more service scenes can be adapted, and service implementation is more flexible.
When the terminal can receive the operation instruction of the first page operation, the terminal can store the first operation data into the buffer area and then judge whether the residual memory resources of the web container are enough to execute the first page operation. The terminal may also determine whether the remaining memory resources of the web container are sufficient to perform the first page operation, and if the remaining memory resources of the web container are sufficient to perform the first page operation, the terminal directly performs the first page operation. If the remaining memory resources of the web container are insufficient to perform the first page operation, the terminal stores 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 acquire the configuration items corresponding to the script file while acquiring the script file, and load the configuration items into the script file so as to realize the service demands of the service party.
The configuration items may also include a page operation interface corresponding to the form buttons, a data type of operation data stored in the buffer area, and the like. In the embodiments of the present disclosure, no specific limitation is imposed.
In the embodiment of the disclosure, the configuration items are introduced into the script file for executing the page refreshing, the script file for executing the page refreshing can interact with other page operations through the configuration items, and the page refreshing operation and the other page operations can be introduced and interacted through the configuration items, so that the page refreshing operation and the other page operations are decoupled, and the script file can be maintained better. And the configurable parameters are realized through the configuration items, so that the usability of the script file as a page refreshing tool is improved.
It should be noted that, there is no strict time sequence between the step S302 and the step S303; step S302 may be performed first, and then step S303 may be performed; step S303 may be performed first, and then step S302 may be performed; 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 insufficient to perform the first page operation, the terminal resets the web page.
With continued reference to fig. 4, if the memory resources remaining in the web container corresponding to the web page are insufficient to perform the first page operation, a page refresh operation is performed, that is, the terminal resets the web page, and the occupied memory resources are released. Accordingly, the steps may be: the terminal releases memory resources occupied by a plurality of web pages in a target window, wherein the target window is a web window in which 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 an initialized state corresponding to the web page. For example, the web page includes an input box therein, and the input box in the initialized 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 will not be described here again.
The insufficient memory resources remaining in the web container to perform the first page operation is due to the existence in the background of the web container of web pages that do not require display but do not release memory resources. And the terminal releases unreleased resources in the web window where the web page is positioned when resetting the web page based on the script file corresponding to the web page.
In one possible implementation, the terminal may release memory resources occupied by all web pages in the target window that do not release memory resources.
In another possible implementation manner, the terminal may also release memory resources occupied by a plurality of web pages in the target window, where the web pages have the largest difference from the last refresh time and the current time, and the web pages do not release memory resources. Correspondingly, the step of releasing the memory resources occupied by the plurality of web pages in the target window by the terminal may be: for each web page without releasing the memory resource in the target window, the terminal acquires the last refreshing time of the web page without releasing the memory resource, and obtains the difference value between the last refreshing time and the current time; ordering the difference value corresponding to each web page without releasing the memory resource from big to small to obtain an ordering result; and releasing the memory resources occupied by the web pages corresponding to the plurality of difference values with the front ordering result. In this embodiment, the number of the current time periods may be 2, 3, or 5, which are the largest, and the present invention is not limited thereto.
In another possible implementation manner, the terminal may further release the memory resources occupied by the portion of the web page in the target window that does not release the memory resources, and after the terminal releases the memory resources occupied by the portion of the web page, the remaining memory resources in the target window are sufficient to execute the first page operation. Correspondingly, the step of releasing the memory resources occupied by the plurality of web pages in the target window by the terminal may be: for each web page without releasing memory resources in the target window, the terminal sequentially releases the memory resources occupied by each web page without releasing memory resources, obtains a fifth resource value of the released memory resources, and obtains a sixth resource value of the memory resources needed for executing the first page operation; and if the fifth resource value is larger than the sixth resource value, stopping releasing the memory resource occupied by the web page by the terminal.
In step S305, the terminal reads the history operation data from the buffer area, and restores the web page to a state when the operation instruction is received based on the history operation data.
The historical operation data includes second operation data of at least one second page operation, the second page operation being a page operation performed on the web page prior to receiving the operation instruction.
The historical operation data in the buffer area includes second operation data of at least one second page operation within a period from when the terminal renders the web page to when the operation instruction for executing the first page operation is received. The terminal reads the historical operation data from the cache area, and based on the historical operation data, the web page is restored to a state when an operation instruction is received.
The web page comprises form options, and the step of the terminal for recovering the web page to the state when the operation instruction is received based on the historical operation data can be as follows: 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 the form options corresponding to the second page operation.
For example, the form option is a text box, and the second operation data of one second page operation in the history operation data includes inputting "litfour" in the text box. The terminal can read second operation data of the second page operation from the historical operation data, write 'Lifour' in a text box of the web page based on the second operation data, and restore the state of the text box before 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 the user can refresh the page to be perceived as zero, and the user experience can be improved.
The terminal may automatically perform the first page operation after restoring the web page to a state when the operation instruction is received. Correspondingly, the step of automatically executing the first page operation by the terminal may be: 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 the embodiment of the disclosure, after the terminal resets the page, the terminal can further continue to execute corresponding page operation according to the operation instruction, automatically execute the page operation triggered by the user, and jump to the page to be jumped before the page refresh without triggering the page operation again by the user, so that the user perceives zero for the page refresh, and the experience of the user is improved.
Another point to be noted is that the operation data stored in the buffer is life-cycled, and the operation data stored in the buffer is deleted periodically or when a specific condition is satisfied.
In one possible implementation, if the storage duration of the historical operation data in the buffer reaches the 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 buffer. Correspondingly, the step of deleting the historical operation data in the buffer area by the terminal may be: 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 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 comprises 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, the data corresponding to the form option is submitted to the server, and the next web page is skipped. The data in the web page corresponding to the first page operation is submitted to the server, after the next web page is jumped, the terminal does not need to acquire the historical operation data corresponding to the web page from the buffer area, and the web page is restored, so that the terminal can delete the historical operation data corresponding to the web page.
In another possible implementation, if the web window in which the web page is located is closed, the terminal may delete the operation data corresponding to the web page stored in the buffer.
The terminal may delete the operation data in the buffer through any of the possible implementations described above. The manner of deleting the operation data in the buffer area in any possible implementation manner may also be configured in the script file as a configuration item. The terminal may execute the step of deleting the operation data in the buffer area according to the configuration item of the script file.
In the embodiment of the disclosure, the operation data stored in the buffer area is deleted, so that overflow of the data in the buffer area caused by excessive operation data cached in the buffer area is avoided.
In the embodiment of the disclosure, when the remaining memory resources of the web container are insufficient to execute the first page operation, the terminal can reset the web page, release the memory resources and prevent the memory leakage of the web container, and when the web page is reset, the terminal can read the historical operation data from the cache region and recover the second page operation executed in the history in the web page, so that a user does not need to execute the second page operation again after the web page is reset, and the efficiency of executing the page operation can be improved.
Any combination of the above-mentioned optional solutions may be adopted to form an optional embodiment of the present disclosure, which is not described herein in detail.
Fig. 5 is a block diagram illustrating a page refresh device according to an exemplary embodiment. Referring to fig. 5, the apparatus includes:
a receiving module 501 configured to perform receiving an operation instruction for performing a first page operation on a web page;
the execution module 502 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 503 configured to perform storing first operation data of a first page operation into a buffer;
A reset module 504 configured to execute 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;
the recovery module 505 is configured to perform reading of historical operation data from the cache area, and based on the historical operation data, recover the web page to a state when the operation instruction is received, 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 another possible implementation manner, the reset module 504 is further configured to execute the step of releasing the memory resources occupied by the plurality of web pages in the target window if the memory resources remaining in the web container corresponding to the web page are insufficient 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 acquire an operation parameter corresponding to the second page operation from the second operation data; and assigning the operation parameters to the form options corresponding to the second page operation.
In another possible implementation manner, the execution module 502 is further configured to execute a page operation interface corresponding to the operation instruction, where the page operation interface corresponding to the operation instruction is determined 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.
In another possible implementation, the apparatus further includes:
a first acquisition module configured to perform a first number of operations of acquiring a second page operation historically performed on a web page;
the counting module is configured to perform one-plus-one operation of the first operation times to obtain second operation times;
the first determining module is configured to determine that the remaining memory resources in the web container corresponding to the web page are insufficient to perform the first page operation if the second operation number reaches the maximum operation number corresponding to the web container.
In another possible implementation manner, the first obtaining module is further configured to obtain first configuration information from a script file corresponding to the web page, where the first configuration information includes a maximum number of operations.
In another possible implementation, the apparatus further includes:
the second acquisition module is configured to acquire the numerical value of the unreleased memory resource in the web container;
And the second determining module is configured to execute the determination that if the value of the unreleased memory resource reaches the preset resource value, the remaining memory resource in the web container corresponding to the web page is insufficient to execute the first page operation.
In another possible implementation manner, the second obtaining module is further configured to obtain 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 execute deleting the historical operation data if the storage duration of the historical operation data in the buffer area reaches a preset duration; or the deleting module is further configured to execute the operation instruction for triggering the web page to jump to the next web page if the remaining memory resources in the web container are enough to execute the first page operation, execute the first page operation in the web page according to the operation instruction, and delete the historical operation data corresponding to the web page in the cache region.
In the embodiment of the disclosure, when the remaining memory resources of the web container are insufficient to execute the first page operation, the terminal can reset the web page, release the memory resources and prevent the memory leakage of the web container, and when the web page is reset, the terminal can read the historical operation data from the cache region and recover the second page operation executed in the history in the web page, so that a user does not need to execute the second page operation again after the web page is reset, and the efficiency of executing the page operation can be improved.
It should be noted that: in the page refreshing device provided in the above embodiment, only the division of the above functional modules is used for illustration, and in practical application, the above functional allocation 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 device and the page refreshing method provided in the foregoing embodiments belong to the same concept, and specific implementation processes of the page refreshing device and the page refreshing method are detailed in the method embodiments and are not described herein again.
Fig. 6 is a block diagram of 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 picture expert compression standard audio plane 3), an MP4 (Moving Picture Experts Group Audio Layer IV, motion picture expert compression standard audio plane 4) player, a notebook computer, or a desktop computer. Terminal 600 may also be referred to by other names of user devices, portable terminals, laptop terminals, desktop terminals, etc.
In general, the terminal 600 includes: a processor 601 and a memory 602.
Processor 601 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 601 may be implemented in at least one hardware form of DSP (Digital Signal Processing ), FPGA (Field-Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array ). The processor 601 may also include a main processor, which is a processor for processing data in an awake state, also called a CPU (Central Processing Unit ), and a coprocessor; a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 601 may integrate a GPU (Graphics Processing Unit, image processor) for rendering and drawing of content required to be displayed by the display screen. In some embodiments, the processor 601 may also include an AI (Artificial Intelligence ) processor for processing computing 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 memory 602 is used to store at least one instruction for execution by processor 601 to implement the page refresh method provided by the method embodiments in 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 a bus or signal line. The individual peripheral devices may be connected to the peripheral device interface 603 via buses, signal lines or a circuit board. Specifically, the peripheral device includes: at least one of radio frequency circuitry 604, a touch display 605, a camera assembly 606, audio circuitry 607, a positioning assembly 608, and a power supply 609.
Peripheral interface 603 may be used to connect at least one Input/Output (I/O) related peripheral to processor 601 and 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, either or both of the processor 601, memory 602, and peripheral interface 603 may be implemented on separate chips or circuit boards, which is not limited in this embodiment.
The Radio Frequency circuit 604 is configured to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 604 communicates with a communication network and other communication devices via electromagnetic signals. The radio frequency circuit 604 converts an electrical signal into an electromagnetic signal for transmission, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 604 includes: antenna systems, RF transceivers, one or more amplifiers, tuners, oscillators, digital signal processors, codec chipsets, subscriber identity module cards, and so forth. The radio frequency circuit 604 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: metropolitan area networks, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and/or WiFi (Wireless Fidelity ) networks. In some embodiments, the radio frequency circuitry 604 may also include NFC (Near Field Communication, short range wireless communication) related circuitry, which is not limited by the present disclosure.
The display screen 605 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display 605 is a touch display, the display 605 also has the ability to collect touch signals at or above the surface of the display 605. The touch signal may be input as a control signal to the processor 601 for processing. At this point, the display 605 may also be used to provide virtual buttons and/or virtual keyboards, also referred to as soft buttons and/or soft keyboards. In some embodiments, the display 605 may be one, providing a 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 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) or other materials.
The camera assembly 606 is used to capture images or video. Optionally, the camera assembly 606 includes a front camera and a rear camera. Typically, the front camera is disposed on the front panel of the terminal and the rear camera is disposed on the rear surface of the terminal. In some embodiments, the at least two rear cameras are any one of a main camera, a depth camera, a wide-angle camera and a tele camera, so as to realize that the main camera and the depth camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize a panoramic shooting and Virtual Reality (VR) shooting function or other fusion shooting functions. In some embodiments, camera assembly 606 may also include a flash. The flash lamp can be a single-color temperature flash lamp or a double-color temperature flash lamp. The dual-color temperature flash lamp refers to a combination of a warm light flash lamp and a cold light flash lamp, and can be used for light compensation under different color temperatures.
The audio circuit 607 may include a microphone and a speaker. The microphone is used for collecting sound waves of users and environments, 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 for voice communication. For the purpose of stereo acquisition or noise reduction, a plurality of microphones may be respectively disposed at different portions of the terminal 600. The microphone may also be an array microphone or an omni-directional pickup microphone. The speaker is used to convert electrical signals from the processor 601 or the radio frequency circuit 604 into sound waves. The speaker may be a conventional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, not only the electric signal can be converted into a sound wave audible to humans, but also the electric signal can be converted into a sound wave inaudible to humans for ranging and other purposes. In some embodiments, the audio circuit 607 may also include a headphone jack.
The location component 608 is used to locate the current geographic location of the terminal 600 to enable navigation or LBS (Location Based Service, location based services). The positioning component 608 may be a positioning component based on the United states GPS (Global Positioning System ), the Beidou system of China, the Granati system of Russia, or the Galileo system of the European Union.
A power supply 609 is used to power the various components in the terminal 600. The power source 609 may be alternating current, direct current, disposable battery or rechargeable battery. When the power source 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 further includes one or more sensors 610. The one or more sensors 610 include, but are not limited to: acceleration sensor 611, gyroscope sensor 612, pressure sensor 613, fingerprint sensor 614, optical sensor 615, and proximity sensor 616.
The acceleration sensor 611 can detect the magnitudes of accelerations on 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 gravitational acceleration in three coordinate axes. The processor 601 may control the touch display screen 605 to display a user interface in a landscape view or a portrait view according to the gravitational acceleration signal acquired by the acceleration sensor 611. The acceleration sensor 611 may also be used for the 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 may collect a 3D motion of the user on the terminal 600 in cooperation with the acceleration sensor 611. The processor 601 may implement the following functions based on the data collected by the gyro sensor 612: motion sensing (e.g., changing UI according to a tilting operation by a user), image stabilization at shooting, game control, and inertial navigation.
The pressure sensor 613 may be disposed at a side frame of the terminal 600 and/or at a lower layer of the touch screen 605. When the pressure sensor 613 is disposed at a side frame of the terminal 600, a grip signal of the terminal 600 by a user may be detected, and a left-right hand recognition or a shortcut operation may be performed by the processor 601 according to the grip 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 controls include 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 the fingerprint of the 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 recognizing 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 for and changing settings, etc. The fingerprint sensor 614 may be provided on the front, back, or side of the terminal 600. When a physical key or vendor Logo is provided on the terminal 600, the fingerprint sensor 614 may be integrated with the physical key or vendor Logo.
The optical sensor 615 is used to collect ambient light intensity. In one embodiment, processor 601 may control the display brightness of touch display 605 based on the intensity of ambient light collected by optical sensor 615. Specifically, when the intensity of the ambient light is high, the display brightness of the touch display screen 605 is turned up; 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 based on the ambient light intensity collected by the optical sensor 615.
A proximity sensor 616, also referred to as a distance sensor, is typically provided on the front panel of the terminal 600. The proximity sensor 616 is used to collect the distance between the user and the front of the terminal 600. In one embodiment, when the proximity sensor 616 detects a gradual decrease in the distance between the user and the front face of the terminal 600, the processor 601 controls the touch display 605 to switch from the bright screen state to the off screen state; when the proximity sensor 616 detects that the distance between the user and the front surface of the terminal 600 gradually increases, the processor 601 controls the touch display screen 605 to switch from the off-screen state to the on-screen state.
Those skilled in the art will appreciate that the structure shown in fig. 6 is not limiting of the terminal 600 and may include more or fewer components than shown, or may combine certain components, or may employ a different arrangement of components.
In an exemplary embodiment, there is also provided a computer-readable storage medium having stored therein at least one instruction executable by a processor in a terminal to perform the page refresh method of 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 which, when at least one instruction in the computer program product is executed by a processor of a terminal, enables the terminal to implement the page refreshing method provided by the above-mentioned 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 adaptations, 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 is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (16)

1. A method of page refreshing, the method comprising:
receiving an operation instruction for executing a first page operation on a web page, wherein the first page operation comprises an input operation or a clicking operation executed by a user on a form option in the 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 in the web page according to the operation instruction, and storing first operation data of the first page operation into a cache region, wherein the first operation data comprises a form option corresponding to the first page operation and an operation parameter corresponding to the first page operation, and the operation parameter is the content input by the user in the form option or any one selected by the user from a plurality of options corresponding to the form option;
if the residual memory resources in the web container corresponding to the web page are insufficient 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 in which the web page is located; resetting the web page based on the script file corresponding to the web page through the released memory resource, reading historical operation data from the cache region, and acquiring operation parameters corresponding to each second page operation in the historical operation data from the second operation data, wherein the historical operation data comprises at least one second page operation second operation data, and the second page operation is the page operation executed on the web page before receiving the operation instruction;
Assigning the operation parameters to form options corresponding to the second page operation;
and executing the first page operation.
2. The method according to claim 1, wherein the method further comprises:
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.
3. The method according to claim 1, wherein the method further comprises:
acquiring a first operation frequency of a second page operation historically executed on the web page;
adding one to the first operation times to obtain second operation times;
and if the second operation times reach the maximum operation times corresponding to the web containers, determining that the residual memory resources in the web containers corresponding to the web pages are insufficient to execute the first page operation.
4. The method according to claim 1, wherein the method further comprises:
acquiring the numerical value of the unreleased memory resource in the web container;
and if the value of the unreleased memory resource reaches a preset resource value, determining that the residual memory resource in the web container corresponding to the web page is insufficient to execute the first page operation.
5. The method according to claim 1, wherein the method further comprises:
if the storage time length of the historical operation data in the cache area reaches the preset time length, deleting the historical operation data; or,
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.
6. A method according to claim 3, characterized in that the method further comprises:
and acquiring first configuration information from a script file corresponding to the web page, wherein the first configuration information comprises the maximum operation times.
7. The method according to claim 4, wherein the method further comprises:
and acquiring second configuration information from the script file corresponding to the web page, wherein the second configuration information comprises the preset resource value.
8. A page refreshing apparatus, the apparatus comprising:
A receiving module configured to perform receiving an operation instruction for performing a first page operation on a web page, the first page operation including an input operation or a click operation performed by a user on a form option in the web page;
the execution module is configured to execute the first page operation in the web page according to the operation instruction if the residual memory resources in the web container corresponding to the web page are enough to execute the first page operation;
a storage module configured to store first operation data of the first page operation into a cache region, where the first operation data includes a form option corresponding to the first page operation and an operation parameter corresponding to the first page operation, where the operation parameter is a content input by the user in the form option, or any one selected by the user from a plurality of options corresponding to the form option;
the resetting module is configured to execute the operation that if the residual memory resources in the web container corresponding to the web page are insufficient to execute the first page operation, the memory resources occupied by a plurality of web pages in a target window are released, wherein the target window is the web window where the web page is located; resetting the web page through the released memory resource based on the script file corresponding to the web page;
The recovery module is configured to read historical operation data from the cache area, and for second operation data of each second page operation in the historical operation data, operation parameters corresponding to the second page operation are obtained from the second operation data, wherein the historical operation data comprises second operation data of at least one second page operation, and the second page operation is executed on the web page before receiving the operation instruction; assigning the operation parameters to form options corresponding to the second page operation;
operations for performing the steps of: and executing the first page operation.
9. The apparatus of claim 8, wherein the execution module is further configured to execute 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.
10. The apparatus of claim 8, wherein the apparatus further comprises:
a first acquisition module configured to perform a first number of operations of acquiring a second page operation historically performed on the web page;
The counting module is configured to perform one-plus-one operation of the first operation times to obtain second operation times;
and the first determining module is configured to execute the determination that the remaining memory resources in the web container corresponding to the web page are insufficient to execute the first page operation if the second operation number reaches the maximum operation number corresponding to the web container.
11. The apparatus of claim 8, wherein the apparatus further comprises:
a second obtaining module configured to obtain a value of a memory resource not released in the web container;
and the second determining module is configured to execute the determination that the residual memory resources in the web container corresponding to the web page are insufficient to execute the first page operation if the value of the unreleased memory resources reaches the preset resource value.
12. The apparatus of claim 8, wherein the apparatus further comprises:
the deleting module is configured to execute the step of deleting the historical operation data if the storage duration of the historical operation data in the cache area reaches the preset duration; or,
the deleting module is further configured to execute the operation instruction for triggering the web page to jump to the next web page if the remaining memory resources in the web container are enough to execute the first page operation, execute the first page operation in the web page according to the operation instruction, and delete the historical operation data corresponding to the web page in the cache region.
13. The apparatus of claim 10, wherein the first obtaining module is further configured to perform obtaining first configuration information from a script file corresponding to the web page, the first configuration information including the maximum number of operations.
14. The apparatus of claim 11, wherein the second obtaining module is further configured to perform obtaining second configuration information from a script file corresponding to the web page, where the second configuration information includes the preset resource value.
15. A terminal comprising a processor and a memory, wherein the memory has stored therein at least one instruction that is loaded and executed by the processor to implement the page refresh method of any of claims 1-7.
16. A computer readable storage medium having stored therein at least one instruction that is loaded and executed by a processor to implement the page refresh method of any 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 CN110968815A (en) 2020-04-07
CN110968815B true 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)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN113590052B (en) * 2021-09-29 2022-01-07 深圳市信润富联数字科技有限公司 Information storage method, device, equipment and storage medium

Citations (4)

* 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
CN108959455A (en) * 2018-06-15 2018-12-07 上海陆家嘴国际金融资产交易市场股份有限公司 Single page Web application implementation method, device, computer equipment 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

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN102779177B (en) * 2012-06-27 2015-07-22 优视科技有限公司 Back-up method, restoring method and device of browse history of browser
CN104050253B (en) * 2014-06-12 2018-09-25 北京猎豹网络科技有限公司 A kind of web page display method and browser
US10432650B2 (en) * 2016-03-31 2019-10-01 Stuart Staniford System and method to protect a webserver against application exploits and attacks
CN109948087B (en) * 2017-12-05 2021-11-16 Oppo广东移动通信有限公司 Webpage resource obtaining method and device and terminal
CN112882832B (en) * 2018-08-28 2024-06-21 Oppo广东移动通信有限公司 Memory management method, device, terminal and storage medium applied to browser
CN110110262B (en) * 2019-05-07 2021-06-29 海信电子科技(深圳)有限公司 Browser memory management method, device and equipment

Patent Citations (4)

* 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
CN108959455A (en) * 2018-06-15 2018-12-07 上海陆家嘴国际金融资产交易市场股份有限公司 Single page Web application implementation method, device, computer equipment 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

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
what is in a web view an analysis of progressive web app feature when the means of web access is not a web browser;Thomas Steiner等;companion proceedings of the web conference;789-796 *
基于交互逻辑复用的页面集成框架设计;付冉;杨燕;王帅;徐罡;卢彬;;计算机工程与设计;第36卷(第02期);539-545 *

Also Published As

Publication number Publication date
CN110968815A (en) 2020-04-07

Similar Documents

Publication Publication Date Title
CN108776568B (en) Webpage display method, device, terminal and storage medium
CN110674022B (en) Behavior data acquisition method and device and storage medium
CN110308956B (en) Application interface display method and device and mobile terminal
CN111597008A (en) Popup management method, popup management device, terminal and storage medium
CN113127130B (en) Page jump method, device and storage medium
CN110362366B (en) Application interface display method and device
CN110968815B (en) Page refreshing method, device, terminal and storage medium
CN108132790B (en) Method, apparatus and computer storage medium for detecting a garbage code
CN112749362B (en) Control creation method, device, equipment and storage medium
CN110851823B (en) Data access method, device, terminal and storage medium
CN111796990B (en) Resource display method, device, terminal and storage medium
CN111159604A (en) Picture resource loading method and device
CN111625315A (en) Page display method and device, electronic equipment and storage medium
CN110889060A (en) Webpage display method and device, computer equipment and storage medium
CN113918258A (en) Page rolling processing method, device, terminal and storage medium
CN110032421B (en) Method and device for managing atlas in memory, terminal and storage medium
CN111241451A (en) Webpage processing method and device, computer equipment and storage medium
CN111275607A (en) Interface display method and device, computer equipment and storage medium
CN108132817B (en) Object management method and device
CN109189525B (en) Method, device and equipment for loading sub-page and computer readable storage medium
CN113836426A (en) Information pushing method and device and electronic equipment
CN113301422A (en) Method, terminal and storage medium for acquiring video cover
CN113312249A (en) Log data generation method, log data display method and device
CN115379274B (en) Picture-based interaction method and device, electronic equipment and storage medium
CN113495770A (en) Method, device, terminal and storage medium for displaying application page

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