CN109740098B - Application processing method based on multi-page window and electronic equipment - Google Patents

Application processing method based on multi-page window and electronic equipment Download PDF

Info

Publication number
CN109740098B
CN109740098B CN201811641837.9A CN201811641837A CN109740098B CN 109740098 B CN109740098 B CN 109740098B CN 201811641837 A CN201811641837 A CN 201811641837A CN 109740098 B CN109740098 B CN 109740098B
Authority
CN
China
Prior art keywords
page window
application
page
window
counter
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
CN201811641837.9A
Other languages
Chinese (zh)
Other versions
CN109740098A (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.)
Shenzhen Dianmao Technology Co Ltd
Original Assignee
Shenzhen Dianmao 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 Shenzhen Dianmao Technology Co Ltd filed Critical Shenzhen Dianmao Technology Co Ltd
Priority to CN201811641837.9A priority Critical patent/CN109740098B/en
Publication of CN109740098A publication Critical patent/CN109740098A/en
Application granted granted Critical
Publication of CN109740098B publication Critical patent/CN109740098B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses an application processing method based on a multi-page window and electronic equipment, wherein the method comprises the following steps: after the application is started, counting the number of the expanded page windows through a counter; in the process of expanding and operating the page window, storing the resources of the page window locally for sharing by other expanded page windows; when an instruction for closing the current page window is received, hiding the current page window, updating a counter and keeping the storage state of the resource of the current page window; and when an instruction for closing the last page window is received, clearing the resources of each local page window, and exiting the application. When a user closes a certain page window, the page window is not directly closed, but is hidden, so that the resources of the page window can still be used by other applications, namely the resources among the page windows can still be shared, and the application crash is avoided.

Description

