Microphone permission processing method and device, equipment and storage medium

By implementing microphone permission processing methods in Linux operating system, the problem that the audio server cannot control microphone permissions is solved, and effective protection of user privacy and improved operating system security is achieved.

CN119946476APending Publication Date: 2025-05-06BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311443821.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-01
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

Audio servers in existing Linux operating systems cannot effectively control microphone permissions, resulting in user privacy not being effectively protected and operating system security is poor.

Method used

By implementing the microphone permission processing method on the terminal device, responding to the application's microphone access request, calling the audio service interface, passing in the permission authentication request to the microphone permission management module, querying the audio permission information in the permission database, and returning the execution result or permission prompt based on the results.

Benefits of technology

It realizes the control of microphone access requests of the application, effectively protects user privacy, and improves the security of the operating system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119946476A_ABST
    Figure CN119946476A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a microphone permission processing method and device, equipment and a storage medium, and the method comprises the steps: responding to an access request of an application program for using a microphone, calling an audio service interface corresponding to the access request, and calling an audio service instruction of an audio server through the audio service interface; transmitting a permission authentication request to a microphone permission control module, wherein the permission authentication request comprises identification information of the application program; inquiring audio permission information corresponding to the identification information from a permission database through a microphone permission management and control module; if the audio permission information is authorized microphone permission, returning an execution result of the audio service instruction to the application program; and if the audio permission information is that the microphone permission is not authorized, returning a prompt message that the permission is not authorized to the application program. According to the method and the device, management and control of the microphone permission are realized, and the security of user information is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of system development technology, and in particular to a microphone permission processing method, apparatus, device and storage medium. Background Art

[0002] Currently, more and more users choose to install the Linux operating system on their terminal devices or smart devices.

[0003] In the prior art, when an application in a Linux operating system uses a microphone to record audio, it uses the pulseaudio audio server. As an open source audio server, the pulseaudio audio server allows an application in a Linux operating system to obtain microphone permissions directly through the pulseaudio audio server when using a microphone. In this way, the application can use the microphone for recording without the user's consent and authorization.

[0004] It can be seen from this that the audio server in the current Linux operating system does not have the function of controlling microphone permissions and cannot effectively protect user privacy. Summary of the invention

[0005] The embodiments of the present disclosure provide a microphone permission processing method, apparatus, device and storage medium, which can improve the security of an operating system.

[0006] In a first aspect, an embodiment of the present disclosure provides a method for handling microphone permissions, which is applied to a terminal device having an application installed thereon; the method comprises:

[0007] In response to an access request from an application to use a microphone, calling an audio service interface corresponding to the access request, and calling an audio service instruction of an audio server through the audio service interface;

[0008] Transmitting a permission authentication request to a microphone permission control module, wherein the permission authentication request includes identification information of the application;

[0009] Through the microphone permission control module, querying the audio permission information corresponding to the identification information from the permission database;

[0010] If the audio permission information indicates that the microphone permission has been authorized, the execution result of the audio service instruction is returned to the application; if the audio permission information indicates that the microphone permission has not been authorized, a prompt message indicating that there is no permission is returned to the application.

[0011] In a second aspect, an embodiment of the present disclosure provides a microphone permission processing device, which is applied to a terminal device installed with an application program, and the device includes:

[0012] A calling module, configured to call an audio service interface corresponding to the access request in response to an access request from an application to use a microphone, and call an audio service instruction of an audio server through the audio service interface;

[0013] A request module, used to transmit a permission authentication request to the microphone permission control module, wherein the permission authentication request includes identification information of the application program;

[0014] A query module, used to query the audio permission information corresponding to the identification information from the permission database through the microphone permission control module;

[0015] The return module is used to return the execution result of the audio service instruction to the application if the audio permission information is the authorized microphone permission; if the audio permission information is the unauthorized microphone permission, return the prompt information of no permission to the application.

[0016] In a third aspect, an embodiment of the present disclosure provides an electronic device, including:

[0017] A processor, and a memory communicatively connected to the processor;

[0018] The memory stores computer-executable instructions;

[0019] The processor executes the computer-executable instructions stored in the memory to implement the microphone permission processing method as described in the first aspect above.

[0020] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the microphone permission processing method described in the first aspect above is implemented.

[0021] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the microphone permission processing method as described in the first aspect above.

[0022] The microphone permission processing method, device, equipment and storage medium provided in this embodiment include: in response to an access request of an application to use a microphone, calling an audio service interface corresponding to the access request, and calling an audio service instruction of an audio server through the audio service interface; passing a permission authentication request to a microphone permission control module, wherein the permission authentication request includes the identification information of the application; through the microphone permission control module, querying the audio permission information corresponding to the identification information from the permission database; if the audio permission information is an authorized microphone permission, returning the execution result of the audio service instruction to the application; if the audio permission information is an unauthorized microphone permission, returning a prompt message of no permission to the application. In the disclosed embodiment, when the application uses the microphone, the permission authentication request is first passed to the microphone permission control module, and then, through the permission authentication request, the audio permission information corresponding to the identification information of the application is queried from the permission database; finally, if the audio permission information is an authorized microphone permission, the execution result of the audio service instruction is returned to the application; that is, through the microphone permission control module, the microphone access request of the application is controlled, so that the privacy of the user can be effectively protected, thereby providing the security of the operating system. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0024] Figure 1 A schematic diagram of an application scenario of a microphone permission processing method provided by an embodiment of the present disclosure;

