Device node startup control method and device, electronic device, and storage medium

By introducing sensitive permission service programs into the operating system, obtaining the application's PID and querying the permission status of the device node, controlling the opening of the device node, solving the problem of unknown code access, and improving the security and user privacy protection of the device node.

CN113935014BActive Publication Date: 2025-08-19DOUYIN VISION CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111196556.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-14
Publication Date
2025-08-19
Estimated Expiration
2041-10-14

AI Technical Summary

Technical Problem

The existing operating system cannot effectively prevent unknown codes from accessing device nodes, resulting in devices such as cameras and microphones being turned on at will, and user privacy data is leaked.

Method used

By creating a sensitive permission service program, obtaining the application's process identity (PID), querying the set permission status of the device node, and controlling the opening or denial of the device node based on the status, standardizing the access path of the device node.

Benefits of technology

It limits the possibility of unknown code accessing device nodes, improves the security and robustness of device nodes, and ensures the security of user privacy data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113935014B_ABST
    Figure CN113935014B_ABST
Patent Text Reader

Abstract

The present application relates to a method and apparatus for controlling the opening of a device node, an electronic device, and a storage medium. The method comprises: in response to an application's access request to a device node, creating an opening function for the device node; executing the opening function, calling a process identification acquisition function, and acquiring the PID of the process of the application accessing the device node; generating a query instruction for the setting permission status of the device node based on the PID, and in response to the query instruction, calling a setting permission service to query the status information of the setting permission of the application accessing the device node; and controlling the opening of the device node in response to the status information. The present application limits the possibility of unknown code accessing device nodes, standardizes and limits the ways to open device nodes, and ensures the security of user privacy data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present application relate to a device node startup management technology in an operating system, and more particularly to a device node startup control method and apparatus, an electronic device, and a storage medium. Background Art

[0002] Some operating systems lack access control for device nodes within the operating system. For example, if developers access device nodes by calling the open function instead of using the dynamic libraries or software development kit (SDK) provided by the operating system, they can still access the device nodes. Consequently, some operating systems currently cannot effectively prevent unidentified code from accessing device nodes within the operating system, failing to achieve the function of controlling and managing device nodes. This leads to significant security vulnerabilities in the operating system, allowing device nodes such as cameras and microphones on electronic devices to be opened at will, potentially leaking user privacy data. Summary of the Invention

[0003] In view of this, embodiments of the present application provide a method and apparatus for controlling the startup of a device node, an electronic device, and a storage medium, so as to at least partially solve the above technical problems existing in the prior art.

[0004] According to a first aspect of an embodiment of the present application, a method for controlling the startup of a device node is provided, comprising:

[0005] In response to an access request from an application to a device node, creating an open function for the device node;

[0006] Execute the start function, call the process identification acquisition function, and obtain the PID of the process of the application accessing the device node;

[0007] generating a query instruction for the setting permission status of the device node based on the PID, and in response to the query instruction, calling a setting permission service to query status information of the setting permission of the application to access the device node;

[0008] In response to the status information, the device node is controlled to be turned on.

[0009] In one embodiment, controlling the startup of the device node in response to the status information includes:

[0010] When the state information is in a first state, generating first feedback information and outputting the first feedback information to the application; and receiving instruction information from the application in response to the first feedback information, and executing startup control of the device node in response to the instruction information;

[0011] When the state information is in the second state, opening the device node for the application;

[0012] When the state information is in the third state, the device node is refused to be started, and second feedback information is generated and output to the application.

[0013] In one embodiment, the calling of the permission setting service to query the status information of the permission setting for the application to access the device node includes:

[0014] The permission setting service queries the access status of the device node to the permission setting of the application in its own database, and uses the queried access status of the permission setting as a response result of the query instruction;

[0015] The database pre-stores access status of more than one device node with respect to permission settings for more than one application.

[0016] In one embodiment, after executing the startup control of the device node in response to the indication information, the method further includes:

[0017] The permission setting service modifies, in the database, an access status of the device node's permission setting for the application based on the indication information.

[0018] In one embodiment, the method further comprises:

[0019] In response to a query request for setting permissions, the setting permission service searches for all data items about setting permissions in its own database, or data items about setting permissions related to the application identification information in the query request, or data items about setting permissions related to the device node identification information in the query request, or data items about setting permissions related to the process identification in the query request, and outputs them.

