CN109857537B - Background service starting method, device, medium and electronic equipment - Google Patents

Background service starting method, device, medium and electronic equipment Download PDF

Info

Publication number
CN109857537B
CN109857537B CN201910167279.5A CN201910167279A CN109857537B CN 109857537 B CN109857537 B CN 109857537B CN 201910167279 A CN201910167279 A CN 201910167279A CN 109857537 B CN109857537 B CN 109857537B
Authority
CN
China
Prior art keywords
page component
background service
proxy
application program
starting
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
CN201910167279.5A
Other languages
Chinese (zh)
Other versions
CN109857537A (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.)
Netease Media Technology Beijing Co Ltd
Original Assignee
Netease Media Technology Beijing 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 Netease Media Technology Beijing Co Ltd filed Critical Netease Media Technology Beijing Co Ltd
Priority to CN201910167279.5A priority Critical patent/CN109857537B/en
Publication of CN109857537A publication Critical patent/CN109857537A/en
Application granted granted Critical
Publication of CN109857537B publication Critical patent/CN109857537B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The embodiment of the invention provides a background service starting method, a background service starting device, a background service starting medium and electronic equipment, and relates to the technical field of computers. The method comprises the following steps: when monitoring that the application program is switched to background operation, acquiring target background service which needs to be started by the application program; starting a page component which is displayed in a non-explicit way to serve as a proxy page component, and binding the target background service with the proxy page component; and starting the target background service through the proxy page component. The technical scheme of the embodiment of the invention can ensure that the corresponding background service is not forbidden when the application program is switched to the background operation, improve the compatibility of the corresponding operating system of the application program and improve the use experience of a user.

Description