Application processing method based on multi-page window and electronic equipment
Technical Field
The invention relates to the technical field of computers, in particular to an application processing method based on a multi-page window and electronic equipment.
Background
In the prior art, a new page window, a jump page window and the like are required in the use process of a website. However, because resources between page windows are shared, when one page window of multiple page windows is closed, the whole application may be crashed, and a new application cannot be restarted.
As part of the application, it may carry the same function as the website, especially for a single-page application, it may be necessary to open more page windows in the application, and in case of conflict of multiple page windows, it may easily cause the crash of the application.
Accordingly, the prior art is yet to be improved and developed.
Disclosure of Invention
In view of the foregoing deficiencies of the prior art, an object of the present invention is to provide an application processing method and an electronic device based on a multi-page window, which aim to solve the problem in the prior art that multiple page windows are prone to cause application crash.
The technical scheme of the invention is as follows:
an application processing method based on a multi-page window comprises the following steps:
after the application is started, counting the number of the expanded page windows through a counter;
in the process of expanding and operating the page window, storing the resources of the page window locally for sharing by other expanded page windows;
when an instruction for closing the current page window is received, hiding the current page window, updating a counter and keeping the storage state of the resource of the current page window;
and when an instruction for closing the last page window is received, clearing the resources of each local page window, and exiting the application.
The application processing method based on the multi-page window is characterized in that the counter is deleted when the application exits.
The application processing method based on the multi-page window further comprises the following steps:
when the application is restarted, a new counter is created.
According to the application processing method based on the multi-page window, after the application is started, an initial page window is opened, and the value of a counter is recorded as 1.
The application processing method based on the multi-page window is characterized in that the application is NW.js application.
The application processing method based on the multi-page window is characterized in that the resources of the page window are stored in a local memory.
The method for processing the application based on the multi-page window, wherein when an instruction for closing the last page window is received, the method for clearing the resources of each local page window and exiting the application specifically comprises the following steps:
when an instruction for closing the last page window is received, closing the last page window and other hidden page windows;
clearing the resources of each local page window;
and exiting the application.
An electronic device, comprising:
a processor adapted to implement the instructions, an
A storage device adapted to store a plurality of instructions, the instructions adapted to be loaded and executed by a processor to:
after the application is started, counting the number of the expanded page windows through a counter;
in the process of expanding and operating the page window, storing the resources of the page window locally for sharing by other expanded page windows;
when an instruction for closing the current page window is received, hiding the current page window, updating a counter and keeping the storage state of the resource of the current page window;
and when an instruction for closing the last page window is received, clearing the resources of each local page window, and exiting the application.
A non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer-executable instructions that, when executed by one or more processors, cause the one or more processors to perform the multi-page window based application processing method.
A computer program product, wherein the computer program product comprises a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a processor, cause the processor to perform the method of multi-page window based application processing.
Has the advantages that: in the invention, when a user closes a certain page window, the page window is not directly closed, but is hidden, so that the resources of the page window can still be used by other applications, namely the resources among the page windows can still be shared, and the application crash situation is avoided.
Drawings
FIG. 1 is a flowchart illustrating a method for processing an application based on a multi-page window according to a preferred embodiment of the present invention.
Fig. 2 is a block diagram of an electronic device according to a preferred embodiment of the invention.
Detailed Description
The invention provides an application processing method based on a multi-page window and an electronic device, and the invention is further described in detail below in order to make the purpose, technical scheme and effect of the invention clearer and clearer. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a flowchart illustrating a method for processing an application based on a multi-page window according to a preferred embodiment of the present invention, as shown in the figure, the method includes the following steps:
s1, after the application is started, counting the number of the expanded page windows through a counter;
s2, storing the resources of the page window locally for other expanded page windows to share in the expanding operation process of the page window;
s3, when an instruction for closing the current page window is received, hiding the current page window, updating a counter and keeping the storage state of the resource of the current page window;
and S4, when the instruction of closing the last page window is received, clearing the resources of each local page window, and exiting the application.
When the page window receives the closing instruction, the page window is not closed directly, but the corresponding page window is hidden, so that other page windows can still continue to use the resources of the page window, the application can be used normally without breakdown, and meanwhile, when all the page windows are closed, the resources are cleared, the application is quitted, and the condition that excessive memory is not occupied is ensured.
Specifically, in the step S1, after the application is started, the number of the expanded page windows is counted by a counter.
The counter can be temporarily created or can be always stored. The total number of the currently expanded page windows can be monitored and counted through the counter, and the counter is updated every time the total number of the currently expanded page windows changes, namely, the value recorded by the counter is updated.
In step S2, during the page window expanding operation, the resources of the page window are stored locally for being shared by other expanded page windows.
Further, the resources of the page window may be stored in a local memory.
A part of the memory may be allocated to the page window in advance for storing the resource. When the application is quitted, the memories are released, and the system operation efficiency is ensured.
In step S3, when receiving an instruction to close the current page window, hiding the current page window, updating the counter, and maintaining the storage state of the resource of the current page window.
In the invention, when the user closes the current page window, the current page window is not directly closed, but instead, the current page window is hidden, so that the resources stored in the local area in the current page window can be continuously kept in a storage state, and other page windows which are kept to be expanded can continuously use the resources of the current page window, and the problem of program crash can not occur.
In addition, in the invention, the counter is updated to record the number of all the page windows which are expanded currently. For example, the counter value is 5 before the current page window is hidden, and the counter value is updated to be 4 after the current page window is hidden. That is, the counter records the number of all expanded page windows in the current state, not the number of all hidden page windows.
The advantage of updating the counter is that it is convenient to determine whether the number of the expanded page windows is the last one, and if so, then a new action is subsequently performed when the last page window is subjected to a hiding operation.
Specifically, in step S4, when the instruction to close the last page window is received, the resources of the page windows stored locally are cleared, and the application is exited.
That is, when the value of the counter is 1, if the closing operation is performed on the last page window at this time, the resources stored in the local area of each page window are cleared, and then the application is directly exited, that is, all the page windows of the application are closed, so that the occupied memory can be released.
Further, when an instruction for closing the last page window is received, the step of clearing the resources of each page window stored locally and exiting the application specifically includes:
when an instruction for closing the last page window is received, closing the last page window and other hidden page windows;
clearing the resources of each local page window;
and exiting the application.
That is, when the closing operation is performed on the last page window, the last page window may be directly closed (at this time, the page window does not need to be hidden any more), all other hidden page windows are also closed at the same time, and then the corresponding resources stored in the local memory are cleared, and the application is exited.
Further, the counter is deleted upon exiting the application. That is, each time the counter is temporarily created at the time of starting the application, the counter is directly deleted at the time of exiting the application.
Further, the method for processing the application based on the multi-page window further comprises the following steps:
when the application is restarted, a new counter is created.
Because the counter is deleted when the application is exited, when the application is restarted, a counter can be directly created again to count and record the number of all the page windows expanded by the application.
Of course, if a plurality of applications need to be used, when each application is started, a corresponding counter may be created, a corresponding relationship between each counter and the corresponding application is established, and the number of all the expanded page windows of the corresponding application is counted and recorded by the counter. Therefore, even under the condition that multiple applications are used simultaneously, resource sharing can be achieved among the page windows of each single application, closing operation (namely hiding processing) can be performed on the page windows at will, and only when the last page window expanded by the application is closed, the closing processing is directly performed. By the method and the device, the situation that the application is crashed is avoided even under the condition of multiple applications.
Further, after the application is started, an initial page window is opened, and the value of the counter is recorded as 1. That is, when starting the application, an initial page window is opened by default, and the value of the counter may be recorded as 1, that is, the value of the counter in the created counter should be 1.
Further, the application is an nw. Js (original name node-webkit) is a Chromium and node.js based application through which native applications can be written in HTML and JavaScript. Js also allows the invocation of node. js modules from the DOM, enabling a new development model for writing native applications with all Web technologies. The system is written based on HTML5, CSS3, JS and WebGL, supports all api and third-party modules of nodejs, can directly call the nodejs modules by using DOM, is easy to package and distribute, and supports Windows, Linux and Mac OS with 32-bit running environment and 64-bit running environment.
The NW.js application is used as a desktop application and bears the same functions as a website, under most current conditions, the NW.js mainly uses single-page window application, and under the condition, if page windows are opened more in the application or conflict exists among the page windows, the application is easy to crash, so the method can avoid the problem that the NW.js application crashes.
In the invention, the local memory is a cache resource which can be shared under the same domain name, and the operations of modification, clearing, new establishment and the like can be conveniently carried out on the local memory. In the nw.js application, although a plurality of page windows can be opened, if the domain name of the page window itself is not changed, the resource in the same local memory can be operated. The counter is increased by one when a new page window is opened, the counter is decreased by one when the page window is closed, and the page window is hidden instead of quitting when the page window is closed.
In addition, the invention can also analyze the use condition of the page window in a targeted manner, and update the counter accordingly.
For example, when an instruction for closing the current page window is received, the resource occupation condition of the current page window is obtained first, that is, whether the resource stored locally in the current page window is occupied by other page windows is judged, if the resource stored locally in the current page window is not occupied by other page windows, the current page window can be directly closed, because if other page windows do not occupy the resource, the normal use of other page windows cannot be influenced even if the current page window is closed, that is, the application cannot be crashed. If the resources stored in the local of the current page window are occupied by other page windows, the current page window is hidden at the moment, and the storage state of the resources stored in the local of the current page window is kept, so that other page windows can still normally use the resources, and the application is not crashed.
Preferably, the present invention further records the usage of the resource of the page windows, that is, when one page window stores the resource locally, if the resource is used by other page windows, the resource is recorded, and the recorded content includes the page window ID and the number of page windows using the resource, which indicates which page window the resource is used by, and how many page windows using the resource are.
Therefore, when an instruction for closing the current page window is received, the use condition of the resource corresponding to the current page window is obtained, whether the resource corresponding to the current page window is occupied by other page windows or not is obtained, and the resource corresponding to the current page window is correspondingly processed according to the use condition.
In addition, if the resource of one page window is originally used by other page windows, but is not used by other page windows or the used page window is reduced later, the use condition of the resource of the page window is updated at this time, so that whether the page window is closed or not is accurately judged in the following.
In this case, in the present invention, whether to close the page window may be determined according to the above rule, and whether to exit the application may still be determined according to the counting result of the counter whether to receive an instruction to close the last page window, and if so, the resource stored in the local area of each page window is cleared, and the application exits. That is, the counter is used to indicate how many page windows are currently left, if the value of the counter is 1, then only one page window is left, and at this time, a close instruction for the page window is received, then an instruction for closing the last page window is received.
The present invention also provides an electronic device 10, as shown in fig. 2, comprising:
a processor 110 adapted to implement instructions, an
A storage device 120 adapted to store a plurality of instructions adapted to be loaded and executed by the processor 110:
after the application is started, counting the number of the expanded page windows through a counter;
in the process of expanding and operating the page window, storing the resources of the page window locally for sharing by other expanded page windows;
when an instruction for closing the current page window is received, hiding the current page window, updating a counter and keeping the storage state of the resource of the current page window;
and when an instruction for closing the last page window is received, clearing the resources of each local page window, and exiting the application.
The processor 110 may be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), a single chip, an arm (acorn RISC machine) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination of these components. Also, the processor may be any conventional processor, microprocessor, or state machine. A processor may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP core, or any other such configuration.
The storage device 120, which is a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions corresponding to the multi-page window-based application processing method in the embodiment of the present invention. The processor executes various functional applications and data processing of the multi-page window-based application processing method by running a non-volatile software program, instructions and units stored in the storage device, namely, the method embodiment is realized.
The details of the electronic device 10 are described in the above method, and thus will not be described in detail.
The present invention also provides a non-transitory computer-readable storage medium storing computer-executable instructions that, when executed by one or more processors, cause the one or more processors to perform the multi-page window based application processing method.
The invention also provides a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a processor, cause the processor to perform the method of multi-page window based application processing.
It is to be understood that the invention is not limited to the examples described above, but that modifications and variations may be effected thereto by those of ordinary skill in the art in light of the foregoing description, and that all such modifications and variations are intended to be within the scope of the invention as defined by the appended claims.