[0020] In one embodiment, the method further comprises:

[0021] In response to a modification request for a permission setting data item, the permission setting service modifies the corresponding permission setting data item in the database and saves the modified permission setting data item.

[0022] According to a second aspect of an embodiment of the present application, a device node startup control apparatus is provided, comprising:

[0023] A creating unit, configured to create an opening function for a device node in response to an access request from an application for the device node;

[0024] A calling unit, configured to execute the start function, call a process identification acquisition function, and acquire the PID of the process of the application accessing the device node;

[0025] a generating unit, configured to generate a query instruction for setting an authority status of the device node based on the PID;

[0026] a first query unit, configured to, in response to the query instruction, call a permission setting service to query status information of the permission set for the application to access the device node;

[0027] A control unit is configured to control the startup of the device node in response to the status information.

[0028] In one embodiment, the control unit is further configured to:

[0029] When the state information is in the first state, generating first feedback information and outputting the first feedback information to the application; and receiving instruction information from the application in response to the first feedback information, and executing startup control of the device node in response to the instruction information;

[0030] When the state information is in the second state, enabling the device node for the application;

[0031] When the state information is in the third state, the device node is refused to be started, and second feedback information is generated and output to the application.

[0032] In one embodiment, the first query unit is further configured to:

[0033] Triggering the permission setting service to query the device node's access status to the application's permission setting in its own database, and using the queried permission setting access status as a response result to the query instruction;

[0034] The database pre-stores access status of more than one device node with respect to permission settings for more than one application.

[0035] In one embodiment, the apparatus further comprises:

[0036] The first modification unit is configured to trigger the permission setting service to modify the access status of the device node to the application setting permission in the database based on the indication information after the control unit performs control on opening the device node.

[0037] In one embodiment, the apparatus further comprises:

[0038] The second query unit is used to trigger the setting permission service to search for all data items about setting permissions in the database of the setting permission service in response to the query request for setting permissions, or the data items of setting permissions related to the application identification information in the query request, or the data items of setting permissions related to the device node identification information in the query request, or the data items of setting permissions related to the process identification in the query request, and output them.

[0039] In one embodiment, the apparatus further comprises:

[0040] The second modification unit is configured to trigger the permission setting service to modify the corresponding permission setting data item in the database in response to a modification request for the permission setting data item, and save the modified permission setting data item.

[0041] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a processor, a memory, and an executable program stored in the memory and capable of being run by the processor, wherein the processor executes the steps of the device node startup control method when running the executable program.

[0042] According to a fourth aspect of an embodiment of the present application, a storage medium is provided, on which an executable program is stored. When the executable program is executed by a processor, the steps of the device node startup control method are implemented.

[0043] In the embodiments of the present application, for any application-created open function, when executing the open function, it is necessary to call the PID of the corresponding application process, and through the setting permission service, find the access status of the device node for the current process, and control the opening of the device node accordingly based on the access status. By managing the opening control of the device node, the embodiments of the present application limit the possibility of unknown code accessing the device node, and at the same time fundamentally standardize and limit the ways to open the device node, greatly increasing the security and robustness of the device node and ensuring the security of user privacy data. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] To more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be derived from these drawings without inventive effort.

[0045] Figure 1 A schematic diagram of a flow chart of a method for controlling the startup of a device node according to an embodiment of the present application;

[0046] Figure 2A schematic diagram of the architecture of the startup control of the device node according to an embodiment of the present application;

[0047] Figure 3 A schematic diagram of a flow chart of a method for controlling the startup of a device node according to an embodiment of the present application;

[0048] Figure 4 A schematic diagram of the architecture of permission settings in an operating system according to an embodiment of the present application;

[0049] Figure 5 A schematic diagram of the structure of a device node startup control device according to an embodiment of the present application;

[0050] Figure 6 This is a structural diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0051] The essence of the technical solution of the embodiment of the present application is explained in detail below with reference to the accompanying drawings.

[0052] Figure 1 This is a flow chart of a method for controlling the start of a device node according to an embodiment of the present application. Figure 1 As shown, the device node startup control method of the embodiment of the present application includes the following processing steps:

[0053] Step 101: In response to an application's access request for a device node, create an open function for the device node.

[0054] The technical solutions of the embodiments of the present application can be applied to Linux systems. Those skilled in the art should understand that the technical solutions of the embodiments of the present application are applicable to all other operating systems that do not have device node access management.

