[go: up one dir, main page]

CN111026462B - Applet control method, device, apparatus and medium - Google Patents

Applet control method, device, apparatus and medium Download PDF

Info

Publication number
CN111026462B
CN111026462B CN201911258916.6A CN201911258916A CN111026462B CN 111026462 B CN111026462 B CN 111026462B CN 201911258916 A CN201911258916 A CN 201911258916A CN 111026462 B CN111026462 B CN 111026462B
Authority
CN
China
Prior art keywords
applet
target
data
host application
restarted
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
CN201911258916.6A
Other languages
Chinese (zh)
Other versions
CN111026462A (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 Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201911258916.6A priority Critical patent/CN111026462B/en
Publication of CN111026462A publication Critical patent/CN111026462A/en
Application granted granted Critical
Publication of CN111026462B publication Critical patent/CN111026462B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • 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)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the application discloses a small program control method, a small program control device, small program control equipment and a small program control medium, and relates to the communication technology in the technical field of computers. The method comprises the following steps: determining whether there are target applets to be restarted on the host application; the control target applet clears the data in the target applet page stack and the target resource data; and controlling the target applet to bind the target applet page stack after the data is cleared, re-downloading the target resource data, and restarting the target applet through the target applet page stack and the re-downloaded target resource data. According to the embodiment of the application, when an abnormal condition occurs in the running process of the applet, the applet is reloaded without leaving the applet, so that the use time of the applet and the data stored by a user are increased, the white screen rate of the applet is reduced, and the user experience is improved.

Description