Background service starting method, device, medium and electronic equipment
Technical Field
Embodiments of the present invention relate to the field of computer technologies, and in particular, to a background service starting method, a background service starting apparatus, a computer-readable storage medium, and an electronic device.
Background
This section is intended to provide a background or context to the embodiments of the invention that are recited in the claims. The description herein is not admitted to be prior art by inclusion in this section.
With the development of scientific technology, the Android operating system is more and more popular among people due to its powerful functions and simple operation, and the version of the Android operating system is continuously updated with the progress of the scientific technology. Background Service (Service) is required to be used in the development of the application program of the android operating system, the background Service is indispensable for the running of the application program as a Service which runs in the background but does not have an interactive interface display, for example, the application program processes some logic calculations through the background Service, and provides data support of a UI (user interface).
In the currently released 8.0 version of the Android operating system, the system prohibits an application from being switched to a background runtime to start a background service.
Disclosure of Invention
However, background services are mostly needed to be started when currently developed application programs are switched to background operation, and users are also used to switch application programs between a foreground and a background.
Therefore, the issued 8.0 version and the versions above of the android operating system cause the problem that background service cannot be started or application crash is directly caused when the background service is switched to background operation after a plurality of application programs are adapted to the 8.0 version of the android operating system, and the use experience of a user is reduced.
To this end, an improved background service starting method is highly needed, so that the application programs adapting to the 8.0 version and above of the android operating system can start the background service when being switched to the background runtime.
In this context, embodiments of the present invention are intended to provide a background service starting method, a background service starting apparatus, a computer-readable storage medium, and an electronic device.
In a first aspect of the embodiments of the present invention, a method for starting a background service is provided, including: when monitoring that the application program is switched to background operation, acquiring target background service which needs to be started by the application program; starting a page component which is displayed in a non-explicit way to serve as a proxy page component, and binding the target background service with the proxy page component; and starting the target background service through the proxy page component.
In some embodiments of the present invention, based on the foregoing scheme, before the monitoring that the application program is switched to the background operation, before acquiring the target background service that the application program needs to be started, the method further includes: acquiring state information corresponding to a page component of the application program, and recording the current state of the page component according to the state information; and saving the state information to a target storage area.
In some embodiments of the present invention, based on the foregoing scheme, the method further comprises: when monitoring that the application program is switched to foreground operation, acquiring state information corresponding to a page component of the application program; starting the page component based on the state information to replace the proxy page component by the page component; and starting the target background service through the page component.
In some embodiments of the present invention, based on the foregoing solution, initiating a non-explicitly displayed page component as a proxy page component includes: determining the theme of the proxy page component through a preset rule; and creating the proxy page component according to the theme of the proxy page component.
In some embodiments of the present invention, based on the foregoing solution, determining the topic of the proxy page component by using a preset rule includes: and carrying out transparent processing on the background, the title bar, the navigation bar and the task bar icon of the proxy page component.
In some embodiments of the present invention, based on the foregoing solution, the determining the topic of the proxy page component by using the preset rule further includes: and hiding the proxy page component so that the terminal equipment does not record the state information corresponding to the proxy page component.
In some embodiments of the present invention, based on the foregoing solution, the binding the target background service and the proxy page component includes: acquiring identification information of the target background service; the identification information comprises a registration identification and version information of the target background service; and binding the target background service with the proxy page component based on the identification information.
In a second aspect of the embodiments of the present invention, there is provided a background service starting apparatus, including: the background service acquisition unit is used for acquiring target background services which need to be started by the application program when the application program is monitored to be switched to the background operation; the background service binding unit is used for starting a non-explicitly displayed page component as a proxy page component and binding the target background service with the proxy page component; and the background service starting unit is used for starting the target background service through the proxy page component.
In some embodiments of the present invention, based on the foregoing solution, the background service obtaining unit is configured to: acquiring state information corresponding to a page component of the application program, and recording the current state of the page component according to the state information; and saving the state information to a target storage area.
In some embodiments of the present invention, based on the foregoing solution, the background service starting apparatus further includes a page component restoring unit, where the page component restoring unit is configured to: when monitoring that the application program is switched to foreground operation, acquiring state information corresponding to a page component of the application program; starting the page component based on the state information to replace the proxy page component by the page component; and starting the target background service through the page component.
In some embodiments of the present invention, based on the foregoing solution, the background service binding unit includes: the theme determining unit is used for determining the theme of the proxy page component through a preset rule; and the proxy page component creating unit is used for creating the proxy page component according to the theme of the proxy page component.
In some embodiments of the invention, based on the foregoing, the topic determination unit is configured to: and carrying out transparent processing on the background, the title bar, the navigation bar and the task bar icon of the proxy page component.
In some embodiments of the invention, based on the foregoing, the topic determination unit is configured to: and hiding the proxy page component so that the terminal equipment does not record the state information corresponding to the proxy page component.
In some embodiments of the present invention, based on the foregoing solution, the background service binding unit is configured to: acquiring identification information of the target background service; the identification information comprises a registration identification and version information of the target background service; and binding the target background service with the proxy page component based on the identification information.
In a third aspect of embodiments of the present invention, there is provided a computer-readable storage medium, on which there is stored a computer program, which, when executed by a processor, implements the background service launching method as described in the first aspect above.
In a fourth aspect of embodiments of the present invention, there is provided an electronic apparatus, comprising: a processor; and a memory having computer readable instructions stored thereon which, when executed by the processor, implement the background service initiation method as described above in the first aspect.
According to the technical scheme of the embodiment of the invention, on one hand, the background service is started by starting a proxy page component to replace a page component before the application program is switched to the background operation, so that the background service can be started when the application program is switched to the background operation, and the problem of application program crash is avoided; on the other hand, by starting a page component which is displayed in a non-explicit way as a proxy page component and starting background service according to the proxy page component, the application program can start service in the background without influencing the normal use of the user, and the use experience of the user is improved.
Drawings
The above and other objects, features and advantages of exemplary embodiments of the present invention will become readily apparent from the following detailed description read in conjunction with the accompanying drawings. Several embodiments of the invention are illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings and in which:
FIG. 1 schematically illustrates a schematic block diagram of an exemplary application scenario, in accordance with some embodiments of the present invention;
FIG. 2 schematically illustrates a flow diagram of a background service launch method according to some embodiments of the invention;
FIG. 3 schematically illustrates a flow diagram for background service launch, in accordance with some embodiments of the invention;
FIG. 4 schematically illustrates a flow diagram for switching an application to foreground operation, in accordance with some embodiments of the present invention;
FIG. 5 schematically illustrates a flow diagram of the set proxy page component in accordance with some embodiments of the invention;
FIG. 6 schematically illustrates a schematic block diagram of a background service launch apparatus according to some embodiments of the inventions;
FIG. 7 schematically shows a schematic view of a storage medium according to an exemplary embodiment of the present invention; and
fig. 8 schematically shows a block diagram of an electronic device according to an exemplary embodiment of the invention.
In the drawings, the same or corresponding reference numerals indicate the same or corresponding parts.
Detailed Description
The principles and spirit of the present invention will be described with reference to a number of exemplary embodiments. It is understood that these examples are given solely to enable those skilled in the art to better understand and to practice the present invention, and are not intended to limit the scope of the invention in any way. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As will be appreciated by one skilled in the art, embodiments of the present invention may be embodied as a system, apparatus, device, method, or computer program product. Accordingly, the present disclosure may be embodied in the form of: entirely hardware, entirely software (including firmware, resident software, micro-code, etc.), or a combination of hardware and software.
According to the embodiment of the invention, a background service starting method, a background service starting device, a computer readable storage medium and an electronic device are provided.
In this context, it should be understood that the term page component (Activity component) refers to a carrier of a foreground UI (User Interface) Interface in a mobile phone operating system, such as an Android operating system. The system background Service (Service) refers to a Service which runs in the background of the terminal equipment and is not interactive, and can be started only through a page component. Moreover, any number of elements in the drawings are by way of example and not by way of limitation, and any nomenclature is used solely for differentiation and not by way of limitation.
The principles and spirit of the present invention are explained in detail below with reference to several representative embodiments of the invention.
Summary of The Invention
The inventor finds that in the currently published 8.0 version of the Android operating system, the system prohibits the application program from being switched to the background operation to start the background service, so that after the application program is adapted to the 8.0 version of the Android operating system, the background service cannot be started or the application program is directly crashed when the application program is switched to the background operation, and the use experience of a user is reduced.
Based on the above, the basic idea of the present invention is to obtain the target background service that the application needs to be started when it is monitored that the application is switched to the background operation, then start a page component that is displayed non-explicitly as a proxy page component, and bind the target background service with the proxy page component, so as to start the target background service through the proxy page component. The target background service of the application program is started by taking the non-explicitly displayed page component as the proxy page component, so that the background service can be started when the application program is switched to the background operation, and the problem of application program crash is avoided; and the proxy page component displayed in a non-explicit way can enable the application program to start service in the background without influencing the normal use of the user, thereby improving the use experience of the user.
Having described the general principles of the invention, various non-limiting embodiments of the invention are described in detail below.
Application scene overview
Referring initially to fig. 1, fig. 1 illustrates a schematic block diagram of an exemplary application scenario in accordance with some embodiments of the present invention. As shown in fig. 1, the background service startup system may include: a proxy page component generating unit 110 and a background service starting unit 120. The proxy page component generating unit 110 is configured to start a non-explicitly displayed page component as a proxy page component when it is monitored that the application program is switched to the background operation; the background service starting unit 120 is configured to bind a background service corresponding to the application according to the proxy page component generated by the proxy page component generating unit 110, and start the background service through the proxy page component.
It should be understood that the application scenario illustrated in fig. 1 is only one example in which the embodiment of the present invention may be implemented, and the application scope of the embodiment of the present invention is not limited in any way by the application scenario.
Exemplary method
In connection with the application scenario of fig. 1, a background service launching method according to an exemplary embodiment of the present invention is described with reference to fig. 2. It should be noted that the above application scenarios are merely illustrative for the convenience of understanding the spirit and principles of the present invention, and the embodiments of the present invention are not limited in this respect. Rather, embodiments of the present invention may be applied to any scenario where applicable.
Fig. 2 schematically illustrates a flow diagram of a background service initiation method according to some embodiments of the invention.
Referring to fig. 2, in step S210, when it is monitored that the application program is switched to the background operation, a target background service that the application program needs to be started is obtained.
In an example embodiment, the target background Service (Service) may refer to a background Service that is required by an application program in the android system when the application program is switched to a background and the application program is maintained to run, for example, the target background Service may be a network connection Service or a data computing Service, and of course, the target background Service may also be other background services, for example, the target background Service may also be an audio Service, which is not particularly limited in the present invention. When the system monitors that the application program is switched to the background operation, the system detects the relevant modules of the application program to determine the target background service required by the background operation of the application program and acquires the determined target background service required to be started by the application program.
In step S220, a non-explicitly displayed page component is started as a proxy page component, and the target background service is bound to the proxy page component.
In an example embodiment, a page component (Activity) may refer to an application component, and a screen is provided so that a user can interact with the application through the page component (which may also be considered as a carrier of a foreground UI interface in an android operating system), and a background service needs the page component to be started. A proxy page component (proxy Activity) may refer to a page component that functions the same as the original page component, but is not explicitly displayed. The non-explicit display may refer to that a relevant module area of the proxy page component is not presented in a display interface (for example, a screen of the terminal device) by setting a theme of the proxy page component, for example, setting a background or a title bar of the proxy page component to be transparent. The system starts a proxy page component and binds the target background service with the proxy page component so that the proxy page component replaces the page component.
Specifically, the system acquires identification information of the target background service, and binds the target background service with the proxy page component through the identification information. The identification information can be a registration identification and version information of the target background service, the target background service is bound with the proxy page component through the identification information, the problem that the application program is crashed due to the existence of the same service (for example, the network connection service names and the running paths of the two application program backgrounds are the same, but the registration identification and the version information are different) can be solved, the success rate of starting the target background service is improved, and the use experience of a user is improved.
In step S230, the target background service is started by the proxy page component.
In an example embodiment, the system initiates a background service for the application through the initiated proxy page component instead of the page component upon detecting that the application has switched to background runtime. The proxy page component now runs in the foreground, and the system can mark a page component as a Stopped state after saving state information (if one page component Activity is completely covered by another Activity, called Stopped state Stopped, the Activity still holds all state and member information, but is no longer visible, and its window is hidden).
According to the technical scheme of the example embodiment of fig. 2, on one hand, the background service is started by starting a proxy page component instead of a page component before the application program is switched to the background operation, so that the background service can be started when the application program is switched to the background operation, and the problem of application program crash is avoided; on the other hand, by starting a page component which is displayed in a non-explicit way as a proxy page component and starting background service according to the proxy page component, the application program can start service in the background without influencing the normal use of the user, and the use experience of the user is improved.
FIG. 3 schematically illustrates a flow diagram for background service initiation, in accordance with some embodiments of the present invention.
Referring to fig. 3, in step S310, since the 8.0 version and above of the android system prohibits the application from starting the target background service when running in the background, when the system monitors that the application is switched to the background running, a proxy page component displayed in a non-explicit manner is started;
step S320, binding the proxy page component running in the foreground with the target background service, and starting the target background service through the proxy page component.
Fig. 4 schematically illustrates a flow diagram for switching an application to foreground operation according to some embodiments of the present invention.
Referring to fig. 4, in step S410, when it is monitored that the application program is switched to the foreground runtime, state information corresponding to a page component of the application program is acquired.
In an example embodiment, the state information may refer to information associated with a current state where a User interacts with a page component of the application before the application is switched to a background for running, for example, the state information may be a Uniform Resource Locator (URL) associated with the page component, or may also be related information such as UI (User Interface, User Interface interaction) state information of the current page component, which is not particularly limited in the present invention.
Specifically, when the system monitors that the application program is switched to the background operation, the system also needs to acquire state information corresponding to the page component of the application program, so as to record the current state of the page component according to the state information, and store the state information in the target storage area. The target storage area may refer to a storage unit of the terminal device corresponding to the application program, for example, the target storage area may be a Random Access Memory (RAM) of the terminal device. Of course, the target storage area may also be other storage units, for example, the target storage area may also be a Flash Memory (Flash Memory), which is not limited in this respect.
In step S420, the page component is started based on the state information to replace the proxy page component by the page component.
In an example embodiment, when it is monitored that the application is switched to the foreground operation, the system may start the corresponding page component according to the state information corresponding to the obtained page component of the application, for example, the system starts the page component through state information such as a Uniform Resource Locator (URL) associated with the page component, or UI (User Interface) information of the current page component (that is, recovers a state corresponding to the page component when the application is switched to the background operation), and replaces the proxy page component according to the started page component, that is, the started page component runs in the foreground at this time, and the proxy page component may be marked as a kill state by the system (that is, a process is terminated, that is, the proxy Activity is deleted in a memory corresponding to the terminal device).
In step S430, the target background service is started by the page component.
In an example embodiment, the system binds the target background service through the started page component, and starts the target background service through the page component, so that the application program is restored to the state of being switched to the background operation. Similarly, the system acquires identification information corresponding to the target background service, binds the page component with the target background service according to the identification information, and starts the target background service through the page component.
FIG. 5 schematically illustrates a flow diagram of the set proxy page component according to some embodiments of the invention.
Referring to fig. 5, in step S510, the theme of the proxy page component is determined by a preset rule.
In an example embodiment, the preset rule may refer to a setting condition preset by a developer according to a function that the proxy page component needs to implement, for example, the preset rule may be a related setting condition for making the proxy page component display transparent, or may be a setting condition for recording an operation track of a user, which is not particularly limited in the present invention. The theme may refer to a set of properties that specify the appearance and format of modules such as a view and a window of a page component in android engineering, for example, the theme of a proxy page component may specify properties such as font size, background color, etc. of the proxy page component.
Specifically, the background, title bar, navigation bar, task bar icon and other attribute information of the proxy page component are completely transparently processed by setting the theme of the proxy page component. For example, a specific implementation in android engineering can be represented as:
<style name="theme_transparent">
< item name ═ android: windows Translucent "> true </item > (setting the window of the page component to be transparent)
< item name ═ android: windowBackground "> @ null </item > (setting the background of the page component to be transparent)
<itemname="android:windowContentOverlay">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:backgroundDimEnabled">false</item>
< item name ═ windows ActionBar "> false </item > (setting the navigation bar of the page assembly to transparent)
< item name ═ windows nottitle "> true </item > (setting the title bar of the page component to transparent)
</style>
Further, the proxy page component is hidden, so that the terminal device does not record the state information corresponding to the proxy page component. The hiding process may be to set a theme in the android project so that the android system does not record state information of the page component (here, it may also be considered as a user history operation track, that is, when the user performs a return operation, the UI corresponding to the agent Activity is not returned, but the UI corresponding to the Activity before the application is switched to the background operation is returned). For example, a specific implementation in android engineering can be represented as:
<activity
android:name="com.netease.***.ServiceProxyActivity"
android:theme="@style/biz_transparent"
android:launchMode="singleInstance"
android:excludeFromRecents="true"/>
it should be noted that the program code in the android project shown in the exemplary embodiment is only an illustrative example, and should not cause any limitation to the present disclosure.
In step S520, the proxy page component is created according to the theme of the proxy page component.
In an example embodiment, the system determines the theme of the proxy page component according to a preset rule, and creates the proxy page component through the theme of the proxy page component, so that the proxy page component is displayed in the foreground in a non-explicit mode.
It is noted that although the steps of the methods of the present invention are depicted in the drawings in a particular order, this does not require or imply that the steps must be performed in this particular order, or that all of the depicted steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
Exemplary devices
Having described the method of the exemplary embodiment of the present invention, the background service startup device of the exemplary embodiment of the present invention is next described with reference to fig. 6.
In fig. 6, the background service initiation means 600 may include: a background service acquiring unit 610, a background service binding unit 620, and a background service starting unit 630. Wherein: the background service acquiring unit 610 is configured to acquire a target background service that an application needs to be started when it is monitored that the application is switched to a background operation; the background service binding unit 620 is configured to start a page component that is displayed non-explicitly as a proxy page component, and bind the target background service with the proxy page component; the background service starting unit 630 is configured to start the target background service through the proxy page component.
In some embodiments of the present invention, based on the foregoing solution, the background service obtaining unit 610 is configured to: acquiring state information corresponding to a page component of the application program, and recording the current state of the page component according to the state information; and saving the state information to a target storage area.
In some embodiments of the present invention, based on the foregoing solution, the background service starting apparatus 600 further includes a page component restoring unit, and the page component restoring unit is configured to: when monitoring that the application program is switched to foreground operation, acquiring state information corresponding to a page component of the application program; starting the page component based on the state information to replace the proxy page component by the page component; and starting the target background service through the page component.
In some embodiments of the present invention, based on the foregoing solution, the background service binding unit 620 includes: the theme determining unit is used for determining the theme of the proxy page component through a preset rule; and the proxy page component creating unit is used for creating the proxy page component according to the theme of the proxy page component.
In some embodiments of the invention, based on the foregoing, the topic determination unit is configured to: and carrying out transparent processing on the background, the title bar, the navigation bar and the task bar icon of the proxy page component.
In some embodiments of the invention, based on the foregoing, the topic determination unit is configured to: and hiding the proxy page component so that the terminal equipment does not record the state information corresponding to the proxy page component.
In some embodiments of the present invention, based on the foregoing solution, the background service binding unit 620 is configured to: acquiring identification information of the target background service; the identification information comprises a registration identification and version information of the target background service; and binding the target background service with the proxy page component based on the identification information.
Examples of the inventionSex medium
Having described the apparatus of the exemplary embodiment of the present invention, a storage medium of the exemplary embodiment of the present invention will be described next.
In some embodiments, aspects of the present invention may also be implemented as a medium having stored thereon program code for implementing steps in a background service initiation method according to various exemplary embodiments of the present invention described in the above-mentioned "exemplary methods" section of this specification, when the program code is executed by a processor of a device.
For example, when the processor of the device executes the program code, step S210 shown in fig. 2 may be implemented, and when it is monitored that the application program is switched to the background operation, the target background service that the application program needs to be started is obtained; step S220, starting a non-explicitly displayed page component as a proxy page component, and binding the target background service with the proxy page component; step S230 starts the target background service through the proxy page component.
Referring to fig. 7, a program product 700 for implementing the background service startup method according to an embodiment of the present invention is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. The readable signal medium may also be any readable medium other than a readable storage medium.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user computing device, partly on the user device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN).
Exemplary computing device
Having described the background service startup method, the background service startup apparatus, and the storage medium according to exemplary embodiments of the present invention, an electronic device according to exemplary embodiments of the present invention is described next.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Thus, various aspects of the invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
In some possible embodiments, an electronic device according to the invention may comprise at least one processing unit, and at least one memory unit. Wherein the storage unit stores program code which, when executed by the processing unit, causes the processing unit to perform the steps in the data processing method according to various exemplary embodiments of the present invention described in the above section "exemplary method" of the present specification. For example, the processing unit may execute step S210 shown in fig. 2, and when it is monitored that the application program is switched to the background operation, obtain a target background service that the application program needs to be started; step S220, starting a non-explicitly displayed page component as a proxy page component, and binding the target background service with the proxy page component; step S230 starts the target background service through the proxy page component.
An electronic device 800 according to an example embodiment of the invention is described below with reference to fig. 8. The electronic device 800 shown in fig. 8 is only an example and should not bring any limitations to the functionality and scope of use of the embodiments of the present invention.
As shown in fig. 8, electronic device 800 is in the form of a general purpose computing device. The components of the electronic device 800 may include, but are not limited to: the at least one processing unit 801, the at least one memory unit 802, a bus 803 connecting different system components (including the memory unit 802 and the processing unit 801), a display unit 807.
The bus 803 includes a data bus, a control bus, and an address bus.
The storage unit 802 may include readable media in the form of volatile memory, such as Random Access Memory (RAM)8021 and/or cache memory 8022, and may further include Read Only Memory (ROM) 8023.
Storage unit 802 can also include a program/utility 8025 having a set (at least one) of program modules 8024, such program modules 8024 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
The electronic device 800 may also communicate with one or more external devices 804 (e.g., keyboard, pointing device, bluetooth device, etc.), which may be through an input/output (I/O) interface 805. Also, the electronic device 800 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 806. As shown, the network adapter 806 communicates with the other modules of the electronic device 800 over the bus 803. It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with the electronic device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
It should be noted that although in the above detailed description several units/modules or sub-units/modules of the background service launch apparatus are mentioned, such a division is merely exemplary and not mandatory. Indeed, the features and functionality of two or more of the units/modules described above may be embodied in one unit/module according to embodiments of the invention. Conversely, the features and functions of one unit/module described above may be further divided into embodiments by a plurality of units/modules.
Moreover, while the operations of the method of the invention are depicted in the drawings in a particular order, this does not require or imply that the operations must be performed in this particular order, or that all of the illustrated operations must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions.
While the spirit and principles of the invention have been described with reference to several particular embodiments, it is to be understood that the invention is not limited to the particular embodiments disclosed, nor is the division of aspects, which is for convenience only as the features in such aspects may not be combined to benefit. The invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