[0025] Figure 2 A flowchart of a microphone permission processing method provided by an embodiment of the present disclosure;

[0026] Figure 3 A schematic diagram of a microphone permission processing method provided by an embodiment of the present disclosure;

[0027] Figure 4 A flowchart of another microphone permission processing method provided by an embodiment of the present disclosure;

[0028] Figure 5 A flowchart of another microphone permission processing method provided by an embodiment of the present disclosure;

[0029] Figure 6A structural block diagram of a microphone permission processing device provided in an embodiment of the present disclosure;

[0030] Figure 7 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0031] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.

[0032] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0033] Currently, more and more users choose to install the Linux operating system on terminal devices or smart devices.

[0034] In the prior art, when an application in a Linux operating system uses a microphone to record audio, it uses the pulseaudio audio server. As an open source audio server, the pulseaudio audio server allows an application in a Linux operating system to obtain microphone permissions directly through the pulseaudio audio server when using a microphone, that is, the application can use the microphone for recording without the user's consent and authorization.

[0035] However, some applications have low security, so after obtaining microphone permissions and using the microphone to record, low-security applications may leak user voice information. Therefore, the current pulseaudio audio server does not have the function of controlling microphone permissions, and cannot effectively protect user information, resulting in poor security of the Linux operating system.

[0036] It can be seen that, under the Linux operating system, how to improve the protection of user privacy by the pulseaudio audio server has become an urgent problem to be solved.

[0037] In order to solve the above problems, this embodiment provides a microphone permission processing method. When an application uses a microphone, a permission authentication request is first transmitted to the microphone permission control module. Then, through the permission authentication request, the audio permission information corresponding to the identification information of the application is queried from the permission database; finally, if the audio permission information is an authorized microphone permission, the execution result of the audio service instruction is returned to the application. That is, through the microphone permission control module, the microphone access request of the application is controlled, so that the privacy of the user can be effectively protected, thereby providing the security of the operating system.

[0038] The application scenarios of the embodiments of the present disclosure are explained below:

[0039] The audio permission processing method provided in the embodiments of the present disclosure can be applied to scenarios in which various types of audio permissions are managed and controlled.

[0040] For example, it can be applied to the scenario where the navigation application obtains voice. When the navigation application A needs to receive the user's voice, it queries the audio permission information corresponding to the navigation application A from the permission database through the microphone permission control module. If the microphone permission has been authorized, the navigation application A is controlled to obtain the user's voice. In this application scenario, the microphone permission of the navigation application A can be controlled through the microphone permission control module.

[0041] For another example, it can be applied to a scenario where an application creates a recording stream or obtains a microphone list. Figure 1 A schematic diagram of an application scenario of a microphone audio permission processing method provided by an embodiment of the present disclosure. Figure 1 As shown, when the application creates a recording stream or obtains a microphone list, the pulse audio interface (pulseaudioapi) in the pulseaudio audio server is called; the pulse audio service program (pulseaudioservice) in the pulseaudio audio server is started through the pulse audio interface, and a permission application is sent to the microphone permission management module; through the microphone permission management module, the microphone audio permission information of the application is obtained. In this application scenario, the microphone permission of the application can be controlled through the microphone audio permission information. The audio permission processing method provided by the embodiment of the present disclosure is described in detail using a detailed embodiment below.

[0042] Example 1

[0043] refer to Figure 2 , Figure 2A flowchart of a microphone permission processing method provided in an embodiment of the present disclosure. The execution subject of the method can be a terminal or a server device. The present disclosure embodiment is described by taking the execution subject as a terminal device with an application installed as an example. The method includes:

[0044] S201. In response to an access request from an application to use a microphone, an audio service interface corresponding to the access request is called, and an audio service instruction of an audio server is called through the audio service interface.

[0045] In the embodiment of the present disclosure, the application program may be any application program installed on the terminal device, wherein the application program may record audio or perform voice interaction with the user through a microphone.

[0046] Optionally, the access request of the application program to use the microphone is processed by the audio server, wherein the audio server includes an audio service interface, through which the audio service program can be called to execute the audio service instruction.

[0047] For example, the audio server may be a pulseaudio audio server. The pulseaudio audio server includes an audio service interface: pulseaudio api. The pulseaudio service program (pulseaudio service) may be called through the audio service interface (pulseaudio api) to execute audio service instructions.

[0048] In the disclosed embodiment, the access request for the application to use the microphone includes one or more. Optionally, the application can use the microphone to implement a voice function and a recording function. Accordingly, the access request for using the microphone includes: a voice request for the microphone to perform voice, and / or a recording request for using the microphone to perform recording.