[0055] In the embodiment of the present invention, the Linux system, also known as the GNU / Linux operating system, includes but is not limited to various distributions such as Ubuntu, Redhat, and Debian.

[0056] When an application needs to access a device node, such as a microphone or camera, it generates an access request for the device node. This process creates a corresponding access process for the application and sends the access request to the device service. In an operating system like Linux, the kernel layer triggers an open function, such as the open() function, to prepare to open the corresponding device node. For example, the open() function includes the do_sys_open() function.

[0057] Step 102: execute the start function, call the process identification acquisition function, and obtain the PID of the process of the application accessing the device node.

[0058] After creating the open function, the open function, such as the open() function, is executed to call the corresponding device node. However, in an embodiment of the present application, when the open() function interface is triggered at the kernel layer of the operating system to prepare to open the device node, a permission query plug-in is also added. That is, a permission service program is created in the operating system, such as the Linux system, to save the access status of the device permissions. Through this permission service program, the access status of the set permissions of the device node to be accessed is obtained. Based on the obtained access status of the set permissions, it is determined whether the corresponding application has the permission to continue the device node opening operation.

[0059] In order to obtain the access status of the application's set permissions for the device node to be accessed, a permission judgment plug-in interface is added when the kernel do_sys_open() function accesses the device node, and the identification information of the caller, that is, the process corresponding to the application, is obtained through a process identification acquisition function such as the sys_getpid() function, so that the permission plug-in interface can query the corresponding permission access status in its own database based on the identification information to determine whether the process or the corresponding application has the permission to access the device node.

[0060] Step 103: Generate a query instruction for the permission setting status of the device node based on the PID, and in response to the query instruction, call a permission setting service to query the status information of the permission setting for the application to access the device node.

[0061] In the embodiment of the present application, after obtaining the identification information PID of the process corresponding to the application through the process identification acquisition function, a query instruction for setting the permission status of the device node to be accessed is generated based on the identification information of the device node to be accessed, so that the permission setting service queries its own database to determine whether the access application has permission to access the identified node. In the embodiment of the present application, the permission setting refers specifically to sensitive permissions, and correspondingly, the permission setting service is a sensitive permission service program.

[0062] In an embodiment of the present application, the permission setting service queries the access status of the device node for the permission setting of the application in its own database, and uses the queried access status of the permission setting as the response result of the query instruction; wherein, the database pre-stores the access status of the permission setting of more than one device node for more than one application. Specifically, when the operating system is loaded, a sensitive permission service and a database of sensitive permission services are generated, and the access status of the sensitive permission of the device node is set to the default value in the database. The default value here means that for all device nodes with sensitive permissions set to the default value for all applications, user authorization is required for the first access, that is, the device node can only be opened based on user authorization, otherwise the current application is refused to open the device node.

[0063] Step 104: Control the startup of the device node in response to the status information.

[0064] Specifically, when the status information is in the first state, first feedback information is generated and output to the application; and instruction information of the application in response to the first feedback information is received, and in response to the instruction information, control of opening the device node is executed; the first state here refers to the state in which the aforementioned sensitive permission is set to the default value. At this time, the application is accessing the device node for the first time, and it is necessary to return the first feedback information to the application accessing the device node through the sensitive permission service. As an example, the first feedback information includes information asking whether access to the device node is allowed. When the user authorizes the application to allow access to the device node, the device node is opened for the corresponding application; otherwise, information denying access to the device node is output to the corresponding application.

[0065] After the user allows the corresponding application to access the device node, the permission setting service modifies the access status of the device node for the application's permission setting in the database based on the indication information. That is, the sensitive permission service needs to modify the sensitive permission access status corresponding to the device node that the user allows to access from the default value to allow access, and when the corresponding application subsequently opens and calls the device node, the sensitive permission service allows it to open and call. Of course, if the user does not allow the application to access the device node, the sensitive permission access status corresponding to the device node will be modified from the default value to deny access, and when the corresponding application subsequently opens and calls the device node, the sensitive permission service returns a prompt message of denying the opening to the application. At this time, the user can still authorize the application to access so that the corresponding application can access the device node. After obtaining authorization, the denied access status can be modified to allowed access.