Applet control method, device, apparatus and medium
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a communication technology, and especially relates to a small program control method, device, equipment and medium.
Background
The small Program (Mini Program) is an application which can be used without downloading and installing, realizes the dream of ' tentacle accessibility ' of the application, and also embodies the concept of ' run out.
In the actual use process, various abnormal conditions can be inevitably generated in the running process of the applet. For example, a JS report error, a system memory reclamation results in a white screen, or triggering the applet management module to destroy a single applet results in a white screen being opened, etc. When an exception occurs in the applet, the applet is typically entered by exiting the host application and closing the applet, and then reopening the host application; or adding an invalid mark for the applet in the use process of the applet, and when the applet is restarted subsequently, if the invalid mark of the applet is monitored, clearing the memory data of the applet and restarting. However, the two solutions affect the use duration of the applet and the data stored by the user, which increases the white screen rate of the applet and seriously affects the user experience.
Disclosure of Invention
The embodiment of the application provides a method, a device, equipment and a medium for controlling an applet, which are used for reloading the applet without leaving the applet when an abnormal condition occurs in the running process of the applet, thereby prolonging the service time of the applet and saving data of a user, reducing the white screen rate of the applet and improving the user experience.
In a first aspect, an embodiment of the present application provides a method for controlling an applet, including:
Determining whether there are target applets to be restarted on the host application;
controlling the target applet to clear data in a target applet page stack and target resource data;
and controlling the target applet to bind with the target applet page stack after data removal, re-downloading target resource data, and restarting the target applet through the target applet page stack and the re-downloaded target resource data.
The embodiment of the application determines whether the target applet to be restarted exists on the host application, if the target applet to be restarted exists, the target applet is controlled to clear the data and the target resource data in the target applet page stack, the target applet page stack after the target applet is bound with the cleared data is controlled to download the target resource data again, and the target applet is restarted through the target applet page stack and the re-downloaded target resource data. Therefore, when abnormal conditions occur in the operation process of the applet, the applet is reloaded without leaving the applet, so that the use time of the applet and the data stored by a user are increased, the white screen rate of the applet is reduced, and the user experience is improved.
In addition, the applet control method according to the above embodiment of the present application may further have the following additional technical features:
Optionally, determining whether there is a target applet on the host application to be restarted includes:
detecting the state of a screen where an applet displayed on a host application is located;
and if the applet is in the global screen abnormal state, taking the applet as a target applet to be restarted.
One embodiment of the above application has the following advantages or benefits: and determining the applet in which the screen state is the global screen abnormal state as the target applet to be restarted, and laying a foundation for determining the target applet to be restarted.
Optionally, detecting a screen state of an applet shown on the host application includes:
acquiring an applet display diagram on a host application through screen capturing operation, and determining a middle area and other areas of the applet display diagram;
determining whether other color pixel points except for the background color of the applet exist in the middle area;
if yes, determining that the applet is not in a global screen abnormal state;
if not, determining whether other color pixel points except the background color of the applet exist in the other areas, and determining whether the applet is in a non-global screen abnormal state according to the result.
One embodiment of the above application has the following advantages or benefits: the method comprises the steps of dividing the applet display diagram into a plurality of areas, and determining whether the middle area has other color pixel points or not so as to detect whether the screen state of the applet is in a global abnormal screen state or not, so that the detection efficiency of the screen state of the applet is improved.
Optionally, acquiring the applet display on the host application through a screen capturing operation includes:
intercepting window pictures except for a screen window from a window container list of a host application;
and generating an applet display diagram on the host application according to the window pictures.
One embodiment of the above application has the following advantages or benefits: and intercepting all window pictures except the screen window through screen interception operation, and generating an applet display diagram on the host application according to all window pictures, so that information such as a prompt popup window, a keyboard popup window and the like on the applet display screen can be intercepted besides the screen window intercepting the applet, and the detection accuracy of the applet display diagram in an abnormal state is improved.
Optionally, determining whether there are other color pixels in the intermediate region or the other region, except for the applet background color, includes:
determining a difference between the channel value of the pixel point in the middle area or the other area and the channel value of the applet background color;
if the difference value is smaller than the threshold value, determining the pixel point as a background color pixel point; otherwise, determining the pixel point as the pixel point of other colors.
One embodiment of the above application has the following advantages or benefits: based on the relation between the difference value between the channel value of the pixel point in the middle area or other areas and the channel value of the background color of the applet and the threshold value, determining whether the applet display diagram is in a global screen abnormal state or a non-global screen abnormal state, so as to avoid inaccurate screen state of the applet in detection caused by chromatic aberration existing when part of the machine types are screen captured, to realize the introduction of an error threshold value, and to improve the detection accuracy of the applet display diagram in the abnormal state.
Optionally, detecting a screen state of an applet shown on the host application includes:
acquiring an applet displayed on a host application, and determining whether the host application enters a secondary page of the applet;
if yes, determining that the applet is not in the global screen abnormal state.
One embodiment of the above application has the following advantages or benefits: when the host application enters a secondary page of the applet displayed by the host application, determining that the applet is not in a global screen abnormal state so as to optimize the detection flow of the screen state of the applet.
Optionally, determining whether there is a target applet on the host application to be restarted includes:
If any applet on the host application monitors a restarting event, taking the applet as a target applet to be restarted;
the restart event is generated when a trigger operation acting on a restart control in the applet is detected; or upon detection of a failure to launch any applet on the host application.
Optionally, determining whether there is a target applet on the host application to be restarted includes:
if any applet on the host application detects a resource update event, the applet is used as a target applet to be restarted;
wherein the resource update event is generated from resource data published through the applet resource update interface.
Optionally, determining whether there is a target applet on the host application to be restarted includes:
if the host application switches to any applet and the applet page stack already exists, the applet is taken as the target applet to be restarted.
One embodiment of the above application has the following advantages or benefits: by adopting different modes to determine the target applet to be restarted on the host application, the diversity of determining the target applet to be restarted is improved.
Optionally, controlling the target applet to bind to the target applet page stack after the data removal, re-downloading the target resource data, and restarting the target applet through the target applet page stack and the re-downloaded target resource data, including:
The method comprises the steps of controlling a target applet page stack after the target applet binds and clears data through an applet creating instruction;
and controlling the target applet to re-download the target resource data through an applet restarting instruction, displaying the downloading progress of the target resource data through a bound target applet page stack, and restarting the target applet according to the re-downloaded target resource data.
One embodiment of the above application has the following advantages or benefits: the target applet page stack after the data removal is bound by the control target applet so as to acquire the starting data of the target applet, and the target applet is re-created and loaded based on the starting data, so that the target applet is restarted in the running process of the applet, and the user experience is improved.
Optionally, the method further comprises:
and adding a probe for the target applet in the restarting process of the target applet, and acquiring the operation data of the target applet after the restarting of the target applet.
One embodiment of the above application has the following advantages or benefits: and adding a probe to the target applet so as to acquire the operation data of the target applet, thereby realizing positioning of an abnormal source of the target applet according to the operation data and providing conditions for repairing the abnormality.
Optionally, after detecting the state of the screen where the applet is displayed on the host application, the method further includes:
if the applet displayed on the host application is in the abnormal state of the local screen, the control clears the webpage view of the applet, recreates the webpage view and binds the applet.
One embodiment of the above application has the following advantages or benefits: when the applet is determined to be in the abnormal state of the local screen, the webpage view is re-created and bound, so that the exception can be removed only by re-generating the webpage view without restarting the applet.
In a second aspect, an embodiment of the present application further discloses an applet control apparatus, including:
the determining module is used for determining whether a target applet to be restarted exists on the host application;
the first control module is used for controlling the target applet to clear data in a target applet page stack and target resource data;
and the second control module is used for controlling the target applet page stack after the target applet binds and clears the data, re-downloading the target resource data, and restarting the target applet through the target applet page stack and the re-downloaded target resource data.
In a third aspect, an embodiment of the present application further discloses an electronic device, including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the applet control methods according to any one of the embodiments of the application.
In a fourth aspect, embodiments of the present application also disclose a non-transitory computer readable storage medium storing computer instructions for causing a computer to execute the applet control method according to any of the embodiments of the present application.
Other effects of the above alternative will be described below in connection with specific embodiments.
Drawings
The drawings are included to provide a better understanding of the present application and are not to be construed as limiting the application. Wherein:
FIG. 1 is a flow chart of an applet control method according to an embodiment of the application;
FIG. 2 is a flow chart of another method for applet control according to an embodiment of the application;
FIG. 3 is a schematic diagram of segmenting an applet display into multiple scale identical regions according to an embodiment of the present application;
FIG. 4 is a flow chart of another method for applet control according to an embodiment of the application;
FIG. 5 is a flow chart of another method for applet control according to an embodiment of the application;
FIG. 6 is a flow chart of another method for applet control according to an embodiment of the application;
FIG. 7 is a schematic diagram of a small program control device according to an embodiment of the present application;
FIG. 8 is a schematic diagram of another applet control apparatus according to an embodiment of the application;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Exemplary embodiments of the present application will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present application are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Exemplary embodiments of the present application will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present application are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Aiming at the related technology, when the applet is abnormal in the running process, the embodiment of the application re-opens the host application to enter the applet by exiting the host application and closing the applet; or, in the use process of the applet, an invalid mark is added for the applet, if the invalid mark of the applet is monitored when the applet is restarted, the memory data of the applet are cleared and restarted, the use time length of the applet and the data stored by a user are influenced, the blank screen rate of the applet is increased, and the user experience is seriously influenced.
The embodiment of the application controls the target applet to clear the data and the target resource data in the target applet page stack by determining whether the target applet to be restarted exists on the host application, then controls the target applet to bind the target applet page stack after the data is cleared, downloads the target resource data again, and restarts the target applet through the target applet page stack and the re-downloaded target resource data. Therefore, when abnormal conditions occur in the operation process of the applet, the applet is reloaded without leaving the applet, so that the use time of the applet and the data stored by a user are increased, the white screen rate of the applet is reduced, and the user experience is improved.
The following describes in detail the method, apparatus, device and medium for controlling small programs according to the embodiments of the present application with reference to the accompanying drawings.
Fig. 1 is a flow chart of an applet control method according to an embodiment of the present application, where the method is applicable to a restart situation during the execution of an applet, and the method is executed by an applet control device, where the device is provided with an applet management system, where the applet management system includes a host application, an applet management tool, an applet and a navigation stack including different applet page stacks, and where the device is implemented in software and/or hardware and is integrated inside an electronic device. In this embodiment, the electronic device may be any hardware device having a data processing function. The method comprises the following steps:
s101, determining whether a target applet to be restarted exists on the host application.
In the embodiment of the application, the host application refers to an application for providing an operation environment for the applet, so that the applet runs on the electronic device depending on the host application. Where the host application is, for example, a cell phone hundred degrees, etc. Wherein the electronic device may be, but is not limited to: smart phones, tablet computers, personal digital assistants, smart home devices, wearable devices, and the like. Wherein, intelligent house includes: smart televisions, etc.; the wearable device includes: smart wristband, smart watch, etc.
Wherein multiple applets can be run in one host application. For example, applet Y1 and applet Y2 run in host application XX 1.
By way of example, it may be determined whether there are target applets on the host application to be restarted as follows.
Mode one: the method comprises the steps of detecting the screen state of an applet displayed on a host application, and determining a target applet to be restarted on the host application when the screen state of the applet is an abnormal global screen state;
in this embodiment, the applet management tool in the applet management system detects the screen state of the applet shown on the host application to determine whether the target applet to be restarted is present on the host application.
The object applet to be restarted is the applet whose screen state is in the global abnormal screen state.
For example, if the screen state in which the applet a is located is a global screen abnormal state, the applet a is determined as a target applet to be restarted.
Mode two: when any applet on the host application detects a restart event, determining a target applet on the host application to be restarted;
the target applet to be restarted is the applet in which the restart event is detected.
For example, if applet b detects a restart event, applet b is determined to be the target applet to be restarted.
It should be noted that, in this embodiment, when any applet on the host application detects a restart event, the applet will send the restart event to the applet management tool, so that the applet management tool determines the target applet on the host application to be restarted.
Mode three: when any applet on the host application detects a resource update event, determining a target applet to be restarted on the host application;
the target applet to be restarted is the applet which detects the resource updating event.
For example, if applet c detects a resource update event, applet c is determined to be the target applet to be restarted.
Mode four: when the host application switches to any applet and the applet page stack already exists, the target applet on the host application to be restarted is determined.
In this embodiment, when the applet management tool in the applet management system detects that the host application is switched to any applet and the applet page stack already exists, the target applet to be restarted on the host application is determined.
The target applet to be restarted is the applet of the existing page stack.
For example, the host application switches from applet e to applet d, and the page stack for applet d is already in place, at which point applet d is determined to be the target applet to be restarted.
It should be noted that, the above-mentioned four implementation manners of determining whether the target applet is to be restarted on the host application are merely exemplary of the embodiments of the present application, and are not specific limitations of the present application.
S102, controlling the target applet to clear data in a target applet page stack and target resource data.
S103, controlling the target applet to bind with the target applet page stack after data removal, re-downloading target resource data, and restarting the target applet through the target applet page stack and the re-downloaded target resource data.
In the embodiment of the application, the data in the target applet page stack refers to other data except the starting data of the target applet; the target resource data refers to a local resource file of the target applet. The applet starting data refers to data required when the applet is started, and may include an applet id, a source applet id for opening the applet, source applet page data, applet initial page parameters, etc.
In the embodiment of the application, the applet page stack and the applet operation are relatively independent, and the applet page stack is stored in the navigation stack, so that after the control target applet clears other data except the starting data of the target applet in the target applet page stack and the local resource file, the starting data of the target applet also exists in the target applet page stack of the navigation stack, and the target applet can also re-create a new target applet based on the starting data in the target applet page stack after clearing the data.
Illustratively, after the control target applet clears the data in the target applet page stack and the target resource data, the control target applet binds the target applet page stack after clearing the data to obtain the starting data and re-download the target resource data. And restarting the target applet according to the starting data in the target applet page stack after the data is cleared by binding and the target resource data which is downloaded again.
In specific implementation, an instruction can be created through an applet to control the applet to bind the applet page stack after data removal;
and controlling the target applet to re-download the target resource data through an applet restarting instruction, displaying the downloading progress of the target resource data through a bound target applet page stack, and restarting the target applet according to the re-downloaded target resource data.
The target resource data downloading progress is displayed through the target applet page stack, so that a user can intuitively see the target resource data downloading condition of the target applet, and user experience is further improved.
It should be noted that, in the embodiment of the present application, the applet creation instruction and the applet restarting instruction are triggered and generated by an applet management tool in the applet management system.
According to the technical scheme provided by the embodiment of the application, whether the target applet to be restarted exists on the host application is determined, if the target applet to be restarted exists, the target applet is controlled to clear data and target resource data in a target applet page stack, the target applet page stack after the target applet is bound with the cleared data is controlled, the target resource data is downloaded again, and the target applet is restarted through the target applet page stack and the re-downloaded target resource data. Therefore, when abnormal conditions occur in the operation process of the applet, the applet is reloaded without leaving the applet, so that the use time of the applet and the data stored by a user are increased, the white screen rate of the applet is reduced, and the user experience is improved.
On the basis of the above embodiment, S103 further includes:
And adding a probe for the target applet in the restarting process of the target applet, and acquiring the operation data of the target applet after the restarting of the target applet.
According to the embodiment of the application, the probe is added for the target applet so as to acquire the operation data of the target applet, so that the abnormal source of the target applet is positioned according to the operation data, and a condition is provided for repairing the abnormality.
As can be seen from the above description, when determining that the target applet is to be restarted on the host application, the embodiment of the application controls the target applet to bind to the target applet page stack after the data is cleared, and re-downloads the target resource data, so as to restart the target applet through the target applet page stack and the re-downloaded target resource data.
In one implementation scenario, determining whether there are target applets on the host application to restart includes: and detecting the screen state of the applet displayed on the host application, if the applet is in the global screen abnormal state, taking the applet as a target applet to be restarted, and restarting the target applet. The above-mentioned determination of the target applet to be restarted and restarting of the target applet will be described below with reference to fig. 2.
As shown in fig. 2, the method may include:
s201, detecting the state of a screen where an applet displayed on the host application is located.
Alternatively, the applet display diagram on the host application may be obtained through a screen capturing operation, and the middle area and other areas of the applet display diagram may be determined; then determining whether other color pixel points except the background color of the applet exist in the middle area; if yes, determining that the applet is not in a global screen abnormal state; otherwise, further determining whether other color pixel points except the background color of the applet exist in other areas of the applet display diagram, and determining whether the applet is in a non-global screen abnormal state according to the result.
The method for acquiring the applet display diagram on the host application through the screen capturing operation specifically comprises the following steps: intercepting window pictures except for a screen window from a window container list of a host application; and generating an applet display diagram on the host application according to the window pictures.
In the embodiment of the application, the screen capturing operation specifically refers to a screen capturing mode of windows so as to capture other window pictures except for an applet screen window, such as a keyboard popup window, a prompt popup window and the like. Therefore, the problem that when the existing applet display diagram is intercepted in a webpage view screen capturing mode, other window pictures except for an applet screen window cannot be intercepted, and the detection accuracy of the screen state of the applet display diagram is low is solved.
Illustratively, the implementation of obtaining the applet display view on the host application using the windows screen capturing method is as follows:
intercepting pictures by intercepting windows
After the applet display on the host application is obtained, the existing solution is typically to traverse the entire applet display to determine if the applet is in a global screen anomaly state. However, since the main content of the general applet is at the very center of the screen, the large probability at the edge is a white screen (applet background color). Therefore, if the entire display diagram is traversed from the (0, 0) point, the pixel point at the start position is substantially white, which makes the detection efficiency low.
Based on this, after the applet display diagram on the host application is obtained, the embodiment of the application may divide the applet display diagram into a plurality of areas by using a preset rule, and then preferentially determine whether there are other color pixel points in the middle area except for the applet background color, so as to improve the detection efficiency of the screen state where the applet is located.
The preset rule may be set according to actual needs, which is not limited herein. For example, if the applet display view is divided into 3 parts in the horizontal direction (i.e., the lateral direction), the region corresponding to the second position (at 2/3) is taken as the middle region, and the regions corresponding to the first position and the third position (at 1/3 and at 3/3) are taken as the other regions; for another example, if the applet display view is divided into 5 parts in the horizontal direction (i.e., the lateral direction), the region corresponding to the 3/5 position is taken as the middle region, and the regions corresponding to the 1/5,2/5,4/5 and 5/5 positions are taken as the other regions.
Assuming that the applet display diagram is partitioned into 5 shares, the implementation code may be as follows:
the detection area is an image of 1/5 width in the middle of the screen capture (3 pixels are reserved to prevent black edges from affecting detection)
CGRect rect=CGRectMake(snapshot.size.width/5*2,3,
snapshot.size.width/5,
snapshot.size.height-6);
Further, after the middle area and other areas of the applet display diagram are determined, it may be preferentially determined whether or not other color pixel points other than the applet background color (white pixel point) exist in the pixel points in the middle area; if yes, determining that the applet is not in a global screen abnormal state; if not, further determining whether other color pixel points except the background color of the applet exist in other areas; if other color pixel points except the background color of the applet exist in other areas, determining that the applet is in a non-global screen abnormal state; and if the other color pixel points except the background color of the applet are not in the other areas, determining that the applet is in a global screen abnormal state.
In particular, it may be determined whether there are other color pixel values in the intermediate region or other regions, other than the applet background color, as follows;
and comparing the pixel values of the pixel points in the middle area or the pixel points in other areas with the pixel values of the pixel points in the background color of the small program to determine whether the pixel points in the middle area or the other areas have other color pixels except the background color of the small program.
For example, if the pixel value of the pixel point in the applet background color is 255 and the pixel value of any pixel point in the intermediate area is not 255, it is determined that there are other color pixel points in the intermediate area than the applet background color.
In the actual use process, chromatic aberration exists in the screenshot of part of machine types, so that errors exist in determining whether other color pixel points except for the background color of the small program exist in the middle area or other areas. Therefore, in order to avoid chromatic aberration during partial model screenshot, the embodiment of the application introduces an error threshold value to determine the difference value between the channel pixel value of each pixel point in the middle area or other areas and the channel value of the applet background color. And then, comparing the difference value with an error threshold value, and determining whether each pixel point in the middle area or other areas is a background color pixel point or other color pixel points.
In specific implementation, determining whether the intermediate area or the other area has pixels of other colors except for the background color of the applet includes:
determining a difference between the channel value of the pixel point in the middle area or the other area and the channel value of the applet background color;
If the difference value is smaller than the threshold value, determining the pixel point as a background color pixel point; otherwise, determining the pixel point as the pixel point of other colors.
In the embodiment of the application, the channel value of the pixel point is specifically RGBA. Among them, RGBA is a color space representing Red Green Blue and Alpha.
The threshold is the error threshold. In this embodiment, the threshold value may be set to a value smaller than 1.
That is, by respectively making differences between the four channel values of each pixel point in the middle area or other areas and the four channel values of the background color of the applet, if the difference value of any channel in each pixel point is greater than a threshold value, determining that the pixel point in the middle area or other areas is a pixel point of other colors; if the difference value of the four channels in each pixel point is smaller than the threshold value, determining the pixel point in the middle area or other areas as a background color pixel point.
The embodiment leads the accuracy of determining whether the pixel points with the colors except the background color of the small program exist in the middle area or other areas to be higher by introducing the error threshold value.
For example, assuming that the threshold is 1, the channel value of any pixel in the middle area is shown in table 1 below, the channel value of the applet background color is shown in table 2 below, and the difference between the channel value of the pixel in the middle area and the channel value of the applet background color is determined as shown in table 3 below; then, the difference value of each channel in table 3 is compared with a threshold value 1 to determine that the pixel point in the middle area is the pixel point of other colors.
TABLE 1
R 255
G 221
B 227
A 178
TABLE 2
R 255
G 255
B 255
A 255
TABLE 3 Table 3
R |255-255|=0 0<1
G |221-255|=34 34>1
B |227-255|=28 28>1
A |178-255|=77 77>1
It should be noted that if the applet background color is non-white, such as blue, then it is not a white screen or a blue screen. And comparing the pixel values of each channel of the pixel points in the screenshot with the pixel values of each channel of the blue color to determine whether the scene is a screen abnormal scene.
In another embodiment of the present application, detecting a screen state of an applet displayed on a host application further includes:
acquiring an applet displayed on a host application, and determining whether the host application enters a secondary page of the applet;
if yes, determining that the applet is not in the global screen abnormal state.
That is, when the applet page identifier displayed on the host application becomes the second-level page identifier, it is indicated that the user enters the second-level page of the applet in the process of opening the applet, and the applet is a non-white screen at this time, so as to end the detection of the abnormal state of the global screen. The applet page identification and the second level page identification may refer to information capable of uniquely determining the page identity, such as an ID, among others.
S202, if the applet is in the global screen abnormal state, the applet is used as a target applet to be restarted.
When the screen state of the applet displayed on the host application is determined to be the global screen abnormal state, the applet is described as abnormal in the running process, and the applet can be used as a target applet to be restarted at the moment to restart the applet.
S203, the target applet is controlled to clear data in a target program page stack and target resource data.
S204, controlling the target program page stack after the target program binds and clears the data, re-downloading the target resource data, and restarting the target program through the target program page stack and the re-downloaded target resource data.
The implementation process and principle of S203-S204 are similar to those of S102-S103 in the above embodiment, and are specifically referred to the implementation process of the above embodiment, and are not described herein in detail.
According to the technical scheme provided by the embodiment of the application, whether the applet is the target applet to be restarted is determined by detecting the screen state of the applet displayed on the host application, if yes, the target applet is controlled to clear data and target resource data in a target applet page stack, the target applet page stack after the target applet is bound with the clear data is controlled, the target resource data is downloaded again, and the target applet is restarted through the target applet page stack and the re-downloaded target resource data. Therefore, an effective restarting mechanism is arranged for the applet, so that the applet can be automatically restarted when an abnormality occurs in the operation process, and the operation stability of the applet is improved.
On the basis of the above embodiment, S201 further includes:
if the applet displayed on the host application is in the abnormal state of the local screen, the control clears the webpage view of the applet, recreates the webpage view and binds the applet.
For example, after obtaining the applet display diagram on the host application, the embodiment of the present application may further segment the applet display diagram into a plurality of regions with the same scale (as shown in fig. 3 in detail), then detect whether each region is solid color, and determine whether the duty ratio of the solid color region to all the regions exceeds the duty ratio threshold, so as to determine whether the applet is in a partial screen abnormal state. And when the duty ratio of the solid color area exceeds the duty ratio threshold value, the applet is in a local screen abnormal state, otherwise, the applet is not in the local screen abnormal state. Wherein it is determined whether each region is solid color, as determined by whether pixel-by-pixel scanning is the same as the next pixel color.
The duty ratio threshold may be adaptively set according to actual needs, and is not specifically limited herein, for example, 0.5.
In the embodiment of the application, when the applet displayed on the host application is determined to be in the abnormal state of the local screen, the webpage view (applet page stack) of the applet is destroyed by the applet management system, but the applet is not destroyed, and the abnormal webpage view of the applet is controlled to be cleared, and the webpage view is re-created and bound.
That is, when the web page view of the applet is abnormal, the applet is not required to be restarted, and the applet can be recovered to be normal only by regenerating the web page view, so that the pertinence of the applet in abnormal processing in the running process is improved, and the user experience is further improved.
In another implementation scenario, determining whether there are target applets on the host application to be restarted further comprises: if any applet on the host application monitors a restart event, the applet is used as a target applet to be restarted, and a restart operation is performed on the target applet. The above-described determination of the target applet to be restarted and restarting of the target applet will be described below with reference to fig. 4. As shown in fig. 4, the method may include:
s401, if any applet on the host application monitors a restart event, the applet is taken as a target applet to be restarted.
The restart event is generated when a trigger operation acting on a restart control in the applet is detected; or upon detection of a failure to launch any applet on the host application.
In the embodiment of the application, the restart event is generated when any applet on the host application is detected to be failed to start, which may mean that the restart event is automatically generated when any applet is detected to be abnormal in the process of switching the applet on the host application; alternatively, the host application generates a restart event when entering any applet in the webless state.
Wherein, any applet exception may be an exception of the applet caused by the host application; alternatively, it may be a memory management mechanism of the host application, such as when more than 5 applets are opened, the previous applet is cleared, and the level one return is abnormal with respect to the offloaded applet.
The triggering operation of the restarting control in the applet can be the triggering operation of the restarting control in the applet menu bar manually triggered by a user when an abnormality occurs in the applet operation process.
S402, the target applet is controlled to clear data in a target program page stack and target resource data.
S403, controlling the target program page stack after the target program binds and clears the data, re-downloading the target resource data, and restarting the target program through the target program page stack and the re-downloaded target resource data.
The implementation process and principle of S402-S403 are similar to those of S102-S103 in the above embodiment, and are specifically referred to the implementation process of the above embodiment, which is not described herein in detail.
According to the technical scheme provided by the embodiment of the application, the applet which detects the restarting event is used as the target applet to be restarted, so that the target applet is controlled to clear data and target resource data in a target applet page stack, the target applet page stack after the target applet is bound with the cleared data is controlled, the target resource data is downloaded again, and the target applet is restarted through the target applet page stack and the re-downloaded target resource data. Therefore, when abnormal conditions occur in the operation process of the applet, the applet is reloaded without leaving the applet, so that the use time of the applet and the data stored by a user are increased, the white screen rate of the applet is reduced, and the user experience is improved.
In yet another implementation scenario, determining whether an applet on the host application has a target applet to be restarted further comprises: if any applet on the host application detects a resource update event, the applet is used as a target applet to be restarted, and the restart operation is performed on the target applet. The above-mentioned determination of the target applet to be restarted and restarting of the target applet will be described below with reference to fig. 5.
As shown in fig. 5, the method may include:
s501, if any applet on the host application detects a resource update event, the applet is used as a target applet to be restarted.
Wherein the resource update event is generated based on resource data published through the applet resource update interface.
In the actual application process, the applet developer can carry out emergency repair or version update on the applet, if the user opens the applet currently, the applet cannot be directly updated, so that the user cannot directly perceive when the developer emergently repairs some problems or updates a version, and can only see updated contents when entering again after exiting the applet, so that the applet update has no real-time property.
Therefore, the application directly updates the applet package through the resource update interface exposed by the applet, and realizes that the applet resource data can be timely and efficiently repaired by restarting and timely refreshing the applet in the process of the applet operation, thereby enabling a user to intuitively sense the update of the applet when using the applet.
S502, controlling the target applet to clear data in a target program page stack and target resource data.
S503, controlling the target program page stack after the target program binds and clears the data, re-downloading the target resource data, and restarting the target program through the target program page stack and the re-downloaded target resource data.
The implementation process and principle of S502-S503 are similar to those of S102-S103 in the above embodiment, and are specifically referred to the implementation process of the above embodiment, which is not described herein in detail.
According to the technical scheme provided by the embodiment of the application, the online forced refreshing of the applet is supported by a developer in the running process of the applet, the applet resource data is pulled again, the online problem can be repaired more timely and efficiently, and a user can intuitively perceive the update of the applet when using the applet.
In yet another implementation scenario, determining whether there are target applets on the host application to be restarted further comprises: if the host application is switched to any applet and the applet page stack exists, the applet is used as a target applet to be restarted, and the restart operation is carried out on the target applet. The above-described determination of the target applet to be restarted and restarting of the target applet will be described below with reference to fig. 6.
As shown in fig. 6, the method may include:
s601, if the host application is switched to any applet and the applet page stack exists, the applet is used as a target applet to be restarted.
S602, controlling the target applet to clear data in a target program page stack and target resource data.
S603, controlling the target program page stack after the target program binds and clears the data, re-downloading the target resource data, and restarting the target program through the target program page stack and the re-downloaded target resource data.
Because the applet on the host application supports the mutual switching of a plurality of applets, if the applet a is switched to the applet b, and then the applet b is switched to the applet a, the page stack of the applet a exists at the moment, and at the moment, two page stacks of the applet a exist, so that the page data has redundancy, and the data is easy to be disordered, so that the maintenance is difficult.
Therefore, in order to avoid redundancy of page data of the same applet, the embodiment of the application unloads the page stack before the applet and empties data in the page stack before the applet, thereby avoiding caching of two pieces of applet data, reducing data redundancy, reducing memory occupation amount and avoiding various problems caused by simultaneous reading and writing of data among the two applets.
The implementation process and principle of S602-S603 are similar to those of S102-S103 in the above embodiment, and are specifically referred to the implementation process of the above embodiment, which is not described herein in detail.
According to the technical scheme provided by the embodiment of the application, when the host application is switched to any applet and the applet page stack exists, the applet is used as the target applet to be restarted, so that the restarting operation is performed on the applet. Therefore, the cache of two small program data is avoided, the data redundancy is reduced, the memory occupation is reduced, and various problems caused by simultaneous reading and writing of data among the small program data are avoided.
Fig. 7 is a schematic structural diagram of an applet control device according to an embodiment of the application. The applet control means may be implemented in software and/or hardware and may be integrated on the electronic device.
As shown in fig. 7, an applet control apparatus 700 according to an embodiment of the application includes a determining module 710, a first control module 720 and a second control module 730, wherein:
a determining module 710 for determining whether there are target applets on the host application to be restarted;
a first control module 720, configured to control the target applet to purge data in a target applet page stack and target resource data;
And a second control module 730, configured to control the target applet to bind to the target applet page stack after the data removal, re-download the target resource data, and restart the target applet through the target applet page stack and the re-downloaded target resource data.
As an alternative implementation form of the present application, the determining module 710 is specifically configured to:
if any applet on the host application monitors a restarting event, taking the applet as a target applet to be restarted;
the restart event is generated when a trigger operation acting on a restart control in the applet is detected; or upon detection of a failure to launch any applet on the host application.
As an alternative implementation form of the present application, the determining module 710 is specifically configured to:
if any applet on the host application detects a resource update event, the applet is used as a target applet to be restarted;
wherein the resource update event is generated from resource data published through the applet resource update interface.
As an alternative implementation form of the present application, the determining module 710 is specifically configured to:
if the host application switches to any applet and the applet page stack already exists, the applet is taken as the target applet to be restarted.
As an alternative implementation form of the present application, the second control module 730 is specifically configured to:
the method comprises the steps of controlling a target applet page stack after the target applet binds and clears data through an applet creating instruction;
and controlling the target applet to re-download the target resource data through an applet restarting instruction, displaying the downloading progress of the target resource data through a bound target applet page stack, and restarting the target applet according to the re-downloaded target resource data.
As an alternative implementation form of the present application, the apparatus 700 further includes: and adding a module.
The adding module is used for adding a probe for the target applet in the restarting process of the target applet and collecting the operation data of the target applet after the restarting of the target applet.
It should be noted that the foregoing explanation of the embodiment of the applet control method is also applicable to the applet control device of this embodiment, and the implementation principle is similar, which is not repeated here.
According to the technical scheme provided by the embodiment of the application, whether the target applet to be restarted exists on the host application is determined, if the target applet to be restarted exists, the target applet is controlled to clear data and target resource data in a target applet page stack, the target applet page stack after the target applet is bound with the cleared data is controlled, the target resource data is downloaded again, and the target applet is restarted through the target applet page stack and the re-downloaded target resource data. Therefore, when abnormal conditions occur in the operation process of the applet, the applet is reloaded without leaving the applet, so that the use time of the applet and the data stored by a user are increased, the white screen rate of the applet is reduced, and the user experience is improved.
Fig. 8 is a schematic structural diagram of an applet control device according to an embodiment of the application. The applet control means may be implemented in software and/or hardware and may be integrated on the electronic device.
As shown in fig. 8, an applet control apparatus 700 according to an embodiment of the application includes a determining module 710, a first control module 720 and a second control module 730, wherein:
a determining module 710 for determining whether there are target applets on the host application to be restarted;
a first control module 720, configured to control the target applet to purge data in a target applet page stack and target resource data;
and a second control module 730, configured to control the target applet to bind to the target applet page stack after the data removal, re-download the target resource data, and restart the target applet through the target applet page stack and the re-downloaded target resource data.
As an alternative implementation form of the present application, the determining module 710 further includes: a detection unit 7110 and a first control unit 7112.
The detection unit 7110 is configured to detect a screen state of an applet displayed on the host application;
the first control unit 7112 is configured to take the applet as a target applet to be restarted if the applet is in a global screen abnormal state.
As an alternative implementation form of the present application, the detection unit 7110 is specifically configured to:
acquiring an applet display diagram on a host application through screen capturing operation, and determining a middle area and other areas of the applet display diagram;
determining whether other color pixel points except for the background color of the applet exist in the middle area;
if yes, determining that the applet is not in a global screen abnormal state;
if not, determining whether other color pixel points except the background color of the applet exist in the other areas, and determining whether the applet is in a non-global screen abnormal state according to the result.
As an alternative implementation form of the application, the detection unit 7110 is further configured to:
intercepting window pictures except for a screen window from a window container list of a host application;
and generating an applet display diagram on the host application according to the window pictures.
As an alternative implementation form of the application, the detection unit 7110 is further configured to:
determining a difference between the channel value of the pixel point in the middle area or the other area and the channel value of the applet background color;
if the difference value is smaller than the threshold value, determining the pixel point as a background color pixel point; otherwise, determining the pixel point as the pixel point of other colors.
As an alternative implementation form of the application, the detection unit 7110 is further configured to:
acquiring an applet displayed on a host application, and determining whether the host application enters a secondary page of the applet;
if yes, determining that the applet is not in the global screen abnormal state.
As an alternative implementation form of the present application, the determining module 710 further includes: and a second control unit.
And the second control unit is used for controlling to clear the webpage view of the applet if the applet displayed on the host application is in the abnormal state of the local screen, re-creating the webpage view and binding the applet.
It should be noted that the foregoing explanation of the embodiment of the applet control method is also applicable to the applet control device of this embodiment, and the implementation principle is similar, which is not repeated here.
According to the technical scheme provided by the embodiment of the application, whether the applet is the target applet to be restarted is determined by detecting the screen state of the applet displayed on the host application, if yes, the target applet is controlled to clear data and target resource data in a target applet page stack, the target applet page stack after the target applet is bound with the clear data is controlled, the target resource data is downloaded again, and the target applet is restarted through the target applet page stack and the re-downloaded target resource data. Therefore, an effective restarting mechanism is arranged for the applet, so that the applet can be automatically restarted when an abnormality occurs in the operation process, and the operation stability of the applet is improved.
According to an embodiment of the present application, the present application also provides an electronic device and a readable storage medium.
As shown in fig. 9, a block diagram of an electronic device of an applet control method according to an embodiment of the application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the applications described and/or claimed herein.
As shown in fig. 9, the electronic device includes: one or more processors 901, memory 902, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions executing within the electronic device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface. In other embodiments, multiple processors and/or multiple buses may be used, if desired, along with multiple memories and multiple memories. Also, multiple electronic devices may be connected, each providing a portion of the necessary operations (e.g., as a server array, a set of blade servers, or a multiprocessor system). In fig. 9, a processor 901 is taken as an example.
Memory 902 is a non-transitory computer readable storage medium provided by the present application. The memory stores instructions executable by the at least one processor to cause the at least one processor to perform the applet control methods provided herein. The non-transitory computer readable storage medium of the present application stores computer instructions for causing a computer to execute the applet control method provided by the present application.
The memory 902 is used as a non-transitory computer readable storage medium for storing non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules (e.g., the determining module 710, the first control module 720, and the second control module 730 shown in fig. 7) corresponding to the applet control method in the embodiment of the application. The processor 901 executes various functional applications of the server and data processing, i.e., implements the applet control method in the above-described method embodiments, by running non-transitory software programs, instructions, and modules stored in the memory 902.
The memory 902 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, at least one application program required for a function; the storage data area may store data created according to the use of the electronic device of the applet control method, and the like. In addition, the memory 902 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory 902 optionally includes memory remotely located relative to processor 901, which may be connected to the electronic device of the applet control method via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device of the applet control method may further include: an input device 903 and an output device 904. The processor 901, memory 902, input devices 903, and output devices 904 may be connected by a bus or other means, for example in fig. 9.
The input device 903 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic device of the applet control method, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointer stick, one or more mouse buttons, a track ball, a joystick, etc. The output means 904 may include a display device, auxiliary lighting means (e.g., LEDs), tactile feedback means (e.g., vibration motors), and the like. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device may be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASIC (application specific integrated circuit), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
These computing programs (also referred to as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented in a high-level procedural and/or object-oriented programming language, and/or in assembly/machine language. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), the internet, and blockchain networks.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
According to the technical scheme provided by the embodiment of the application, whether the target applet to be restarted exists on the host application is determined, if the target applet to be restarted exists, the target applet is controlled to clear data and target resource data in a target applet page stack, the target applet page stack after the target applet is bound with the cleared data is controlled, the target resource data is downloaded again, and the target applet is restarted through the target applet page stack and the re-downloaded target resource data. Therefore, when abnormal conditions occur in the operation process of the applet, the applet is reloaded without leaving the applet, so that the use time of the applet and the data stored by a user are increased, the white screen rate of the applet is reduced, and the user experience is improved.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present application may be performed in parallel, sequentially, or in a different order, provided that the desired results of the disclosed embodiments are achieved, and are not limited herein.
The above embodiments do not limit the scope of the present application. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application should be included in the scope of the present application.