[0049] S202: Transmit a permission authentication request to the microphone permission management and control module, wherein the permission authentication request includes identification information of the application.

[0050] In the disclosed embodiment, the microphone permission control module is not an installable entity module. Optionally, the microphone permission control module is a permission control program, which can process permission authentication requests and return audio permission information.

[0051] The identification information of the application is used to distinguish different applications. The identification information of the application may be an application package name.

[0052] Optionally, when the permission authentication request is transmitted to the microphone permission control module, the identification information of the application program is also obtained. In some embodiments, the terminal can directly obtain the identification information of the application program.

[0053] In other embodiments, when an application is started, the terminal assigns a process number (i.e., PID) to the application. The process number corresponds to the identification information of the application. The terminal can also obtain the identification information of the application through the process number. Accordingly, the specific steps of obtaining the identification information of the application are: obtaining the current process number of the application, and obtaining the identification information of the application corresponding to the current process number from the corresponding relationship between the process number and the identification information of the application.

[0054] Exemplarily, the identification information of the application is the application package name. Figure 3 As shown, the steps of obtaining the application package name are: obtaining the process ID (PID) of the application, and querying the application package name corresponding to the process ID (PID) of the application from the corresponding relationship between the process ID and the application package name.

[0055] S203: Query the audio permission information corresponding to the identification information from the permission database through the microphone permission management and control module.

[0056] In the disclosed embodiment, the permission database includes a one-to-one correspondence between multiple identification information and multiple audio permission information. Accordingly, this step is: query the corresponding relationship in the permission database through the microphone permission control module to obtain the audio permission information corresponding to the identification information, wherein the audio permission information includes authorized microphone permission or unauthorized microphone permission.

[0057] Exemplarily, the permission database includes: application A has authorized microphone permission, application B has authorized microphone permission, and application C has not authorized microphone permission. If the identification information is: application A, then through the microphone permission control module, the audio permission information corresponding to application A is queried from the permission database: authorized microphone permission.

[0058] It should be noted that, continue to refer to Figure 3 If the audio permission information corresponding to the identification information is not stored in the permission database, the authorization application interface can also be displayed, and then the audio permission information is determined through the user's selection operation. Accordingly, the specific steps are: if the audio permission information corresponding to the identification information is not found in the corresponding relationship, the authorization application interface is displayed; in response to the user's selection operation in the authorization application interface, the audio permission information corresponding to the selection operation is generated. Optionally, continue to refer to Figure 3 , the authorization application interface can be displayed in a pop-up window.

[0059] Since the audio permission information corresponding to the identification information is not stored in the permission database, an authorization application interface can also be displayed to determine the audio permission information through the user's selection operation. That is, when the application uses the microphone, it needs to apply for microphone permission from the user. Only after obtaining the user's authorization can the microphone be used normally, thereby protecting user privacy and further improving the security of the system.

[0060] Optionally, the authorization application interface includes a first control and a second control. Accordingly, in response to the user's selection operation in the authorization application interface, the step of generating audio permission information corresponding to the selection operation is: in response to the user's trigger operation on the first control, the corresponding audio permission information is generated as: authorizing microphone permission; in response to the user's trigger operation on the second control, the corresponding audio permission information is generated as: not authorizing microphone permission.

[0061] In the embodiments of the present disclosure, the trigger operation may be any form of user operation. Optionally, the trigger operation may be a click operation or a slide operation. Exemplarily, the first control and the second control may select a button control. The trigger operation may be a click operation on the selected button control. For example, the first control is an "authorize" button control, and the second control is a "do not authorize" button control.

[0062] Since the corresponding audio permission information can be generated through the first control and the second control, and the triggering operation of the first control and the second control is convenient and simple, it is easy for users to operate.

[0063] It should be noted that, continue to refer to Figure 3 After the audio permission information is determined through the user's selection operation, the corresponding audio permission information can also be stored in the permission database to achieve dynamic update of the permission database. Accordingly, the specific steps are: associating the identification information with the audio permission information and storing them in the corresponding relationship of the permission database.

[0064] After the audio permission information is determined through the user's selection operation, the data in the permission database can also be updated. In this way, when the application accesses the microphone again, the corresponding audio permission information can be queried through the updated permission database, thereby improving the efficiency of microphone permission management.

[0065] S204: If the audio permission information indicates that the microphone permission has been authorized, the execution result of the audio service instruction is returned to the application; if the audio permission information indicates that the microphone permission has not been authorized, a prompt message indicating that there is no permission is returned to the application.

[0066] In some embodiments, the execution result of the audio service instruction can be a microphone list, and the microphone can be further selected through the microphone list to interact with the user by voice. If the audio permission information is not authorized microphone permission, the application cannot obtain the microphone list, and it is also impossible to select a microphone through the microphone list to interact with the user by voice. Among them, the prompt information of no permission can be used to indicate that the application does not have permission to access the microphone list, and can also be used to indicate that the application does not have voice permission.