[0066] When the status information is in the second state, the device node is enabled for the application; the second state here means that the sensitive permission of the device node is in a state of allowing access, that is, the corresponding application has previously obtained the user's permission to access the device node, and the sensitive permission service has set the sensitive permission of the device node to the allowed state for the application in the database.

[0067] If the status information is in the third state, the device node is denied from being enabled, and second feedback information is generated and output to the application. The third state here refers to the sensitive permission of the device node being in the access denied state, i.e., the corresponding application has not previously obtained permission from the user to access the device node, and the sensitive permission service has set the sensitive permission of the device node to the access denied state for the application in the database.

[0068] In an embodiment of the present application, based on the aforementioned processing steps, it may also include: in response to a query request for setting permissions, the permission setting service searches for all data items related to setting permissions in its own database, or data items related to setting permissions related to the application identification information in the query request, or data items related to setting permissions related to the device node identification information in the query request, or data items related to setting permissions related to the process identification in the query request, and outputs them. That is, the embodiment of the present application also supports query requests for setting permissions, and the query request may be a default query for all sensitive permission information, including both sensitive permission information of device nodes and sensitive permission information of applications, etc., or the query request is to query the status information of the sensitive permissions of a certain application on a device node, or to query the status information of the sensitive permissions of a certain process (based on process identification (Process ID, PID)) on a device node, or to query the status information of the sensitive permissions of a certain device node on which applications. The embodiment of the present application supports querying the setting permission information and its access status at any time, and the supported query methods are more extensive.

[0069] In an embodiment of the present application, based on the aforementioned processing steps, it may also include: in response to a modification request for a data item for setting permissions, the setting permission service modifies the corresponding data item for setting permissions in the setting database, and saves the modified data item for setting permissions. After querying the access status of the relevant application for the sensitive permissions of the device node or the sensitive permission access status of the device node to the application or its process, the user can modify the access status of the sensitive permissions at any time based on the corresponding scenario, and the modified sensitive permission access status will be recorded and saved by the sensitive permission service in its own database. The modification here includes the modification of the relevant values of the access status of the original sensitive permissions, such as changing the default status to allow or deny access, etc., and also includes modifications such as adding or deleting the access status of sensitive permissions.

[0070] The following is a detailed description of the technical solution of the embodiment of the present application with reference to specific examples. Here, the operating system is taken as an example of the Linux system, and other operating systems are also applicable to the technical solution of the embodiment of the present application.

[0071] In the embodiment of the present application, a service program for sensitive permissions is created in the Linux system (the aforementioned permission setting service) to save information on the dynamic adjustment of the sensitive permissions of the application. In the embodiment of the present application, the access status of the sensitive permissions of the device node is mainly set and managed. In addition to sensitive permissions, the Linux system also includes general permissions, signature permissions, and system signature permissions. Among them:

[0072] Normal permissions, also known as normal permissions, carry a high risk of user privacy being leaked or tampered with. For example, setting the time zone is a normal permission. If an app declares that it requires a normal permission, the system automatically grants it.

[0073] Sensitive permissions, also known as dangerous permissions, have the opposite access status to normal permissions at runtime. Once an app obtains these permissions, the user's private data is at risk of being leaked or tampered with. For example, the READ_CONTACTS permission is a dangerous permission. If an app declares that it requires a dangerous permission, the user must explicitly grant it.

[0074] Signature permission: This type of permission is only available to applications with the same signature. For example, QQ Mobile customizes a permission and adds android:protectionLevel="signature" to the permission tag. This permission is required to access certain data. WeChat and QQ then use the same signature when publishing. WeChat can then apply for access to this permission in QQ and use the data controlled by the corresponding permission. Even if other applications learn the interface for the open data and register the permission in the manifest, they still cannot access the corresponding data due to the different application signatures.

[0075] System signature permission (signatureOrSystem permission): Similar to signature permission, but it requires not only the same signature but also the same type of system-level application. This type of permission is generally used in pre-made scenarios developed by mobile phone manufacturers.

[0076] In the embodiment of the present application, the Linux device node refers to: in Linux, all devices are stored in the form of files in the / dev directory, and device nodes are accessed in the form of files. The device node is the Linux kernel's abstraction of the device, and a device node is a file. The application accesses the device through a set of standardized calls, which are independent of any specific driver. The driver is responsible for mapping these standard calls to the unique operations of the actual hardware. The file nodes under the / dev directory are called special device nodes. The so-called node refers to the entrance, and the purpose of operating (reading, writing, etc.) a certain device is achieved through such an entrance. The reason why the corresponding entrance is uniformly set in / dev is because the Linux system provides a corresponding virtual file system, which can use a consistent function interface (open(), read(), write(), close()...) to operate various different devices, which can greatly reduce the complexity of application access to Linux peripheral devices.

