USB camera management method, device and equipment and readable storage medium
By judging the interface access capability of the application, dynamically managing the usage permissions of USB cameras, the problem of complex permission settings and inability to achieve refined management in the existing technology is solved, and simple and efficient USB camera permission management is achieved.
Patent Information
- Application Number
- CN202311310827.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-10
- Publication Date
- 2025-04-11
AI Technical Summary
The existing USB cameras lack access permission management capabilities, resulting in complex permission settings and inability to achieve refined permission management, especially in multiple USB camera scenarios that cannot be authorized separately to each third-party application.
By determining whether the application has the ability to access the target interface, if it has it, determine the USB camera through the target interface and enable the usage permissions. If it does not have it, keep the target function in the off state to realize the permission management of the USB camera.
Without complex system settings or installation of additional software, the permission settings and access of USB cameras are realized, and the access permissions for each USB camera can be determined for each application, realizing the refined processing of permission management.
Smart Images

Figure CN119807097A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of camera technology, and in particular to a management method, device, equipment and readable storage medium for a USB camera. Background Art
[0002] A Universal Serial Bus (USB) camera is a camera that is connected to an electronic device via a USB interface. After the USB camera is connected to the electronic device, the operating system or application in the electronic device can access the USB camera and obtain the images captured / collected by the USB camera.
[0003] Existing USB cameras do not have access rights management capabilities, so every application or account can access the USB camera normally. In order to prevent illegal use of USB cameras and effectively protect the security of USB camera data, USB camera access rights can be set in electronic devices equipped with Windows operating systems.
[0004] However, the setting of the above permissions requires entering the system or control panel of the electronic device, or installing permission management software / specific drivers in the electronic device. Regardless of which method is used, the operation process is relatively complicated. In addition, in the scenario where the electronic device is connected to multiple USB cameras, the existing permission setting method cannot authorize each third-party application separately, nor can it set the usage permissions of each third-party application for each camera, that is, it is impossible to achieve refined processing of permission management. Summary of the invention
[0005] The embodiment of the present application provides a management method, device, equipment and readable storage medium for a USB camera, which solves the problem that permission setting operation is complicated and refined permission management cannot be achieved. The electronic device determines whether to enable the use permission of the first USB camera for the application based on whether the application has the ability to access the target interface, without entering the control panel or system for complex settings.
[0006] In a first aspect, an embodiment of the present application provides a method for managing a USB camera, which is applied to an electronic device configured with a Windows operating system, and the electronic device is connected to at least one physical USB camera, and the method includes:
[0007] Receive a start instruction for a target function of starting an application program; the target function is implemented by calling a first USB camera
[0008] When the application has the ability to access the target interface, the first USB camera is determined through the target interface, and the use permission of the first USB camera is opened to the application;
[0009] When the application does not have the ability to access the target interface, keep the target function disabled;
[0010] Among them, the target interface is used to find a first USB camera, the first USB camera is a USB camera among USB cameras of an electronic device that requires permission management, and the first USB camera is a physical USB camera among at least one physical USB camera; or, the first USB camera is at least one of virtual USB cameras virtualized based on the physical USB camera.
[0011] In a second aspect, an embodiment of the present application provides a management device for a USB camera, the device is set on an electronic device, the electronic device is connected to at least one physical USB camera, and the device includes:
[0012] A receiving module is used to start a start instruction of a target function of an application program;
[0013] A processing module, used for determining the first USB camera through the target interface and opening the use permission of the first USB camera to the application program when the application program has the ability to access the target interface;
[0014] A holding module is used to keep the target function in a closed state when the application does not have the ability to access the target interface;
[0015] Among them, the target interface is used to find a first USB camera, the first USB camera is a USB camera among USB cameras of an electronic device that requires permission management, and the first USB camera is a physical USB camera among at least one physical USB camera; or, the first USB camera is at least one of virtual USB cameras virtualized based on the physical USB camera.
[0016] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the electronic device implements the method described in the first aspect or various possible implementation methods of the first aspect.
[0017] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed by a processor, they are used to implement the method described in the first aspect or various possible implementation methods of the first aspect.
[0018] In a fifth aspect, an embodiment of the present application provides a computer program product comprising a computing program, and when the computer program is executed by a processor, the method described in the first aspect or various possible implementation methods of the first aspect is implemented.
[0019] In summary, for an electronic device connected with at least one physical USB camera and configured with a Windows operating system in the embodiment of the present application, after receiving a start instruction for starting a target function of an application (the realization of the target function requires calling a first USB camera, and the first USB camera is a camera that has been set up for permission management), it is determined whether the application has the ability to access the target interface. If it has, the electronic device determines the first USB camera through the target interface and opens the use permission of the first USB camera for the application. If it does not have, the electronic device refuses to open the use permission of the first USB camera for the application, and keeps the target function in a closed state. In this way, the permission setting of the USB camera can be realized without the user performing complex operations or installing additional software, and the USB camera can be accessed according to the set permissions. In addition, the management method provided in the embodiment of the present application can determine the access rights to each USB camera for each application. Compared with the prior art, the refined processing of permission management is realized. At the same time, there is no need to install additional specific drivers or permission management software, saving the software and hardware resources of the electronic device. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0021] Figure 1A This is a schematic diagram of an implementation environment of the USB camera management method provided in the embodiment of the present application;
[0022] Figure 1B Schematic diagram of another implementation environment of the USB camera management method provided in the embodiment of the present application;
[0023] Figure 2 is a flow chart of a USB camera management method provided in an embodiment of the present application;
[0024] Figure 3 is a registration flow chart of a first USB camera in the USB camera management method provided in an embodiment of the present application;
[0025] Figure 4 is another flow chart of the USB camera management method provided in the embodiment of the present application;
[0026] Figure 5A schematic diagram of a USB camera management device provided in an embodiment of the present application;
[0027] Figure 6 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] With the development of computers and networks, people often use USB cameras in daily use of various electronic devices. USB cameras are connected to electronic devices through USB interfaces, and use USB technology to achieve video transmission and image acquisition. Specifically, USB cameras can achieve image transmission based on the USB video class (UVC) protocol. The UVC protocol can work in PC operating systems such as Windows. Of course, USB cameras also have other functions, such as audio acquisition and transmission functions.
[0029] Since USB cameras do not have access rights management capabilities, every application or account in the electronic device can access the USB camera normally. In order to prevent illegal use of USB cameras and effectively protect the security of USB camera data, USB camera access rights can be set in electronic devices equipped with Windows operating systems.
[0030] At present, electronic devices equipped with Windows operating systems mainly manage the permissions of USB cameras in the following ways to ensure that only authorized accounts or applications can access or use USB cameras, thereby improving the security of the system and data and ensuring the stability of application services.
[0031] The first one: depends on the window operating system.
[0032] The user enters the control panel of the electronic device to set permissions so that the application that comes with the electronic device or a third-party application can use the USB camera or cannot use the USB camera. Generally, the permission settings of the applications that come with the Windows operating system and the third-party applications are independent. The user can only set permissions for all the applications that come with the Windows operating system or all third-party applications at the same time, and cannot set permissions for a single application that comes with the Windows operating system or a third-party application.
[0033] The second method: install permission management software.
[0034] In this method, a permission management software is installed on the electronic device, that is, a third-party (non-Windows system-provided) software, such as a security manager, is installed, and the permission management software is used to manage the USB camera's permissions.
[0035] The third method: Install a specific driver.
[0036] Regardless of which of the above methods is used, the operation process is relatively complicated, requiring users to open the corresponding interface or install software one by one. The second and third methods above also require additional installation of permission management software or drivers, occupying the software and hardware resources of the electronic device, and the effective utilization rate of resources is low.
[0037] In addition, in actual applications, there will be scenarios where multiple USB cameras are connected to an electronic device, such as multiple USB cameras connected to an interactive tablet in a teaching environment, multiple USB cameras connected to the same electronic device in a video conferencing environment, and multiple USB cameras connected to an electronic device in a live broadcast scenario. In these scenarios, the above-mentioned permission setting method is only set for all system built-in applications, or for all third-party applications, and it is impossible to authorize each third-party application separately. In addition, it is also impossible to set the use rights of each third-party application to each camera. That is, the existing permission setting method cannot achieve refined processing of permission management.
[0038] Based on this, the embodiment of the present application provides a management method, device, equipment and readable storage medium for a USB camera. For an electronic device connected to at least one physical USB camera and configured with a Windows operating system, after receiving a startup instruction for starting a target function of an application (the realization of the target function requires calling a first USB camera, and the first USB camera is a camera that has been set up for permission management), it is determined whether the application has the ability to access the target interface. If it has, the electronic device determines the first USB camera through the target interface and opens the use permission of the first USB camera for the application. If it does not have, the electronic device refuses to open the use permission of the first USB camera for the application, and keeps the target function in a closed state. In this way, the permission setting of the USB camera can be realized without the user performing complex operations or installing additional software, and the USB camera can be accessed according to the set permissions. In addition, the management method of the USB camera provided in the embodiment of the present application can determine the access rights to each USB camera for each application. Compared with the prior art, the refined processing of permission management is realized.
[0039] Figure 1A This is a schematic diagram of an implementation environment of the USB camera management method provided in the embodiment of the present application. Figure 1AThe implementation environment includes an electronic device 11 and multiple physical USB cameras 12. The electronic device 11 has multiple USB interfaces 111, and each physical USB camera 12 is respectively inserted into the USB interface 111 to establish a connection with the electronic device 11. Some or all of these physical USB cameras 12 are cameras that need to be managed by permissions.
[0040] Figure 1B This is another implementation environment diagram of the USB camera management method provided in the embodiment of the present application. Figure 1B The implementation environment includes an electronic device 11 and at least one physical USB camera 12. The electronic device 11 has at least one USB interface 111. Figure 1B Take a physical USB camera and an electronic device 11 having a USB interface 111 as an example. After the physical USB camera 12 is inserted into the USB interface 111, multiple virtual USB cameras 112 are virtualized on the electronic device 11. Some or all of these virtual USB cameras 112 are cameras that need to be managed by permissions.
[0041] It should be noted that the virtual USB camera mentioned in the embodiment of the present application is a software-defined camera constructed based on the physical USB camera information of the electronic device. The method of constructing a virtual USB camera based on a physical USB camera can refer to the prior art, and the specific implementation process is not described in detail in the embodiment of the present application.
[0042] Please refer to Figure 1A and Figure 1B The electronic device 11 is a device having a USB interface 111 and configured with a Windows operating system. The electronic device 11 can be an interactive tablet, a laptop, a desktop tablet, etc.
[0043] In the embodiment of the present application, the USB camera that needs to be managed / has been managed is called the first USB camera, and the USB camera that does not need to be managed is called the second USB camera. The first USB camera may include a physical USB camera 12 and a virtual USB camera 112. For example, the first USB camera is one or all of at least one physical USB camera connected to the electronic device 11; for another example, a physical USB camera 12 is connected to the electronic device 11, and multiple virtual USB cameras 112 are virtualized based on the physical USB camera 12, and some or all of the virtual USB cameras 112 in the multiple virtual USB cameras 112 are the first USB camera.
[0044] In the embodiment of the present application, before the physical USB camera 12 is inserted into the electronic device 11, some pre-settings can be performed to set the physical USB camera 12 as the first USB camera; or, some or all of the virtual USB cameras 112 virtualized based on the physical USB camera 12 are set as the first USB camera. When a USB camera (physical USB camera 12 or virtual USB camera 112) is set as the first USB camera, the application can only find the first USB camera through the target interface. Among them, the pre-settings can be to configure the physical USB camera or to configure the electronic device 11, which is not limited by the embodiment of the present application.
[0045] Afterwards, the physical USB camera 12 is inserted into the electronic device 11, and when the target function of the application on the electronic device 11 is enabled, if the application has the ability to access the target interface, the first USB camera is determined through the target interface, and the use permission of the first USB camera is enabled for the application. The target function is a function that can only be realized by relying on the first USB camera.
[0046] Below, based on Figure 1A and Figure 1B The implementation environment shown is used to describe in detail the USB camera management method described in the embodiment of the present application. Figure 2 , Figure 2 : is a flow chart of a USB camera management method provided by an embodiment of the present application. The execution subject of this embodiment is the above-mentioned electronic device, which is connected to at least one physical USB camera and is configured with a Windows operating system. This embodiment includes:
[0047] 201. Receive a start instruction for starting a target function of an application program, where the target function is implemented by calling a first USB camera.
[0048] In an embodiment of the present application, the electronic device has a USB interface, and the USB cable of the physical USB camera is inserted into the USB interface, so that a connection is established between the physical USB camera and the electronic device.
[0049] An application is installed on the electronic device, and the application has at least a target function, which can be started at the same time as the application is started, or after the application is running. The user can flexibly send a start instruction to the electronic device to start the target function of the application. The target function here is a function that the application needs to call the first USB camera to achieve. For example: recording video, collecting images, etc.
[0050] In one method, a user clicks on an application icon on a display screen of an electronic device, thereby sending a startup instruction to the electronic device so that the target function and the application are started simultaneously. For example, the application is a shooting application, and the target function is the shooting function. After the user clicks on the application icon, the shooting function is started.
[0051] In another way, the electronic device has a voice recognition function and can recognize the user's voice command. The user starts the application program by voice, thereby sending a start instruction to the electronic device so that the target function and the application program are started at the same time.
[0052] In another way, the target function is started after the application is running. The user interface of the application is displayed on the display screen of the electronic device, and the control is displayed on the user interface. The user clicks the control to send a startup instruction to the electronic device to start the target function. Among them, the user interface can be the main interface after the application is started, or it can be an interface called up by operating the main interface. For example, the application is a conference application, and the target function is a screen recording function.
[0053] 202. The electronic device determines whether the application has the ability to access the target interface. When the application has the ability to access the target interface, step 203 is executed; when the application does not have the ability to access the target interface, step 204 is executed.
[0054] In the embodiment of the present application, the target interface is used to search for the first USB camera. Some pre-settings are performed in advance to configure which physical USB cameras and / or which virtual USB cameras are the first USB cameras, i.e., cameras that require permission management. These first USB cameras are USB cameras that can only be found by the application through the target interface.
[0055] After receiving the start instruction for starting the target function of the application, the electronic device determines whether the application has the ability to access the target interface. For example, it determines whether the application itself has the target interface. If the application has the target interface, the application has the ability to access the target interface.
[0056] 203. Determine the first USB camera through the target interface, and grant the application program access to use the first USB camera.
[0057] In the embodiment of the present application, the USB cameras that need to be managed for permissions are registered in the registry of the electronic device operating system through some pre-settings in advance, and these USB cameras are used as the first USB cameras. When the application requests to use the first USB camera, the electronic device finds the first USB camera through the target interface and opens the permission to use the first USB camera.
[0058] 204. Keep the target function turned off.
[0059] When the application does not have the ability to access the target interface, the electronic device keeps the target function in a closed state, that is, in an unavailable state. For example, the application is a conference application, and the target function is a screen recording function. When the application does not have the ability to access the target interface, during the conference, if the user clicks the screen recording control, the electronic device keeps the screen recording function in a closed state.
[0060] Optionally, the electronic device also displays a prompt message, which is used to indicate that the application cannot enable the target function.
[0061] The management method of the USB camera provided in the embodiment of the present application is that after receiving the start instruction for starting the target function of the application (the realization of the target function requires calling the first USB camera, and the first USB camera is a camera that has been set up for permission management), the electronic device determines whether the application has the ability to access the target interface. If it has, the electronic device determines the first USB camera through the target interface and opens the use permission of the first USB camera for the application. If it does not have, the electronic device refuses to open the use permission of the first USB camera for the application, and keeps the target function in a closed state. In this way, the permission setting of the USB camera can be realized without the user performing complex operations or installing additional software, and the USB camera can be accessed according to the set permissions. In addition, the management method provided in the embodiment of the present application can determine the access rights to each USB camera for each application. Compared with the prior art, refined processing of permission management is achieved. Furthermore, there is no need to install additional specific drivers or permission management software, saving the software and hardware resources of the electronic device.
[0062] Optionally, in the above embodiment, when the application has the ability to access the target interface, in the process of the electronic device determining the first USB camera through the target interface, first, the electronic device determines the target path whose identifier is a preset identifier from the driver of the electronic device operating system through the target interface. Then, the first USB camera is determined according to the target path.
[0063] Exemplarily, when the application has the ability to access the target interface, the electronic device determines the target path whose identifier is a preset identifier in the device interface class driven by Windows through the target interface, such as the MFEnumDeviceSources interface of Media Foundation, so as to find the first USB camera. The preset identifier is, for example, KSCATEGORY_SENSOR_CAMERA, etc., which is not limited in the embodiment of the present application.
[0064] General applications, that is, applications that do not have the ability to access the target interface, will not search for the first USB camera in KSCATEGORY_SENSOR_CAMERA. Therefore, the purpose of enabling specific applications to use the first USB camera and general applications not being able to use the first USB camera can be achieved. Specific applications are applications that have the ability to access the target interface, such as algorithm applications, live broadcast applications, etc.; general applications are applications that do not have the ability to access the target interface, such as shooting applications.
[0065] By adopting this solution, the purpose of USB camera permission management and control at the application level is achieved by only allowing applications with target interface access capabilities to find the first USB camera.
[0066] Optionally, in the above embodiment, the electronic device configures which physical USB cameras and / or which virtual USB cameras are the first USB cameras, i.e., cameras that require permission management, in advance through some pre-settings. When a USB camera (physical USB camera 12 or virtual USB camera 112) is set as the first USB camera, the application can find the first USB camera through the target interface. Below, how to perform pre-settings is described in detail.
[0067] In one way, the front-end settings are configured for the physical USB camera.
[0068] In an embodiment of the present application, when configuring a physical USB camera, the original descriptor of the physical USB camera is kept unchanged, and a target descriptor is added. The original descriptor is used to transmit information to an electronic device so that the electronic device understands the physical USB camera. The newly added target descriptor is, for example, a Microsoft OS 2.0 descriptor. In the target descriptor, a target attribute is added to the USB interface that needs to be managed for rights, and the value of the target attribute is set to a preset value. For example, the target attribute is a sensor camera mode attribute, and the preset value is 1.
[0069] It should be noted that the USB interface that needs to be managed for rights in the target descriptor here is a virtual USB interface, and the virtual USB interface and the virtual USB camera correspond one to one. In other words, the virtual USB camera virtualized based on the physical USB camera corresponds one to one to the USB interface. For example, three virtual USB cameras are virtualized based on a physical USB camera, corresponding to USB interface0, USB interface3 and USB interface5 respectively. Assuming that the virtual USB cameras corresponding to USB interface0 and USB interface3 are USB cameras that need to be managed for rights, the target attribute is added to USB interface0 and USB interface3 in the target descriptor, and the value of the target attribute is 1.
[0070] Since the virtual USB camera corresponding to USB interface5 does not need to be managed by rights, a target attribute is added to USB interface5 in the target descriptor, and the value of the target attribute is not 1, for example, equal to 2, etc., which is not limited in the embodiment of the present application.
[0071] In addition, for a USB camera that does not require permission management, it is not necessary to add a target attribute to the USB interface of the USB camera in the target descriptor. Instead, the electronic device defaults all USB cameras that do not exist in the target descriptor as USB cameras that do not require permission management.
[0072] The above describes how to set a virtual USB camera as the first USB camera. When a physical USB camera needs to be set as the first USB camera, a new descriptor may also be added, which is not limited in the embodiments of the present application.
[0073] After the physical USB camera is set up, the physical USB camera is inserted into the USB interface of the electronic device. The electronic device completes the registration of the first USB camera. For example, please refer to Figure 3 .
[0074] Figure 3 This is a registration flow chart of the first USB camera in the USB camera management method provided in the embodiment of the present application. This embodiment includes:
[0075] 301. Determine whether a physical USB camera is inserted into a USB interface of an electronic device.
[0076] The electronic device determines whether the physical USB camera is inserted into the electronic device by detecting the voltage of the USB interface, etc.
[0077] 302. Parse a target descriptor of the physical USB camera, where the target descriptor is used to indicate a virtual USB camera that needs to be managed for rights among at least one virtual USB camera virtualized based on the physical USB camera.
[0078] After the electronic device detects that a physical USB camera is inserted into the USB interface, it obtains and parses the target descriptor through the USB interface to obtain a virtual USB camera that needs to be managed for rights. For example, the electronic device uses the virtual USB camera in the target descriptor with a target attribute of a preset value as the virtual USB camera that needs to be managed for rights.
[0079] 303. For each virtual USB camera that needs to be managed for rights, generate a key value with a first preset value in a registry of the electronic device.
[0080] For the virtual USB camera in the target descriptor whose target attribute is a preset value, the electronic device generates a key value with a first preset value in the registration table, and assigns the value of the target attribute, that is, the preset value, to the key value. In other words, the first preset value is the preset value.
[0081] 304. Classify each virtual USB camera corresponding to the key value having the first preset value as a first USB camera.
[0082] The UVC driver of the electronic device registers the virtual USB camera to the corresponding device category according to the content of the key value in the registry. For example, if the value of the key value is the first preset value, the virtual USB camera is registered as the first category. The USB camera of the first category is a sensor camera, also known as the first USB camera. The USB cameras of the first category include but are not limited to non-color cameras such as grayscale cameras, infrared cameras, depth cameras, etc. Non-color cameras belong to sensor cameras and can only be discovered and used by applications with target interface access capabilities.
[0083] For another example, if the value of the key value is not the first preset value but the second preset value, the virtual USB camera is registered as the second category, and the second category of USB cameras is a color camera, including but not limited to a red, green, blue (RGB) camera, a YUV camera, etc. The first preset value is, for example, 1, and the second preset value is, for example, 2.
[0084] By adopting this solution, the physical USB camera is pre-set so that the electronic device can identify which physical USB cameras and / or which virtual USB cameras are the first USB camera, and then automatically perform permission control on the first USB camera without entering the control panel or system to perform complicated settings. The permission control speed is fast and the accuracy is high.
[0085] Optionally, in the above embodiment, for at least one virtual USB camera that does not require permission management, a key value with a second preset value is generated in the registry of the electronic device, and each virtual USB camera corresponding to the key value with the second preset value is classified as a second USB camera.
[0086] After the physical USB camera is inserted into the USB interface of the electronic device, the electronic device can determine how many virtual USB cameras are virtualized based on the physical USB camera, which virtual USB cameras are cameras that need to be managed for permissions, and which virtual USB cameras do not need to be managed for permissions through the original descriptors and target descriptors of the physical USB camera. For virtual USB cameras that do not need to be managed for permissions, the electronic device generates a key value with a second preset value in the registry, and classifies each virtual USB camera corresponding to the key value with the second preset value as a second USB camera. In this way, general applications that do not have the ability to access the target interface can discover and use this type of second USB camera.
[0087] By adopting this solution, the electronic device will register a virtual USB camera that does not require permission management into the registration table of the electronic device so that it can be discovered and used by applications that do not have the ability to access the target interface, thereby ensuring the normal operation of the application and improving the reliability of the application.
[0088] In another way, the front-end configuration is to configure the electronic device.
[0089] In an embodiment of the present application, when configuring an electronic device, a custom file is created in advance, such as a custom information file (INF). A new target attribute is added to the custom file, and the target attribute is the sensor camera mode attribute, and the preset value is 1. When a physical USB camera is inserted into the USB interface of an electronic device, the custom file is loaded to make each virtual USB camera virtualized based on the physical USB camera become a virtual USB camera that needs to be managed for rights; for each virtual USB camera that needs to be managed for rights, a key value with a value of the first preset value is generated in the registry of the electronic device; each virtual USB camera corresponding to the key value with the value of the first preset value is classified as a first USB camera.
[0090] Exemplarily, the electronic device creates a custom file based on the UVC driver on the operating system, adds an AddReg target attribute, namely the sensor camera mode attribute, inside the custom file, and sets the value of the target attribute to a preset value, such as 1, etc., which is not limited by the embodiment of the present application. Subsequently, when a physical USB camera is inserted, for each virtual USB camera virtualized based on the physical USB camera, the electronic device loads a custom file for each virtual USB camera, thereby making each virtual USB camera virtualized based on the physical USB camera a virtual USB camera that requires permission management.
[0091] Afterwards, for each virtual USB camera that needs to be managed for rights, a key value with a first preset value is generated in the registration table of the electronic device, and each virtual USB camera corresponding to the key value with the first preset value is classified as a first USB camera head. For details, please refer to the description of the above steps 303 and 304, which will not be repeated here.
[0092] By adopting this solution, when there is no pre-setting for the physical USB camera but it is desired to manage the permissions of the physical USB camera or a virtual USB camera virtualized based on the physical USB camera, the pre-setting is performed on the electronic device side, which is simple and flexible.
[0093] Optionally, in the above embodiment, the custom file is also used to indicate a USB camera that needs to be managed for rights. When the physical USB camera is inserted into the USB interface of the electronic device and the electronic device loads the custom file, the electronic device determines whether the physical USB camera, or each virtual USB camera virtualized based on the physical USB camera, is a USB camera that needs to be managed for rights as indicated by the custom file. For example, the manufacturer ID (Manufacturer ID) of the virtual USB camera that needs to be managed for rights is indicated in the custom file, and the manufacturer ID is generated based on the vendor ID (VID) of the physical USB camera, the product ID (PID) and the interface ID (interface ID) of the virtual USB camera. The electronic device determines the manufacturer ID of each virtual USB camera. When the manufacturer ID is the manufacturer ID indicated by the custom file, the electronic device considers that the virtual USB camera is a USB camera that needs to be managed for rights. The electronic device loads the custom file for the virtual USB camera, so that each virtual USB camera virtualized based on the physical USB camera becomes a virtual USB camera that needs to be managed for rights.
[0094] Afterwards, for each virtual USB camera that needs to be managed for rights, a key value with a value of the first preset value is generated in the registration table of the electronic device. Each virtual USB camera corresponding to the key value with a value of the first preset value is classified as a first USB camera. For details, please refer to the description of the above steps 303 and 304, which will not be repeated here.
[0095] By adopting this solution, pre-settings are performed on the electronic device side and a specific USB camera is specified in a custom file to implement permission management for the specified USB camera. The method is simple and flexible.
[0096] Optionally, in the above embodiment, the first USB camera is at least used to provide a video stream for the application.
[0097] The Windows operating system of the electronic device supports two types of USB cameras. The first type is a sensor camera. In the embodiment of the present application, the first type of USB camera is referred to as a first USB camera. The first type of USB camera includes but is not limited to non-color cameras such as grayscale cameras, infrared cameras (IR cameras), and depth cameras. Non-color cameras belong to sensor cameras (sensor cameras) and can only be discovered and used by applications with target interface access capabilities.
[0098] The second category of USB cameras are color cameras, including but not limited to red, green, blue (RGB) cameras, YUV cameras, etc. In the embodiment of the present application, the second category of USB cameras are referred to as second USB cameras.
[0099] Although the first type of USB camera is a non-color camera and the first USB camera is declared as a sensor camera in the Windows operating system, the application can still obtain a video stream, such as an RGB video stream or a YUV video stream, through the first USB camera.
[0100] By adopting this solution, the first USB camera provides the application with an RGB video stream or a YUV video stream that can only be provided by a color camera, thereby facilitating reliable operation of the application.
[0101] Figure 4 This is another flow chart of the USB camera management method provided by the embodiment of the present application. This embodiment includes:
[0102] 401. Add a target descriptor for the physical USB camera and add target attributes to the target descriptor.
[0103] Exemplarily, the target descriptor is, for example, Microsoft OS2.0Descriptors. A physical USB camera has multiple virtual USB interfaces, and different USB interfaces correspond to different virtual USB cameras. For a virtual USB camera that needs to be managed for rights, a target attribute is added to the target descriptor, and the value of the target attribute is set to a preset value.
[0104] 402. The electronic device detects that a physical USB camera is inserted into a USB interface.
[0105] 403. The electronic device generates a key value in the registry.
[0106] The electronic device obtains and parses the target descriptor to obtain the target attribute of each virtual USB camera. Afterwards, for each virtual USB camera that requires permission management, a key value with a first preset value is generated in the electronic device's registry; for each virtual USB camera that does not require permission management, a key value with a second preset value is generated in the electronic device's registry. Among them, the virtual USB camera that requires permission management is the USB camera whose target attribute is the first preset value mentioned above. The virtual USB camera that does not require permission management is the USB camera whose target attribute is not the first preset value mentioned above
[0107] 404. The electronic device creates a custom file.
[0108] Exemplarily, the electronic device creates a custom file for predicting a UVC driver, adds a target attribute, namely, Sensor Camera Mode, to the custom file, and sets the value of the target attribute to a preset value.
[0109] At the same time, the manufacturer ID of the USB camera that needs to be managed for rights is indicated in the custom file. For the virtual USB camera, the manufacturer ID is generated according to the manufacturer ID, product ID and interface ID of the physical USB camera. Therefore, when multiple virtual USB cameras are virtualized based on a physical USB camera, even if the manufacturer IDs corresponding to the virtual USB cameras are the same and the product IDs are the same, since the interface IDs of the virtual USB cameras are different, the manufacturer IDs of the virtual USB cameras are different.
[0110] 405. The electronic device detects that a physical USB camera is inserted into the USB interface.
[0111] 406. The electronic device determines the USB camera that needs to be managed for permissions, and generates a key value in a registry.
[0112] Exemplarily, the electronic device determines whether the physical USB camera or the virtual USB camera is a USB camera that needs to be managed for rights according to the custom file. For the USB camera that needs to be managed for rights, the electronic device generates a key value with a first preset value in the registration table.
[0113] It should be noted that steps 401 to 403 are the above-mentioned pre-settings for configuring the physical USB camera, and steps 404 to 406 are the above-mentioned pre-settings for configuring the electronic device. Either one of the two can be performed. Then, step 407 is performed.
[0114] 407. The electronic device determines the value of the key in the registry. When the value of the key is a first preset value, step 408 is executed; when the value of the key is a second preset value, step 412 is executed.
[0115] For each USB camera, including a physical USB camera and a virtual USB camera, the electronic device determines the value of the key value corresponding to the USB camera. If the value of the key value is a first preset value, the USB camera is considered to be a USB camera that requires permission management; if the value of the key value is a second preset value, or there is no key value of the USB camera in the registry, the USB camera is considered to not require permission management.
[0116] 408. Classify each virtual USB camera corresponding to the key value having the first preset value as a first USB camera.
[0117] Exemplarily, the electronic device classifies each virtual USB camera corresponding to the key value whose value in the registration table is the first preset value as a first USB camera. This type of USB camera can only be discovered and used by an application program that has the ability to access the target interface.
[0118] 409. The electronic device receives a start instruction for starting a target function of an application program.
[0119] 410. The electronic device controls the application to access the target interface to identify a first USB camera.
[0120] The target interface is, for example, the MFEnumDeviceSources interface of Media Foundation. The electronic device determines a target path whose identifier is a preset identifier in the Windows operating system driver. For example, the preset identifier is KSCATEGORY_SENSOR_CAMERA, and the electronic device finds the first USB camera in the target path whose identifier of the device interface class is KSCATEGORY_SENSOR_CAMERA in the Windows operating system driver.
[0121] 411. The electronic device opens the permission for the application to use the first USB camera.
[0122] Optionally, when there are multiple first USB cameras, in one way, the application can use multiple first USB cameras. In another way, the electronic device determines the target field according to the application, and the target field is used to indicate the USB camera used by the application.
[0123] Afterwards, the electronic device determines a USB camera with a manufacturer identifier as a target field from the plurality of first USB cameras, and opens the first USB camera with the manufacturer identifier as a target field to the application program, wherein the manufacturer identifier is generated according to the manufacturer identifier VID, the product identifier PID of the physical USB camera, and the interface identifier of the virtual USB camera.
[0124] By adopting this solution, the first USB camera with the manufacturer identifier as the target field is opened to the application, thereby realizing the control of the USB camera permissions at the application level.
[0125] 412. Classify each virtual USB camera corresponding to the key value having the second preset value as a second USB camera.
[0126] Exemplarily, a virtual USB camera with a value of the second preset value, or a USB camera without a key value, is registered as a second USB camera. This type of USB camera can be discovered and used by an application that does not have the target interface access capability.
[0127] The following is a detailed description of the USB camera management method using a specific example.
[0128] In this embodiment, the physical USB camera is a three-way UVC USB composite device. After the physical USB camera is inserted into the USB interface of the electronic device, three virtual USB cameras are virtualized based on the physical USB device, namely virtual USB camera A, virtual USB camera B and virtual USB camera C. Among them, virtual USB camera A is the main camera, which is mainly used for picture preview, shooting, etc. Virtual USB camera B is an algorithm camera, which is only used for algorithm applications. For example, the application is a remote video application. During the remote video process, the electronic device uses the virtual USB camera to capture communication information, etc. Virtual USB camera C is a live broadcast camera, which is mainly provided to live broadcast applications for live broadcast or video recording.
[0129] The USB interfaces (usbinterface number) of virtual USB camera A, virtual USB camera B and virtual USB camera C are 0, 3 and 5 respectively, and the physical USB camera is pre-set in advance. During the pre-set process, a target descriptor is added to the physical USB camera, and a target descriptor is added to the target descriptor for each virtual USB camera. Among them, the value of the target attribute of virtual USB camera A is 2, which is not a preset value; the target attributes of virtual USB camera B and virtual USB camera C are 1, which are all preset values.
[0130] After the physical USB camera is inserted into the USB interface of the electronic device, the electronic device parses the target descriptor to determine that the virtual USB camera A is a USB camera that does not require permission management. For the virtual USB camera A, the electronic device generates a key value with a second preset value in the registry, thereby classifying the virtual USB camera A as a second USB camera, namely a color camera.
[0131] Virtual USB camera B and virtual USB camera C are USB cameras that need to be managed for permissions. For virtual USB camera B and virtual USB camera C, the electronic device generates a key value with a first preset value in the registration table, thereby classifying virtual USB camera B and virtual USB camera C as the first USB camera, i.e., a sensor camera.
[0132] When the electronic device receives a start-up instruction for starting the shooting function of a shooting application, since the application does not have the ability to access the target interface, the electronic device does not need to search for the first USB camera through the target interface, but instead uses the second USB camera, namely virtual USB camera A.
[0133] When the electronic device receives the start instruction of the capture function of the algorithm application, since the algorithm application has the ability to access the target interface, the electronic device finds the first USB camera, such as virtual USB camera B and virtual USB camera C, under the target path with the identifier KSCATEGORY_SENSOR_CAMERA in the windows driver through the target interface.
[0134] Optionally, the electronic device may also determine a target field based on the algorithm application, and the target field is used to indicate the USB camera used by the algorithm application. For example, if the target field is the manufacturer identification of the virtual USB camera B, the electronic device will determine the virtual USB camera B after finding the first USB camera, and open the use permission of the virtual USB camera to the algorithm application.
[0135] It should be noted that although the virtual USB camera B is declared as a sensor camera in Windows, the virtual USB camera B can still provide the algorithm application with video streams that can only be provided by color cameras, such as RGB video streams, YUV video streams, etc.
[0136] When the electronic device receives the start instruction of the live broadcast function or the recording function of the live broadcast application, since the live broadcast application has the ability to access the target interface, the electronic device finds the first USB camera, such as the virtual USB camera B and the virtual USB camera C, under the target path with the identifier KSCATEGORY_SENSOR_CAMERA in the windows driver through the target interface.
[0137] Optionally, the electronic device may also determine a target field based on the live broadcast application, and the target field is used to indicate the USB camera used by the live broadcast application. For example, if the target field is the manufacturer identifier of the virtual USB camera C, the electronic device will determine the virtual USB camera C after finding the first USB camera, and grant the live broadcast application the right to use the virtual USB camera.
[0138] It should be noted that, although the virtual USB camera C is declared as a sensor camera in Windows, the virtual USB camera C can still provide the algorithm application with video streams that can only be provided by color cameras, such as RGB video streams, YUV video streams, etc.
[0139] In the above embodiment, the shooting application, the algorithm application and the live broadcast application are applications that run at different times. However, the present application embodiment is not limited to this. In other feasible implementations, the above applications can run at the same time, and different applications call different virtual USB cameras.
[0140] In the video call scenario, the video call application can directly obtain the video stream from the virtual USB camera A for video calls. If the video call process needs to be analyzed and recorded simultaneously, the algorithm application calls the virtual USB camera B to obtain the video for algorithm analysis, and the live broadcast application calls the virtual USB camera C to obtain the video stream for video recording and live broadcast. Moreover, since the virtual USB camera B and the virtual USB camera C have added permission management, only applications with the ability to access the target interface can call them, while general applications that do not have the ability to access the target interface cannot call them, thereby avoiding the problem of the service being unable to start due to the USB camera being occupied.
[0141] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0142] Figure 5 A schematic diagram of a USB camera management device provided in an embodiment of the present application. The USB camera management device 500 includes: a receiving module 51 , a processing module 52 and a holding module 53 .
[0143] A receiving module 51 is used for starting a start instruction of a target function of an application program, where the target function is realized by calling a first USB camera;
[0144] The processing module 52 is used to determine the first USB camera through the target interface and grant the application a permission to use the first USB camera when the application has the ability to access the target interface;
[0145] A maintaining module 53, used for maintaining the target function in a closed state when the application does not have the ability to access the target interface;
[0146] Among them, the target interface is used to find a first USB camera, the first USB camera is a USB camera among USB cameras of an electronic device that requires permission management, and the first USB camera is a physical USB camera among at least one physical USB camera; or, the first USB camera is at least one of virtual USB cameras virtualized based on the physical USB camera.
[0147] In a feasible implementation, the processing module 52 is used to determine a target path whose identifier is a preset identifier from a driver of an electronic device operating system through the target interface when the application has the ability to access the target interface; and determine the first USB camera based on the target path.
[0148] In a feasible implementation, the processing module 52 is further used to determine the USB interface of the electronic device into which the physical USB camera is inserted before the receiving module 51 receives the start instruction of the target function of the start application; parse the target descriptor of the physical USB camera, the target descriptor is used to indicate the virtual USB camera that needs to be managed for permissions among at least one virtual USB camera virtualized based on the physical USB camera; for each virtual USB camera that needs to be managed for permissions, generate a key value with a first preset value in the registry of the electronic device; and classify each virtual USB camera corresponding to the key value with the first preset value as a first USB camera.
[0149] In a feasible implementation method, the processing module 52 is also used to generate a key value with a second preset value in the registry of the electronic device for at least one virtual USB camera that does not require permission management, and classify each virtual USB camera corresponding to the key value with the second preset value as a second USB camera.
[0150] In a feasible implementation method, the processing module 52 is also used to load a custom file when a physical USB camera is inserted into the USB interface of an electronic device before the receiving module 51 receives a start instruction for the target function of starting the application. The custom file is used to indicate a USB camera that needs to be managed for permissions; when there are virtual USB cameras that need to be managed for permissions among the virtual USB cameras virtualized based on the physical USB camera, a key value with a value of a first preset value is generated in the registry of the electronic device for each virtual USB camera that needs to be managed for permissions; and each virtual USB camera corresponding to a key value with a value of the first preset value is classified as a first USB camera.
[0151] In a feasible implementation, the first USB camera is at least used to provide a video stream for the application.
[0152] In a feasible implementation, the processing module 52 is used to determine the target field according to the application when there are multiple first USB cameras, and the target field is used to indicate the USB camera used by the application; determine the USB camera with the manufacturer identifier as the target field from the multiple first USB cameras, and the manufacturer identifier is generated according to the manufacturer identifier VID, product identifier PID and interface identifier of the virtual USB camera of the physical USB camera; open the first USB camera with the manufacturer identifier as the target field to the application.
[0153] The USB camera management device provided in the embodiment of the present application can execute the actions of the electronic device in the above-mentioned embodiment. Its implementation principle and technical effect are similar and will not be repeated here.
[0154] Figure 6 This is a schematic diagram of the structure of the electronic device provided in the embodiment of the present application. Figure 6 The electronic device 600 of the embodiment of the present application includes: at least one processor 61, at least one communication bus 62, a user interface 63, at least one network interface 64, a memory 65 and at least one physical USB camera 66, and the physical USB camera 66 is inserted into the USB interface of the electronic device. Based on the physical USB camera 66, at least one virtual USB camera can be virtualized.
[0155] The communication bus 62 is used to realize the connection and communication between these components.
[0156] The user interface 63 may include a display screen (Display), and the optional user interface 63 may also include a standard wired interface and a wireless interface.
[0157] The network interface 64 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0158] Among them, the processor 61 may include one or more processing cores. The processor 61 uses various interfaces and lines to connect various parts of the entire electronic device 60, and executes various functions and processes data of the electronic device 60 by running or executing instructions, programs, code sets or instruction sets stored in the memory 65, and calling data stored in the memory 65. Optionally, the processor 61 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 61 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 61, and it can be implemented separately through a chip.
[0159] Among them, the memory 65 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 65 includes a non-transitory computer-readable storage medium. The memory 65 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 65 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned method embodiments, etc.; the data storage area may store data involved in the above-mentioned method embodiments, etc. The memory 65 may also be optionally at least one storage device located away from the aforementioned processor 61. As Figure 6 As shown, the memory 65 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an operating application of the electronic device.
[0160] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0161] The present application is described with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, and the combination of the process and / or box in the flowchart and / or block diagram can be realized by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for realizing the function specified in one process or multiple processes in the flowchart and / or one box or multiple boxes in the block diagram.
[0162] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0163] These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0164] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0165] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0166] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0167] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0168] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A method for managing a USB camera, characterized in that: Applied to an electronic device configured with a Windows operating system, the electronic device is connected to at least one physical USB camera, and the method comprises: Receiving a start instruction for starting a target function of an application program, wherein the target function is implemented by calling a first USB camera; When the application has the ability to access the target interface, determining the first USB camera through the target interface, and opening the use permission of the first USB camera to the application; When the application does not have the ability to access the target interface, keeping the target function in a closed state; The target interface is used to search for the first USB camera, the first USB camera is a USB camera among the USB cameras of the electronic device that requires permission management, and the first USB camera is a physical USB camera among the at least one physical USB camera; or, the first USB camera is a virtual USB camera virtualized based on the physical USB camera.
2. The method according to claim 1, characterized in that When the application has the ability to access the target interface, determining the first USB camera through the target interface includes: When the application has the ability to access the target interface, determining a target path whose identifier is a preset identifier from a driver of the electronic device operating system through the target interface; The first USB camera is determined according to the target path.
3. The method according to claim 1, characterized in that Before receiving the start instruction of the target function of the start application program, the method further includes: Determine that the physical USB camera is inserted into a USB interface of the electronic device; Parsing a target descriptor of the physical USB camera, where the target descriptor is used to indicate a virtual USB camera that needs to be managed for rights among at least one virtual USB camera virtualized based on the physical USB camera; For each virtual USB camera that needs to be managed for rights, generating a key value with a first preset value in a registration table of the electronic device; Each virtual USB camera corresponding to the key value having the first preset value is classified as the first USB camera.
4. The method according to claim 3, characterized in that Also includes: For the virtual USB camera that does not need permission management among the at least one virtual USB camera, a key value with a second preset value is generated in the registration table of the electronic device, and each virtual USB camera corresponding to the key value with the second preset value is classified as a second USB camera.
5. The method according to claim 1, characterized in that: Before receiving the start instruction of the target function of the start application program, the method further includes: When the physical USB camera is inserted into the USB interface of the electronic device, a custom file is loaded, wherein the custom file is used to indicate the USB camera that needs to be managed for rights; When there is a virtual USB camera requiring permission management among the virtual USB cameras virtualized based on the physical USB camera, a key value having a value of a first preset value is generated in a registration table of the electronic device for each virtual USB camera requiring permission management; Each virtual USB camera corresponding to the key value having the first preset value is classified as the first USB camera.
6. The method according to any one of claims 1 to 5, characterized in that: The first USB camera is at least used to provide a video stream for the application.
7. The method according to any one of claims 1 to 5, characterized in that: The step of opening the permission for the application to use the first USB camera includes: When there are multiple first USB cameras, determining a target field according to the application, wherein the target field is used to indicate the USB camera used by the application; Determine, from a plurality of first USB cameras, a USB camera whose manufacturer identifier is the target field, wherein the manufacturer identifier is generated according to a manufacturer identifier VID, a product identifier PID of the physical USB camera, and an interface identifier of the virtual USB camera; The application opens the first USB camera identified by the manufacturer as the target field.
8. A management device for a USB camera, characterized in that: The device is arranged on an electronic device configured with a Windows operating system, the electronic device is connected to at least one physical USB camera, and the device comprises: A receiving module is used to start a start instruction of a target function of the application program; the target function is realized by calling the first USB camera; a processing module, configured to, when the application has the ability to access the target interface, determine the first USB camera through the target interface, and grant the application the permission to use the first USB camera; A maintaining module, used for maintaining the target function in a closed state when the application does not have the ability to access the target interface; The target interface is used to search for the first USB camera, the first USB camera is a USB camera among the USB cameras of the electronic device that requires permission management, and the first USB camera is a physical USB camera among the at least one physical USB camera; or, the first USB camera is at least one of the virtual USB cameras virtualized based on the physical USB camera.
9. An electronic device comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the electronic device implements the method according to any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.