Claims (8)

1. An application processing method based on a multi-page window is characterized by comprising the following steps:
after the application is started, counting the number of the expanded page windows through a counter;
in the process of expanding and operating the page window, storing the resources of the page window locally for sharing by other expanded page windows;
when an instruction for closing the current page window is received, hiding the current page window, updating a counter and keeping the storage state of the resource of the current page window;
when an instruction for closing the last page window is received, clearing the resources of each local page window, and quitting the application;
when an instruction for closing the last page window is received, clearing the resources of each local page window, and exiting the application specifically comprises the following steps:
when an instruction for closing the last page window is received, closing the last page window and other hidden page windows;
clearing the resources of each local page window;
and exiting the application.
2. The multi-page window based application processing method of claim 1, wherein the counter is deleted upon exiting the application.
3. The multi-page window based application processing method according to claim 2, further comprising the steps of:
when the application is restarted, a new counter is created.
4. The method for processing an application based on multiple page windows as claimed in claim 3, wherein after the application is started, an initial page window is opened and the value of the counter is recorded as 1.
5. The method of claim 1, wherein the application is an nw.js application.
6. The multi-page window based application processing method of claim 1, wherein the resources of the page window are stored in a local memory.
7. An electronic device, comprising:
a processor adapted to implement the instructions, an
A storage device adapted to store a plurality of instructions, the instructions adapted to be loaded and executed by a processor to:
after the application is started, counting the number of the expanded page windows through a counter;
in the process of expanding and operating the page window, storing the resources of the page window locally for sharing by other expanded page windows;
when an instruction for closing the current page window is received, hiding the current page window, updating a counter and keeping the storage state of the resource of the current page window;
and when an instruction for closing the last page window is received, clearing the resources of each local page window, and exiting the application.
8. A non-transitory computer-readable storage medium storing computer-executable instructions that, when executed by one or more processors, cause the one or more processors to perform the method of multi-page window based application processing of any one of claims 1-6.
CN201811641837.9A 2018-12-29 2018-12-29 Application processing method based on multi-page window and electronic equipment Active CN109740098B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811641837.9A CN109740098B (en) 2018-12-29 2018-12-29 Application processing method based on multi-page window and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811641837.9A CN109740098B (en) 2018-12-29 2018-12-29 Application processing method based on multi-page window and electronic equipment

