WO2017190450A1 - 进程关闭方法及装置 - Google Patents

进程关闭方法及装置 Download PDF

Info

Publication number
WO2017190450A1
WO2017190450A1 PCT/CN2016/096740 CN2016096740W WO2017190450A1 WO 2017190450 A1 WO2017190450 A1 WO 2017190450A1 CN 2016096740 W CN2016096740 W CN 2016096740W WO 2017190450 A1 WO2017190450 A1 WO 2017190450A1
Authority
WO
WIPO (PCT)
Prior art keywords
application
camera
configuration file
preset configuration
needs
Prior art date
Application number
PCT/CN2016/096740
Other languages
English (en)
French (fr)
Inventor
严力
Original Assignee
深圳Tcl数字技术有限公司
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 深圳Tcl数字技术有限公司 filed Critical 深圳Tcl数字技术有限公司
Publication of WO2017190450A1 publication Critical patent/WO2017190450A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44594Unloading
    • 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/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system

Definitions

  • the present invention relates to the field of computer technologies, and in particular, to a method and apparatus for shutting down a process.
  • Android system has been rapidly developed due to its openness, allowing any device manufacturer to become its developer. It has become one of the mainstream operating systems and is widely used in mobile phones, tablets, TVs and cameras. For users, the biggest benefit is the availability of a wealth of Android-based software resources.
  • the camera is still in the occupied state in the background process, and the camera resources cannot be released in time because the process of occupying the camera is not closed in time.
  • the invention provides a method and device for shutting down a process, which aims to solve the technical problem that the resources of the camera cannot be released in time due to the fact that the process of occupying the camera is not closed in time in the Android system.
  • the present invention provides a process shutdown method, and the process shutdown method includes the following steps:
  • the system attribute value is the process number of the application, it is determined that the camera is occupied by other processes, and the process currently occupying the camera is closed by the framework layer.
  • the process shutdown method further includes:
  • the camera After receiving the camera launch request based on the application after the application startup is completed, the camera is allocated to the application for use by the framework layer.
  • the process shutdown method further includes:
  • determining, according to information of the application, whether the application needs to use the camera comprises:
  • the preset configuration file includes information of all applications in the terminal that need to use the camera
  • the process shutdown method further includes:
  • the information of the application is deleted from the preset configuration file.
  • the present invention further provides a process shutdown device, the process shutdown device comprising:
  • a determining module configured to determine, according to information of the application, whether the application needs to use a camera according to an application when the application starts;
  • An acquiring module configured to acquire a system attribute value of the camera when the application needs to use the camera
  • a determining module configured to determine, according to the system attribute value, whether the camera is occupied by another process
  • the closing module is configured to determine that the camera is occupied by another process when the system attribute value is the process number of the application, and close the process currently occupying the camera by using the framework layer.
  • the process closing device further comprises:
  • an allocating module configured to allocate the camera to the application through the framework layer when receiving a camera startup request based on the application after the application is started.
  • the process closing device further comprises:
  • an update module configured to update a system attribute value of the camera through the framework layer based on a process ID occupying the camera process in the application.
  • the determining module comprises:
  • An obtaining unit configured to acquire a preset configuration file when the application is started, where the preset configuration file includes information of all applications in the terminal that need to use the camera;
  • a determining unit configured to determine whether the preset configuration file includes information of the launched application, where the application is determined when the preset configuration file includes information of the launched application The camera needs to be used.
  • the process closing device further comprises:
  • Adding a module after detecting that the terminal installs an application that needs to use a camera, adding information of the installed application to the preset configuration file;
  • a deleting module configured to delete information of the application from the preset configuration file after detecting that the terminal uninstalls an application that needs to use a camera.
  • the present invention determines whether the application needs to use the camera according to information of the application when the application is started, and then acquires a system attribute value of the camera when the application needs to use the camera, and then based on the
  • the system attribute value determines whether the camera is occupied by other processes, and finally, when the system attribute value is the process number of the application, determining that the camera is occupied by another process, and then closing the camera currently occupying the camera through the frame layer.
  • the process realizes the process of closing the camera occupying the camera through the framework layer according to the value of the system attribute, and can release the resources of the camera in time when the application that needs to use the camera is started, thereby avoiding other equipment resources caused by the application not releasing the camera in time.
  • the application does not work properly with the camera, which avoids conflicts when using the camera and improves the ease of use of the camera.
  • FIG. 1 is a schematic flowchart of a first embodiment of a process shutdown method according to the present invention
  • FIG. 2 is a schematic diagram of a refinement process for determining whether the application needs to use the camera step in the second embodiment of the process shutdown method according to the present invention
  • FIG. 3 is a schematic diagram of functional modules of a first embodiment of a process shutdown apparatus according to the present invention.
  • FIG. 4 is a schematic diagram of a refinement function module of a determining module in a second embodiment of the process shutdown device of the present invention.
  • FIG. 1 is a schematic flowchart diagram of a first embodiment of a process shutdown method according to the present invention.
  • the process shutdown method includes:
  • Step S10 when the application is started, determining, according to information of the application, whether the application needs to use the camera;
  • the information of the application that needs to use the camera may be stored in a preset configuration file, and when the application is started, the preset configuration file is obtained, and the preset configuration is determined.
  • the package contains the information of the application, it is determined that the currently launched application needs to use the camera, wherein the information of the application can be a unique identifier of the application, such as a number.
  • the specific information includes the need Use the camera to achieve functional information and so on.
  • Step S20 acquiring, when the application needs to use the camera, a system attribute value of the camera
  • the code of the frame layer framework of the Android system includes the system attribute value of the camera.
  • the Android attribute “com.tcl.camera.used” may be added in the code of the camera-related framework, and the attribute of the attribute is adopted.
  • the value identifies the process in which the camera is occupied and occupies the camera. Specifically, if the camera is occupied, the attribute value is the ID of the process occupying the camera, and the ID is the process ID of the application, for example, the process occupying the camera.
  • the process ID PID is 672, etc., where the process number corresponds to the process of the application in the terminal; if the camera is not occupied, the attribute value can be set to a preset value, for example, the attribute value is set to 0.
  • Step S30 determining, according to the system attribute value, whether the camera is occupied by another process
  • determining whether the camera is occupied by other processes based on the system attribute value specifically means: when the obtained system attribute value is a preset value, for example, 0, determining that the camera is not occupied by other processes, When the obtained system attribute value is the application ID of the application, that is, the process ID of the application, it is determined that the camera is being occupied by other processes, and the ID of the process occupying the camera is the acquired system attribute value.
  • Step S40 When the system attribute value is the process number of the application, it is determined that the camera is occupied by other processes, and the process currently occupying the camera is closed by the framework layer.
  • the system attribute value is the process number of the application
  • a script command is executed through the framework, and the script command is sent to a backdoor program running in the background of the system through a socket, and the backdoor program is specifically configured to execute a system command including the kill command, thereby killing the running of the background running. The progress of the camera.
  • the system attribute value is set to a preset value through the framework layer, and the preset value indicates that the camera is not currently occupied by other processes, specifically,
  • the system property value can be set to 0.
  • the process is closed, and the dynamic processing is completely performed in the framework layer.
  • the code of the camera that is currently occupying the camera can be used to release the resources of the camera, solve the problem of camera conflict, and improve the efficiency of camera resource release.
  • the process shutdown method further includes: after receiving the camera startup request based on the application, after the application startup is completed, the camera is accessed through the framework layer Assigned to the application for use.
  • the camera startup request based on the application is received, for example, when the user is using the function of the camera in the application, the camera is assigned to the application through the framework layer.
  • the program is used; since the camera is not occupied by any application before the distribution, the camera can be quickly and accurately assigned to the application, thereby avoiding the application being unable to use the camera normally, and solving multiple applications simultaneously A conflict occurs when the camera is occupied.
  • the process shutdown method further comprises: updating, by the framework layer, the camera based on a process number occupying the camera process in the application. System property value.
  • the framework layer updates the system attribute value of the camera.
  • the framework layer can set the system attribute value to the ID of the application, that is, the process number, and implements the timely manner.
  • the system attribute value is updated so that when the resources of the camera are needed to be released again, the process of occupying the camera can be accurately determined.
  • the application when the application is started, it is determined whether the application needs to use the camera, and then when the application needs to use the camera, acquiring a system attribute value of the camera, and then based on the The system attribute value determines whether the camera is occupied by other processes. Finally, when the system attribute value is the process number of the application, it is determined that the camera is occupied by another process, and then the process currently occupying the camera is closed by the frame layer. The process of closing the occupied camera through the framework layer according to the system attribute value is realized, and the camera resource can be released in time when the application that needs to use the camera is started, thereby avoiding other applications caused by the application device not releasing the camera device resources in time. The camera cannot be used normally, which avoids conflicts when using the camera and improves the convenience of the camera.
  • step S10 includes:
  • Step S11 when the application is started, acquiring a preset configuration file, where the preset configuration file includes information of all applications in the terminal that need to use the camera;
  • the system partition of the Android system is used to place preset applications, system files and user interfaces, etc.
  • the data partition is used to place user data such as contact information and third-party applications.
  • the framework layer of the Android system contains the framework that needs to be used when writing the core service. During the startup process of the Android system, the framework layer starts the operation of starting the core service and obtaining the preset configuration file.
  • the preset configuration file is obtained from the data partition when the application is started. Before obtaining the preset configuration file, the following steps are also required: for the Android system, a configuration file is added in the system partition as a preset configuration file, and the configuration file configures all applications in the preset application that need to use the camera. Program information. When the Android system starts, it detects whether the data partition has the required configuration file through the framework layer, and if not, copies a copy from the system partition to the data partition.
  • the preset configuration file is obtained from the data partition. If the acquisition fails, the configuration file is obtained from the system partition, and a copy is copied from the system partition to the data partition. In this way, when the Android system is restored to the factory settings, the above-mentioned preset configuration files in the system partition are not cleared by the user, and the acquisition is guaranteed to be successful.
  • the configuration file configured with the preset application and the third-party application information is obtained from the data partition, and if the acquisition fails, the configuration file containing only the preset application is obtained from the system partition, so that It can solve the problem that the preset application and the third-party application need to occupy the camera at the same time, and also ensure that the configuration file preset in the system partition will not be cleared by the user when the Android system is restored to the factory settings. Successfully acquired.
  • Step S12 determining whether the preset configuration file includes information of the launched application, wherein when the preset configuration file includes information of the launched application, determining that the application needs to be used The camera.
  • the preset configuration file includes information of the launched application, it is determined that the application needs to use the camera, otherwise it is determined that the application does not need to use the camera.
  • the process shutdown method further includes:
  • the information of the application is deleted from the preset configuration file.
  • the information of the installed application is added into the preset configuration file; when it is detected that the terminal needs to be deleted After the application of the camera is used, the information of the application is deleted from the preset configuration file.
  • the third-party application is deployed in the application store, whether the third-party application needs to be identified by using a camera and recorded in the database of the server, and the third-party application interacts with the data of the server to obtain the identifier, and determines whether it is Need to use a camera.
  • the preset configuration file is acquired, and then it is determined whether the preset configuration file includes the information of the activated application, and the application is accurately determined according to the preset configuration file. Whether you need to use a camera or not, improves the accuracy of the application that determines the camera you need to use.
  • FIG. 3 is a schematic diagram of functional modules of a first embodiment of a process shutdown apparatus according to the present invention.
  • the process shutdown device includes:
  • a determining module 10 configured to determine, according to information of the application, whether the application needs to use the camera when the application is started;
  • the information of the application that needs to use the camera may be stored in a preset configuration file, and when the application is started, the preset configuration file is obtained, and the preset configuration is determined.
  • the package contains the information of the application, it is determined that the currently launched application needs to use the camera, wherein the information of the application can be a unique identifier of the application, such as a number.
  • the specific information includes the need Use the camera to achieve functional information and so on.
  • the obtaining module 20 is configured to acquire a system attribute value of the camera when the application needs to use the camera;
  • the code of the framework layer framework of Android includes the system attribute value of the camera.
  • the Android attribute “com.tcl.camera.used” may be added in the code of the camera-related framework, and the attribute value of the attribute is adopted.
  • the attribute value is the ID of the process occupying the camera, and the ID may be the process ID of the application, for example, in the process of occupying the camera.
  • the process ID PID is 672, etc., where the process number corresponds to the application in the terminal; if the camera is not occupied, the attribute value can be set to a preset value, for example, the attribute value is set to 0. .
  • the determining module 30 is configured to determine, according to the system attribute value, whether the camera is occupied by another process
  • the determining module 30 determines whether the camera is occupied by other processes based on the system attribute value. Specifically, when the obtained system attribute value is a preset value, for example, 0, the determining module 30 determines that the camera is not It is occupied by other processes. When the obtained system attribute value is the application ID of the application, that is, the process ID of the application, the determining module 30 determines that the camera is being occupied by another process, and the ID of the process occupying the camera is acquired. System property value.
  • the closing module 40 is configured to determine that the camera is occupied by another process when the system attribute value is a process number of the application, and close the process currently occupying the camera by using the framework layer.
  • the shutdown module 40 may close the process currently occupying the camera through the framework layer according to the ID of the application, that is, the process ID, thereby releasing the camera of the terminal.
  • Resources Specifically, a script command is executed through the framework, and the script command is sent to a backdoor program running in the background of the system through a socket, and the backdoor program is specifically configured to execute a system command including the kill command, thereby killing the running of the background running. The progress of the camera.
  • the shutdown module 40 closes the process currently occupying the camera through the framework layer, that is, when the camera resource release of the terminal is completed, the system attribute value is set to a preset value through the framework layer, and the preset value indicates that the camera is not currently occupied by other processes. Specifically, you can set the system property value to 0.
  • the process shutdown device further includes:
  • an allocating module configured to allocate the camera to the application through the framework layer when receiving a camera startup request based on the application after the application is started.
  • the distribution module allocates the camera to the camera through the framework layer.
  • the application is used; since the camera is not occupied by any application before the distribution, the camera can be quickly and accurately assigned to the application, thereby preventing the application from using the camera normally, and solving multiple applications. A problem that conflicts when the program occupies the camera at the same time.
  • the process shutdown device further comprises:
  • an update module configured to update a system attribute value of the camera through the framework layer based on a process ID occupying the camera process in the application.
  • the update module updates the system property value of the camera through the framework layer. Specifically, the update module can set the system property value to the application ID, ie, the process ID, through the framework layer.
  • the system attribute value is updated in time, so that when the resources of the camera need to be released again, the process of occupying the camera can be accurately determined.
  • the determining module 10 determines whether the application needs to use the camera, and then when the application needs to use the camera, the acquiring module 20 acquires the system attribute of the camera. a value, and then the determining module 30 determines whether the camera is occupied by other processes based on the system attribute value. Finally, when the system attribute value is the process number of the application, it is determined that the camera is occupied by another process, and then the module 40 is closed.
  • the framework layer closes the process currently occupying the camera, realizes the process of closing the occupied camera through the framework layer according to the system attribute value, and can release the camera resource in time when the application that needs to use the camera is started, thereby avoiding the application due to the application.
  • the lack of timely release of the camera's device resources causes other applications to not use the camera properly, thereby avoiding conflicts when using the camera and improving the convenience of the camera.
  • the determining module includes:
  • the obtaining unit 11 is configured to acquire a preset configuration file when the application is started, where the preset configuration file includes information of all applications in the terminal that need to use the camera;
  • the system partition of the Android system is used to place preset applications, system files and user interfaces, etc.
  • the data partition is used to place user data such as contact information and third-party applications.
  • the framework layer of the Android system contains the framework that needs to be used when writing the core service. During the startup process of the Android system, the framework layer starts the operation of starting the core service and obtaining the preset configuration file.
  • the preset configuration file is obtained from the data partition when the application is started. Before obtaining the preset configuration file, the following steps are also required: for the Android system, a configuration file is added in the system partition as a preset configuration file, and the configuration file configures all applications in the preset application that need to use the camera. Program information. When the Android system starts, it detects whether the data partition has the required configuration file through the framework layer, and if not, copies a copy from the system partition to the data partition.
  • the preset configuration file is obtained from the data partition. If the acquisition fails, the configuration file is obtained from the system partition, and a copy is copied from the system partition to the data partition. In this way, when the Android system is restored to the factory settings, the above-mentioned preset configuration files in the system partition are not cleared by the user, and the acquisition is guaranteed to be successful.
  • the configuration file configured with the preset application and the third-party application information is obtained from the data partition, and if the acquisition fails, the configuration file containing only the preset application is obtained from the system partition, so that It can solve the problem that the preset application and the third-party application need to occupy the camera at the same time, and also ensure that the configuration file preset in the system partition will not be cleared by the user when the Android system is restored to the factory settings. Successfully acquired.
  • a determining unit 12 configured to determine whether the preset configuration file includes information of the launched application, where the application is determined when the preset configuration file includes information of the launched application The program needs to use the camera.
  • the preset configuration file includes information of the launched application, it is determined that the application needs to use the camera, otherwise it is determined that the application does not need to use the camera.
  • the process shutdown device further includes:
  • Adding a module after detecting that the terminal installs an application that needs to use a camera, adding information of the installed application to the preset configuration file;
  • a deleting module configured to delete information of the application from the preset configuration file after detecting that the terminal uninstalls an application that needs to use a camera.
  • the adding module adds the installed information of the application into the preset configuration file; when the terminal is detected; After deleting the application that needs to use the camera, the delete module deletes the information of the application from the preset configuration file.
  • the deleting module deletes the information of the third-party application from the preset configuration file in the data partition. This dynamically updates the configuration files of the above presets in the data partition.
  • the obtaining unit 11 acquires the preset configuration file, and then the determining unit 12 determines whether the preset configuration file includes the information of the activated application, and implements the configuration according to the preset.
  • the file accurately determines whether the application requires the use of a camera, improving the accuracy of the application that determines the need to use the camera.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

