CN108845845B - Shortcut key creation method and device, electronic equipment and storage medium - Google Patents

Shortcut key creation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN108845845B
CN108845845B CN201810688191.3A CN201810688191A CN108845845B CN 108845845 B CN108845845 B CN 108845845B CN 201810688191 A CN201810688191 A CN 201810688191A CN 108845845 B CN108845845 B CN 108845845B
Authority
CN
China
Prior art keywords
shortcut key
foreground
creation process
background
preset
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
CN201810688191.3A
Other languages
Chinese (zh)
Other versions
CN108845845A (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 Kingsoft Internet Security Software Co Ltd
Original Assignee
Beijing Kingsoft Internet Security Software 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 Kingsoft Internet Security Software Co Ltd filed Critical Beijing Kingsoft Internet Security Software Co Ltd
Priority to CN201810688191.3A priority Critical patent/CN108845845B/en
Publication of CN108845845A publication Critical patent/CN108845845A/en
Application granted granted Critical
Publication of CN108845845B publication Critical patent/CN108845845B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural
    • 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/4401Bootstrapping

Abstract

The embodiment of the invention provides a method, a device, electronic equipment and a storage medium for creating a shortcut key. In the invention, when the shortcut key creation process is detected to run in the background, the shortcut key creation process is made to be a foreground process by running the shortcut key creation process in the foreground, so that the shortcut key creation process can create the shortcut key of the target application program, the purpose of creating the shortcut key of the application program by the background process is achieved, and the creation of the shortcut key is convenient.

Description

Shortcut key creation method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and apparatus for creating a shortcut key, an electronic device, and a storage medium.
Background
In the process of using an electronic device, a shortcut key of an application program is often created, and at present, in the electronic device, the way of creating the shortcut key of the application program is as follows: only in the foreground process can a shortcut of the application be created.
Since during daily use there are often certain situations where a process running in the background needs to create a shortcut for an application. Because the method for creating the shortcut key can only create the shortcut key of the application program by the process in the foreground, the background process cannot create the shortcut key of the application program.
Disclosure of Invention
The embodiment of the invention aims to provide a method, a device, electronic equipment and a storage medium for creating a shortcut key of an application program by a background process. The specific technical scheme is as follows:
a method of shortcut key creation, the method comprising:
detecting whether a shortcut key creation process runs in the background;
if yes, the shortcut key creation process is operated on a foreground;
and creating the shortcut key of the target application program through the shortcut key creation process running in the foreground.
Optionally, the step of detecting whether the shortcut key creation process runs in the background includes:
detecting whether the process state value of the shortcut key creation process is larger than a preset state value;
if yes, determining that the shortcut key creation process runs in the background.
Optionally, the step of running the shortcut key creation process in the foreground includes:
Starting a preset background service in the shortcut key creation process;
and operating the preset background service on the foreground to obtain the shortcut key creation process operated on the foreground.
Optionally, the step of running the preset background service on the foreground to obtain the shortcut key creation process running on the foreground includes:
generating a resident notification in the preset background service;
binding the preset background service with the resident notification to obtain the shortcut key creation process running in the foreground.
Optionally, the step of running the preset background service on the foreground to obtain the shortcut key creation process running on the foreground includes:
selecting one resident notification from the resident notifications of the current operation;
binding the preset background service with the selected resident notification to obtain the shortcut key creation process running in the foreground.
Optionally, the step of creating the shortcut key of the target application program through the shortcut key creation process running in the foreground includes:
calling an interface of a system for creating the shortcut key through the shortcut key creation process running in the foreground, and displaying an inquiry popup of whether to create the shortcut key;
And receiving a creation instruction and creating a shortcut key of the target application program.
Optionally, after the step of starting the shortcut key creation process, before the step of detecting whether the shortcut key creation process is running in the background, the method further includes:
detecting whether the current system version number is higher than a preset version number, wherein the preset version number is a version number which does not support a background process to create a shortcut key;
and if so, executing the step of detecting whether the shortcut key creation process runs in the background.
Optionally, the step of detecting whether the current system version number is higher than a preset version number includes:
detecting whether the version number of the SDK of the software development kit of the current system is not less than a preset SDK version number;
if so, it is determined that the current system version number is higher than the preset version number.
A method of running a background process in a foreground, the method comprising:
starting a preset background service in a background process;
and selecting one resident notification from the resident notifications, and binding the preset background service with the selected resident notification to obtain the background process running on the foreground.
A shortcut key creation apparatus, the apparatus comprising:
The first detection module is used for detecting whether the shortcut key creation process runs in the background, and if so, the operation module is triggered;
the operation module is used for operating the shortcut key creation process on a foreground;
and the creation module is used for creating the shortcut key of the target application program through the shortcut key creation process running in the foreground.
Optionally, the first detection module is specifically configured to:
and detecting whether the process state value of the shortcut key creation process is larger than a preset state value, and if so, determining that the shortcut key creation process runs in the background.
Optionally, the operation module includes:
the starting unit is used for starting a preset background service in the shortcut key creation process;
and the operation unit is used for operating the preset background service on the foreground to obtain the shortcut key creation process operated on the foreground.
Optionally, the operation unit includes:
a generating subunit, configured to generate a resident notification in the preset background service;
the first binding unit is used for binding the preset background service with the resident notification to obtain the shortcut key creation process running in the foreground.
Optionally, the operation unit includes:
A selecting subunit, configured to select one resident notification from the resident notifications that are currently running;
and the second binding unit is used for binding the preset background service with the selected resident notification to obtain the shortcut key creation process running on the foreground.
Optionally, the creating module includes:
the calling unit is used for calling an interface of a system for creating the shortcut key through the shortcut key creation process running in the foreground and displaying an inquiry popup window for whether the shortcut key is created or not;
and the creating unit is used for receiving the creating instruction and creating the shortcut key of the target application program.
Optionally, the apparatus further includes:
and the second detection module is used for detecting whether the current system version number is higher than a preset version number or not before detecting whether the shortcut key creation process runs in the background after the shortcut key creation process is started, wherein the preset version number is a version number which does not support the background process to create the shortcut key, and if so, the detection is carried out to detect whether the shortcut key creation process runs in the background.
Optionally, the second detection module is specifically configured to:
and detecting whether the version number of the SDK of the software development kit of the current system is not smaller than the preset version number, and if so, determining that the version number of the current system is higher than the preset version number.
An apparatus for running a background process in a foreground, the apparatus comprising:
the starting module is used for starting a preset background service in a background process;
and the control module is used for selecting one resident notification from the resident notifications, binding the preset background service with the selected resident notification, and obtaining the background process running on the foreground.
An electronic device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing any one of the steps of the method for creating the shortcut key or the steps of the method for enabling the background process to run in the foreground when executing the computer program stored in the memory.
A computer readable storage medium having stored therein a computer program which when executed by a processor performs any of the above-described shortcut key creation method steps or method steps for causing a background process to run in the foreground.
In the embodiment of the invention, whether the shortcut key creation process runs in the background is detected, if yes, the shortcut key creation process runs in the foreground, and the shortcut key of the target application program is created through the shortcut key creation process running in the foreground. In the invention, when the shortcut key creation process is detected to run in the background, the shortcut key creation process is made to be a foreground process by running the shortcut key creation process in the foreground, so that the shortcut key creation process can create the shortcut key of the target application program, the purpose of creating the shortcut key of the application program by the background process is achieved, and the creation of the shortcut key is convenient.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a first flow of a method for creating a shortcut key according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a shortcut key creation process running in the foreground according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of a first process for creating a shortcut key running on a foreground by running a preset background service on the foreground according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a second flow chart of a shortcut key creation process running on a foreground when a preset background service is running on the foreground according to an embodiment of the present invention;
FIG. 5 is a schematic flow chart of creating a shortcut key of a target application program through a shortcut key creation process running in the foreground according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a second flowchart of a method for creating a shortcut key according to an embodiment of the present invention;
FIG. 7 is a flowchart of a method for running a background process in a foreground according to an embodiment of the present invention;
FIG. 8 is a schematic diagram of a shortcut key creation apparatus provided in an embodiment of the present invention;
FIG. 9 is a schematic structural diagram of an apparatus for running a background process on a foreground according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In order to solve the technical problem that a shortcut key of an application running in the background cannot be created, the embodiment of the invention provides a shortcut key creation method, a shortcut key creation device, electronic equipment and a storage medium.
The following first describes a shortcut key creation method provided by the embodiment of the present invention.
The shortcut key creation method provided by the embodiment of the invention is applied to the electronic equipment, wherein the electronic equipment can comprise but is not limited to the following equipment: cell phone, tablet computer.
As shown in fig. 1, a method for creating a shortcut key according to an embodiment of the present invention may include:
s101: it is detected whether the shortcut key creation process is running in the background, if yes, step S102 is executed, and if no, step S104 is executed.
When the user needs to create the shortcut key of the target application program, a shortcut key creation instruction for the target application program, namely, a shortcut key creation instruction of the target application program is sent, and the electronic equipment receives the shortcut key creation instruction of the target application program. Of course, the shortcut key of the target application program can be set to be created as soon as the target application program is started, and at this time, the electronic device also receives the shortcut key creation instruction of the target application program.
After receiving a target application shortcut key creation instruction, the electronic device acquires a shortcut key of a target application to be created, and starts a shortcut key creation process for creating the shortcut key of the target application, wherein the shortcut key creation process is a process for creating the shortcut key of the target application.
The process is the execution process of the program, and is one running activity of the program with a certain independent function on a certain data set.
Since in the related art, only the process in the foreground can create the shortcut key of the application program, in order to determine whether the shortcut key creation process can create the shortcut key of the target application program, it is necessary to detect whether the shortcut key creation process is running in the background and perform the subsequent steps according to the detection result.
Because each process corresponds to a process state value, the process state value can reflect whether a foreground activity or a foreground service exists in the corresponding process, if the foreground activity or the foreground service exists, the process is described as a foreground process, that is, the process operates in the foreground, and therefore whether the shortcut key creation process operates in the background can be determined according to the process state value.
Therefore, the detecting whether the shortcut key creation process runs in the background may include:
detecting whether a process state value of a shortcut key creation process is larger than a preset state value;
if so, determining that the shortcut key creation process runs in the background.
In order to detect whether the process state value of the shortcut key creation process is greater than a preset state value, the process state value of the shortcut key creation process needs to be obtained.
By way of example, the way to obtain the process state value of the shortcut key creation process may be: and obtaining the process information RunningAppProcessInfo maintained in the activity management ActiveyManager by the shortcut key creation process according to the process ID of the shortcut key creation process, and then obtaining the process state value ProcessState in the process information RunningAppProcessInfo in a reflection mode.
After the process state value of the shortcut key creation process is obtained, whether the process state value of the shortcut key creation process is larger than a preset state value or not can be detected, if so, no foreground activity or foreground service exists in the shortcut key creation process, the shortcut key creation process is described as a background process, and the shortcut key creation process is determined to run in the background; if not, the foreground activity or the foreground service exists in the shortcut key creation process, the shortcut key creation process is the foreground process, and the shortcut key creation process is determined to run in the foreground.
The preset state value may be, for example, 4.
S102: and running the shortcut key creation process in the foreground.
And under the condition that the shortcut key creation process is detected to run in the background, the shortcut key creation process is not capable of creating the shortcut key of the target application program. Since only a process running in the foreground can create a shortcut of an application, in order to create a shortcut of a target application, a shortcut creation process needs to be run in the foreground.
Since if there is a foreground service in the process, the process is described as a foreground process, that is, the process runs in the foreground, the above running of the shortcut key creation process in the foreground may be: and running the shortcut key creation process on the foreground in a mode that a foreground service exists in the shortcut key creation process. Referring to fig. 2, step S102 may include:
s1021: and starting a preset background service in the shortcut key creation process.
In order to enable the foreground service to exist in the shortcut key creation process, the foreground service needs to be started in the shortcut key creation process, and because the shortcut key creation process runs in the background and only the background server can be started, the preset background service can be started in the shortcut key creation process, and then the foreground service exists in the shortcut key creation process in a mode that the started preset background service runs in the foreground.
S1022: and operating the preset background service on the foreground to obtain a shortcut key creation process operated on the foreground.
In order to enable a foreground service to exist in the shortcut key creation process, after a preset background service is started, the preset background service can be operated on the foreground to obtain the shortcut key creation process operated on the foreground.
Thus, the shortcut key creation process is run in the foreground in such a manner that a foreground service exists in the shortcut key creation process.
The preset background service only has the function of enabling the shortcut key creation process to run in the foreground, so that the preset background service can be finished after the shortcut key creation process is run in the foreground.
Generally, the preset background service is started, the preset background service is operated in the foreground, and the process of obtaining the shortcut key creation process operated in the foreground is short, so that the preset operation duration can be set when the preset background service is started, and the preset background service is automatically ended when the operation duration of the preset background service reaches the preset duration. The preset run length may be, for example, 3s.
The foregoing method for running the preset background service on the foreground to obtain the shortcut key creation process running on the foreground has various manners, including but not limited to the following several manners:
the first way is:
referring to fig. 3, step S1022 may include:
s10221: in a preset background service, a resident notification is generated.
Since the resident notification is a notification that cannot be deleted on the interface of the electronic device, that is, the resident notification is running in the foreground, in order to obtain the shortcut key creation process running in the foreground, the resident notification may be generated in the preset background service.
In the foregoing method for generating the resident notification in the preset background service, the method may be: in the preset background service, a preset notification is generated, and the preset notification is changed into a resident notification through a preset resident notification generation method.
For example, the preset resident notification generation method may be: startForeground method.
S10222: binding a preset background service with the resident notification to obtain a shortcut key creation process running in the foreground.
After the resident notification is generated, the preset background service and the resident notification can be bound, and after the preset background service and the resident notification are bound, the preset background service runs in the foreground, and at the moment, the preset background service running in the foreground exists in the shortcut key creation process, namely the foreground service exists, so that the shortcut key creation process running in the foreground is obtained.
In this way, in the preset background service, the resident notification is generated, and the shortcut key creation process running in the foreground is obtained by binding the preset background service with the generated resident notification.
The second way is:
referring to fig. 4, step S1022 may include:
s10223: from the currently running resident notifications, one resident notification is selected.
Since there are a plurality of resident notifications running on the interface of the general electronic device, one resident notification may be selected from the resident notifications running currently in order to obtain the shortcut key creation process running in the foreground. Any one of the resident notifications may be selected.
S10224: binding the preset background service with the selected resident notification to obtain a shortcut key creation process running in the foreground.
After one resident notification is selected, the preset background service and the selected resident notification can be bound, and after the preset background service and the selected resident notification are bound, the preset background service runs on the foreground, and at the moment, the preset background service running on the foreground exists in the shortcut key creation process, namely the foreground service exists, so that the shortcut key creation process running on the foreground is obtained.
Thus, one resident notification is selected from the resident notifications which are currently running, and the shortcut key creation process which is running in the foreground is obtained by binding the preset background service with the selected resident notification.
S103: and creating the shortcut key of the target application program through a shortcut key creation process running in the foreground.
After the shortcut key creation process is operated in the foreground, the shortcut key creation process can create the shortcut key of the target application program, namely, the shortcut key of the target application program is created through the shortcut key creation process operated in the foreground.
Referring to fig. 5, step S103 may include:
s1031: and calling an interface of the system for creating the shortcut key through a shortcut key creation process running in the foreground, and displaying an inquiry popup of whether to create the shortcut key.
In order to avoid the background from automatically creating the shortcut key, before the shortcut key is created, the user needs to be inquired whether to create the shortcut key, namely, the interface of the system for creating the shortcut key needs to be called through the shortcut key creation process running in the foreground, and the inquiry popup window of whether to create the shortcut key is displayed.
S1032: and receiving a creation instruction and creating a shortcut key of the target application program.
The user checks the query popup window, selects whether to create a shortcut key according to the self requirement, and sends a creation instruction when the user selects to create the shortcut key, and the electronic equipment receives the creation instruction to create the shortcut key of the target application program.
Thereby, the shortcut key of the target application is created by calling the interface of the system for creating the shortcut key.
S104: and creating the shortcut key of the target application program through the shortcut key creation process.
In the case of detecting that the shortcut-creating process is running in the foreground, it is explained that the shortcut-creating process can create a shortcut of the target application. At this time, the shortcut key of the target application program can be created through the shortcut key creation process.
Thus, under the condition that the shortcut key creation process is detected to run in the foreground, the shortcut key of the target application program is created directly through the shortcut key creation process.
In the embodiment of the invention, whether the shortcut key creation process runs in the background is detected, if yes, the shortcut key creation process runs in the foreground, and the shortcut key of the target application program is created through the shortcut key creation process running in the foreground. In the invention, when the shortcut key creation process is detected to run in the background, the shortcut key creation process is made to be a foreground process by running the shortcut key creation process in the foreground, so that the shortcut key creation process can create the shortcut key of the target application program, the purpose of creating the shortcut key of the application program by the background process is achieved, and the creation of the shortcut key is convenient.
On the basis of the method shown in fig. 1, before step S101, as shown in fig. 6, the method for creating a shortcut key according to the embodiment of the present invention may further include:
S101A: and detecting whether the current system version number is higher than a preset version number, wherein the preset version number is a version number which does not support the background process to create a shortcut key, if so, executing the step S101, and if not, performing no processing.
Different system versions have different specifications for creating the shortcut key of the application program, and some system versions have specifications for creating the shortcut key of the application program: only in the foreground process, the shortcut key of the application program can be created, and the specification of the creation of the shortcut key of the application program by the system version is as follows: a shortcut to the application may be created, either in the background or in a background process.
If the current system version is a system version which can create the shortcut key of the application program no matter in the background or in a background process, the shortcut key of the target application program can be directly created without detecting whether the shortcut key creation process runs in the background.
If the current system version is one that can only be created for a process in the foreground, it is necessary to detect whether the shortcut key creation process is running in the background. Therefore, before detecting whether the shortcut key creation process runs in the background, it is necessary to detect whether the current system version number is higher than a preset version number to determine why the current system version is, where the preset version number is a version number that does not support the background process to create the shortcut key.
When the current system version number is detected to be higher than the preset version number, the current system version is a system version in which the shortcut key of the application program can be created only in the foreground process, and at this time, in order to create the shortcut key of the target application program, it is required to detect whether the shortcut key creation process is running in the background, that is, step S101 is executed.
The detecting whether the current system version number is higher than the preset version number may include:
Detecting whether the version number of the SDK of the software development kit of the current system is not less than a preset SDK version number;
if so, it is determined that the current system version number is higher than the preset version number.
Because the software development kit SDK version number may reflect the specification of the creation of the shortcut key to the application program by the current system, whether the current system version number is higher than the preset version number may be determined by detecting whether the software development kit SDK version number of the current system is not less than the preset SDK version number. The preset SDK version number is an SDK version number which does not support a background process to create a shortcut key.
When the software development kit SDK version number of the current system is detected to be not smaller than the preset SDK number, the current system is not supported by the background process to create a shortcut key, and therefore the fact that the current system version number is higher than the preset version number can be determined.
Therefore, when the current system version number is detected to be higher than the preset version number, the step and the subsequent steps of detecting whether the shortcut key creation process runs in the background are executed, and the step of detecting whether the shortcut key creation process runs in the background is executed when the system version is the system version which can create the shortcut key of the application program no matter in the background or in the background process, so that the resource occupation is reduced, and the running cost is reduced.
The embodiment of the invention also provides a method for running the background process on the foreground, which is applied to the electronic equipment, wherein the electronic equipment can comprise but is not limited to the following equipment: cell phone, tablet computer.
As shown in fig. 7, a method for running a background process on a foreground according to an embodiment of the present invention may include:
s201: and starting a preset background service in the background process.
In order to enable the background process to run in the foreground, the foreground service needs to be existed in the background process, in order to enable the foreground service to exist in the background process, the foreground service needs to be started in the background process, and since the background process runs in the background and only the background server can be started, the preset background service can be started in the background process, and then the foreground service exists in the background process in a mode of running the started preset background service in the foreground.
S202: and running the preset background service on the foreground to obtain a background process running on the foreground.
In order to enable the background process to have the foreground service, after the preset background service is started, the preset background service can be operated on the foreground to obtain the background process operated on the foreground.
For example, step S202 may include: and selecting one resident notification from the resident notifications, and binding a preset background service with the selected resident notification to obtain a background process running on the foreground.
Since the resident notifications cannot be deleted on the interface of the electronic device, that is, the resident notifications are running in the foreground, in order to obtain the background process running in the foreground, one resident notification may be selected from the resident notifications, and the preset background service and the selected resident notification are bound to obtain the background process running in the foreground.
The manner of selecting one resident notification from the resident notifications may be: in the preset background service, generating a resident notification, selecting the generated resident notification, or selecting one resident notification from the resident notifications currently running, and detailed description can be referred to in the related description of fig. 3 and fig. 4, which are not repeated here.
Thus, the background process is run on the foreground by allowing the foreground service to exist in the background process.
With respect to the above-mentioned shortcut key creation method embodiment, referring to fig. 8, the embodiment of the present invention further provides a shortcut key creation apparatus, which may include:
A first detection module 801, configured to detect whether a shortcut key creation process is running in the background, and if so, trigger an operation module;
the running module 802 is configured to run the shortcut key creation process in a foreground;
a creating module 803, configured to create a shortcut of the target application through the shortcut creation process running in the foreground.
In the embodiment of the invention, whether the shortcut key creation process runs in the background is detected, if yes, the shortcut key creation process runs in the foreground, and the shortcut key of the target application program is created through the shortcut key creation process running in the foreground. In the invention, when the shortcut key creation process is detected to run in the background, the shortcut key creation process is made to be a foreground process by running the shortcut key creation process in the foreground, so that the shortcut key creation process can create the shortcut key of the target application program, the purpose of creating the shortcut key of the application program by the background process is achieved, and the creation of the shortcut key is convenient.
In one implementation of the present invention, the first detection module 801 may be specifically configured to:
and detecting whether the process state value of the shortcut key creation process is larger than a preset state value, and if so, determining that the shortcut key creation process runs in the background.
In one implementation of the present invention, the running module 802 may include:
the starting unit is used for starting a preset background service in the shortcut key creation process;
and the operation unit is used for operating the preset background service on the foreground to obtain the shortcut key creation process operated on the foreground.
In one implementation manner of the present invention, the operation unit may include:
a generating subunit, configured to generate a resident notification in the preset background service;
the first binding unit is used for binding the preset background service with the resident notification to obtain the shortcut key creation process running in the foreground.
In one implementation manner of the present invention, the operation unit may include:
a selecting subunit, configured to select one resident notification from the resident notifications that are currently running;
and the second binding unit is used for binding the preset background service with the selected resident notification to obtain the shortcut key creation process running on the foreground.
In one implementation of the present invention, the creating module 803 may include:
the calling unit is used for calling an interface of a system for creating the shortcut key through the shortcut key creation process running in the foreground and displaying an inquiry popup window for whether the shortcut key is created or not;
And the creating unit is used for receiving the creating instruction and creating the shortcut key of the target application program.
In one implementation of the present invention, the apparatus may further include:
and the second detection module is used for detecting whether the current system version number is higher than a preset version number or not before detecting whether the shortcut key creation process runs in the background after the shortcut key creation process is started, wherein the preset version number is a version number which does not support the background process to create the shortcut key, and if so, the detection is carried out to detect whether the shortcut key creation process runs in the background.
In one implementation manner of the present invention, the second detection module may be specifically configured to:
and detecting whether the version number of the SDK of the software development kit of the current system is not smaller than the preset version number, and if so, determining that the version number of the current system is higher than the preset version number.
With respect to the above embodiment of the method for enabling the background process to run in the foreground, referring to fig. 9, an embodiment of the present invention further provides an apparatus for enabling the background process to run in the foreground, where the apparatus may include:
the starting module 901 is configured to start a preset background service in a background process;
And the control module 902 is configured to run the preset background service on the foreground, so as to obtain the background process running on the foreground.
Thus, the background process is run on the foreground by allowing the foreground service to exist in the background process.
In one implementation of the present invention, the control module 902 may include:
a selection unit for selecting one resident notification from the resident notifications;
and the binding unit is used for binding the preset background service with the selected resident notification to obtain the background process running on the foreground.
The embodiment of the invention also provides an electronic device, as shown in fig. 10, comprising a processor 1001 and a memory 1002,
a memory 1002 for storing a computer program;
the processor 1001 is configured to implement a method for creating a shortcut key when executing a computer program stored on the memory 1002, and the method may include the steps of:
detecting whether a shortcut key creation process runs in the background;
if yes, the shortcut key creation process is operated on a foreground;
and creating the shortcut key of the target application program through the shortcut key creation process running in the foreground.
In the embodiment of the invention, the electronic equipment detects whether the shortcut key creation process runs in the background, if so, the shortcut key creation process runs in the foreground, and the shortcut key of the target application program is created through the shortcut key creation process running in the foreground. In the invention, when the shortcut key creation process is detected to run in the background, the shortcut key creation process is made to be a foreground process by running the shortcut key creation process in the foreground, so that the shortcut key creation process can create the shortcut key of the target application program, the purpose of creating the shortcut key of the application program by the background process is achieved, and the creation of the shortcut key is convenient.
In one implementation of the present invention, the step of detecting whether the shortcut key creation process runs in the background may include:
detecting whether the process state value of the shortcut key creation process is larger than a preset state value;
if yes, determining that the shortcut key creation process runs in the background.
In one implementation of the present invention, the step of running the shortcut key creation process in the foreground may include:
starting a preset background service in the shortcut key creation process;
and operating the preset background service on the foreground to obtain the shortcut key creation process operated on the foreground.
In an implementation manner of the present invention, the step of running the preset background service on the foreground to obtain the shortcut key creation process running on the foreground may include:
generating a resident notification in the preset background service;
binding the preset background service with the resident notification to obtain the shortcut key creation process running in the foreground.
In an implementation manner of the present invention, the step of running the preset background service on the foreground to obtain the shortcut key creation process running on the foreground may include:
Selecting one resident notification from the resident notifications of the current operation;
binding the preset background service with the selected resident notification to obtain the shortcut key creation process running in the foreground.
In one implementation of the present invention, the step of creating the shortcut of the target application by the shortcut creation process running in the foreground may include:
calling an interface of a system for creating the shortcut key through the shortcut key creation process running in the foreground, and displaying an inquiry popup of whether to create the shortcut key;
and receiving a creation instruction and creating a shortcut key of the target application program.
In one implementation of the present invention, after the step of starting the shortcut key creation process, before the step of detecting whether the shortcut key creation process is running in the background, the method may further include:
detecting whether the current system version number is higher than a preset version number, wherein the preset version number is a version number which does not support a background process to create a shortcut key;
and if so, executing the step of detecting whether the shortcut key creation process runs in the background.
In one implementation manner of the present invention, the step of detecting whether the current system version number is higher than a preset version number may include:
Detecting whether the version number of the SDK of the software development kit of the current system is not less than a preset SDK version number;
if so, it is determined that the current system version number is higher than the preset version number.
The processor 1001 is further configured to implement a method for enabling a background process to run in a foreground when executing a computer program stored on the memory 1002, where the method may include the following steps:
starting a preset background service in a background process;
and operating the preset background service on a foreground to obtain the background process operating on the foreground.
In the embodiment of the invention, the electronic equipment starts a preset background service in a background process, and the preset background service is operated on a foreground to obtain the background process operated on the foreground. In the invention, the background process is operated on the foreground by making the background process have the foreground service.
In an implementation manner of the present invention, the step of running the preset background service on a foreground to obtain the background process running on the foreground may include:
selecting one resident notification from the resident notifications;
binding the preset background service with the selected resident notification to obtain the background process running on the foreground.
The Memory mentioned in the electronic device may include a random access Memory (Random Access Memory, RAM) or may include a Non-Volatile Memory (NVM), such as at least one magnetic disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processing, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
The embodiment of the invention also provides a computer readable storage medium, wherein a computer program is stored in the computer readable storage medium, and when the computer program is executed by a processor, a shortcut key creation method is realized, and the method can comprise the following steps:
detecting whether a shortcut key creation process runs in the background;
if yes, the shortcut key creation process is operated on a foreground;
And creating the shortcut key of the target application program through the shortcut key creation process running in the foreground.
In the embodiment of the invention, when the computer program is executed by the processor, whether the shortcut key creation process runs in the background is detected, if so, the shortcut key creation process runs in the foreground, and the shortcut key of the target application program is created through the shortcut key creation process running in the foreground. In the invention, when the shortcut key creation process is detected to run in the background, the shortcut key creation process is made to be a foreground process by running the shortcut key creation process in the foreground, so that the shortcut key creation process can create the shortcut key of the target application program, the purpose of creating the shortcut key of the application program by the background process is achieved, and the creation of the shortcut key is convenient.
In one implementation of the present invention, the step of detecting whether the shortcut key creation process runs in the background may include:
detecting whether the process state value of the shortcut key creation process is larger than a preset state value;
if yes, determining that the shortcut key creation process runs in the background.
In one implementation of the present invention, the step of running the shortcut key creation process in the foreground may include:
Starting a preset background service in the shortcut key creation process;
and operating the preset background service on the foreground to obtain the shortcut key creation process operated on the foreground.
In an implementation manner of the present invention, the step of running the preset background service on the foreground to obtain the shortcut key creation process running on the foreground may include:
generating a resident notification in the preset background service;
binding the preset background service with the resident notification to obtain the shortcut key creation process running in the foreground.
In an implementation manner of the present invention, the step of running the preset background service on the foreground to obtain the shortcut key creation process running on the foreground may include:
selecting one resident notification from the resident notifications of the current operation;
binding the preset background service with the selected resident notification to obtain the shortcut key creation process running in the foreground.
In one implementation of the present invention, the step of creating the shortcut of the target application by the shortcut creation process running in the foreground may include:
calling an interface of a system for creating the shortcut key through the shortcut key creation process running in the foreground, and displaying an inquiry popup of whether to create the shortcut key;
And receiving a creation instruction and creating a shortcut key of the target application program.
In one implementation of the present invention, after the step of starting the shortcut key creation process, before the step of detecting whether the shortcut key creation process is running in the background, the method may further include:
detecting whether the current system version number is higher than a preset version number, wherein the preset version number is a version number which does not support a background process to create a shortcut key;
and if so, executing the step of detecting whether the shortcut key creation process runs in the background.
In one implementation manner of the present invention, the step of detecting whether the current system version number is higher than a preset version number may include:
detecting whether the version number of the SDK of the software development kit of the current system is not less than a preset SDK version number;
if so, it is determined that the current system version number is higher than the preset version number.
The computer program, when executed by a processor, implements a method for running a background process in a foreground, the method may comprise the steps of:
starting a preset background service in a background process;
and operating the preset background service on a foreground to obtain the background process operating on the foreground.
In the embodiment of the invention, when the computer program is executed by the processor, a preset background service is started in a background process, and the preset background service is operated on a foreground to obtain the background process operated on the foreground. In the invention, the background process is operated on the foreground by making the background process have the foreground service.
In an implementation manner of the present invention, the step of running the preset background service on a foreground to obtain the background process running on the foreground may include:
selecting one resident notification from the resident notifications;
binding the preset background service with the selected resident notification to obtain the background process running on the foreground.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims (18)

1. A method of shortcut key creation, the method comprising:
starting a shortcut key creation process for creating a shortcut key of the target application;
detecting whether the shortcut key creation process runs in the background;
if yes, the shortcut key creation process is operated on a foreground;
creating a shortcut key of the target application program through the shortcut key creating process running in the foreground;
the step of running the shortcut key creation process in the foreground comprises the following steps:
Starting a preset background service in the shortcut key creation process; and operating the preset background service on the foreground to obtain the shortcut key creation process operated on the foreground.
2. The method of claim 1, wherein the step of detecting whether the shortcut creation process is running in the background comprises:
detecting whether the process state value of the shortcut key creation process is larger than a preset state value;
if yes, determining that the shortcut key creation process runs in the background.
3. The method according to claim 1, wherein the step of running the preset background service in the foreground to obtain the shortcut creation process running in the foreground includes:
generating a resident notification in the preset background service;
binding the preset background service with the resident notification to obtain the shortcut key creation process running in the foreground.
4. The method according to claim 1, wherein the step of running the preset background service in the foreground to obtain the shortcut creation process running in the foreground includes:
selecting one resident notification from the resident notifications of the current operation;
Binding the preset background service with the selected resident notification to obtain the shortcut key creation process running in the foreground.
5. The method of claim 1, wherein the step of creating the shortcut of the target application by the shortcut creation process running in the foreground comprises:
calling an interface of a system for creating the shortcut key through the shortcut key creation process running in the foreground, and displaying an inquiry popup of whether to create the shortcut key;
and receiving a creation instruction and creating a shortcut key of the target application program.
6. The method according to claim 1, wherein after the step of starting a shortcut creation process for creating a shortcut of a target application, before the step of detecting whether the shortcut creation process is running in the background, the method further comprises:
detecting whether the current system version number is higher than a preset version number, wherein the preset version number is a version number which does not support a background process to create a shortcut key;
and if so, executing the step of detecting whether the shortcut key creation process runs in the background.
7. The method of claim 6, wherein the step of detecting whether the current system version number is higher than a preset version number comprises:
Detecting whether the version number of the SDK of the software development kit of the current system is not less than a preset SDK version number;
if so, it is determined that the current system version number is higher than the preset version number.
8. A method for running a background process in a foreground, the method comprising:
starting a preset background service in a background process;
and selecting one resident notification from the resident notifications, and binding the preset background service with the selected resident notification to obtain the background process running on a foreground, wherein the background process is a process for creating a shortcut key of a target application program.
9. A shortcut key creation apparatus, characterized by comprising:
the starting module is used for starting a shortcut key creation process for creating a shortcut key of the target application program;
the first detection module is used for detecting whether the shortcut key creation process runs in the background, and if so, the operation module is triggered;
the operation module is used for operating the shortcut key process on a foreground;
the creation module is used for creating the shortcut key of the target application program through the shortcut key creation process running in the foreground;
wherein, the operation module is fast, includes: the starting unit is used for starting a preset background service in the shortcut key creation process; and the operation unit is used for operating the preset background service on the foreground to obtain the shortcut key creation process operated on the foreground.
10. The apparatus according to claim 9, wherein the first detection module is specifically configured to:
and detecting whether the process state value of the shortcut key creation process is larger than a preset state value, and if so, determining that the shortcut key creation process runs in the background.
11. The apparatus of claim 9, wherein the operation unit comprises:
a generating subunit, configured to generate a resident notification in the preset background service;
the first binding unit is used for binding the preset background service with the resident notification to obtain the shortcut key creation process running in the foreground.
12. The apparatus of claim 9, wherein the operation unit comprises:
a selecting subunit, configured to select one resident notification from the resident notifications that are currently running;
and the second binding unit is used for binding the preset background service with the selected resident notification to obtain the shortcut key creation process running on the foreground.
13. The apparatus of claim 9, wherein the creation module comprises:
the calling unit is used for calling an interface of a system for creating the shortcut key through the shortcut key creation process running in the foreground and displaying an inquiry popup window for whether the shortcut key is created or not;
And the creating unit is used for receiving the creating instruction and creating the shortcut key of the target application program.
14. The apparatus of claim 9, wherein the apparatus further comprises:
and the second detection module is used for detecting whether the current system version number is higher than a preset version number after the shortcut key creation process for creating the shortcut key of the target application program is started and before detecting whether the shortcut key creation process runs in the background, wherein the preset version number is a version number which does not support the background process to create the shortcut key, and if so, the detection is carried out to detect whether the shortcut key creation process runs in the background.
15. The apparatus according to claim 14, wherein the second detection module is specifically configured to:
and detecting whether the version number of the SDK of the software development kit of the current system is not smaller than the preset version number, and if so, determining that the version number of the current system is higher than the preset version number.
16. An apparatus for running a background process in a foreground, the apparatus comprising:
the starting module is used for starting a preset background service in a background process;
and the control module is used for selecting one resident notification from the resident notifications, binding the preset background service with the selected resident notification, and obtaining the background process running on the foreground, wherein the background process is a process for creating a shortcut key of a target application program.
17. The electronic equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
a processor for carrying out the method steps of claims 1-7 or 8 when executing a computer program stored on a memory.
18. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored therein a computer program which, when executed by a processor, implements the method steps of claims 1-7 or 8.
CN201810688191.3A 2018-06-28 2018-06-28 Shortcut key creation method and device, electronic equipment and storage medium Active CN108845845B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810688191.3A CN108845845B (en) 2018-06-28 2018-06-28 Shortcut key creation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810688191.3A CN108845845B (en) 2018-06-28 2018-06-28 Shortcut key creation method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN108845845A CN108845845A (en) 2018-11-20
CN108845845B true CN108845845B (en) 2023-06-20

Family

ID=64201481

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810688191.3A Active CN108845845B (en) 2018-06-28 2018-06-28 Shortcut key creation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108845845B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109710128B (en) * 2018-12-19 2020-12-18 北京金山安全软件有限公司 Shortcut key display method and device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105975339A (en) * 2016-05-26 2016-09-28 北京金山安全软件有限公司 Switching operation method and device
CN106371704B (en) * 2016-09-30 2020-11-10 山东兴创信息科技有限公司 Application shortcut layout method of screen locking interface and terminal
CN106648295A (en) * 2016-09-30 2017-05-10 北京奇虎科技有限公司 Shortcut key display method and apparatus, and intelligent terminal
CN106648861B (en) * 2016-12-05 2020-07-14 阿里巴巴(中国)有限公司 Keep-alive method and device for background service process
CN106919331A (en) * 2017-01-20 2017-07-04 珠海市魅族科技有限公司 A kind of quick control method and system

Also Published As

Publication number Publication date
CN108845845A (en) 2018-11-20

Similar Documents

Publication Publication Date Title
US20220100353A1 (en) Launching Application Task Based on Single User Input and Preset Condition
JP6571277B2 (en) Method and apparatus for loading terminal application
CN106919427B (en) Setting method, setting device and electronic equipment
CN106528791B (en) A kind of method and device of sending out notice message
CN107957837B (en) Method and device for generating shortcut of webpage application program and terminal equipment
CN105512033A (en) Automated testing method and device of mobile terminal and mobile terminal
CN109117153B (en) Application processing method, device, terminal and storage medium
CN105376719A (en) Information pushing method and device
CN107577527B (en) Task generation and scheduling method and device
CN108845845B (en) Shortcut key creation method and device, electronic equipment and storage medium
CN107547285B (en) Configuration information storage method and device
CN113485722A (en) Application program shelf loading method and processing method for application store and computer equipment
US8972533B1 (en) Activating touch-sensitive keys utilizing configuration settings
CN113721936B (en) Application management method, intelligent terminal, device and storage medium
CN108920333B (en) Event state monitoring method and event state monitor
CN111124627A (en) Method, device, terminal and storage medium for determining application program caller
CN113126982B (en) Application program generation and operation method and device
CN111294377A (en) Network request sending method of dependency relationship, terminal device and storage medium
CN110795242A (en) Storage space management method and device, electronic equipment and storage medium
CN108762736B (en) Project branch management method, device and equipment and computer readable storage medium
CN107728769B (en) Background application management method and device and computer readable storage medium
CN111026466A (en) File processing method and device, computer readable storage medium and electronic equipment
CN110321196A (en) Information display method and device
CN111914148A (en) Switching method and device of search engine and electronic equipment
CN105988804B (en) Software transfer method and terminal

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