Publications (2)

Publication Number Publication Date
CN109740098A CN109740098A (en) 2019-05-10
CN109740098B true CN109740098B (en) 2022-01-11

Family

ID=66362520

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811641837.9A Active CN109740098B (en) 2018-12-29 2018-12-29 Application processing method based on multi-page window and electronic equipment

Country Status (1)

Country Link
CN (1) CN109740098B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111240757B (en) * 2020-01-03 2024-02-06 北京小米移动软件有限公司 Quick application control method, device and storage medium
CN112148744A (en) * 2020-09-22 2020-12-29 北京字节跳动网络技术有限公司 Page display method and device, electronic equipment and computer readable medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102270133A (en) * 2011-07-18 2011-12-07 百度在线网络技术(北京)有限公司 Method and equipment for showing status of page window
CN105302828A (en) * 2014-07-02 2016-02-03 腾讯科技(深圳)有限公司 Page tag information display method and apparatus, and electronic device
CN107704605A (en) * 2017-10-13 2018-02-16 北京中教在线科技有限公司 It is a kind of based on the user behavior recording method being locally stored
CN108268499A (en) * 2016-12-30 2018-07-10 北京优朋普乐科技有限公司 A kind of Webpage display process and device

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1444591A4 (en) * 2001-11-01 2007-06-06 Yahoo Inc Method and system of facilitating automatic login to a web site using an internet browser
CN102043630A (en) * 2010-12-30 2011-05-04 国网电力科学研究院 Method and system for generating multi-page in framework
CN103064677B (en) * 2012-12-24 2016-06-29 广东威创视讯科技股份有限公司 The management method of a kind of WEB multi-document child window and device
WO2015123891A1 (en) * 2014-02-24 2015-08-27 华为技术有限公司 Multi-page management method and device
US9658995B2 (en) * 2014-04-07 2017-05-23 International Business Machines Corporation Content sharing web page overlay system
CN107193834A (en) * 2016-03-15 2017-09-22 广州市动景计算机科技有限公司 Computing device, device and method for browsing pages
US10007607B2 (en) * 2016-05-31 2018-06-26 Salesforce.Com, Inc. Invalidation and refresh of multi-tier distributed caches
CN107995245B (en) * 2016-10-27 2019-03-15 腾讯科技(深圳)有限公司 A kind of method and terminal of resource-sharing
CN107092473B (en) * 2016-10-31 2020-12-08 北京星选科技有限公司 Desktop application development method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102270133A (en) * 2011-07-18 2011-12-07 百度在线网络技术(北京)有限公司 Method and equipment for showing status of page window
CN105302828A (en) * 2014-07-02 2016-02-03 腾讯科技(深圳)有限公司 Page tag information display method and apparatus, and electronic device
CN108268499A (en) * 2016-12-30 2018-07-10 北京优朋普乐科技有限公司 A kind of Webpage display process and device
CN107704605A (en) * 2017-10-13 2018-02-16 北京中教在线科技有限公司 It is a kind of based on the user behavior recording method being locally stored