本发明公开了一种进程关闭方法,包括:在应用程序启动时,根据应用程序的信息确定所述应用程序是否需要使用所述摄像头;在所述应用程序需要使用摄像头时,获取所述摄像头的系统属性值;基于所述系统属性值判断所述摄像头是否被其他进程占用;在所述系统属性值为应用程序的进程号时,判定所述摄像头被其他进程占用,并通过所述框架层关闭当前占用所述摄像头的进程。本发明还公开了一种进程关闭装置。本发明实现了根据系统属性值通过框架层关闭占用摄像头的进程,能够在需要使用所述摄像头的应用程序启动时及时释放摄像头的资源,避免了在使用摄像头时造成冲突,提高了摄像头使用的便捷性。

Description

进程关闭方法及装置
技术领域
本发明涉及计算机技术领域,尤其涉及一种进程关闭方法及装置。
背景技术
Android系统因其开放性,允许任何设备厂商成为其开发者而得到了迅速的发展,目前已成为主流的操作系统之一,被广泛应用于手机、平板电脑、电视和相机等设备上。对用户而言,最大的收益则是拥有丰富的基于Android系统的软件资源可供选择。
与此同时,用户对使用应用程序时的体验要求越来越高,往往需要面对面的交流或者通过肢体动作发出指令,因此,在许多Android终端上越来越多的应用程序需要使用到摄像头进行照相、录像、视频通讯、手势识别等。例如,在Android智能电视上,通过即时通信软件可以实现视频通话、通过一些肢体动作来参与体感游戏等。
但是有些应用程序在退出了使用摄像头的界面后,在后台的进程中摄像头仍然处于被占用的状态,由于占用摄像头的进程没有及时关闭而造成摄像头的资源无法及时释放。
发明内容
本发明提供一种进程关闭方法及装置,旨在解决Android系统中由于占用摄像头的进程没有及时关闭而造成摄像头的资源无法及时释放的技术问题。
为实现上述目的,本发明提供的一种进程关闭方法,所述进程关闭方法包括以下步骤:
在应用程序启动时,根据应用程序的信息确定所述应用程序是否需要使用摄像头;
在所述应用程序需要使用所述摄像头时,获取所述摄像头的系统属性值;
基于所述系统属性值判断所述摄像头是否被其他进程占用;
在所述系统属性值为应用程序的进程号时,判定所述摄像头被其他进程占用,并通过所述框架层关闭当前占用所述摄像头的进程。
优选地,所述通过所述框架层关闭当前占用所述摄像头的进程的步骤之后,所述进程关闭方法还包括:
在应用程序启动完成后,接收到基于所述应用程序的摄像头启动请求时,通过所述框架层将所述摄像头分配给所述应用程序使用。
优选地,所述通过所述框架层将所述摄像头分配给所述应用程序使用的步骤之后,所述进程关闭方法还包括:
基于所述应用程序中占用所述摄像头进程的进程号通过所述框架层更新所述摄像头的系统属性值。
优选地,所述在应用程序启动时,根据应用程序的信息确定所述应用程序是否需要使用所述摄像头的步骤包括:
在应用程序启动时,获取预置的配置文件,其中,所述预置的配置文件包括终端中所有需要使用所述摄像头的应用程序的信息;
确定所述预置的配置文件是否包括启动的所述应用程序的信息,其中,在所述预置的配置文件包括启动的所述应用程序的信息时,判定所述应用程序需要使用所述摄像头。
优选地,所述进程关闭方法还包括:
在检测到所述终端安装需要使用摄像头的应用程序后,将安装的所述应用程序的信息添加进所述预置的配置文件中;或者,
在检测到所述终端卸载需要使用摄像头的应用程序后,从所述预置的配置文件中删除所述应用程序的信息。
此外,为实现上述目的,本发明还提供一种进程关闭装置,所述进程关闭装置包括:
确定模块,用于在应用程序启动时,根据应用程序的信息确定所述应用程序是否需要使用摄像头;
获取模块,用于在所述应用程序需要使用所述摄像头时,获取所述摄像头的系统属性值;
判断模块,用于基于所述系统属性值判断所述摄像头是否被其他进程占用;
关闭模块,用于在所述系统属性值为应用程序的进程号时,判定所述摄像头被其他进程占用,并通过所述框架层关闭当前占用所述摄像头的进程。
优选地,所述进程关闭装置还包括:
分配模块,用于在应用程序启动完成后,接收到基于所述应用程序的摄像头启动请求时,通过所述框架层将所述摄像头分配给所述应用程序使用。
优选地,所述进程关闭装置还包括:
更新模块,用于基于所述应用程序中占用所述摄像头进程的进程号通过所述框架层更新所述摄像头的系统属性值。
优选地,所述确定模块包括:
获取单元,用于在应用程序启动时,获取预置的配置文件,其中,所述预置的配置文件包括终端中所有需要使用所述摄像头的应用程序的信息;
确定单元,用于确定所述预置的配置文件是否包括启动的所述应用程序的信息,其中,在所述预置的配置文件包括启动的所述应用程序的信息时,判定所述应用程序需要使用所述摄像头。
优选地,所述进程关闭装置还包括:
添加模块,用于在检测到所述终端安装需要使用摄像头的应用程序后,将安装的所述应用程序的信息添加进所述预置的配置文件中;或者,
删除模块,用于在检测到所述终端卸载需要使用摄像头的应用程序后,从所述预置的配置文件中删除所述应用程序的信息。
本发明通过在应用程序启动时,根据应用程序的信息确定所述应用程序是否需要使用所述摄像头,接着在所述应用程序需要使用摄像头时,获取所述摄像头的系统属性值,而后基于所述系统属性值判断所述摄像头是否被其他进程占用,最后在所述系统属性值为应用程序的进程号时,判定所述摄像头被其他进程占用,而后通过所述框架层关闭当前占用所述摄像头的进程,实现了根据系统属性值通过框架层关闭占用摄像头的进程,能够在需要使用所述摄像头的应用程序启动时及时释放摄像头的资源,避免了由于应用程序没有及时释放摄像头的设备资源而导致其他应用程序不能正常使用摄像头的情况,进而避免了在使用摄像头时造成冲突,提高了摄像头使用的便捷性。
附图说明
图1为本发明进程关闭方法第一实施例的流程示意图;
图2为本发明进程关闭方法第二实施例中确定所述应用程序是否需要使用所述摄像头步骤的细化流程示意图;
图3为本发明进程关闭装置第一实施例的功能模块示意图;
图4为本发明进程关闭装置第二实施例中确定模块的细化功能模块示意图。
本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。
本发明提供一种进程关闭方法。参照图1,图1为本发明进程关闭方法第一实施例的流程示意图。
在本实施例中,该进程关闭方法包括:
步骤S10,在应用程序启动时,根据应用程序的信息确定所述应用程序是否需要使用所述摄像头;
在本实施例中,可以在应用程序安装时,将需要使用摄像头的应用程序的信息存储在预置的配置文件中,在应用程序启动时,获取该预置的配置文件,判断预置的配置文件包该含应用程序的信息时,确定当前启动的应用程序需要使用摄像头,其中,应用程序的信息可以为应用程序的唯一标识,例如编号等。当然,也可以通过其他方式确定应用程序是否需要使用摄像头,譬如,获取当前正在启动的应用程序的具体信息,然后基于应用程序的具体信息确定应用程序是否需要使用摄像头,其中,该具体信息包括需要使用摄像头实现的功能信息等。
步骤S20,在所述应用程序需要使用所述摄像头时,获取所述摄像头的系统属性值;
本实施例中,Android系统的框架层framework的代码中包含摄像头的系统属性值,例如,可以在摄像头相关的framework的代码里面添加Android属性“com.tcl.camera.used”,通过该属性的属性值来标识摄像头被占用以及占用摄像头的进程,具体地,如果摄像头被占用,该属性值为占用摄像头的进程的标识ID,该ID为该应用程序的进程号PID,例如,在占用摄像头的进程为微信时,该进程号PID为672等,其中进程号与终端中应用程序的进程一一对应;如果摄像头未被占用,则该属性值可以设置为预设值,例如将该属性值设置为0。
步骤S30,基于所述系统属性值判断所述摄像头是否被其他进程占用;
本实施例中,基于所述系统属性值判断所述摄像头是否被其他进程占用具体是指:在获取到的系统属性值为预设值例如0时,判定所述摄像头未被其他进程占用,在获取到的系统属性值为应用程序的标识ID即应用程序的进程号时,判定所述摄像头正在被其他进程占用,且占用摄像头的进程的标识ID为获取到的系统属性值。
步骤S40,在所述系统属性值为应用程序的进程号时,判定所述摄像头被其他进程占用,并通过所述框架层关闭当前占用所述摄像头的进程。
在系统属性值为应用程序的进程号时,判定所述摄像头被其他进程占用,然后可以根据应用程序的ID即进程号通过框架层关闭当前占用摄像头的进程,进而释放终端的摄像头资源。具体地,通过所述框架执行一个脚本命令,该脚本命令会通过socket发送给系统后台运行的一个后门程序,而这个后门程序是专门来执行包含kill命令的系统命令,进而杀掉后台运行的占用摄像头的进程。
在通过框架层关闭当前占用摄像头的进程之后,即终端的摄像头资源释放完成时,通过框架层将系统属性值设置为预设值,该预设值表示摄像头当前未被其他进程占用,具体的,可以将系统属性值设置为0。
本实施例中进程关闭方法,完全在框架层进行动态处理,不需要修改当前占用摄像头的进程的代码即可释放摄像头的资源、解决摄像头冲突的问题,提高了摄像头资源释放的效率。
进一步地,在一实施例中,在步骤S40之后,该进程关闭方法还包括:在应用程序启动完成后,接收到基于所述应用程序的摄像头启动请求时,通过所述框架层将所述摄像头分配给所述应用程序使用。
本实施例中,在应用程序启动完成后,接收到基于所述应用程序的摄像头启动请求时,例如用户正在使用该应用程序中需要使用摄像头的功能时,通过框架层将摄像头分配给所述应用程序使用;由于在分配之前,摄像头未被任何应用程序占用,因此能够快速、准确地将摄像头分配给应用程序使用,进而能够避免该应用程序不能正常使用摄像头的情况,解决了多个应用程序同时占用摄像头时发生冲突的问题。
优选地,在将所述摄像头分配给所述应用程序使用的步骤之后,该进程关闭方法还包括:基于所述应用程序中占用所述摄像头进程的进程号通过所述框架层更新所述摄像头的系统属性值。
本实施例中,在通过框架层将摄像头分配给应用程序使用之后,框架层更新摄像头的系统属性值,具体地,框架层可以将系统属性值设置为应用程序的ID即进程号,实现了及时更新系统属性值,使得后续再次需要释放摄像头的资源时,能够准确的确定占用摄像头的进程。
本实施例中,通过在应用程序启动时,确定所述应用程序是否需要使用所述摄像头,接着在所述应用程序需要使用所述摄像头时,获取所述摄像头的系统属性值,而后基于所述系统属性值判断所述摄像头是否被其他进程占用,最后在系统属性值为应用程序的进程号时,判定所述摄像头被其他进程占用,而后通过所述框架层关闭当前占用所述摄像头的进程,实现了根据系统属性值通过框架层关闭占用摄像头的进程,能够在需要使用所述摄像头的应用程序启动时及时释放摄像头的资源,避免了由于应用程序没有及时释放摄像头的设备资源而导致其他应用程序不能正常使用摄像头的情况,进而避免了在使用摄像头时造成冲突,提高了摄像头使用的便捷性。
基于第一实施例提出本发明进程关闭方法的第二实施例,参照图2,在本实施例中,步骤S10包括:
步骤S11,在应用程序启动时,获取预置的配置文件,其中,所述预置的配置文件包括终端中所有需要使用所述摄像头的应用程序的信息;
Android系统的系统分区用于放置预置的应用程序、系统文件和用户界面等,数据分区用于放置用户的数据,如联系人信息和第三方应用程序等。而Android系统的框架层包含了编写核心服务时需要使用的框架,在Android系统启动过程中,框架层启动时会执行启动核心服务和获取预置的配置文件等操作。
在本实施例中,在应用程序启动时,从数据分区中获取预置的配置文件。在获取该预置的配置文件之前,还需要进行如下步骤:对于Android系统,在系统分区中添加配置文件作为预置的配置文件,该配置文件配置了预置应用程序中所有需要使用摄像头的应用程序的信息。当Android系统启动时,通过框架层检测数据分区是否存在所需的配置文件,如果没有,则从系统分区中拷贝一份到数据分区中。
在本实施例中,从数据分区中获取预置的配置文件,如果出现获取失败的情况,则从系统分区获取上述配置文件,同时,从系统分区中重新拷贝一份到数据分区中。这样,在Android系统恢复出厂设置时,系统分区中的上述预置的配置文件不会被用户清除掉,保证能够获取成功。在Android系统启动时,从数据分区获取上述配置了预置应用程序和第三方应用程序信息的配置文件,如果出现获取失败的情况,则从系统分区获取仅包含预置应用程序的配置文件,这样既可以解决预置应用程序和第三方应用程序同时需要占用摄像头时产生冲突的问题,也可以保证在Android系统恢复出厂设置时,系统分区中预置的配置文件不会被用户清除掉,仍然能够成功获取。
步骤S12,确定所述预置的配置文件是否包括启动的所述应用程序的信息,其中,在所述预置的配置文件包括启动的所述应用程序的信息时,判定所述应用程序需要使用所述摄像头。
本实施例中,若预置的配置文件包括启动的所述应用程序的信息时,则判定所述应用程序需要使用所述摄像头,否则判定所述应用程序不需要使用所述摄像头。
进一步地,在其他实施例中,该进程关闭方法还包括:
在检测到所述终端安装需要使用摄像头的应用程序后,将安装的所述应用程序的信息添加进所述预置的配置文件中;或者,
在检测到所述终端卸载需要使用摄像头的应用程序后,从所述预置的配置文件中删除所述应用程序的信息。
本实施例中,用户在使用终端时,除了预置的应用程序,还需要下载和安装许多第三方应用程序以满足其个性化需求,例如在Android智能电视中,通常都安装有网络电视等的应用程序,但是用户还会下载和安装其他的第三方应用程序,如体感游戏,以享受电视大屏幕化带来的良好体验和全家一起参与游戏的乐趣。而这些第三方应用程序中也可能需要使用到摄像头,因此上述预置的配置文件中也应该包含用户安装的第三方应用程序的信息。
为了兼容第三方应用程序,当检测到所述终端安装需要使用摄像头的应用程序后,将安装的所述应用程序的信息添加进所述预置的配置文件中;当检测到所述终端删除需要使用摄像头的应用程序后,从所述预置的配置文件中删除所述应用程序的信息。在应用商店部署第三方应用程序时,对该第三方应用程序是否需要使用摄像头进行标识,并记录到服务器的数据库中,通过该第三方应用程序与服务器的数据交互来获取该标识,判断其是否需要使用摄像头。在本实施例中,安装第三方应用程序后,检测该标识,如果需要使用摄像头,则将该第三方应用程序的信息添加到数据分区预置的配置文件中;在卸载第三方应用程序后,则从数据分区中上述预置的配置文件中删除该第三方应用程序的信息。这样可以动态更新数据分区中的上述预置的配置文件。
本实施例通过在应用程序启动时,获取预置的配置文件,而后确定所述预置的配置文件是否包括启动的所述应用程序的信息,实现了根据预置的配置文件准确的确定应用程序是否需要使用摄像头,提高了确定需要使用摄像头的应用程序的准确性。
本发明进一步提供一种进程关闭装置。参照图3,图3为本发明进程关闭装置第一实施例的功能模块示意图。
在本实施例中,该进程关闭装置包括:
确定模块10,用于在应用程序启动时,根据应用程序的信息确定所述应用程序是否需要使用所述摄像头;
在本实施例中,可以在应用程序安装时,将需要使用摄像头的应用程序的信息存储在预置的配置文件中,在应用程序启动时,获取该预置的配置文件,判断预置的配置文件包该含应用程序的信息时,确定当前启动的应用程序需要使用摄像头,其中,应用程序的信息可以为应用程序的唯一标识,例如编号等。当然,也可以通过其他方式确定应用程序是否需要使用摄像头,譬如,获取当前正在启动的应用程序的具体信息,然后基于应用程序的具体信息确定应用程序是否需要使用摄像头,其中,该具体信息包括需要使用摄像头实现的功能信息等。
获取模块20,用于在所述应用程序需要使用所述摄像头时,获取所述摄像头的系统属性值;
本实施例中,Android的框架层framework的代码中包含摄像头的系统属性值,例如,可以在摄像头相关的framework的代码里面添加Android属性“com.tcl.camera.used”,通过该属性的属性值来标识摄像头被占用以及占用摄像头的进程,具体地,如果摄像头被占用,该属性值为占用摄像头的进程的标识ID,该ID可以为该应用程序的进程号PID,例如,在占用摄像头的进程为微信时,该进程号PID为672等,其中进程号与终端中的应用程序一一对应;如果摄像头未被占用,则该属性值可以设置为预设值,例如将该属性值设置为0。
判断模块30,用于基于所述系统属性值判断所述摄像头是否被其他进程占用;
本实施例中,判断模块30基于所述系统属性值判断所述摄像头是否被其他进程占用具体是指:在获取到的系统属性值为预设值例如0时,判断模块30判定所述摄像头未被其他进程占用,在获取到的系统属性值为应用程序的标识ID即应用程序的进程号时,判断模块30判定所述摄像头正在被其他进程占用,且占用摄像头的进程的标识ID为获取到的系统属性值。
关闭模块40,用于在所述系统属性值为应用程序的进程号时,判定所述摄像头被其他进程占用,并通过所述框架层关闭当前占用所述摄像头的进程。
在系统属性值为应用程序的进程号时,判定所述摄像头被其他进程占用时,然后关闭模块40可以根据应用程序的ID即进程号通过框架层关闭当前占用摄像头的进程,进而释放终端的摄像头资源。具体地,通过所述框架执行一个脚本命令,该脚本命令会通过socket发送给系统后台运行的一个后门程序,而这个后门程序是专门来执行包含kill命令的系统命令,进而杀掉后台运行的占用摄像头的进程。
在关闭模块40通过框架层关闭当前占用摄像头的进程之后,即终端的摄像头资源释放完成时,通过框架层将系统属性值设置为预设值,该预设值表示摄像头当前未被其他进程占用,具体的,可以将系统属性值设置为0。
进一步地,在一实施例中,该进程关闭装置还包括:
分配模块,用于在应用程序启动完成后,接收到基于所述应用程序的摄像头启动请求时,通过所述框架层将所述摄像头分配给所述应用程序使用。
本实施例中,在应用程序启动完成后,接收到基于所述应用程序的摄像头启动请求时,例如用户正在使用该应用程序中需要使用摄像头的功能时,分配模块通过框架层将摄像头分配给所述应用程序使用;由于在分配之前,摄像头未被任何应用程序占用,因此能够快速、准确地将摄像头分配给应用程序使用,进而能够避免该应用程序不能正常使用摄像头的情况,解决了多个应用程序同时占用摄像头时发生冲突的问题。
优选地,在又一实施例中,该进程关闭装置还包括:
更新模块,用于基于所述应用程序中占用所述摄像头进程的进程号通过所述框架层更新所述摄像头的系统属性值。
在分配模块通过框架层将摄像头分配给应用程序使用之后,更新模块通过框架层更新摄像头的系统属性值,具体地,更新模块通过框架层可以将系统属性值设置为应用程序的ID即进程号,实现了及时更新系统属性值,使得后续再次需要释放摄像头的资源时,能够准确的确定占用摄像头的进程。
本实施例中,通过在应用程序启动时,确定模块10确定所述应用程序是否需要使用所述摄像头,接着在所述应用程序需要使用所述摄像头时,获取模块20获取所述摄像头的系统属性值,而后判断模块30基于所述系统属性值判断所述摄像头是否被其他进程占用,最后在系统属性值为应用程序的进程号时,判定所述摄像头被其他进程占用,而后关闭模块40通过所述框架层关闭当前占用所述摄像头的进程,实现了根据系统属性值通过框架层关闭占用摄像头的进程,能够在需要使用所述摄像头的应用程序启动时及时释放摄像头的资源,避免了由于应用程序没有及时释放摄像头的设备资源而导致其他应用程序不能正常使用摄像头的情况,进而避免了在使用摄像头时造成冲突,提高了摄像头使用的便捷性。
基于第一实施例提出本发明进程关闭装置的第二实施例,参照图4,在本实施例中,确定模块包括:
获取单元11,用于在应用程序启动时,获取预置的配置文件,其中,所述预置的配置文件包括终端中所有需要使用所述摄像头的应用程序的信息;
Android系统的系统分区用于放置预置的应用程序、系统文件和用户界面等,数据分区用于放置用户的数据,如联系人信息和第三方应用程序等。而Android系统的框架层包含了编写核心服务时需要使用的框架,在Android系统启动过程中,框架层启动时会执行启动核心服务和获取预置的配置文件等操作。
在本实施例中,在应用程序启动时,从数据分区中获取预置的配置文件。在获取该预置的配置文件之前,还需要进行如下步骤:对于Android系统,在系统分区中添加配置文件作为预置的配置文件,该配置文件配置了预置应用程序中所有需要使用摄像头的应用程序的信息。当Android系统启动时,通过框架层检测数据分区是否存在所需的配置文件,如果没有,则从系统分区中拷贝一份到数据分区中。
在本实施例中,从数据分区中获取预置的配置文件,如果出现获取失败的情况,则从系统分区获取上述配置文件,同时,从系统分区中重新拷贝一份到数据分区中。这样,在Android系统恢复出厂设置时,系统分区中的上述预置的配置文件不会被用户清除掉,保证能够获取成功。在Android系统启动时,从数据分区获取上述配置了预置应用程序和第三方应用程序信息的配置文件,如果出现获取失败的情况,则从系统分区获取仅包含预置应用程序的配置文件,这样既可以解决预置应用程序和第三方应用程序同时需要占用摄像头时产生冲突的问题,也可以保证在Android系统恢复出厂设置时,系统分区中预置的配置文件不会被用户清除掉,仍然能够成功获取。
确定单元12,用于确定所述预置的配置文件是否包括启动的所述应用程序的信息,其中,在所述预置的配置文件包括启动的所述应用程序的信息时,判定所述应用程序需要使用所述摄像头。
本实施例中,若预置的配置文件包括启动的所述应用程序的信息时,则判定所述应用程序需要使用所述摄像头,否则判定所述应用程序不需要使用所述摄像头。
进一步地,在其他实施例中,该进程关闭装置还包括:
添加模块,用于在检测到所述终端安装需要使用摄像头的应用程序后,将安装的所述应用程序的信息添加进所述预置的配置文件中;或者,
删除模块,用于在检测到所述终端卸载需要使用摄像头的应用程序后,从所述预置的配置文件中删除所述应用程序的信息。
本实施例中,用户在使用终端时,除了预置的应用程序,还需要下载和安装许多第三方应用程序以满足其个性化需求,例如在Android智能电视中,通常都安装有网络电视等的应用程序,但是用户还会下载和安装其他的第三方应用程序,如体感游戏,以享受电视大屏幕化带来的良好体验和全家一起参与游戏的乐趣。而这些第三方应用程序中也可能需要使用到摄像头,因此上述预置的配置文件中也应该包含用户安装的第三方应用程序的信息。
为了兼容第三方应用程序,当检测到所述终端安装需要使用摄像头的应用程序后,添加模块将安装的所述应用程序的信息添加进所述预置的配置文件中;当检测到所述终端删除需要使用摄像头的应用程序后,删除模块从所述预置的配置文件中删除所述应用程序的信息。在应用商店部署第三方应用程序时,对该第三方应用程序是否需要使用摄像头进行标识,并记录到服务器的数据库中,通过该第三方应用程序与服务器的数据交互来获取该标识,判断其是否需要使用摄像头。在本实施例中,安装第三方应用程序后,检测该标识,如果需要使用摄像头,则将该第三方应用程序的信息添加到数据分区预置的配置文件中;在卸载第三方应用程序后,则删除模块从数据分区中上述预置的配置文件中删除该第三方应用程序的信息。这样可以动态更新数据分区中的上述预置的配置文件。
本实施例通过在应用程序启动时,获取单元11获取预置的配置文件,而后确定单元12确定所述预置的配置文件是否包括启动的所述应用程序的信息,实现了根据预置的配置文件准确的确定应用程序是否需要使用摄像头,提高了确定需要使用摄像头的应用程序的准确性。
以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。