Claims (15)

1. A applet control method, comprising:
determining whether there are target applets to be restarted on the host application;
controlling the target applet to clear data in a target applet page stack and target resource data; the data in the target applet page stack are other data except the starting data of the target applet; the target resource data is a local resource file of the target applet;
And controlling the target applet to bind with the target applet page stack after data removal, re-downloading target resource data, and restarting the target applet through the target applet page stack and the re-downloaded target resource data.
2. The method of claim 1, wherein determining whether there are target applets on the host application to be restarted comprises:
detecting the state of a screen where an applet displayed on a host application is located;
and if the applet is in the global screen abnormal state, taking the applet as a target applet to be restarted.
3. The method of claim 2, wherein detecting the screen state of the applet exposed on the host application comprises:
acquiring an applet display diagram on a host application through screen capturing operation, and determining a middle area and other areas of the applet display diagram;
determining whether other color pixel points except for the background color of the applet exist in the middle area;
if yes, determining that the applet is not in a global screen abnormal state;
if not, determining whether other color pixel points except the background color of the applet exist in the other areas, and determining whether the applet is in a non-global screen abnormal state according to the result.
4. A method according to claim 3, wherein obtaining an applet display on the host application by a screen capture operation comprises:
intercepting window pictures except for a screen window from a window container list of a host application;
and generating an applet display diagram on the host application according to the window pictures.
5. A method according to claim 3, wherein determining whether there are other color pixels in the intermediate region or the other region than the applet background color comprises:
determining a difference between the channel value of the pixel point in the middle area or the other area and the channel value of the applet background color;
if the difference value is smaller than the threshold value, determining the pixel point as a background color pixel point; otherwise, determining the pixel point as the pixel point of other colors.
6. The method of claim 2, wherein detecting the screen state of the applet exposed on the host application comprises:
acquiring an applet displayed on a host application, and determining whether the host application enters a secondary page of the applet;
if yes, determining that the applet is not in the global screen abnormal state.
7. The method of claim 1, wherein determining whether there are target applets on the host application to be restarted comprises:
If any applet on the host application monitors a restarting event, taking the applet as a target applet to be restarted;
the restart event is generated when a trigger operation acting on a restart control in the applet is detected; or upon detection of a failure to launch any applet on the host application.
8. The method of claim 1, wherein determining whether there are target applets on the host application to be restarted comprises:
if any applet on the host application detects a resource update event, the applet is used as a target applet to be restarted;
wherein the resource update event is generated from resource data published through the applet resource update interface.
9. The method of claim 1, wherein determining whether there are target applets on the host application to be restarted comprises:
if the host application switches to any applet and the applet page stack already exists, the applet is taken as the target applet to be restarted.
10. The method of claim 1, wherein controlling the target applet to bind the target applet page stack after clearing data, re-download target resource data, and re-launch the target applet through the target applet page stack and the re-downloaded target resource data comprises:
The method comprises the steps of controlling a target applet page stack after the target applet binds and clears data through an applet creating instruction;
and controlling the target applet to re-download the target resource data through an applet restarting instruction, displaying the downloading progress of the target resource data through a bound target applet page stack, and restarting the target applet according to the re-downloaded target resource data.
11. The method according to claim 1, wherein the method further comprises:
and adding a probe for the target applet in the restarting process of the target applet, and acquiring the operation data of the target applet after the restarting of the target applet.
12. The method of claim 2, further comprising, after detecting a screen state of an applet exposed on the host application:
if the applet displayed on the host application is in the abnormal state of the local screen, the control clears the webpage view of the applet, recreates the webpage view and binds the applet.
13. An applet control apparatus, comprising:
the determining module is used for determining whether a target applet to be restarted exists on the host application;
the first control module is used for controlling the target applet to clear data in a target applet page stack and target resource data; the data in the target applet page stack are other data except the starting data of the target applet; the target resource data is a local resource file of the target applet;
And the second control module is used for controlling the target applet page stack after the target applet binds and clears the data, re-downloading the target resource data, and restarting the target applet through the target applet page stack and the re-downloaded target resource data.
14. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the applet control method according to any one of claims 1-12.
15. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the applet control method according to any one of claims 1-12.
CN201911258916.6A 2019-12-10 2019-12-10 Applet control method, device, apparatus and medium Active CN111026462B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911258916.6A CN111026462B (en) 2019-12-10 2019-12-10 Applet control method, device, apparatus and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911258916.6A CN111026462B (en) 2019-12-10 2019-12-10 Applet control method, device, apparatus and medium