[0067] In other embodiments, the execution result of the audio service instruction may also be a created recording stream, and the application may further implement the recording function through the created recording stream. If the audio permission information indicates that the microphone permission is not authorized, the application cannot obtain the recording stream, and thus cannot implement the recording function through the recording stream. Among them, the prompt information of no permission can be used to indicate that the application does not have permission to obtain the recording stream, and can also be used to indicate that the application does not have permission to record.

[0068] The microphone permission processing method provided in this embodiment is that when an application uses the microphone, a permission authentication request is first transmitted to the microphone permission management module, and then, through the permission authentication request, the audio permission information corresponding to the identification information of the application is queried from the permission database; finally, if the audio permission information is an authorized microphone permission, the execution result of the audio service instruction is returned to the application; that is, through the microphone permission management module, the microphone access request of the application is managed, so that the privacy of the user can be effectively protected, thereby providing the security of the operating system.

[0069] Example 2

[0070] refer to Figure 4 , Figure 4 A flowchart of another microphone permission processing method provided in an embodiment of the present disclosure. In an embodiment of the present disclosure, an access request includes a voice request using a microphone for voice as an example for explanation. The method includes:

[0071] S401. In response to a voice request from an application program to use a microphone for voice, a microphone list acquisition interface corresponding to the voice request is called, and a microphone list acquisition instruction of an audio server is called through the microphone list acquisition interface.

[0072] In the embodiment of the present disclosure, the microphone list interface is pa_context_get_source_info_list. The instruction for obtaining the microphone list is: PA_COMMAND_GET_SOURCE_INFO_LIST.

[0073] Accordingly, this step is: in response to the application's voice request using the microphone for voice, call the microphone list acquisition interface pa_context_get_source_info_list corresponding to the voice request. Through the microphone list acquisition interface pa_context_get_source_info_list, call the audio server's microphone list acquisition instruction: PA_COMMAND_GET_SOURCE_INFO_LIST.

[0074] S402: Execute the instruction to obtain a microphone list to obtain a microphone list.

[0075] Optionally, the microphone list instruction may be: command_get_info_list. Accordingly, this step is: execute command_get_info_list to obtain the microphone list. The microphone list may be represented by source info list.

[0076] S403: Transmit a permission authentication request to the microphone permission management and control module, wherein the permission authentication request includes identification information of the application program.

[0077] Step S403 is the same as step S202 and will not be described again here.

[0078] S404: Query the audio permission information corresponding to the identification information from the permission database through the microphone permission management and control module.

[0079] Step S404 is the same as step S203 and will not be described again here.

[0080] S405: If the audio permission information indicates that the microphone permission has been authorized, a microphone list is returned to the application; if the audio permission information indicates that the microphone permission has not been authorized, the microphone list is cleared and the cleared microphone list is returned to the application.

[0081] In the disclosed embodiment, when an application uses a microphone for voice, a permission authentication request is first passed to the microphone permission control module, and then, through the permission authentication request, the audio permission information corresponding to the identification information of the application is queried from the permission database; finally, if the audio permission information is an authorized microphone permission, a microphone list is returned to the application. It can be seen that when an application uses a microphone for voice, it is necessary to determine the audio permission information of the application through the microphone permission control module. Only when the audio permission information is an authorized microphone permission, the microphone list is returned to the application, thereby realizing the voice function, thereby being able to effectively protect the user's privacy, thereby providing the security of the operating system.

[0082] Example 3

[0083] refer to Figure 5 , Figure 5 A flowchart of another microphone permission processing method provided in an embodiment of the present disclosure. In an embodiment of the present disclosure, an access request includes a recording request including using a microphone to record a sound. The method includes:

[0084] S501. In response to a recording request from an application using a microphone, a create recording stream interface corresponding to the recording request is called, and a create recording stream instruction of an audio server is called through the create recording stream interface.

[0085] In the embodiment of the present disclosure, the interface for creating a recording stream is pa_stream_connect_record. The command for creating a recording stream is: PA_COMMAND_CREATE_RECORD_STREAM.

[0086] Accordingly, this step is: in response to the recording request of the application using the microphone, call the recording stream creation interface pa_context_get_source_info_list corresponding to the recording request. By creating the recording stream interface pa_context_get_source_info_list, call the audio server's recording stream creation instruction: PA_COMMAND_CREATE_RECORD_STREAM.

[0087] S502, execute the create recording stream instruction to obtain the recording stream.

[0088] Optionally, the microphone list instruction may be: command_create_record_stream. Accordingly, this step is: execute command_create_record_stream to obtain a recording stream. The recording stream may be represented by record_stream.

[0089] S503: Transmit a permission authentication request to the microphone permission management and control module, wherein the permission authentication request includes identification information of the application program.

[0090] Step S503 is the same as step S202 and will not be described again here.

[0091] S504: Query the audio permission information corresponding to the identification information from the permission database through the microphone permission management and control module.

[0092] Step S504 is the same as step S202 and will not be described again here.