Claims (20)

  1. 一种进程关闭方法,其特征在于,所述进程关闭方法包括以下步骤:
    在需要使用摄像头的应用程序安装完成时,存储该需要使用摄像头的应用程序的信息;
    在应用程序启动时,根据应用程序的信息确定所述应用程序是否需要使用摄像头;
    在所述应用程序需要使用所述摄像头时,获取所述摄像头的系统属性值;
    基于所述系统属性值判断所述摄像头是否被其他进程占用;
    在所述系统属性值为应用程序的进程号时,判定所述摄像头被其他进程占用,并通过所述框架层关闭当前占用所述摄像头的进程。
  2. 如权利要求1所述的进程关闭方法,其特征在于,所述通过所述框架层关闭当前占用所述摄像头的进程的步骤之后,所述进程关闭方法还包括:
    在应用程序启动完成后,接收到基于所述应用程序的摄像头启动请求时,通过所述框架层将所述摄像头分配给所述应用程序使用。
  3. 如权利要求2所述的进程关闭方法,其特征在于,所述通过所述框架层将所述摄像头分配给所述应用程序使用的步骤之后,所述进程关闭方法还包括:
    基于所述应用程序中占用所述摄像头进程的进程号通过所述框架层更新所述摄像头的系统属性值。
  4. 如权利要求1至所述的进程关闭方法,其特征在于,所述在应用程序启动时,根据应用程序的信息确定所述应用程序是否需要使用所述摄像头的步骤包括:
    在应用程序启动时,获取预置的配置文件,其中,所述预置的配置文件包括终端中所有需要使用所述摄像头的应用程序的信息;
    确定所述预置的配置文件是否包括启动的所述应用程序的信息,其中,在所述预置的配置文件包括启动的所述应用程序的信息时,判定所述应用程序需要使用所述摄像头。
  5. 如权利要求4所述的进程关闭方法,其特征在于,所述进程关闭方法还包括:
    在检测到所述终端安装需要使用摄像头的应用程序后,将安装的所述应用程序的信息添加进所述预置的配置文件中;或者,
    在检测到所述终端卸载需要使用摄像头的应用程序后,从所述预置的配置文件中删除所述应用程序的信息。
  6. 如权利要求2至所述的进程关闭方法,其特征在于,所述在应用程序启动时,根据应用程序的信息确定所述应用程序是否需要使用所述摄像头的步骤包括:
    在应用程序启动时,获取预置的配置文件,其中,所述预置的配置文件包括终端中所有需要使用所述摄像头的应用程序的信息;
    确定所述预置的配置文件是否包括启动的所述应用程序的信息,其中,在所述预置的配置文件包括启动的所述应用程序的信息时,判定所述应用程序需要使用所述摄像头。
  7. 如权利要求6所述的进程关闭方法,其特征在于,所述进程关闭方法还包括:
    在检测到所述终端安装需要使用摄像头的应用程序后,将安装的所述应用程序的信息添加进所述预置的配置文件中;或者,
    在检测到所述终端卸载需要使用摄像头的应用程序后,从所述预置的配置文件中删除所述应用程序的信息。
  8. 如权利要求3至所述的进程关闭方法,其特征在于,所述在应用程序启动时,根据应用程序的信息确定所述应用程序是否需要使用所述摄像头的步骤包括:
    在应用程序启动时,获取预置的配置文件,其中,所述预置的配置文件包括终端中所有需要使用所述摄像头的应用程序的信息;
    确定所述预置的配置文件是否包括启动的所述应用程序的信息,其中,在所述预置的配置文件包括启动的所述应用程序的信息时,判定所述应用程序需要使用所述摄像头。
  9. 一种进程关闭方法,其特征在于,所述进程关闭方法包括以下步骤:
    在应用程序启动时,根据应用程序的信息确定所述应用程序是否需要使用摄像头;
    在所述应用程序需要使用所述摄像头时,获取所述摄像头的系统属性值;
    基于所述系统属性值判断所述摄像头是否被其他进程占用;
    在所述系统属性值为应用程序的进程号时,判定所述摄像头被其他进程占用,并通过所述框架层关闭当前占用所述摄像头的进程。
  10. 如权利要求9所述的进程关闭方法,其特征在于,所述通过所述框架层关闭当前占用所述摄像头的进程的步骤之后,所述进程关闭方法还包括:
    在应用程序启动完成后,接收到基于所述应用程序的摄像头启动请求时,通过所述框架层将所述摄像头分配给所述应用程序使用。
  11. 如权利要求10所述的进程关闭方法,其特征在于,所述通过所述框架层将所述摄像头分配给所述应用程序使用的步骤之后,所述进程关闭方法还包括:
    基于所述应用程序中占用所述摄像头进程的进程号通过所述框架层更新所述摄像头的系统属性值。
  12. 如权利要求9所述的进程关闭方法,其特征在于,所述在应用程序启动时,根据应用程序的信息确定所述应用程序是否需要使用所述摄像头的步骤包括:
    在应用程序启动时,获取预置的配置文件,其中,所述预置的配置文件包括终端中所有需要使用所述摄像头的应用程序的信息;
    确定所述预置的配置文件是否包括启动的所述应用程序的信息,其中,在所述预置的配置文件包括启动的所述应用程序的信息时,判定所述应用程序需要使用所述摄像头。
  13. 如权利要求12所述的进程关闭方法,其特征在于,所述进程关闭方法还包括:
    在检测到所述终端安装需要使用摄像头的应用程序后,将安装的所述应用程序的信息添加进所述预置的配置文件中;或者,
    在检测到所述终端卸载需要使用摄像头的应用程序后,从所述预置的配置文件中删除所述应用程序的信息。
  14. 如权利要求10所述的进程关闭方法,其特征在于,所述在应用程序启动时,根据应用程序的信息确定所述应用程序是否需要使用所述摄像头的步骤包括:
    在应用程序启动时,获取预置的配置文件,其中,所述预置的配置文件包括终端中所有需要使用所述摄像头的应用程序的信息;
    确定所述预置的配置文件是否包括启动的所述应用程序的信息,其中,在所述预置的配置文件包括启动的所述应用程序的信息时,判定所述应用程序需要使用所述摄像头。
  15. 如权利要求11所述的进程关闭方法,其特征在于,所述在应用程序启动时,根据应用程序的信息确定所述应用程序是否需要使用所述摄像头的步骤包括:
    在应用程序启动时,获取预置的配置文件,其中,所述预置的配置文件包括终端中所有需要使用所述摄像头的应用程序的信息;
    确定所述预置的配置文件是否包括启动的所述应用程序的信息,其中,在所述预置的配置文件包括启动的所述应用程序的信息时,判定所述应用程序需要使用所述摄像头。
  16. 一种进程关闭装置,其特征在于,所述进程关闭装置包括:
    确定模块,用于在应用程序启动时,根据应用程序的信息确定所述应用程序是否需要使用摄像头;
    获取模块,用于在所述应用程序需要使用所述摄像头时,获取所述摄像头的系统属性值;
    判断模块,用于基于所述系统属性值判断所述摄像头是否被其他进程占用;
    关闭模块,用于在所述系统属性值为应用程序的进程号时,判定所述摄像头被其他进程占用,并通过所述框架层关闭当前占用所述摄像头的进程。
  17. 如权利要求16所述的进程关闭装置,其特征在于,所述进程关闭装置还包括:
    分配模块,用于在应用程序启动完成后,接收到基于所述应用程序的摄像头启动请求时,通过所述框架层将所述摄像头分配给所述应用程序使用。
  18. 如权利要求17所述的进程关闭装置,其特征在于,所述进程关闭装置还包括:
    更新模块,用于基于所述应用程序中占用所述摄像头进程的进程号通过所述框架层更新所述摄像头的系统属性值。
  19. 如权利要求16所述的进程关闭装置,其特征在于,所述确定模块包括:
    获取单元,用于在应用程序启动时,获取预置的配置文件,其中,所述预置的配置文件包括终端中所有需要使用所述摄像头的应用程序的信息;
    确定单元,用于确定所述预置的配置文件是否包括启动的所述应用程序的信息,其中,在所述预置的配置文件包括启动的所述应用程序的信息时,判定所述应用程序需要使用所述摄像头。
  20. 如权利要求19所述的进程关闭装置,其特征在于,所述进程关闭装置还包括:
    添加模块,用于在检测到所述终端安装需要使用摄像头的应用程序后,将安装的所述应用程序的信息添加进所述预置的配置文件中;或者,
    删除模块,用于在检测到所述终端卸载需要使用摄像头的应用程序后,从所述预置的配置文件中删除所述应用程序的信息。