Publications (2)

Publication Number Publication Date
CN111026462A CN111026462A (en) 2020-04-17
CN111026462B true CN111026462B (en) 2023-08-29

Family

ID=70208504

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911258916.6A Active CN111026462B (en) 2019-12-10 2019-12-10 Applet control method, device, apparatus and medium

Country Status (1)

Country Link
CN (1) CN111026462B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111858303B (en) * 2020-06-05 2023-12-01 百度在线网络技术(北京)有限公司 Page control method, device, equipment and medium for applet
CN111654838B (en) * 2020-06-12 2023-05-30 阿波罗智联(北京)科技有限公司 Information processing method and device
CN111787088B (en) 2020-06-28 2023-04-28 百度在线网络技术(北京)有限公司 Method and device for processing small program data
CN111782218B (en) * 2020-06-29 2024-03-01 百度在线网络技术(北京)有限公司 Applet processing method, device, equipment and storage medium
CN112698884B (en) * 2020-12-30 2025-02-11 北京达佳互联信息技术有限公司 Program startup method, device, system, equipment and storage medium
CN113821205A (en) * 2021-01-21 2021-12-21 北京沃东天骏信息技术有限公司 Method and device for controlling small program page parameters, medium and electronic equipment
CN113687892B (en) * 2021-07-30 2024-05-03 阿里巴巴创新公司 Page processing method, device and computer program product
CN113849252B (en) * 2021-08-17 2024-05-10 支付宝(杭州)信息技术有限公司 Small program multi-screen display method, host system supporting small program multi-screen display and client device
CN113885967B (en) * 2021-10-22 2024-02-13 北京字跳网络技术有限公司 Method, device, equipment and medium for starting applet
CN113986389A (en) * 2021-10-28 2022-01-28 上海米哈游璃月科技有限公司 Project restarting method and device, electronic equipment and storage medium

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1723448A (en) * 2002-11-18 2006-01-18 Arm有限公司 Secure memory for protecting against malicious programs
CN102985929A (en) * 2010-05-11 2013-03-20 杉中顺子 External boot device, external boot program, external boot method and network communication system
CN103038652A (en) * 2010-05-25 2013-04-10 海德沃特合作I有限公司 Device-assisted services for protecting network capacity
CN104135684A (en) * 2014-07-17 2014-11-05 Tcl集团股份有限公司 A method and a device for displaying an interface based on a Firefox OS
CN107943593A (en) * 2018-01-03 2018-04-20 上海传英信息技术有限公司 A kind of memory automatic cleaning method for intelligent terminal
CN108156265A (en) * 2010-11-22 2018-06-12 杭州硕文软件有限公司 A kind of application control method and mobile equipment
CN108334415A (en) * 2017-01-20 2018-07-27 百度在线网络技术(北京)有限公司 A kind of fault-tolerance processing method, device, terminal and storage medium
CN108376207A (en) * 2018-03-22 2018-08-07 宝鸡中车时代工程机械有限公司 The emulation platform calculated for rail vehicle traction
CN108614722A (en) * 2018-05-10 2018-10-02 Oppo广东移动通信有限公司 Application program preloads method, apparatus, storage medium and terminal
CN109669764A (en) * 2017-10-13 2019-04-23 阿里巴巴集团控股有限公司 Processing method, device, equipment and machine readable media
CN109684123A (en) * 2018-12-25 2019-04-26 北京达佳互联信息技术有限公司 Problem resource localization method, device, terminal and storage medium
CN109726076A (en) * 2018-12-03 2019-05-07 百度在线网络技术(北京)有限公司 A kind of small routine life cycle management method and system
CN110069308A (en) * 2019-04-22 2019-07-30 北京字节跳动网络技术有限公司 Page launching method, apparatus, electronic device and storage medium
CN110083399A (en) * 2019-03-04 2019-08-02 上海连尚网络科技有限公司 Small routine operation method, computer equipment and storage medium
CN110196726A (en) * 2019-05-17 2019-09-03 江西山水光电科技股份有限公司 A method of the load of FPGA program remote upgrading is realized based on CPU+CPLD

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4549809B2 (en) * 2004-10-29 2010-09-22 京セラ株式会社 Mobile phone terminal, program management method and computer program
US7761853B2 (en) * 2005-02-25 2010-07-20 Kyocera Corporation Portable terminal device, method for restoring program, method for terminating program, and computer program therefor

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1723448A (en) * 2002-11-18 2006-01-18 Arm有限公司 Secure memory for protecting against malicious programs
CN102985929A (en) * 2010-05-11 2013-03-20 杉中顺子 External boot device, external boot program, external boot method and network communication system
CN103038652A (en) * 2010-05-25 2013-04-10 海德沃特合作I有限公司 Device-assisted services for protecting network capacity
CN108156265A (en) * 2010-11-22 2018-06-12 杭州硕文软件有限公司 A kind of application control method and mobile equipment
CN104135684A (en) * 2014-07-17 2014-11-05 Tcl集团股份有限公司 A method and a device for displaying an interface based on a Firefox OS
CN108334415A (en) * 2017-01-20 2018-07-27 百度在线网络技术(北京)有限公司 A kind of fault-tolerance processing method, device, terminal and storage medium
CN109669764A (en) * 2017-10-13 2019-04-23 阿里巴巴集团控股有限公司 Processing method, device, equipment and machine readable media
CN107943593A (en) * 2018-01-03 2018-04-20 上海传英信息技术有限公司 A kind of memory automatic cleaning method for intelligent terminal
CN108376207A (en) * 2018-03-22 2018-08-07 宝鸡中车时代工程机械有限公司 The emulation platform calculated for rail vehicle traction
CN108614722A (en) * 2018-05-10 2018-10-02 Oppo广东移动通信有限公司 Application program preloads method, apparatus, storage medium and terminal
CN109726076A (en) * 2018-12-03 2019-05-07 百度在线网络技术(北京)有限公司 A kind of small routine life cycle management method and system
CN109684123A (en) * 2018-12-25 2019-04-26 北京达佳互联信息技术有限公司 Problem resource localization method, device, terminal and storage medium
CN110083399A (en) * 2019-03-04 2019-08-02 上海连尚网络科技有限公司 Small routine operation method, computer equipment and storage medium
CN110069308A (en) * 2019-04-22 2019-07-30 北京字节跳动网络技术有限公司 Page launching method, apparatus, electronic device and storage medium
CN110196726A (en) * 2019-05-17 2019-09-03 江西山水光电科技股份有限公司 A method of the load of FPGA program remote upgrading is realized based on CPU+CPLD

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
欧燕jonathan."解决微信小程序部分ios机型在onLaunch中调用reLaunch,页面栈无法清空的坑".2019,第1-3页. *