[0093] S505. If the audio permission information indicates that the microphone permission is authorized, the recording stream is returned to the application; if the audio permission information indicates that the microphone permission is not authorized, the recording stream is closed and a recording failure prompt is returned to the application.

[0094] In the disclosed embodiment, when an application uses a microphone for recording, a permission authentication request is first passed to the microphone permission control module, and then, through the permission authentication request, the audio permission information corresponding to the identification information of the application is queried from the permission database; finally, if the audio permission information is an authorized microphone permission, the recording stream is returned to the application. It can be seen that when an application uses a microphone for recording, it is necessary to determine the audio permission information of the application through the microphone permission control module. Only when the audio permission information is an authorized microphone permission, the recording stream is returned to the application, thereby realizing the recording function, thereby being able to effectively protect the user's privacy, thereby providing the security of the operating system.

[0095] Figure 6 This is a structural block diagram of a microphone permission processing device provided by an embodiment of the present disclosure, which is applied to a terminal device with an application installed. Figure 6 The microphone permission processing device includes: a calling module 601, a requesting module 602, a querying module 603 and a returning module 604.

[0096] The calling module 601 is used to respond to the access request of the application program to use the microphone, call the audio service interface corresponding to the access request, and call the audio service instruction of the audio server through the audio service interface;

[0097] A request module 602 is used to transmit a permission authentication request to the microphone permission control module, wherein the permission authentication request includes identification information of the application program;

[0098] A query module 603 is used to query the audio permission information corresponding to the identification information from the permission database through the microphone permission control module;

[0099] The return module 604 is used to return the execution result of the audio service instruction to the application if the audio permission information indicates that the microphone permission has been authorized; if the audio permission information indicates that the microphone permission has not been authorized, return a prompt message indicating that there is no permission to the application.

[0100] In one embodiment of the present disclosure, the permission database includes a one-to-one correspondence between multiple identification information and multiple audio permission information; accordingly, the query module 603 queries the audio permission information corresponding to the identification information from the permission database through the microphone permission management module, specifically including: querying the correspondence in the permission database through the microphone permission management module to obtain the audio permission information corresponding to the identification information, wherein the audio permission information includes authorized microphone permissions or unauthorized microphone permissions.

[0101] In one embodiment of the present disclosure, the device also includes: a display module; a display module, used to display an authorization application interface if the audio permission information corresponding to the identification information is not found in the corresponding relationship; in response to the user's selection operation in the authorization application interface, generate audio permission information corresponding to the selection operation.

[0102] In one embodiment of the present disclosure, the authorization application interface includes a first control and a second control; accordingly, the display module generates audio permission information corresponding to the selection operation in response to the user's selection operation in the authorization application interface, specifically including: in response to the user's trigger operation on the first control, the corresponding audio permission information is generated: microphone permission is authorized; in response to the user's trigger operation on the second control, the corresponding audio permission information is generated: microphone permission is not authorized.

[0103] In one embodiment of the present disclosure, the device further includes: an association storage module; the association storage module is used to associate the identification information with the audio permission information and store them in a corresponding relationship in the permission database.

[0104] In one embodiment of the present disclosure, the access request includes a voice request for using a microphone for voice; accordingly, the calling module 601, in response to the access request of the application to use the microphone, calls the audio service interface corresponding to the access request, and calls the audio service instruction of the audio server through the audio service interface, specifically including: in response to the voice request of the application to use the microphone for voice, calls the obtain microphone list interface corresponding to the voice request, and calls the obtain microphone list instruction of the audio server through the obtain microphone list interface.

[0105] In one embodiment of the present disclosure, the device further includes: an execution module; the execution module is used to execute the instruction to obtain a microphone list to obtain a microphone list;

[0106] Correspondingly, the return module 604 returns the execution result of the audio service instruction to the application if the audio permission information is authorized microphone permission; if the audio permission information is unauthorized microphone permission, it returns a prompt message of no permission to the application, specifically including: if the audio permission information is authorized microphone permission, it returns the microphone list to the application; if the audio permission information is unauthorized microphone permission, it clears the microphone list and returns the cleared microphone list to the application.

[0107] In one embodiment of the present disclosure, the access request includes a recording request for recording using a microphone; accordingly, the calling module 601, in response to the access request of the application using the microphone, calls the audio service interface corresponding to the access request, and calls the audio service instruction of the audio server through the audio service interface, specifically including: in response to the recording request of the application using the microphone, calls the create recording stream interface corresponding to the recording request, and calls the create recording stream instruction of the audio server through the create recording stream interface.

[0108] In one embodiment of the present disclosure, the device further includes: an execution module; the execution module is used to execute the instruction to create a recording stream to obtain a recording stream;

[0109] Correspondingly, the return module 604 returns the execution result of the audio service instruction to the application if the audio permission information is authorized microphone permission; if the audio permission information is unauthorized microphone permission, it returns a prompt message of no permission to the application, specifically including: if the audio permission information is authorized microphone permission, it returns the recording stream to the application; if the audio permission information is unauthorized microphone permission, it closes the recording stream and returns a recording failure prompt to the application.