PCT/CN2016/096740 2016-05-03 2016-08-25 进程关闭方法及装置 WO2017190450A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610285286.1A CN105955779B (zh) 2016-05-03 2016-05-03 进程关闭方法及装置
CN201610285286.1 2016-05-03

Publications (1)

Publication Number Publication Date
WO2017190450A1 true WO2017190450A1 (zh) 2017-11-09

Family

ID=56913305

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/096740 WO2017190450A1 (zh) 2016-05-03 2016-08-25 进程关闭方法及装置

Country Status (2)

Country Link
CN (1) CN105955779B (zh)
WO (1) WO2017190450A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113014792A (zh) * 2019-12-20 2021-06-22 青岛海信移动通信技术股份有限公司 一种终端设备和相机资源共享方法

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107197379B (zh) * 2017-06-06 2019-08-06 烽火通信科技股份有限公司 基于IPTV平台认证的Android机顶盒管理方法及系统
CN108322640B (zh) * 2017-12-27 2020-10-27 武汉长江通信智联技术有限公司 一种基于广播机制实现多应用同时调用摄像头的方法及系统
US10911593B2 (en) 2019-05-15 2021-02-02 Asustek Computer Inc. Electronic device having a rotatable camera module
US11477385B2 (en) 2019-05-15 2022-10-18 Asustek Computer Inc. Electronic device with rotatable camera for protecting privacy
US11375125B2 (en) 2019-05-15 2022-06-28 Asustek Computer Inc. Electronic device
US11240357B2 (en) 2019-05-15 2022-02-01 Asustek Computer Inc. Electronic device
US11546451B2 (en) 2019-05-15 2023-01-03 Asustek Computer Inc. Electronic device
CN112685099A (zh) * 2020-12-31 2021-04-20 联想(北京)有限公司 一种处理方法及装置
CN113114936B (zh) * 2021-04-08 2022-07-29 读书郎教育科技有限公司 一种解决人脸解锁与拍照冲突的方法及系统
CN113489898B (zh) * 2021-06-29 2023-10-31 广州小鹏汽车科技有限公司 摄像头的调用方法、装置、交通工具和存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103389900A (zh) * 2013-07-23 2013-11-13 Tcl集团股份有限公司 一种Android设备摄像头使用的控制方法及装置
CN103677848A (zh) * 2013-12-27 2014-03-26 厦门雅迅网络股份有限公司 一种基于Android的摄像头控制方法
CN105068945A (zh) * 2015-08-03 2015-11-18 Tcl集团股份有限公司 一种Android系统的摄像头分配方法及系统

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102088470B (zh) * 2009-12-07 2014-03-05 中兴通讯股份有限公司 通信系统中文件传输协议死锁检测及自恢复的方法与装置
CN103793246B (zh) * 2014-01-22 2017-09-05 深圳Tcl新技术有限公司 协调摄像头资源的方法及系统

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103389900A (zh) * 2013-07-23 2013-11-13 Tcl集团股份有限公司 一种Android设备摄像头使用的控制方法及装置
CN103677848A (zh) * 2013-12-27 2014-03-26 厦门雅迅网络股份有限公司 一种基于Android的摄像头控制方法
CN105068945A (zh) * 2015-08-03 2015-11-18 Tcl集团股份有限公司 一种Android系统的摄像头分配方法及系统

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113014792A (zh) * 2019-12-20 2021-06-22 青岛海信移动通信技术股份有限公司 一种终端设备和相机资源共享方法