[0077] The embodiments of this application address the problem of bypassing the device node's permission management functionality when accessing device nodes without using a dynamic library or SDK interface. This can result in a lack of protection for the device node's privacy data and, in severe cases, can lead to conflicts between device node calls made by applications within the operating system. The technical solutions of the embodiments of this application, by controlling the opening of device nodes, can restrict unidentified code from accessing the device nodes. This also fundamentally standardizes and restricts the ways in which device nodes can be opened, significantly increasing the security and robustness of the Linux system.

[0078] Figure 2 This is a schematic diagram of the architecture of the device node startup control according to an embodiment of the present application, such as Figure 2 As shown, in an embodiment of the present application, when a related application (App) in the operating system accesses a Linux device node, since the access status of the sensitive permissions of the Linux device node is managed and controlled, when the App calls the Linux device node, it needs to obtain the access status of the sensitive permissions of the Linux device node to be called through the device service. Specifically, the device service sends a query request to the sensitive permissions service, and the sensitive permissions service queries its own database to obtain the access status of the current application to the sensitive permissions of the Linux device node to be accessed, and makes corresponding access management based on the corresponding access status.

[0079] Specifically, by creating a sensitive permission service program in the Linux system and setting up a corresponding database for the sensitive permission service, the database stores information about the dynamic adjustment of the access status of the sensitive permissions of applications, thereby controlling the access of related applications to corresponding device nodes based on the access status of sensitive permissions. Furthermore, applications can only access device nodes through the access methods provided in the embodiments of the present application. For unknown applications, user authorization is required to access the device nodes, which prevents other code programs from directly calling device nodes.

[0080] The default sensitive permission for all Linux-installed applications is to ask whether access to device nodes is allowed. When an application starts to access a device node with sensitive permission, such as using the device microphone, the microphone service calls the sensitive permission service to query whether the application is allowed to access the microphone. If access is allowed, the microphone function is enabled for the application. If access is not allowed, a prompt message indicating that the microphone cannot be enabled is returned. In the query state scenario, a system dialog box may pop up, allowing the user to choose whether to allow the relevant application to access the device node. After the user makes a sensitive permission selection, the access status of the sensitive permission selected by the user is saved in the database of the sensitive permission service program.

[0081] Figure 3 This is a flow chart of a method for controlling the start of a device node according to an embodiment of the present application. Figure 3 As shown, the permission control method of the embodiment of the present application includes:

[0082] When the Linux system starts, the sensitive permission service program runs and generates a database to store the correspondence between application package name information and sensitive permission information.

[0083] When an App accesses a device node with sensitive permissions, such as when an application requests to use system device nodes such as the camera and microphone, the public library interface / system service interface is called. The public library / system service requests to open the Linux device node through the open function. The open function interface will be imported into the Linux kernel function do_sys_open() interface. When the Linux kernel do_sys_open() is executed, it is necessary to call the Linux kernel system function sys_getpid() to obtain the PID of the caller, that is, the application process. The query instruction is generated based on the obtained PID and the identification information of the device node, and the query instruction is sent to the sensitive permission service program. The sensitive permission service program obtains the process name based on the PID, and uses the process name and sensitive permission information to query the access status of the sensitive permission of the corresponding device node to the PID in the database of the sensitive permission service. After querying the access status of the sensitive permission of the device node, the query result is returned to the application corresponding to the process. The Linux kernel controls whether to allow the device node to be opened based on the result returned by the sensitive permission service.

[0084] When the device-related service opens a Linux device node, it accesses the sensitive permission service program to query the access status of the sensitive permissions of the application. That is, when an app needs to access a device node with sensitive permissions, the Linux device service obtains the current app's process PID information.

[0085] The sensitive permission service program can query the application package name and other information based on the PID, and query its access status to the sensitive permissions of the device node based on the application package name and other related information. In the embodiment of the present application, the access status of the sensitive permissions includes at least three states: default state, denied state, and allowed state.