[0110] The calling module 601, the requesting module 602, the querying module 603 and the returning module 604 are connected in sequence. The microphone permission processing device provided in this embodiment can implement the technical solution of the above method embodiment, and its implementation principle and technical effect are similar, which will not be described in detail in this embodiment.

[0111] An embodiment of the present disclosure provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the microphone permission processing method provided in any of the above embodiments of the present application.

[0112] Figure 7 A schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present disclosure. Figure 7The electronic device 700 may be a terminal device or a server. The terminal device may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (PMPs), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0113] like Figure 7 As shown, the electronic device 700 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage device 708 to a random access memory (RAM) 703. Various programs and data required for the operation of the electronic device 700 are also stored in the RAM 703. The processing device 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0114] Typically, the following devices may be connected to the I / O interface 705: input devices 706 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 707 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 708 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 709. The communication devices 709 may allow the electronic device 700 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 7 The electronic device 700 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0115] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 709, or installed from a storage device 708, or installed from a ROM 702. When the computer program is executed by the processing device 701, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0116] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer 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 of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0117] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0118] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.

[0119] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0120] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0121] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".

[0122] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0123] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer 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 of the foregoing.

[0124] In a first aspect, according to one or more embodiments of the present disclosure, a microphone permission processing method is provided, which is applied to a terminal device with an application installed, including:

[0125] In response to an access request from an application to use a microphone, calling an audio service interface corresponding to the access request, and calling an audio service instruction of an audio server through the audio service interface;

[0126] Transmitting a permission authentication request to a microphone permission control module, wherein the permission authentication request includes identification information of the application;

[0127] Through the microphone permission control module, querying the audio permission information corresponding to the identification information from the permission database;

[0128] If the audio permission information indicates that the microphone permission has been authorized, the execution result of the audio service instruction is returned to the application; if the audio permission information indicates that the microphone permission has not been authorized, a prompt message indicating that there is no permission is returned to the application.

[0129] According to one or more embodiments of the present disclosure, the permission database includes a one-to-one correspondence between multiple identification information and multiple audio permission information; accordingly, querying the audio permission information corresponding to the identification information from the permission database through the microphone permission management module includes: querying the correspondence in the permission database through the microphone permission management module to obtain the audio permission information corresponding to the identification information, wherein the audio permission information includes authorized microphone permission or unauthorized microphone permission.

[0130] According to one or more embodiments of the present disclosure, it also includes: if the audio permission information corresponding to the identification information is not found in the corresponding relationship, an authorization application interface is displayed; in response to the user's selection operation in the authorization application interface, audio permission information corresponding to the selection operation is generated.

[0131] According to one or more embodiments of the present disclosure, the authorization application interface includes a first control and a second control; accordingly, in response to a selection operation of a user in the authorization application interface, audio permission information corresponding to the selection operation is generated, including: in response to a trigger operation of a user on the first control, the corresponding audio permission information is generated as: authorizing microphone permission; in response to a trigger operation of a user on the second control, the corresponding audio permission information is generated as: not authorizing microphone permission.

[0132] According to one or more embodiments of the present disclosure, after generating the audio permission information corresponding to the selection operation, the method further includes associating the identification information with the audio permission information and storing the associative relationship in the permission database.

[0133] According to one or more embodiments of the present disclosure, the access request includes a voice request for using a microphone for voice; accordingly, the response to the access request of the application to use the microphone, calling the audio service interface corresponding to the access request, and calling the audio service instruction of the audio server through the audio service interface, including: responding to the voice request of the application to use the microphone for voice, calling the get microphone list interface corresponding to the voice request, and calling the get microphone list instruction of the audio server through the get microphone list interface.

[0134] According to one or more embodiments of the present disclosure, before the permission authentication request is passed to the microphone permission management module, it also includes: executing the instruction to obtain the microphone list to obtain the microphone list; accordingly, if the audio permission information is an authorized microphone permission, the execution result of the audio service instruction is returned to the application; if the audio permission information is an unauthorized microphone permission, a prompt message of no permission is returned to the application, including: if the audio permission information is an authorized microphone permission, the microphone list is returned to the application; if the audio permission information is an unauthorized microphone permission, the microphone list is cleared and the cleared microphone list is returned to the application.

[0135] According to one or more embodiments of the present disclosure, the access request includes a recording request for recording using a microphone; accordingly, the response to the access request of the application using the microphone, calling the audio service interface corresponding to the access request, and calling the audio service instruction of the audio server through the audio service interface, includes: responding to the recording request of the application using the microphone, calling the create recording stream interface corresponding to the recording request, and calling the create recording stream instruction of the audio server through the create recording stream interface.