Also Published As

Publication number Publication date
CN105955779B (zh) 2020-06-09
CN105955779A (zh) 2016-09-21

Similar Documents

Publication Publication Date Title
WO2017190450A1 (zh) 进程关闭方法及装置
WO2017063366A1 (zh) 应用启动方法和系统
WO2013143334A1 (zh) 一种更新移动终端nfc固件的方法及其移动终端
WO2017084311A1 (zh) 单分片视频播放加速方法及装置
WO2014000635A1 (zh) 阅读器提供服务的方法、阅读器、终端及计算机存储介质
WO2017041538A1 (zh) 终端用户界面的受控显示方法及装置
WO2019205272A1 (zh) 虚拟机服务提供方法、装置、设备及计算机可读存储介质
WO2018036057A1 (zh) 软件后台自适应升级方法及装置
WO2016173192A1 (zh) 电视稳定性测试方法及装置
WO2019051902A1 (zh) 终端控制方法、空调器及计算机可读存储介质
WO2018028121A1 (zh) 数据分区的存储空间管理方法及装置
WO2013143341A1 (zh) 一种更新移动终端的应用信息的方法及装置
WO2018126888A1 (zh) 电视功能的快捷启动设置方法及装置
WO2018053963A1 (zh) 智能电视的系统升级方法及装置
WO2017201943A1 (zh) 显示屏驱动方法及装置
WO2017063368A1 (zh) 视频广告的插播方法及装置
WO2018098880A1 (zh) 网站信息下载方法及装置
WO2017206601A1 (zh) 客户端数据处理方法及装置
WO2017059686A1 (zh) 桌面显示方法及装置
WO2017024877A1 (zh) 电视主界面的切换方法及装置
WO2019024472A1 (zh) 数据操作方法、装置及计算机可读存储介质
WO2017000729A1 (zh) 音视频播放控制方法和装置
WO2018006581A1 (zh) 智能电视的播放方法及装置
WO2019080401A1 (zh) 脚本语句转换方法、装置及计算机可读存储介质
WO2017071223A1 (zh) 电视应用的控制方法及装置

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16900972

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 03.04.2019)

122 Ep: pct application non-entry in european phase

Ref document number: 16900972

Country of ref document: EP

Kind code of ref document: A1