Claims (12)

1. A background service initiation method, comprising:
when monitoring that the application program is switched to background operation, acquiring target background service which needs to be started by the application program;
starting a page component which is displayed in a non-explicit way to serve as a proxy page component, and binding the target background service with the proxy page component;
starting the target background service through the proxy page component;
before monitoring that the application program is switched to the background operation and acquiring the target background service which needs to be started by the application program, the method further comprises the following steps:
acquiring state information corresponding to a page component of the application program, and recording the current state of the page component according to the state information;
saving the state information to a target storage area; and
when monitoring that the application program is switched to foreground operation, acquiring state information corresponding to a page component of the application program;
starting the page component based on the state information to replace the proxy page component by the page component;
and starting the target background service through the page component.
2. A background service startup method as claimed in claim 1, wherein starting a non-explicitly displayed page component as a proxy page component comprises:
determining the theme of the proxy page component through a preset rule;
and creating the proxy page component according to the theme of the proxy page component.
3. The background service starting method of claim 2, wherein determining the theme of the proxy page component through a preset rule comprises:
and carrying out transparent processing on the background, the title bar, the navigation bar and the task bar icon of the proxy page component.
4. A background service startup method as claimed in claim 2, wherein said determining the topic of the proxy page component by a preset rule further comprises:
and hiding the proxy page component so that the terminal equipment does not record the state information corresponding to the proxy page component.
5. The background service startup method of claim 1, wherein binding the target background service with the proxy page component comprises:
acquiring identification information of the target background service; the identification information comprises a registration identification and version information of the target background service;
and binding the target background service with the proxy page component based on the identification information.
6. A background service initiation apparatus, comprising:
the background service acquisition unit is used for acquiring target background services which need to be started by the application program when the application program is monitored to be switched to the background operation;
the background service binding unit is used for starting a non-explicitly displayed page component as a proxy page component and binding the target background service with the proxy page component;
the background service starting unit is used for starting the target background service through the proxy page component;
wherein the background service acquisition unit is configured to:
acquiring state information corresponding to a page component of the application program, and recording the current state of the page component according to the state information;
saving the state information to a target storage area; and
the background service starting device further comprises a page component restoring unit, wherein the page component restoring unit is configured to:
when monitoring that the application program is switched to foreground operation, acquiring state information corresponding to a page component of the application program;
starting the page component based on the state information to replace the proxy page component by the page component;
and starting the target background service through the page component.
7. The background service startup device of claim 6, wherein the background service binding unit comprises:
the theme determining unit is used for determining the theme of the proxy page component through a preset rule;
and the proxy page component creating unit is used for creating the proxy page component according to the theme of the proxy page component.
8. The background service activation apparatus according to claim 7, wherein the theme determination unit is configured to:
and carrying out transparent processing on the background, the title bar, the navigation bar and the task bar icon of the proxy page component.
9. The background service activation apparatus according to claim 7, wherein the theme determination unit is configured to:
and hiding the proxy page component so that the terminal equipment does not record the state information corresponding to the proxy page component.
10. The background service initiation apparatus of claim 6, wherein the background service binding unit is configured to:
acquiring identification information of the target background service; the identification information comprises a registration identification and version information of the target background service;
and binding the target background service with the proxy page component based on the identification information.
11. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the background service startup method according to any one of claims 1 to 5.
12. An electronic device, comprising:
a processor; and
a memory having stored thereon computer readable instructions which, when executed by the processor, implement the background service initiation method of any of claims 1 to 5.
CN201910167279.5A 2019-03-06 2019-03-06 Background service starting method, device, medium and electronic equipment Active CN109857537B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910167279.5A CN109857537B (en) 2019-03-06 2019-03-06 Background service starting method, device, medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910167279.5A CN109857537B (en) 2019-03-06 2019-03-06 Background service starting method, device, medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN109857537A CN109857537A (en) 2019-06-07
CN109857537B true CN109857537B (en) 2021-07-09