[0136] According to one or more embodiments of the present disclosure, before the permission authentication request is passed to the microphone permission management module, it also includes: executing the create recording stream instruction to obtain the recording stream; accordingly, if the audio permission information is authorized microphone permission, returning the execution result of the audio service instruction to the application; if the audio permission information is unauthorized microphone permission, returning a prompt message of no permission to the application, including: if the audio permission information is authorized microphone permission, returning the recording stream to the application; if the audio permission information is unauthorized microphone permission, closing the recording stream and returning a recording failure prompt to the application.

[0137] In a second aspect, according to one or more embodiments of the present disclosure, there is provided a microphone permission processing apparatus, which is applied to a terminal device with an application installed thereon, and includes: a calling module, a requesting module, a querying module, and a returning module.

[0138] The calling module is used to call the audio service interface corresponding to the access request in response to the access request of the application program to use the microphone, and call the audio service instruction of the audio server through the audio service interface;

[0139] A request module, used to transmit a permission authentication request to the microphone permission control module, wherein the permission authentication request includes identification information of the application program;

[0140] A query module, used to query the audio permission information corresponding to the identification information from the permission database through the microphone permission control module;

[0141] The return module is used to return the execution result of the audio service instruction to the application if the audio permission information is the authorized microphone permission; if the audio permission information is the unauthorized microphone permission, return the prompt information of no permission to the application.

[0142] According to one or more embodiments of the present disclosure, the permission database includes a one-to-one correspondence between multiple identification information and multiple audio permission information; accordingly, the query module queries the audio permission information corresponding to the identification information from the permission database through the microphone permission management module, specifically including: querying the correspondence in the permission database through the microphone permission management module to obtain the audio permission information corresponding to the identification information, wherein the audio permission information includes authorized microphone permissions or unauthorized microphone permissions.

[0143] According to one or more embodiments of the present disclosure, the device also includes: a display module; a display module for displaying an authorization application interface if the audio permission information corresponding to the identification information is not found in the corresponding relationship; and in response to a user's selection operation in the authorization application interface, generating audio permission information corresponding to the selection operation.

[0144] According to one or more embodiments of the present disclosure, the authorization application interface includes a first control and a second control; accordingly, the display module generates audio permission information corresponding to the selection operation in response to the user's selection operation in the authorization application interface, specifically including: in response to the user's trigger operation on the first control, the corresponding audio permission information is generated: microphone permission is authorized; in response to the user's trigger operation on the second control, the corresponding audio permission information is generated: microphone permission is not authorized.

[0145] According to one or more embodiments of the present disclosure, the device further includes: an association storage module; an association storage module, configured to associate the identification information with the audio permission information, and store the association information in the corresponding relationship of the permission database.

[0146] According to one or more embodiments of the present disclosure, the access request includes a voice request for using a microphone for voice; accordingly, the calling module, in response to the application's access request for using a microphone, calls the audio service interface corresponding to the access request, and calls the audio service instruction of the audio server through the audio service interface, specifically including: in response to the application's voice request for using a microphone for voice, calling the obtain microphone list interface corresponding to the voice request, and calling the obtain microphone list instruction of the audio server through the obtain microphone list interface.

[0147] According to one or more embodiments of the present disclosure, the device further includes: an execution module; the execution module is used to execute the instruction to obtain the microphone list to obtain the microphone list;

[0148] Correspondingly, the return module returns the execution result of the audio service instruction to the application if the audio permission information is authorized microphone permission; if the audio permission information is unauthorized microphone permission, it returns a prompt message of no permission to the application, specifically including: if the audio permission information is authorized microphone permission, it returns the microphone list to the application; if the audio permission information is unauthorized microphone permission, it clears the microphone list and returns the cleared microphone list to the application.

[0149] According to one or more embodiments of the present disclosure, the access request includes a recording request for recording using a microphone; accordingly, the calling module, in response to the application's access request using a microphone, calls an audio service interface corresponding to the access request, and calls an audio service instruction of an audio server through the audio service interface, specifically including: in response to the application's recording request using a microphone, calling a create recording stream interface corresponding to the recording request, and calling a create recording stream instruction of the audio server through the create recording stream interface.

[0150] According to one or more embodiments of the present disclosure, the device further includes: an execution module; the execution module is used to execute the instruction to create a recording stream to obtain a recording stream;

[0151] Correspondingly, the return module returns the execution result of the audio service instruction to the application if the audio permission information is authorized microphone permission; if the audio permission information is unauthorized microphone permission, it returns a prompt message of no permission to the application, specifically including: if the audio permission information is authorized microphone permission, it returns the recording stream to the application; if the audio permission information is unauthorized microphone permission, it closes the recording stream and returns a recording failure prompt to the application.

[0152] In a third aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device, comprising: a processor, and a memory communicatively connected to the processor;

[0153] The memory stores computer-executable instructions;

[0154] The processor executes the computer-executable instructions stored in the memory to implement the microphone permission processing method as described in the first aspect and various possible designs of the first aspect.

[0155] In a fourth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer execution instructions. When a processor executes the computer execution instructions, the microphone permission processing method described in the first aspect and various possible designs of the first aspect is implemented.

[0156] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the microphone permission processing method as described in the first aspect and various possible designs of the first aspect.