Also Published As

Publication number Publication date
CN111026462A (en) 2020-04-17

Similar Documents

Publication Publication Date Title
CN111026462B (en) Applet control method, device, apparatus and medium
CN111258609B (en) Upgrading method and device of Kubernetes cluster, electronic equipment and medium
CN111770169A (en) Method, device, equipment and storage medium for upgrading equipment firmware
CN110780890A (en) System upgrading method and device, electronic equipment and medium
US11175823B2 (en) Method and apparatus for controlling terminal device using gesture control function, and non-transitory computer-readable storage medium
CN110659246B (en) Container-based file mounting method and device and electronic equipment
US9268662B2 (en) Method and system for a high availability framework
CN108604200A (en) The method and terminal device of the failure of processing terminal equipment
CN111177107A (en) File processing method, device, equipment and storage medium based on block chain
CN111708653B (en) Memory fault processing method and device, electronic equipment and storage medium
US20190324841A1 (en) System and method to predictively service and support the solution
CN111881387B (en) Data processing method, device, equipment and medium for small program
US20140289719A1 (en) Automatic version management
CN112328296B (en) Method, device, equipment and medium for updating software aiming at cross-platform application
CN112565356A (en) Data storage method and device and electronic equipment
CN111191619A (en) Method, device and equipment for detecting virtual line segment of lane line and readable storage medium
CN110737560A (en) service state detection method, device, electronic equipment and medium
CN111708940B (en) Problem processing method, device, electronic equipment and storage medium
CN113868090A (en) Application program monitoring method and device
CN111399888B (en) Audio processing chip processing method and device and electronic equipment
KR20210042859A (en) Method and device for detecting pedestrians
CN107729032A (en) Boot animation updating method, intelligent terminal and storage medium
CN111292223A (en) Graph calculation processing method and device, electronic equipment and storage medium
CN113051122B (en) Performance data acquisition method, device, electronic equipment and medium
CN111597192A (en) Database switching control method and device and electronic equipment

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