Family

ID=66900005

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910167279.5A Active CN109857537B (en) 2019-03-06 2019-03-06 Background service starting method, device, medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN109857537B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110941344B (en) * 2019-12-09 2022-03-15 Oppo广东移动通信有限公司 Method for obtaining gazing point data and related device
CN112416212B (en) * 2020-11-25 2023-05-30 维沃移动通信有限公司 Program access method, apparatus, electronic device and readable storage medium
CN112817654A (en) * 2021-01-26 2021-05-18 广州欢网科技有限责任公司 Method and device for restoring application software from background to foreground and controller

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107291336A (en) * 2017-07-13 2017-10-24 北京元心科技有限公司 Method and device for starting application programs among multiple systems and terminal equipment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103914335B (en) * 2013-01-05 2017-03-22 中国移动通信集团公司 Invoking method, equipment and system for background service
CN105095045A (en) * 2015-06-12 2015-11-25 深圳市美贝壳科技有限公司 Method and system for monitoring background service of Android system
CN105138372A (en) * 2015-08-27 2015-12-09 上海斐讯数据通信技术有限公司 Backstage service management and control system and method based on Android system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107291336A (en) * 2017-07-13 2017-10-24 北京元心科技有限公司 Method and device for starting application programs among multiple systems and terminal equipment