[0157] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0158] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0159] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. A microphone permission processing method, characterized in that: Applicable to terminal devices with applications installed, including: In response to an access request from an application to use a microphone, calling an audio service interface corresponding to the access request, and calling an audio service instruction of an audio server through the audio service interface; Transmitting a permission authentication request to a microphone permission control module, wherein the permission authentication request includes identification information of the application; Through the microphone permission control module, querying the audio permission information corresponding to the identification information from the permission database; If the audio permission information indicates that the microphone permission has been authorized, the execution result of the audio service instruction is returned to the application; if the audio permission information indicates that the microphone permission has not been authorized, a prompt message indicating that there is no permission is returned to the application.

2. The method according to claim 1, characterized in that The authority database includes a one-to-one correspondence between a plurality of identification information and a plurality of audio authority information; Correspondingly, querying the audio permission information corresponding to the identification information from the permission database through the microphone permission control module includes: The corresponding relationship in the permission database is queried through the microphone permission management module to obtain audio permission information corresponding to the identification information, wherein the audio permission information includes authorized microphone permission or unauthorized microphone permission.

3. The method according to claim 2, characterized in that Also includes: If the audio permission information corresponding to the identification information is not found in the corresponding relationship, an authorization application interface is displayed; In response to a selection operation by a user in the authorization application interface, audio permission information corresponding to the selection operation is generated.

4. The method according to claim 3, characterized in that The authorization application interface includes a first control and a second control; Accordingly, in response to the user's selection operation in the authorization application interface, generating audio permission information corresponding to the selection operation includes: In response to the user's triggering operation on the first control, the corresponding audio permission information is generated as follows: authorizing microphone permission; In response to the user's triggering operation on the second control, the corresponding audio permission information is generated: the microphone permission is not authorized.

5. The method according to claim 3 or 4, characterized in that: After the audio permission information corresponding to the selection operation is generated, the method further includes: The identification information is associated with the audio authority information and stored in the corresponding relationship of the authority database.

6. The method according to claim 1, characterized in that wherein the access request comprises a voice request using a microphone for speech; Accordingly, in response to the application's access request to use the microphone, calling the audio service interface corresponding to the access request, and calling the audio service instruction of the audio server through the audio service interface, includes: In response to a voice request from an application using a microphone for voice, a microphone list acquisition interface corresponding to the voice request is called, and a microphone list acquisition instruction of an audio server is called through the microphone list acquisition interface.

7. The method according to claim 6, characterized in that Before the permission authentication request is transmitted to the microphone permission control module, the method further includes: Execute the instruction to obtain the microphone list to obtain the microphone list; Correspondingly, if the audio permission information is an authorized microphone permission, the execution result of the audio service instruction is returned to the application; if the audio permission information is an unauthorized microphone permission, a prompt message indicating that there is no permission is returned to the application, including: If the audio permission information indicates that the microphone permission has been authorized, the microphone list is returned to the application; if the audio permission information indicates that the microphone permission has not been authorized, the microphone list is cleared and the cleared microphone list is returned to the application.

8. The method according to claim 1, characterized in that The access request includes a recording request for recording using a microphone; Accordingly, in response to the application's access request to use the microphone, calling the audio service interface corresponding to the access request, and calling the audio service instruction of the audio server through the audio service interface, includes: In response to an application's recording request using a microphone, a create recording stream interface corresponding to the recording request is called, and a create recording stream instruction of an audio server is called through the create recording stream interface.

9. The method according to claim 8, characterized in that Before the permission authentication request is transmitted to the microphone permission control module, the method further includes: Execute the instruction to create a recording stream to obtain a recording stream; Correspondingly, if the audio permission information is an authorized microphone permission, the execution result of the audio service instruction is returned to the application; if the audio permission information is an unauthorized microphone permission, a prompt message indicating that there is no permission is returned to the application, including: If the audio permission information is to authorize microphone permission, the recording stream is returned to the application; if the audio permission information is to not authorize microphone permission, the recording stream is closed and a recording failure prompt is returned to the application.

10. A microphone permission processing device, characterized in that: Applicable to terminal devices with applications installed, including: A calling module, configured to call an audio service interface corresponding to the access request in response to an access request from an application to use a microphone, and call an audio service instruction of an audio server through the audio service interface; A request module, used to transmit a permission authentication request to the microphone permission control module, wherein the permission authentication request includes identification information of the application program; A query module, used to query the audio permission information corresponding to the identification information from the permission database through the microphone permission control module; The return module is used to return the execution result of the audio service instruction to the application if the audio permission information is the authorized microphone permission; if the audio permission information is the unauthorized microphone permission, return the prompt information of no permission to the application.

11. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the microphone permission processing method according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions. When the processor executes the computer-executable instructions, the microphone permission processing method according to any one of claims 1 to 9 is implemented.

13. A computer program product, characterized in that It comprises a computer program, which, when executed by a processor, implements the microphone permission processing method as described in any one of claims 1 to 9.