[0086] If the sensitive permissions query indicates that the application's access rights to the device node are in the default state, a system pop-up window will appear, asking the user to approve or deny access to the Linux device node function. The following process will then proceed based on the user's choice of granting or denying access.

[0087] When the sensitive permission query finds that the application's access permission to the device node is denied, the relevant information of denying access to the device node is returned, and the function of the Linux device node is prohibited from being enabled.

[0088] When the sensitive permission query finds that the application's access permission to the device node is allowed, the function of the Linux device node is normally enabled.

[0089] In the above steps, after the user selects the status of sensitive permissions in the system pop-up box, the device node is enabled or denied. At this time, the sensitive permission service program will store the application package name and other information and the selected sensitive permission access status for the device node in the database at the same time, so as to manage the sensitive permissions of the device node based on the selected sensitive permission access status when the application accesses next time.

[0090] Figure 4 This is a schematic diagram of the architecture of the permission setting in the operating system of the embodiment of the present application, such as Figure 4 As shown, in an embodiment of the present application, the function of querying and modifying settings for sensitive permission access status is also supported. Through the system setting function in the App, the access status of the application's sensitive permissions for the device node can be queried in the database (also called an encrypted database) through the sensitive permission service. That is, the embodiment of the present application can provide a corresponding query interface for the App to query all sensitive permission information, such as querying the sensitive permission information of a certain application package, querying the sensitive permission information of a certain PID, setting the sensitive permission information of a certain application package, deleting the sensitive permission information of a certain application package, creating and storing sensitive permission information in the database, etc. The storage data about the access status of sensitive permissions in the database includes information such as the application package name, the binary executable file name, the sensitive permission name, and the sensitive permission status. In an embodiment of the present application, the application process name is queried according to the PID, and the application package name information is queried according to the process name. The sensitive permission status specifically includes:

[0091]

[0092] Those skilled in the art should understand that the above-mentioned access status of sensitive permissions is only for illustrative purposes and is not intended to limit the access status of sensitive permissions. Other status settings are also supported.

[0093] In an embodiment of the present application, the system settings in the App can call the sensitive permission service interface to query the application sensitive permission information and modify the relevant information of the sensitive permissions in the database.

[0094] Figure 5 This is a schematic diagram of the structure of the device node start control device of the embodiment of the present application, such as Figure 5 As shown, the device node startup control device of the embodiment of the present application includes:

[0095] A creating unit 50, configured to create an opening function for a device node in response to an access request from an application to the device node;

[0096] The calling unit 51 is configured to execute the start function, call the process identification acquisition function, and acquire the PID of the process of the application accessing the device node;

[0097] A generating unit 52 is configured to generate a query instruction for setting an authority status of the device node based on the PID;

[0098] A first query unit 53 is configured to, in response to the query instruction, call a permission setting service to query status information of the permission setting for the application to access the device node;

[0099] The control unit 54 is configured to control the startup of the device node in response to the status information.

[0100] In one embodiment, the control unit 54 is further configured to:

[0101] When the state information is in the first state, generating first feedback information and outputting the first feedback information to the application; and receiving instruction information from the application in response to the first feedback information, and executing startup control of the device node in response to the instruction information;

[0102] When the state information is in the second state, enabling the device node for the application;

[0103] When the state information is in the third state, the device node is refused to be started, and second feedback information is generated and output to the application.

[0104] In one embodiment, the first query unit 53 is further configured to:

[0105] Triggering the permission setting service to query the device node's access status to the application's permission setting in its own database, and using the queried permission setting access status as a response result to the query instruction;

[0106] The database pre-stores access status of more than one device node with respect to permission settings for more than one application.

[0107] In one embodiment, Figure 5 Based on the device node startup control device shown in FIG, the device node startup control device of the embodiment of the present application further includes:

[0108] The first modification unit ( Figure 5 (not shown) for triggering the setting permission service to modify the access status of the device node for the setting permission of the application in the database based on the indication information after the control unit executes the control of the device node opening.

[0109] In one embodiment, Figure 5Based on the device node startup control device shown in FIG, the device node startup control device of the embodiment of the present application further includes:

[0110] The second query unit ( Figure 5 (not shown) is used to respond to a query request for setting permissions, trigger the setting permission service to search for all data items about setting permissions in the database of the setting permission service, or the data items of setting permissions related to the application identification information in the query request, or the data items of setting permissions related to the device node identification information in the query request, or the data items of setting permissions related to the process identification in the query request, and output them.

[0111] In one embodiment, Figure 5 Based on the device node startup control device shown in FIG, the device node startup control device of the embodiment of the present application further includes:

[0112] The second modification unit ( Figure 5 ), for responding to a modification request for a data item of setting permissions, triggering the setting permissions service to modify the corresponding data item of setting permissions in the database, and saving the modified data item of setting permissions.

[0113] In an exemplary embodiment, the creation unit 50, the calling unit 51, the generation unit 52, the first query unit 53, the control unit 54, the first modification unit, the second query unit, the second modification unit, etc. can be implemented by one or more central processing units (CPU), application-specific integrated circuits (ASIC), digital signal processors (DSP), programmable logic devices (PLD), complex programmable logic devices (CPLD), field programmable gate arrays (FPGA), general-purpose processors, controllers, microcontrollers (MCU), microprocessors, or other electronic components to execute the steps of the device node startup control method of the aforementioned embodiment.

[0114] In the embodiments of the present disclosure, Figure 5The specific manner in which each unit in the illustrated device node startup control apparatus performs operations has been described in detail in the embodiment of the method, and will not be elaborated on here.

[0115] Below, reference Figure 6 The electronic device 11 according to an embodiment of the present application is described.

[0116] like Figure 6 As shown, the electronic device 11 includes one or more processors 111 and a memory 112 .

[0117] The processor 111 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 11 to perform desired functions.

[0118] The memory 112 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may include, for example, read-only memory (ROM), a hard disk, a flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 111 may execute the program instructions to implement the device node startup control method of each embodiment of the present application described above and / or other desired functions. Various contents such as input signals, signal components, noise components, etc. may also be stored in the computer-readable storage medium.

[0119] In one example, the electronic device 11 may further include: an input device 113 and an output device 114, which are connected via a bus system and / or other forms of connection mechanisms ( Figure 6 not shown) interconnected.

[0120] The input device 113 may include, for example, a keyboard, a mouse, and the like.

[0121] The output device 114 can output various information to the outside, including determined distance information, direction information, etc. The output device 114 can include, for example, a display, a speaker, a printer, a communication network and its connected remote output device, etc.

[0122] Of course, to simplify, Figure 6 Only some of the components of the electronic device 11 that are relevant to the present application are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, the electronic device 11 may further include any other appropriate components according to specific application scenarios.

[0123] The embodiment of the present application further describes a storage medium on which an executable program is stored. The executable program is used by a processor to execute the steps of the device node startup control method of the aforementioned embodiment.

[0124] In addition to the above-mentioned methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the method according to various embodiments of the present application described in the above-mentioned "Exemplary Method" section of this specification.

[0125] The computer program product may be written in any combination of one or more programming languages to implement the program code for performing the operations of the embodiments of the present application, including object-oriented programming languages such as Java, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0126] In addition, an embodiment of the present application may also be a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, enable the processor to execute the steps of the method according to various embodiments of the present application described in the above "Exemplary Method" section of this specification.

[0127] The computer-readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can, for example, include but is not limited to a system, device or component of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0128] The basic principles of the present application have been described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, and effects mentioned in this application are merely illustrative and not restrictive, and it should not be assumed that these advantages, strengths, and effects are required of each embodiment of this application. In addition, the specific details disclosed above are merely illustrative and facilitating understanding, and are not restrictive. The above details do not limit this application to necessarily being implemented using the above specific details.

[0129] The block diagrams of the devices, devices, equipment, and systems involved in this application are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, devices, equipment, and systems can be connected, arranged, or configured in any manner. Words such as "include," "comprise," "have," and the like are open-ended words, meaning "including but not limited to," and can be used interchangeably therewith. The words "or" and "and" used herein refer to the words "and / or" and can be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to," and can be used interchangeably therewith.

[0130] It should also be noted that in the apparatus, device, and method of the present application, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present application.

[0131] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present application. Therefore, the present application is not intended to be limited to the aspects shown herein, but rather to be accorded the widest scope consistent with the principles and novel features disclosed herein.

[0132] The above description has been provided for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present application to the forms disclosed herein. Although a number of example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations thereof.

Claims