Also Published As

Publication number Publication date
CN109740098A (en) 2019-05-10

Similar Documents

Publication Publication Date Title
US10114740B2 (en) Memory management techniques
KR101644666B1 (en) Programming model for synchronizing browser caches across devices and web services
EP2979189B1 (en) Storing data from cache lines to main memory based on memory addresses
US9411743B2 (en) Detecting memory corruption
WO2020181810A1 (en) Data processing method and apparatus applied to multi-level caching in cluster
US9043520B2 (en) Interrupt control method and multicore processor system
CN108089856A (en) The monitor method and device of a kind of page elements
CN110865888A (en) Resource loading method and device, server and storage medium
US20160246724A1 (en) Cache controller for non-volatile memory
CN109740098B (en) Application processing method based on multi-page window and electronic equipment
US9575827B2 (en) Memory management program, memory management method, and memory management device
US11782761B2 (en) Resource management unit for capturing operating system configuration states and offloading tasks
CN111522706A (en) Method and device for monitoring page abnormity of front-end application
US9158690B2 (en) Performing zero-copy sends in a networked file system with cryptographic signing
CN115269544A (en) Database cluster upgrading method and device, electronic equipment and storage medium
CN112667326A (en) Display method and device of popup page, computer equipment and storage medium
CN109408265B (en) IOS abnormal operation protection method and device, terminal equipment and storage medium
CN111078418A (en) Operation synchronization method and device, electronic equipment and computer readable storage medium
CN113536168B (en) Component processing method and device
US11630698B2 (en) Resource management unit for capturing operating system configuration states and swapping memory content
CN107273188B (en) Virtual machine Central Processing Unit (CPU) binding method and device
CN114064357A (en) Data backup method and device, electronic equipment and storage medium
US11892981B2 (en) On demand file sync
CN118051313A (en) Process scheduling method and device, computer readable storage medium and terminal
US20200387416A1 (en) Managing heap metadata corruption

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