Also Published As

Publication number Publication date
CN109857537A (en) 2019-06-07

Similar Documents

Publication Publication Date Title
CN107172454B (en) Video recommendation method, medium, device and computing equipment
US7051288B2 (en) Method, system, and product for a java-based desktop to provide window manager services on UNIX
CN110113252B (en) Method and device for processing applet notification message and computer storage medium
CN111198730B (en) Method, device, terminal and computer storage medium for starting sub-application program
CN109857537B (en) Background service starting method, device, medium and electronic equipment
US11334374B2 (en) Modifying readable and focusable elements on a page during execution of automated scripts
CN103345405A (en) Application program starting method and device and client
CN109074278B (en) Validating stateful dynamic links in mobile applications
CN104685469A (en) Background application page architecture for WEB applications
US20190278431A1 (en) Window control for simultaneously running applications
CN111954072B (en) Multimedia playing method, device, multimedia player and medium
TW200925972A (en) Modifying hover help for a user interface
CN110083467B (en) Method and device for processing applet message and computer storage medium
CN114691273A (en) User interface returning method and device, electronic equipment and storage medium
CN114661375A (en) Application integration method and device
US20210026913A1 (en) Web browser control feature
CN110825370A (en) Mobile terminal application development method, device and system
CN103914289A (en) Desktop application access method and device
CN110083407B (en) Method and device for realizing step bar in applet, electronic equipment and storage medium
CN113535037A (en) Interactive display method and device for command line terminal, computer readable medium and equipment
KR101987183B1 (en) Apparatus, method and server for app development supporting front-end development using app development utility
CN112612531A (en) Application program starting method and device, electronic equipment and storage medium
US20230315499A1 (en) Simulation of user actions in computer environment
CN110147260B (en) Method, medium, apparatus and computing device for implementing scene transition animation
CN113821205A (en) Method and device for controlling small program page parameters, medium 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