1. A method for controlling the start of a device node, characterized in that: The method comprises: In response to an application's access request for a device node, creating an enable function for the device node, wherein the access request is used to trigger the enable function at a kernel layer of an operating system to prepare to enable the device node, and the access request does not access the device node through a dynamic library or a software development kit (SDK) provided by the operating system; Execute the start function, call the process identification acquisition function, and obtain the identification information PID of the process of the application accessing the device node; generating a query instruction for the setting permission status of the device node based on the PID, and in response to the query instruction, calling a setting permission service to query status information of the setting permission of the application to access the device node; In response to the status information, controlling the start of the device node; The step of controlling the start of the device node in response to the status information includes: When the status information is in a first state, first feedback information is generated and the first feedback information is output to the application; and indication information of the application regarding the first feedback information is received, and in response to the indication information, control of opening the device node is executed; and the setting permission service is triggered to modify the access status of the device node to the setting permission of the application in the database based on the indication information.

2. The method according to claim 1, characterized in that The controlling the startup of the device node in response to the status information further includes: When the state information is in the second state, opening the device node for the application; When the state information is in the third state, the device node is refused to be started, and second feedback information is generated and output to the application.

3. The method according to claim 2, characterized in that The calling of the permission setting service to query the status information of the permission setting for the application to access the device node includes: The permission setting service queries the access status of the device node to the permission setting of the application in its own database, and uses the queried access status of the permission setting as a response result of the query instruction; The database pre-stores access status of more than one device node with respect to permission settings for more than one application.

4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: In response to a query request for setting permissions, the setting permission service searches for all data items about setting permissions in its own database, or data items about setting permissions related to the application identification information in the query request, or data items about setting permissions related to the device node identification information in the query request, or data items about setting permissions related to the process identification in the query request, and outputs them.

5. The method according to claim 4, characterized in that The method further comprises: In response to a modification request for a permission setting data item, the permission setting service modifies the corresponding permission setting data item in the database and saves the modified permission setting data item.

6. A device node start control device, characterized in that: The device comprises: a creating unit, configured to create, in response to an access request from an application for a device node, an enable function for the device node, wherein the access request is configured to trigger the enable function at a kernel layer of an operating system to prepare to enable the device node, and wherein the access request does not access the device node through a dynamic library or a software development kit (SDK) provided by the operating system; A calling unit, configured to execute the start function, call a process identification acquisition function, and acquire the PID of the process of the application accessing the device node; a generating unit, configured to generate a query instruction for setting an authority status of the device node based on the PID; a first query unit, configured to, in response to the query instruction, call a permission setting service to query status information of the permission set for the application to access the device node; a control unit, configured to control the activation of the device node in response to the status information; The control unit is further configured to: When the state information is in the first state, generating first feedback information and outputting the first feedback information to the application; and receiving instruction information from the application in response to the first feedback information, and executing startup control of the device node in response to the instruction information; The device further comprises: The first modification unit is configured to trigger the permission setting service to modify the access status of the device node to the application setting permission in the database based on the indication information after the control unit performs control on starting the device node.

7. The device according to claim 6, characterized in that The control unit is further configured to: When the state information is in the second state, enabling the device node for the application; When the state information is in the third state, the device node is refused to be started, and second feedback information is generated and output to the application.

8. The device according to claim 7, characterized in that The first query unit is further configured to: Triggering the permission setting service to query the device node's access status to the application's permission setting in its own database, and using the queried permission setting access status as a response result to the query instruction; The database pre-stores access status of more than one device node with respect to permission settings for more than one application.

9. The device according to any one of claims 6 to 8, characterized in that The device further comprises: The second query unit is used to trigger the setting permission service to search for all data items about setting permissions in the database of the setting permission service in response to the query request for setting permissions, or the data items of setting permissions related to the application identification information in the query request, or the data items of setting permissions related to the device node identification information in the query request, or the data items of setting permissions related to the process identification in the query request, and output them.

10. The device according to claim 9, characterized in that The device further comprises: The second modification unit is configured to trigger the permission setting service to modify the corresponding permission setting data item in the database in response to a modification request for the permission setting data item, and save the modified permission setting data item.

11. An electronic device comprising a processor, a memory, and an executable program stored in the memory and capable of being run by the processor, wherein the processor executes the steps of the device node startup control method according to any one of claims 1 to 5 when running the executable program.

12. A storage medium storing an executable program, wherein when the executable program is executed by a processor, the steps of the device node startup control method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Application permission management method, device and equipment and storage medium

    CN111523136A