WO2019119831A1 - Method and apparatus for accessing camera, server, and readable storage medium - Google Patents

Method and apparatus for accessing camera, server, and readable storage medium Download PDF

Info

Publication number
WO2019119831A1
WO2019119831A1 PCT/CN2018/100543 CN2018100543W WO2019119831A1 WO 2019119831 A1 WO2019119831 A1 WO 2019119831A1 CN 2018100543 W CN2018100543 W CN 2018100543W WO 2019119831 A1 WO2019119831 A1 WO 2019119831A1
Authority
WO
WIPO (PCT)
Prior art keywords
camera
terminal device
access request
client
server
Prior art date
Application number
PCT/CN2018/100543
Other languages
French (fr)
Chinese (zh)
Inventor
段庆领
李军杰
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2019119831A1 publication Critical patent/WO2019119831A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing

Definitions

  • the present application relates to the field of computing, and in particular, to a method and apparatus for accessing a camera, a server, and a readable storage medium.
  • Desktop virtualization technology virtualizes the desktop provided by the server, such as running a virtual machine (VM) or container that provides a virtual desktop on the server.
  • the user can remotely access the virtual desktop provided by the server through the client on the terminal device, and the client can also redirect the operation of the user on the terminal device to the operation of the virtual desktop.
  • VM virtual machine
  • the mouse or keyboard on the terminal device can be redirected for virtual desktop access.
  • Open source community targeting The virtual machine of the operating system provides a virtual camera file "V4L2loopback"; the file can be deployed in the kernel of the virtual machine, so that the virtual machine can provide the V4L2 interface in the kernel state; the application on the virtual desktop can access the V4L2
  • the interface redirects access to the camera of the terminal device, for example to obtain image data from the camera.
  • the present application provides a method and apparatus for accessing a camera, a server, and a readable storage medium, which facilitate a virtual machine of an Android operating system to access a camera of the terminal device.
  • the present application provides a method of accessing a camera.
  • the server deploys a virtual machine of the Android operating system, where the Android operating system provides a server of the virtual desktop, and a virtual camera is deployed at the hardware abstraction layer of the server, and the virtual camera is used to redirect the access request to the access terminal device. Camera access request.
  • the virtual camera detects an access request by the application to access the virtual camera, and redirects the access request to an access request of a camera accessing the terminal device. Then, the virtual camera sends the redirected access request to the client of the terminal device. In this way, the client can access the camera of the terminal device according to the access request obtained by the redirect.
  • All steps in the method do not require the kernel layer of the server to participate, thus avoiding the occupation of kernel resources and eliminating the time taken to access the camera of the terminal device by driving interaction with the camera of the kernel.
  • the virtual camera receives the parameters of the camera of the terminal device sent by the client, and the parameters of the camera of the terminal device include the The image format, resolution, and frame rate supported by the camera of the terminal device.
  • the virtual camera configures the virtual camera using parameters of a camera of the terminal device.
  • the virtual camera is configured according to the parameters of the camera of the terminal device, and is convenient for redirecting the access request for accessing the virtual camera to the access request of the camera accessing the terminal device.
  • the virtual camera receives image data acquired by the client from the camera according to the redirected access request; the virtual camera The image data is sent to the application.
  • the application can acquire image data from the camera of the terminal device by accessing the request.
  • the virtual camera establishes a communication connection between the virtual camera and the client.
  • the virtual camera and the client can transmit data through the communication connection.
  • the present application provides an apparatus for accessing a camera, the apparatus comprising functional units implementing the method of accessing a camera provided by the first aspect or various possible designs of the first aspect.
  • the application provides a server, where the server includes a processor and a memory;
  • the processor executes instructions stored in the memory such that the server performs the method of accessing a camera provided by the first aspect or various possible designs of the first aspect.
  • the application provides a computer readable storage medium. Instructions are stored in the computer readable storage medium.
  • the server executes instructions in the computer readable storage medium such that the server performs the method of accessing the camera provided by the first aspect or various possible designs of the first aspect.
  • the application provides a computer program product comprising instructions stored in a computer readable storage medium.
  • the server executes instructions in the computer program product such that the server performs the method of accessing the camera provided by the first aspect or various possible designs of the first aspect.
  • FIG. 1 is a schematic diagram of an application scenario including a server and a terminal device;
  • FIG. 2 is a schematic diagram of a hardware architecture of a server
  • FIG. 3 is a schematic diagram of a logical architecture of a server and a client
  • FIG. 4 is a schematic flowchart of accessing a camera according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of an apparatus for community discovery according to an embodiment of the present invention.
  • the server 101 is communicatively coupled to the terminal device 102.
  • the terminal device 102 can be a thin client (TC), a mobile terminal, a tablet or other device.
  • the server 101 deploys a virtual machine (VM) of an Android (Android) operating system.
  • the VM provides a virtual desktop to the terminal device 102.
  • the terminal device 102 deploys a client of the virtual desktop through which the virtual desktop provided by the VM to the terminal device 102 is accessed.
  • the server 101 is a server that provides virtual desktops in the cloud, and FIG. 1 only schematically shows one server 101 in the cloud.
  • the cloud can also include multiple servers or even a large number of servers.
  • Servers in the cloud are virtualized by cloud computing, providing virtualized computing resources, storage resources, input/output (I/O) resources, and more.
  • a server in the cloud that can deploy a VM running an application and a VM that provides a virtual desktop.
  • the VM that runs the running application and the VM that provides the virtual desktop can be located on the same server 101; or the VM that provides the virtual desktop is located at the server 101, and the VM that runs the application is located at the other server.
  • the virtual desktop provides the application to the client, and the application accesses the camera of the terminal device through the virtual desktop.
  • FIG. 2 schematically provides one possible basic hardware architecture of server 101.
  • the server 200 includes at least one processor 201, a memory 202, a communication interface 203, and a bus 204.
  • Each processor 201 in the server 200 may be any one of the following: a central processing unit (CPU), an ARM processor, a Field Programmable Gate Array (FPGA), a dedicated processor. Such devices with computational processing capabilities.
  • CPU central processing unit
  • ARM ARM processor
  • FPGA Field Programmable Gate Array
  • the number of processors 201 in the server 200 is plural; the plurality of processors 201 may be different types of processors 201, or may be the same type of processor 201. In an optional implementation manner, the plurality of processors 201 may also be integrated into a many-core processor.
  • Memory 202 stores computer instructions and data; for example, memory 202 stores computer instructions and data associated with an operating system (OS).
  • the memory 202 may be any one or any combination of the following: a read only memory (ROM), a non-volatile memory (NVM), a solid state drive (SSD), Storage media such as mechanical hard disks, disks, and disk arrays.
  • ROM read only memory
  • NVM non-volatile memory
  • SSD solid state drive
  • Storage media such as mechanical hard disks, disks, and disk arrays.
  • the communication interface 203 may be any one or any combination of the following: a network interface (such as an Ethernet interface), a wireless network card, or the like having a network access function.
  • the communication interface 203 is used by the server 200 to perform data interaction with other devices (e.g., terminal devices).
  • the bus 204 includes a memory bus, and may also include any one or any combination of the following: an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, and an extended industry.
  • ISA Industry Standard Architecture
  • PCI Peripheral Component Interconnect
  • EISA Extended Industry Standard Architecture
  • Figure 2 shows the bus 204 with a thick line.
  • processor 201 the memory 202, and the communication interface 203 are connected by a bus 204.
  • processor 201 can access memory 202 via bus 204 and interact with other devices (e.g., terminal devices) via communication interface 203 via bus 204.
  • the server 200 executes the instructions in the memory 202, so that the server 200 implements the method for accessing the camera provided by the method embodiment.
  • the VM running on the server 101 deploys an Android (Android) operating system.
  • the VM provides a virtual desktop for the Android operating system.
  • the Android operating system deploys a server of a virtual desktop, and the server includes a kernel layer, a hardware abstraction layer (HAL), and a framework layer.
  • the server can also include an application layer.
  • the kernel layer provides a camera driver that the application can call to access the local camera or the camera of the terminal device.
  • accessing the camera of the terminal device through the driver of the kernel layer requires interaction with the kernel, which occupies kernel resources, and the interaction time brings delay in accessing the camera. Therefore, the embodiment of the present invention provides a virtual camera in a hardware abstraction layer (HAL), which replaces the driver of the kernel layer to implement access to the camera of the terminal device, thereby avoiding occupation of kernel resources, and eliminating the need for The time taken by the driver's interaction of the kernel's camera.
  • HAL hardware abstraction layer
  • the hardware abstraction layer provides a virtual camera.
  • the virtual camera is used to redirect an application's access request to an access request to access the camera of the terminal device.
  • the virtual camera includes a communication module and a management module.
  • the communication module (ie, the communication module of the server) is configured to establish a communication connection with the client, and specifically may establish a communication connection with the communication module of the client. Subsequently, the communication module can interact with the communication module of the client, such as a communication module such as a client to send an access request.
  • the management module (the management module of the server) is used to manage the virtual camera.
  • the management module authenticates the client and authenticates, and then allows a communication connection with the communication module of the client.
  • the way to authenticate can be the way to use tokens for authentication.
  • the camera layer provides a camera service module.
  • the application needs to access the virtual camera, it first establishes communication with the camera service module, and then opens the virtual camera through the camera service module, thereby implementing the application's access to the virtual camera.
  • the application layer can deploy applications.
  • the application can also be deployed in other VMs or containers or physical servers or other environments where applications can be deployed.
  • the application here can access the virtual camera through the camera service module.
  • the terminal device deploys a client of the virtual desktop.
  • the client includes a communication module, a management module, a detection module, and a message processing module.
  • the communication module of the client is used to request to establish a communication connection with the communication module of the server. Thereby, the communication connection between the client and the server is realized.
  • the management module of the client is used to manage the camera of the terminal device.
  • the management module can acquire the parameters of the camera, and can send the parameters of the camera to the server through the communication module of the client.
  • the management module can control the camera, for example, can control the opening or closing of the camera.
  • the detection module of the client is used to identify the plugging and unplugging state of the camera, specifically whether the camera is normally inserted or unplugged.
  • the communication module When detecting that the camera is normally inserted, the communication module notifies the server to load the virtual camera mapped by the camera on the server; when detecting that the camera is unplugged, the communication module notifies the server to uninstall the camera at the server. Map the virtual camera.
  • the message processing module of the client is configured to identify the request of the server, and instruct the management module of the client to perform a corresponding response operation according to the request of the server. For example, according to the access request of the server, the management module of the client is instructed to acquire image data from the camera; and the image data is fed back to the server through the communication module.
  • a method for accessing a camera provided by an embodiment of the present invention includes step S401, step S402, step S403, step S404, step S405, step S406, step S407, and step S408.
  • a virtual machine camera is deployed in the hardware abstraction layer of the server.
  • step S401 the virtual camera establishes a communication connection with the client.
  • the communication module of the client requests to establish a communication connection with the communication module in the virtual camera, and if the virtual camera authenticates the client, the communication module of the client continues to communicate with the communication module in the virtual camera. The establishment of the connection.
  • the communication connection is for transmitting data between the virtual camera and the client.
  • step S401 may be omitted. That is, step S401 is an optional step in the method of accessing the camera.
  • Step S402 the client sends the parameters of the camera of the terminal device to the virtual camera.
  • the camera of the terminal device may be a camera deployed on the terminal device, or may be a camera connected to the terminal device, and the camera may be accessed by the terminal device.
  • the parameters of the camera include an image format, resolution, and frame rate supported by the camera.
  • the virtual camera receives the parameters of the camera of the terminal device sent by the client, and stores the parameters of the camera of the terminal device.
  • the management module of the client acquires the parameters of the camera of the terminal device, and the client sends the parameter to the communication module in the virtual camera through its communication module.
  • the communication module in the virtual camera receives the parameter, and the management module in the virtual camera stores the parameter.
  • step S403 the virtual camera self-configures using the parameters of the camera of the terminal device.
  • the management module in the virtual camera completes parameter configuration of the virtual camera according to parameters of the camera of the terminal device.
  • step S402 and step S403 may be omitted. That is, step S402 and step S403 are optional steps in the method of accessing the camera.
  • Step S404 the virtual camera detects an access request of the application to access the virtual camera.
  • Applications can run on servers or other servers that provide virtual desktops. Specifically, the application can run on the operating system of the server, can also run in the VM or container deployed by the server, and can also run in other environments in the server, where the scenario for running the application is not performed. limited.
  • the app can access the virtual camera in the HAL. Specifically, the application sends an access request to the virtual camera by providing a camera service module provided by the server of the virtual desktop. Thus, the virtual camera can detect an access request for the application.
  • the virtual camera before the application accesses the virtual camera, the virtual camera provides the virtual camera with parameters of the virtual camera (ie, parameters of the camera of the terminal device), and the application can access the data according to the parameter. Go to the virtual camera.
  • parameters of the virtual camera ie, parameters of the camera of the terminal device
  • step S405 the virtual camera redirects access to the virtual camera access request.
  • the management module in the virtual camera redirects the access request to access the virtual camera to an access request of the camera accessing the terminal device.
  • the technology for redirecting the access request of the virtual camera may be similarly referred to the prior art technology for redirecting access requests of other devices, for example, referring to the access request of the mouse or keyboard of the redirected access terminal device.
  • Related technology may be similarly referred to the prior art technology for redirecting access requests of other devices, for example, referring to the access request of the mouse or keyboard of the redirected access terminal device.
  • Step S406 the virtual camera sends the access request obtained by the redirect to the client.
  • the communication module in the virtual camera transmits the access request to the communication module of the client through a communication connection between the client and the virtual camera.
  • the client receives the access request through its communication module.
  • step S407 the client acquires image data from the camera of the terminal device.
  • the message processing module in the client recognizes the access request. Since the access request indicates that the image data of the camera is acquired, the message processing module instructs the management module to acquire image data from the camera of the terminal.
  • the client sends the image data to the virtual camera.
  • the client transmits the image data to the communication module of the virtual camera through its communication module.
  • the virtual camera can feed the image data back to the application through the camera service module.
  • the application can acquire image data from the camera of the terminal device by the access request.
  • step S407 and step S408 may be omitted. That is, step S407 and step S408 are optional steps in the method of accessing the camera.
  • the client will feed back the updated parameters to the virtual camera.
  • the virtual camera updates the configuration of the virtual camera based on the parameter.
  • An embodiment of the present invention provides a device for accessing a camera.
  • the device 500 includes functional units for implementing the steps included in the method for accessing a camera provided by the method embodiment.
  • the embodiment of the present invention is in the device 500. How to divide functional units is not limited, and the following is exemplarily provided for division of functional units, as shown in FIG.
  • the apparatus 500 for accessing a camera is deployed on a server end of the Android operating system to provide a virtual desktop, and the hardware abstraction layer of the server is used to redirect the access request to the camera of the access terminal device.
  • Access request; the apparatus 500 includes:
  • the management module 501 is configured to detect an access request of the application to access the virtual camera, and redirect the access request to an access request of a camera accessing the terminal device;
  • the communication module 502 is configured to send the redirected access request to the client of the terminal device, where the client is configured to access the camera of the terminal device according to the access request obtained by the redirecting.
  • the communication module 502 is configured to receive a parameter of a camera of the terminal device that is sent by the client, where a parameter of the camera of the terminal device includes an image format and a resolution supported by a camera of the terminal device. And frame rate;
  • the management module 501 is configured to configure the virtual camera by using parameters of a camera of the terminal device.
  • the communication module 502 is configured to:
  • the image data is sent to the application.
  • the communication module 502 is configured to establish a communication connection between the virtual camera and the client, where the communication connection is used to transfer data between the virtual camera and the client.
  • each functional unit included in the device 500 refers to the foregoing embodiments (for example, the application scenario embodiment, the redirection embodiment, and the method embodiment), and the related steps included in the method for accessing the camera. .
  • the device 500 for accessing the camera may be a virtual camera as described in the embodiment of the present invention.
  • the virtual camera is deployed in the hardware abstraction layer described in the embodiment of the present invention.
  • an embodiment of the present invention provides a server 200.
  • the server includes a processor 201 and a memory 202.
  • the processor 201 executes instructions stored in the memory 202, so that the server 200 executes the method for accessing the camera provided by the method embodiment.
  • An embodiment of the present invention provides a readable storage medium (such as the memory 202 in FIG. 2), where the readable storage medium stores instructions, and the server executes the instructions, so that the server executes the access camera provided by the method embodiment. Methods.
  • Embodiments of the present invention provide a computer program product comprising instructions stored in a computer readable storage medium.
  • the server executes instructions in the computer program product such that the server performs the method of accessing the camera provided by the method embodiment.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

A method and apparatus for accessing a camera, a server (101, 200), and a readable storage medium. A virtual machine with an Android operating system is deployed on the server (101, 200); the Android operating system provides a service terminal with a virtual desktop; a virtual camera is deployed at a hardware abstraction layer of the service terminal; the virtual camera is used for redirecting an access request as an access request of accessing a camera of a terminal device. The method for accessing a camera comprises detecting an access request of an application for accessing the virtual camera, redirecting the access request as the access request of accessing the camera of the terminal device, and then sending the redirected access request to a client of the terminal device. In this way, the client can access the camera of the terminal device according to the redirected access request. According to the method, a kernel layer of the service terminal does not need to participate, thereby saving the time taken, in the prior art, by accessing the camera of the terminal device by means of driving interaction with a kernel camera.

Description

访问摄像头的方法和装置、服务器、可读存储介质Method and device for accessing camera, server, readable storage medium 技术领域Technical field
本申请涉及计算领域,尤其涉及一种访问摄像头的方法和装置、服务器、可读存储介质。The present application relates to the field of computing, and in particular, to a method and apparatus for accessing a camera, a server, and a readable storage medium.
背景技术Background technique
桌面虚拟化(desktop virtualization,DV)技术将服务器提供的桌面进行虚拟化,例如在服务器上运行提供虚拟桌面的虚拟机(virtual machine,VM)或者容器(container)。用户可以通过终端设备上的客户端远程访问服务器提供的虚拟桌面,通过该客户端还可以将用户在终端设备上的操作重定向为对虚拟桌面的操作。Desktop virtualization (DV) technology virtualizes the desktop provided by the server, such as running a virtual machine (VM) or container that provides a virtual desktop on the server. The user can remotely access the virtual desktop provided by the server through the client on the terminal device, and the client can also redirect the operation of the user on the terminal device to the operation of the virtual desktop.
终端设备上的鼠标或者键盘可以重定向供虚拟桌面访问。开源社区针对
Figure PCTCN2018100543-appb-000001
操作系统的虚拟机,提供了一个虚拟摄像头的文件“V4L2loopback”;该文件可以部署在虚拟机的内核中,这样虚拟机可以在内核态提供V4L2的接口;虚拟桌面上的应用程序可以访问该V4L2的接口,重定向访问到终端设备的摄像头,例如从该摄像头获取图像数据。
The mouse or keyboard on the terminal device can be redirected for virtual desktop access. Open source community targeting
Figure PCTCN2018100543-appb-000001
The virtual machine of the operating system provides a virtual camera file "V4L2loopback"; the file can be deployed in the kernel of the virtual machine, so that the virtual machine can provide the V4L2 interface in the kernel state; the application on the virtual desktop can access the V4L2 The interface redirects access to the camera of the terminal device, for example to obtain image data from the camera.
发明内容Summary of the invention
有鉴于此,本申请提供了一种访问摄像头的方法和装置、服务器、可读存储介质,便于安卓(Android)操作系统的虚拟机访问终端设备的摄像头。In view of this, the present application provides a method and apparatus for accessing a camera, a server, and a readable storage medium, which facilitate a virtual machine of an Android operating system to access a camera of the terminal device.
第一方面,本申请提供一种访问摄像头的方法。服务器部署安卓操作系统的虚拟机,该安卓操作系统提供虚拟桌面的服务端,在所述服务端的硬件抽象层部署虚拟的摄像头,所述虚拟的摄像头用于将访问请求重定向为访问终端设备的摄像头的访问请求。In a first aspect, the present application provides a method of accessing a camera. The server deploys a virtual machine of the Android operating system, where the Android operating system provides a server of the virtual desktop, and a virtual camera is deployed at the hardware abstraction layer of the server, and the virtual camera is used to redirect the access request to the access terminal device. Camera access request.
在该方法中,所述虚拟的摄像头检测应用程序访问所述虚拟的摄像头的访问请求,将所述访问请求重定向为访问终端设备的摄像头的访问请求。然后,所述虚拟的摄像头将重定向所得的访问请求发送至所述终端设备的客户端。这样,所述客户端可以根据所述重定向所得的访问请求访问所述终端设备的摄像头。In the method, the virtual camera detects an access request by the application to access the virtual camera, and redirects the access request to an access request of a camera accessing the terminal device. Then, the virtual camera sends the redirected access request to the client of the terminal device. In this way, the client can access the camera of the terminal device according to the access request obtained by the redirect.
该方法中的所有步骤都不需要服务端的内核层参与,因此避免对内核资源的占用,并且省去了通过与内核的摄像头的驱动交互来访问终端设备的摄像头所占用的时间。All steps in the method do not require the kernel layer of the server to participate, thus avoiding the occupation of kernel resources and eliminating the time taken to access the camera of the terminal device by driving interaction with the camera of the kernel.
结合第一方面或者第一方面的任意一种可能设计,在本可能设计,虚拟的摄像头接收所述客户端发送的所述终端设备的摄像头的参数,所述终端设备的摄像头的参数包括所述终端设备的摄像头支持的图像格式、分辨率和帧率。该虚拟的摄像头使用所述终端设备的摄像头的参数配置所述虚拟的摄像头。With reference to the first aspect or any of the possible designs of the first aspect, in a possible design, the virtual camera receives the parameters of the camera of the terminal device sent by the client, and the parameters of the camera of the terminal device include the The image format, resolution, and frame rate supported by the camera of the terminal device. The virtual camera configures the virtual camera using parameters of a camera of the terminal device.
这样,虚拟的摄像头按照所述终端设备的摄像头的参数配置,便于将访问虚拟的摄像头的访问请求重定向为访问终端设备的摄像头的访问请求。In this way, the virtual camera is configured according to the parameters of the camera of the terminal device, and is convenient for redirecting the access request for accessing the virtual camera to the access request of the camera accessing the terminal device.
结合第一方面或者第一方面的任意一种可能设计,在本可能设计,虚拟的摄像头接收所述客户端根据所述重定向所得的访问请求从所述摄像头获取的图像数据;该虚拟的摄像头向所述应用程序发送所述图像数据。In combination with the first aspect or any of the possible designs of the first aspect, in a possible design, the virtual camera receives image data acquired by the client from the camera according to the redirected access request; the virtual camera The image data is sent to the application.
这样,应用程序可以通过访问请求实现从终端设备的摄像头获取图像数据。In this way, the application can acquire image data from the camera of the terminal device by accessing the request.
结合第一方面或者第一方面的任意一种可能设计,在本可能设计,所述虚拟的摄像头建立所述虚拟的摄像头与所述客户端的通信连接。In combination with the first aspect or any of the possible designs of the first aspect, in the present possible design, the virtual camera establishes a communication connection between the virtual camera and the client.
后续,所述虚拟的摄像头与所述客户端,可以通过所述通信连接传输数据。Subsequently, the virtual camera and the client can transmit data through the communication connection.
第二方面,本申请提供一种访问摄像头的装置,该装置包括实现第一方面或者第一方面的各种可能设计提供的访问摄像头的方法的各功能单元。In a second aspect, the present application provides an apparatus for accessing a camera, the apparatus comprising functional units implementing the method of accessing a camera provided by the first aspect or various possible designs of the first aspect.
第三方面,本申请提供一种服务器,所述服务器包括处理器和存储器;In a third aspect, the application provides a server, where the server includes a processor and a memory;
所述处理器执行所述存储器中存储的指令,使得所述服务器执行第一方面或者第一方面的各种可能设计提供的访问摄像头的方法。The processor executes instructions stored in the memory such that the server performs the method of accessing a camera provided by the first aspect or various possible designs of the first aspect.
第四方面,本申请提供一种计算机可读存储介质。计算机可读存储介质中存储有指令。服务器执行所述计算机可读存储介质中的指令,使得所述服务器执行第一方面或者第一方面的各种可能设计提供的访问摄像头的方法。In a fourth aspect, the application provides a computer readable storage medium. Instructions are stored in the computer readable storage medium. The server executes instructions in the computer readable storage medium such that the server performs the method of accessing the camera provided by the first aspect or various possible designs of the first aspect.
第五方面,本申请提供一种计算机程序产品,该计算机程序产品包括指令,该指令存储在计算机可读存储介质中。服务器执行该计算机程序产品中的指令,使得所述服务器执行第一方面或者第一方面的各种可能设计提供的访问摄像头的方法。In a fifth aspect, the application provides a computer program product comprising instructions stored in a computer readable storage medium. The server executes instructions in the computer program product such that the server performs the method of accessing the camera provided by the first aspect or various possible designs of the first aspect.
附图说明DRAWINGS
图1为包括服务器和终端设备的一种应用场景示意图;FIG. 1 is a schematic diagram of an application scenario including a server and a terminal device;
图2为服务器的一种硬件架构示意图;2 is a schematic diagram of a hardware architecture of a server;
图3为服务端和客户端的一种逻辑架构示意图;3 is a schematic diagram of a logical architecture of a server and a client;
图4本发明实施例提供的访问摄像头的一种流程示意图;4 is a schematic flowchart of accessing a camera according to an embodiment of the present invention;
图5为本发明实施例提供的社团发现的装置的一种结构示意图。FIG. 5 is a schematic structural diagram of an apparatus for community discovery according to an embodiment of the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例提供的技术方案进行描述。The technical solutions provided by the embodiments of the present invention are described below in conjunction with the accompanying drawings in the embodiments of the present invention.
应用场景实施例Application scenario
参见图1,服务器101与终端设备102通信连接。终端设备102可以是瘦终端(thin client,TC)、移动终端、平板电脑或者其它设备。Referring to FIG. 1, the server 101 is communicatively coupled to the terminal device 102. The terminal device 102 can be a thin client (TC), a mobile terminal, a tablet or other device.
服务器101部署安卓(Android)操作系统的虚拟机(virtual machine,VM)。该VM向终端设备102提供虚拟桌面。终端设备102部署虚拟桌面的客户端,通过该客户端访问该VM向终端设备102提供的虚拟桌面。The server 101 deploys a virtual machine (VM) of an Android (Android) operating system. The VM provides a virtual desktop to the terminal device 102. The terminal device 102 deploys a client of the virtual desktop through which the virtual desktop provided by the VM to the terminal device 102 is accessed.
可选地,服务器101为云中提供虚拟桌面的服务器,图1仅示意地表示了云中的一个服务器101。Optionally, the server 101 is a server that provides virtual desktops in the cloud, and FIG. 1 only schematically shows one server 101 in the cloud.
可以理解,云还可以包括多个服务器,甚至大量服务器。云中的服务器被云计算虚拟化,提供虚拟化的计算资源、存储资源、输入/输出(Input/Output,I/O)资源等等。It can be understood that the cloud can also include multiple servers or even a large number of servers. Servers in the cloud are virtualized by cloud computing, providing virtualized computing resources, storage resources, input/output (I/O) resources, and more.
云中的服务器,可以部署运行应用程序的VM,还可以部署提供虚拟桌面的VM。可以理解,部署运行应用程序的VM与部署提供虚拟桌面的VM,可以是位于同一服务器101上;或者,提供虚拟桌面的VM位于服务器101,而运行应用程序的VM位于另一服务器。该虚拟桌面向客户端提供该应用程序,该应用程序通过该虚拟桌面访问终端设备的摄像 头。A server in the cloud that can deploy a VM running an application and a VM that provides a virtual desktop. It can be understood that the VM that runs the running application and the VM that provides the virtual desktop can be located on the same server 101; or the VM that provides the virtual desktop is located at the server 101, and the VM that runs the application is located at the other server. The virtual desktop provides the application to the client, and the application accesses the camera of the terminal device through the virtual desktop.
图2示意性地提供了服务器101的一种可能的基本硬件架构。FIG. 2 schematically provides one possible basic hardware architecture of server 101.
参见图2,服务器200包括至少一个处理器201、存储器202、通信接口203和总线204。Referring to FIG. 2, the server 200 includes at least one processor 201, a memory 202, a communication interface 203, and a bus 204.
服务器200中的每个处理器201,可以是以下的任一种:中央处理器(Central Processing Unit,CPU)、ARM处理器、现场可编程门阵列(Field Programmable Gate Array,FPGA)、专用处理器等具有计算处理能力的器件。Each processor 201 in the server 200 may be any one of the following: a central processing unit (CPU), an ARM processor, a Field Programmable Gate Array (FPGA), a dedicated processor. Such devices with computational processing capabilities.
可选地,服务器200中的处理器201的数量为多个;多个处理器201可以是不同类型的处理器201,或者可以是相同类型的处理器201。一种可选实施方式,该多个处理器201还可以集成为众核处理器。Alternatively, the number of processors 201 in the server 200 is plural; the plurality of processors 201 may be different types of processors 201, or may be the same type of processor 201. In an optional implementation manner, the plurality of processors 201 may also be integrated into a many-core processor.
存储器202存储计算机指令和数据;例如,存储器202存储操作系统(operating system,OS)相关的计算机指令和数据。存储器202可以是以下的任一种或任一种组合:只读存储器(read only memory,ROM)、非易失性存储器(non-volatile memory,NVM)、固态硬盘(Solid State Drives,SSD)、机械硬盘、磁盘、磁盘整列等存储介质。 Memory 202 stores computer instructions and data; for example, memory 202 stores computer instructions and data associated with an operating system (OS). The memory 202 may be any one or any combination of the following: a read only memory (ROM), a non-volatile memory (NVM), a solid state drive (SSD), Storage media such as mechanical hard disks, disks, and disk arrays.
通信接口203可以是以下的任一种或任一种组合:网络接口(例如以太网接口)、无线网卡等具有网络接入功能的器件。The communication interface 203 may be any one or any combination of the following: a network interface (such as an Ethernet interface), a wireless network card, or the like having a network access function.
通信接口203用于服务器200与其它设备(例如终端设备)进行数据交互。The communication interface 203 is used by the server 200 to perform data interaction with other devices (e.g., terminal devices).
总线204包括内存总线,还可以包括以下的任一种或任一种组合:工业标准体系结构(Industry Standard Architecture,ISA)总线、外设组件互连标准(Peripheral Component Interconnect,PCI)总线、扩展工业标准结构(Extended Industry Standard Architecture,EISA)总线等有线数据传输的器件。图2用一条粗线表示总线204。The bus 204 includes a memory bus, and may also include any one or any combination of the following: an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, and an extended industry. A device for wired data transmission such as an Extended Industry Standard Architecture (EISA) bus. Figure 2 shows the bus 204 with a thick line.
处理器201、存储器202和通信接口203通过总线204连接。这样,处理器201可以通过总线204访问存储器202,以及通过总线204利用通信接口203与其它设备(例如终端设备)进行数据交互。The processor 201, the memory 202, and the communication interface 203 are connected by a bus 204. Thus, processor 201 can access memory 202 via bus 204 and interact with other devices (e.g., terminal devices) via communication interface 203 via bus 204.
在本发明实施例中,服务器200执行存储器202中的指令,使得该个服务器200实现方法实施例提供的访问摄像头的方法。In the embodiment of the present invention, the server 200 executes the instructions in the memory 202, so that the server 200 implements the method for accessing the camera provided by the method embodiment.
重定向实施例Redirecting embodiment
服务器101运行的VM部署安卓(Android)操作系统。该VM提供该安卓操作系统的虚拟桌面。The VM running on the server 101 deploys an Android (Android) operating system. The VM provides a virtual desktop for the Android operating system.
参见图3,安卓操作系统部署虚拟桌面的服务端,该服务端包括内核层(kernel)、硬件抽象层(hardware abstraction layer,HAL)和框架层(framework)。该服务端还可以包括应用层。Referring to FIG. 3, the Android operating system deploys a server of a virtual desktop, and the server includes a kernel layer, a hardware abstraction layer (HAL), and a framework layer. The server can also include an application layer.
内核层提供摄像头的驱动,应用程序可以调用该驱动访问本地的摄像头或者终端设备的摄像头。但通过内核层的驱动访问终端设备的摄像头,需要与内核交互,会占用内核资源,以及交互时间会带来访问摄像头的延迟。因此,本发明实施例在硬件抽象层(hardware abstraction layer,HAL)提供虚拟的摄像头,替代内核层的驱动来实现对终端设备的摄像头的访问,从而避免对内核资源的占用,并且省去了与内核的摄像头的驱动交互所占用的时间。The kernel layer provides a camera driver that the application can call to access the local camera or the camera of the terminal device. However, accessing the camera of the terminal device through the driver of the kernel layer requires interaction with the kernel, which occupies kernel resources, and the interaction time brings delay in accessing the camera. Therefore, the embodiment of the present invention provides a virtual camera in a hardware abstraction layer (HAL), which replaces the driver of the kernel layer to implement access to the camera of the terminal device, thereby avoiding occupation of kernel resources, and eliminating the need for The time taken by the driver's interaction of the kernel's camera.
参见图3,硬件抽象层提供虚拟的摄像头。该虚拟的摄像头用于将应用程序的访问请求重定向为访问终端设备的摄像头的访问请求。具体地,该虚拟的摄像头包括通信模块和管理模块。Referring to Figure 3, the hardware abstraction layer provides a virtual camera. The virtual camera is used to redirect an application's access request to an access request to access the camera of the terminal device. Specifically, the virtual camera includes a communication module and a management module.
该通信模块(即服务端的通信模块),用于与客户端建立通信连接,具体可以是与客户端的通信模块建立通信连接。后续,该通信模块可以与客户端的通信模块交互数据,例如像客户端的通信模块发送访问请求。The communication module (ie, the communication module of the server) is configured to establish a communication connection with the client, and specifically may establish a communication connection with the communication module of the client. Subsequently, the communication module can interact with the communication module of the client, such as a communication module such as a client to send an access request.
该管理模块(服务端的管理模块),用于管理虚拟的摄像头。该管理模块在该服务端的通信模块与客户端建立通信连接时,对客户端进行鉴权,鉴权通过,才允许与该客户端的通信模块建立通信连接。鉴权的方式可以是使用token进行鉴权的方式。The management module (the management module of the server) is used to manage the virtual camera. When the communication module of the server establishes a communication connection with the client, the management module authenticates the client and authenticates, and then allows a communication connection with the communication module of the client. The way to authenticate can be the way to use tokens for authentication.
框架层提供摄像头服务模块(camera service)。应用程序需要访问虚拟的摄像头时,首先与该摄像头服务模块建立通信,然后通过该摄像头服务模块打开虚拟的摄像头,从而实现该应用程序对该虚拟的摄像头的访问。The camera layer provides a camera service module. When the application needs to access the virtual camera, it first establishes communication with the camera service module, and then opens the virtual camera through the camera service module, thereby implementing the application's access to the virtual camera.
应用层可以部署应用程序。当然,该应用程序也可以部署在其它的VM或者容器或者物理服务器或者其它可以部署应用程序的环境中。这里的应用程序可以通过摄像头服务模块访问虚拟的摄像头。The application layer can deploy applications. Of course, the application can also be deployed in other VMs or containers or physical servers or other environments where applications can be deployed. The application here can access the virtual camera through the camera service module.
参见图3,终端设备部署虚拟桌面的客户端。客户端包括通信模块、管理模块、检测模块和消息处理模块。Referring to FIG. 3, the terminal device deploys a client of the virtual desktop. The client includes a communication module, a management module, a detection module, and a message processing module.
客户端的通信模块,用于请求与服务端的通信模块建立通信连接。从而实现客户端与服务端的通信连接。The communication module of the client is used to request to establish a communication connection with the communication module of the server. Thereby, the communication connection between the client and the server is realized.
客户端的管理模块,用于管理终端设备的摄像头。该管理模块可以获取该摄像头的参数,以及可以通过客户端的通信模块将该摄像头的参数发送给服务端。该管理模块可以控制摄像头,例如可以控制摄像头的开启或关闭。The management module of the client is used to manage the camera of the terminal device. The management module can acquire the parameters of the camera, and can send the parameters of the camera to the server through the communication module of the client. The management module can control the camera, for example, can control the opening or closing of the camera.
客户端的检测模块,用于识别摄像头的插拔状态,具体是检测摄像头是否被正常插入,或者是否被拔出。在检测到摄像头被正常插入时,通过通信模块通知服务端加载该摄像头在该服务端映射的虚拟的摄像头;在检测到摄像头被拔出时,通过通信模块通知服务端卸载该摄像头在该服务端映射的虚拟的摄像头。The detection module of the client is used to identify the plugging and unplugging state of the camera, specifically whether the camera is normally inserted or unplugged. When detecting that the camera is normally inserted, the communication module notifies the server to load the virtual camera mapped by the camera on the server; when detecting that the camera is unplugged, the communication module notifies the server to uninstall the camera at the server. Map the virtual camera.
客户端的消息处理模块,用于识别服务端的请求,以及根据该服务端的请求,指示该客户端的管理模块执行相应的响应操作。例如,根据服务端的访问请求,指示客户端的管理模块从摄像头获取图像数据;通过通信模块反馈该图像数据给服务端。The message processing module of the client is configured to identify the request of the server, and instruct the management module of the client to perform a corresponding response operation according to the request of the server. For example, according to the access request of the server, the management module of the client is instructed to acquire image data from the camera; and the image data is fed back to the server through the communication module.
方法实施例Method embodiment
参见图4,本发明实施例提供的访问摄像头的方法包括步骤S401、步骤S402、步骤S403、步骤S404、步骤S405、步骤S406、步骤S407和步骤S408。Referring to FIG. 4, a method for accessing a camera provided by an embodiment of the present invention includes step S401, step S402, step S403, step S404, step S405, step S406, step S407, and step S408.
在服务端的硬件抽象层中部署有虚拟机的摄像头。A virtual machine camera is deployed in the hardware abstraction layer of the server.
步骤S401,该虚拟的摄像头与客户端建立通信连接。In step S401, the virtual camera establishes a communication connection with the client.
具体地,客户端的通信模块请求与该虚拟的摄像头中的通信模块建立通信连接,如果该虚拟的摄像头对该客户端鉴权通过,客户端的通信模块与该虚拟的摄像头中的通信模块继续完成通信连接的建立。Specifically, the communication module of the client requests to establish a communication connection with the communication module in the virtual camera, and if the virtual camera authenticates the client, the communication module of the client continues to communicate with the communication module in the virtual camera. The establishment of the connection.
该通信连接用于在所述虚拟的摄像头与所述客户端之间传输数据。The communication connection is for transmitting data between the virtual camera and the client.
应知,在实现访问摄像头的方法时,如果先前已经完成该虚拟的摄像头与客户端之间的通信连接的建立,则可以省去执行步骤S401。即步骤S401是访问摄像头的方法中的可选步骤。It should be understood that, in implementing the method of accessing the camera, if the establishment of the communication connection between the virtual camera and the client has been previously completed, step S401 may be omitted. That is, step S401 is an optional step in the method of accessing the camera.
步骤S402,客户端向该虚拟的摄像头发送终端设备的摄像头的参数。Step S402, the client sends the parameters of the camera of the terminal device to the virtual camera.
终端设备的摄像头,可以是指部署在终端设备上的摄像头,或者可以是指与该终端设备连接的摄像头,该摄像头可以被终端设备访问。The camera of the terminal device may be a camera deployed on the terminal device, or may be a camera connected to the terminal device, and the camera may be accessed by the terminal device.
所述摄像头的参数包括所述摄像头支持的图像格式、分辨率和帧率。The parameters of the camera include an image format, resolution, and frame rate supported by the camera.
该虚拟的摄像头接收客户端发送的该终端设备的摄像头的参数,并存储该终端设备的摄像头的参数。The virtual camera receives the parameters of the camera of the terminal device sent by the client, and stores the parameters of the camera of the terminal device.
举例说明,客户端的管理模块获取终端设备的摄像头的参数,客户端通过其通信模块向虚拟的摄像头中的通信模块发送该参数。该虚拟的摄像头中的通信模块接收该参数,该虚拟的摄像头中的管理模块存储该参数。For example, the management module of the client acquires the parameters of the camera of the terminal device, and the client sends the parameter to the communication module in the virtual camera through its communication module. The communication module in the virtual camera receives the parameter, and the management module in the virtual camera stores the parameter.
步骤S403,该虚拟的摄像头使用该终端设备的摄像头的参数进行自我配置。In step S403, the virtual camera self-configures using the parameters of the camera of the terminal device.
具体地,该虚拟的摄像头中的管理模块根据该终端设备的摄像头的参数,完成该虚拟的摄像头的参数配置。Specifically, the management module in the virtual camera completes parameter configuration of the virtual camera according to parameters of the camera of the terminal device.
应知,在实现访问摄像头的方法时,如果先前已经完成该虚拟的摄像头的参数配置,则可以省去执行步骤S402和步骤S403。即步骤S402和步骤S403是访问摄像头的方法中的可选步骤。It should be noted that, when implementing the method of accessing the camera, if the parameter configuration of the virtual camera has been previously completed, step S402 and step S403 may be omitted. That is, step S402 and step S403 are optional steps in the method of accessing the camera.
步骤S404,该虚拟的摄像头检测到应用程序访问该虚拟的摄像头的访问请求。Step S404, the virtual camera detects an access request of the application to access the virtual camera.
应用程序可以运行在提供虚拟桌面的服务器或者其它服务器。具体地,该应用程序可以运行在服务器的操作系统上,也可以运行在该服务器部署的VM或者容器中,还可以运行在该服务器中的其它环境中,在此对运行应用程序的场景不做限定。Applications can run on servers or other servers that provide virtual desktops. Specifically, the application can run on the operating system of the server, can also run in the VM or container deployed by the server, and can also run in other environments in the server, where the scenario for running the application is not performed. limited.
该应用程序可以访问HAL中的虚拟的摄像头。具体地,该应用程序通过提供虚拟桌面的服务端所提供的摄像头服务模块,向该虚拟的摄像头发送访问请求。从而,该虚拟的摄像头可以检测到该应用程序的访问请求。The app can access the virtual camera in the HAL. Specifically, the application sends an access request to the virtual camera by providing a camera service module provided by the server of the virtual desktop. Thus, the virtual camera can detect an access request for the application.
可选地,在该应用程序访问该虚拟的摄像头之前,该虚拟的摄像头会向该应用程序提供该虚拟的摄像头的参数(即终端设备的摄像头的参数),该应用程序根据该参数才能正常访问到该虚拟的摄像头。Optionally, before the application accesses the virtual camera, the virtual camera provides the virtual camera with parameters of the virtual camera (ie, parameters of the camera of the terminal device), and the application can access the data according to the parameter. Go to the virtual camera.
步骤S405,该虚拟的摄像头重定向访问该虚拟的摄像头的访问请求。In step S405, the virtual camera redirects access to the virtual camera access request.
具体地,该虚拟的摄像头中的管理模块,将访问该虚拟的摄像头的访问请求重定向为访问终端设备的摄像头的访问请求。Specifically, the management module in the virtual camera redirects the access request to access the virtual camera to an access request of the camera accessing the terminal device.
可选地,重定向访问该虚拟的摄像头的访问请求的技术,可以类似地参见现有技术中重定向访问其它设备的访问请求的技术,例如参见重定向访问终端设备的鼠标或者键盘的访问请求的相关技术。Optionally, the technology for redirecting the access request of the virtual camera may be similarly referred to the prior art technology for redirecting access requests of other devices, for example, referring to the access request of the mouse or keyboard of the redirected access terminal device. Related technology.
步骤S406,该虚拟的摄像头向客户端发送该重定向所得的访问请求。Step S406, the virtual camera sends the access request obtained by the redirect to the client.
具体地,该虚拟的摄像头中的通信模块,通过客户端与该虚拟的摄像头之间的通信连接,向客户端的通信模块发送该访问请求。Specifically, the communication module in the virtual camera transmits the access request to the communication module of the client through a communication connection between the client and the virtual camera.
客户端通过其通信模块接收该访问请求。The client receives the access request through its communication module.
步骤S407,客户端从终端设备的摄像头获取图像数据。In step S407, the client acquires image data from the camera of the terminal device.
具体地,客户端中的消息处理模块识别出该访问请求,由于该访问请求指示获取摄像头的图像数据,因此该消息处理模块指示管理模块从终端的摄像头获取图像数据。Specifically, the message processing module in the client recognizes the access request. Since the access request indicates that the image data of the camera is acquired, the message processing module instructs the management module to acquire image data from the camera of the terminal.
S408,客户端向虚拟的摄像头发送该图像数据。S408. The client sends the image data to the virtual camera.
具体地,客户端通过其通信模块向该虚拟的摄像头的通信模块发送该图像数据。Specifically, the client transmits the image data to the communication module of the virtual camera through its communication module.
后续,该虚拟的摄像头可以将该图像数据通过摄像头服务模块向应用程序反馈。这样,通过执行步骤S404、步骤S405、步骤S406、步骤S407和步骤S408,应用程序可以通过访问请求实现从终端设备的摄像头获取图像数据。Subsequently, the virtual camera can feed the image data back to the application through the camera service module. Thus, by performing steps S404, S405, S406, S407, and S408, the application can acquire image data from the camera of the terminal device by the access request.
应知,在实现访问摄像头的方法时,如果根据访问请求不需要向该虚拟的摄像头反馈图像数据,则可以省去执行步骤S407和步骤S408。即步骤S407和步骤S408是访问摄像头的方法中的可选步骤。It should be noted that, when implementing the method of accessing the camera, if it is not necessary to feed back the image data to the virtual camera according to the access request, step S407 and step S408 may be omitted. That is, step S407 and step S408 are optional steps in the method of accessing the camera.
另外,如果终端设备的摄像头有参数更新,客户端会向虚拟的摄像头反馈更新后参数。该虚拟的摄像头根据该参数更新该虚拟的摄像头的配置。In addition, if the camera of the terminal device has a parameter update, the client will feed back the updated parameters to the virtual camera. The virtual camera updates the configuration of the virtual camera based on the parameter.
从访问摄像头的方法来看,所有步骤都不需要服务端的内核层参与,因此避免对内核资源的占用,并且省去了通过与内核的摄像头的驱动交互来访问终端设备的摄像头所占用的时间。From the point of view of accessing the camera, all steps do not require the kernel layer of the server to participate, thus avoiding the occupation of kernel resources and eliminating the time taken to access the camera of the terminal device by driving interaction with the camera of the kernel.
装置和设备实施例Apparatus and apparatus embodiment
本发明实施例提供一种访问摄像头的装置,参见图5,该装置500包括用于实施方法实施例提供的访问摄像头的方法包括的各步骤的功能单元;本发明实施例对在该装置500中如何划分功能单元不做限定,下面实例性地提供一种功能单元的划分,如图5所示。An embodiment of the present invention provides a device for accessing a camera. Referring to FIG. 5, the device 500 includes functional units for implementing the steps included in the method for accessing a camera provided by the method embodiment. The embodiment of the present invention is in the device 500. How to divide functional units is not limited, and the following is exemplarily provided for division of functional units, as shown in FIG.
如图5所示的访问摄像头的装置500,该装置500部署在安卓操作系统提供虚拟桌面的服务端,在所述服务端的硬件抽象层,用于将访问请求重定向为访问终端设备的摄像头的访问请求;该装置500包括:As shown in FIG. 5, the apparatus 500 for accessing a camera is deployed on a server end of the Android operating system to provide a virtual desktop, and the hardware abstraction layer of the server is used to redirect the access request to the camera of the access terminal device. Access request; the apparatus 500 includes:
管理模块501,用于检测应用程序访问所述虚拟的摄像头的访问请求,将所述访问请求重定向为访问终端设备的摄像头的访问请求;The management module 501 is configured to detect an access request of the application to access the virtual camera, and redirect the access request to an access request of a camera accessing the terminal device;
通信模块502,用于将重定向所得的访问请求发送至所述终端设备的客户端,所述客户端用于根据所述重定向所得的访问请求访问所述终端设备的摄像头。The communication module 502 is configured to send the redirected access request to the client of the terminal device, where the client is configured to access the camera of the terminal device according to the access request obtained by the redirecting.
可选地,所述通信模块502,用于接收所述客户端发送的所述终端设备的摄像头的参数,所述终端设备的摄像头的参数包括所述终端设备的摄像头支持的图像格式、分辨率和帧率;Optionally, the communication module 502 is configured to receive a parameter of a camera of the terminal device that is sent by the client, where a parameter of the camera of the terminal device includes an image format and a resolution supported by a camera of the terminal device. And frame rate;
所述管理模块501,用于使用所述终端设备的摄像头的参数配置所述虚拟的摄像头。The management module 501 is configured to configure the virtual camera by using parameters of a camera of the terminal device.
可选地,所述通信模块502,用于:Optionally, the communication module 502 is configured to:
接收所述客户端根据所述重定向所得的访问请求从所述摄像头获取的图像数据;Receiving image data acquired by the client from the camera according to the access request obtained by the redirecting;
向所述应用程序发送所述图像数据。The image data is sent to the application.
可选地,所述通信模块502,用于建立所述虚拟的摄像头与所述客户端的通信连接,所述通信连接用于在所述虚拟的摄像头与所述客户端之间传输数据。Optionally, the communication module 502 is configured to establish a communication connection between the virtual camera and the client, where the communication connection is used to transfer data between the virtual camera and the client.
在本发明实施例中,装置500包括的各功能单元的功能描述,参见上述实施例(例如应用场景实施例、重定向实施例和方法实施例)对访问摄像头的方法包括的各步骤的相关描述。In the embodiment of the present invention, the function description of each functional unit included in the device 500, refer to the foregoing embodiments (for example, the application scenario embodiment, the redirection embodiment, and the method embodiment), and the related steps included in the method for accessing the camera. .
可选地,访问摄像头的装置500可以是本发明实施例所述的虚拟的摄像头。该虚拟的摄像头部署在本发明实施例所述的硬件抽象层。Optionally, the device 500 for accessing the camera may be a virtual camera as described in the embodiment of the present invention. The virtual camera is deployed in the hardware abstraction layer described in the embodiment of the present invention.
参见图2,本发明实施例提供一种服务器200,服务器包括处理器201和存储器202;处理器201执行存储器202中存储的指令,使得服务器200执行方法实施例提供的访问摄像头的方法。Referring to FIG. 2, an embodiment of the present invention provides a server 200. The server includes a processor 201 and a memory 202. The processor 201 executes instructions stored in the memory 202, so that the server 200 executes the method for accessing the camera provided by the method embodiment.
本发明实施例提供一种可读存储介质(例如图2中的存储器202),所述可读存储介质中存储有指令,服务器执行所述指令使得所述服务器执行方法实施例提供述的访问摄像头的方法。An embodiment of the present invention provides a readable storage medium (such as the memory 202 in FIG. 2), where the readable storage medium stores instructions, and the server executes the instructions, so that the server executes the access camera provided by the method embodiment. Methods.
本发明实施例提供一种计算机程序产品,该计算机程序产品包括指令,该指令存储在计算机可读存储介质中。服务器执行该计算机程序产品中的指令,使得所述服务器执行方法实施例提供的访问摄像头的方法。Embodiments of the present invention provide a computer program product comprising instructions stored in a computer readable storage medium. The server executes instructions in the computer program product such that the server performs the method of accessing the camera provided by the method embodiment.
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的保护范围。It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not limited thereto; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that The technical solutions described in the foregoing embodiments are modified, or some of the technical features are equivalently replaced; and the modifications or substitutions do not deviate from the technical scope of the embodiments of the present invention.

Claims (10)

  1. 一种访问摄像头的方法,其特征在于,虚拟机部署安卓操作系统,所述安卓操作系统提供虚拟桌面的服务端,在所述服务端的硬件抽象层HAL部署虚拟的摄像头,所述虚拟的摄像头用于将访问请求重定向为访问终端设备的摄像头的访问请求;所述方法包括:A method for accessing a camera, wherein the virtual machine deploys an Android operating system, the Android operating system provides a server of the virtual desktop, and a virtual camera is deployed in the hardware abstraction layer HAL of the server, and the virtual camera is used. Redirecting the access request to an access request of a camera accessing the terminal device; the method includes:
    检测应用程序访问所述虚拟的摄像头的访问请求;Detecting an application access request by the application to access the virtual camera;
    将所述访问请求重定向为访问终端设备的摄像头的访问请求;Redirecting the access request to an access request of a camera accessing the terminal device;
    将重定向所得的访问请求发送至所述终端设备的客户端,所述客户端用于根据所述重定向所得的访问请求访问所述终端设备的摄像头。Sending the redirected access request to the client of the terminal device, the client is configured to access the camera of the terminal device according to the access request obtained by the redirecting.
  2. 根据权利要求1所述的方法,其特征在于,所述方法包括:The method of claim 1 wherein the method comprises:
    接收所述客户端发送的所述终端设备的摄像头的参数,所述终端设备的摄像头的参数包括所述终端设备的摄像头支持的图像格式、分辨率和帧率;Receiving, by the client, a parameter of a camera of the terminal device, where a parameter of a camera of the terminal device includes an image format, a resolution, and a frame rate supported by a camera of the terminal device;
    使用所述终端设备的摄像头的参数配置所述虚拟的摄像头。The virtual camera is configured using parameters of a camera of the terminal device.
  3. 根据权利要求1或2所述的方法,其特征在于,所述方法包括:The method of claim 1 or 2, wherein the method comprises:
    接收所述客户端根据所述重定向所得的访问请求从所述摄像头获取的图像数据;Receiving image data acquired by the client from the camera according to the access request obtained by the redirecting;
    向所述应用程序发送所述图像数据。The image data is sent to the application.
  4. 根据权利要求1至3任一项所述的方法,其特征在于,所述方法包括:The method according to any one of claims 1 to 3, wherein the method comprises:
    建立所述虚拟的摄像头与所述客户端的通信连接,所述通信连接用于在所述虚拟的摄像头与所述客户端之间传输数据。Establishing a communication connection between the virtual camera and the client, the communication connection for transmitting data between the virtual camera and the client.
  5. 一种访问摄像头的装置,其特征在于,虚拟机部署安卓操作系统,所述安卓操作系统提供虚拟桌面的服务端,在所述服务端的硬件抽象层HAL部署虚拟的摄像头,所述虚拟的摄像头用于将访问请求重定向为访问终端设备的摄像头的访问请求;所述装置包括:An apparatus for accessing a camera, wherein the virtual machine deploys an Android operating system, the Android operating system provides a server of the virtual desktop, and a virtual camera is deployed in the hardware abstraction layer HAL of the server, and the virtual camera is used by the virtual camera. Redirecting the access request to an access request of a camera accessing the terminal device; the device includes:
    管理模块,用于检测应用程序访问所述虚拟的摄像头的访问请求,将所述访问请求重定向为访问终端设备的摄像头的访问请求;a management module, configured to detect an access request of the application to access the virtual camera, and redirect the access request to an access request of a camera accessing the terminal device;
    通信模块,用于将重定向所得的访问请求发送至所述终端设备的客户端,所述客户端用于根据所述重定向所得的访问请求访问所述终端设备的摄像头。And a communication module, configured to send the redirected access request to a client of the terminal device, where the client is configured to access a camera of the terminal device according to the access request obtained by the redirecting.
  6. 根据权利要求5所述的装置,其特征在于,The device according to claim 5, characterized in that
    所述通信模块,用于接收所述客户端发送的所述终端设备的摄像头的参数,所述终端设备的摄像头的参数包括所述终端设备的摄像头支持的图像格式、分辨率和帧率;The communication module is configured to receive a parameter of a camera of the terminal device that is sent by the client, where a parameter of the camera of the terminal device includes an image format, a resolution, and a frame rate supported by a camera of the terminal device;
    所述管理模块,用于使用所述终端设备的摄像头的参数配置所述虚拟的摄像头。The management module is configured to configure the virtual camera by using parameters of a camera of the terminal device.
  7. 根据权利要求5或6所述的装置,其特征在于,所述通信模块,用于:The device according to claim 5 or 6, wherein the communication module is configured to:
    接收所述客户端根据所述重定向所得的访问请求从所述摄像头获取的图像数据;Receiving image data acquired by the client from the camera according to the access request obtained by the redirecting;
    向所述应用程序发送所述图像数据。The image data is sent to the application.
  8. 根据权利要求5至7任一项所述的装置,其特征在于,A device according to any one of claims 5 to 7, wherein
    所述通信模块,用于建立所述虚拟的摄像头与所述客户端的通信连接,所述通信连接用于在所述虚拟的摄像头与所述客户端之间传输数据。The communication module is configured to establish a communication connection between the virtual camera and the client, and the communication connection is used to transfer data between the virtual camera and the client.
  9. 一种服务器,其特征在于,所述服务器包括处理器和存储器;A server, characterized in that the server comprises a processor and a memory;
    所述处理器执行所述存储器中存储的指令,使得所述服务器执行权利要求1至4任一项所述的访问摄像头的方法。The processor executes the instructions stored in the memory such that the server performs the method of accessing a camera as claimed in any one of claims 1 to 4.
  10. 一种可读存储介质,其特征在于,所述可读存储介质中存储有指令,服务器执行所述指令使得所述服务器执行权利要求1至4任一项所述的访问摄像头的方法。A readable storage medium, wherein the readable storage medium stores instructions, and the server executes the instructions to cause the server to perform the method of accessing a camera according to any one of claims 1 to 4.
PCT/CN2018/100543 2017-12-19 2018-08-15 Method and apparatus for accessing camera, server, and readable storage medium WO2019119831A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711375456.6 2017-12-19
CN201711375456.6A CN108304247A (en) 2017-12-19 2017-12-19 The method and apparatus of access camera, server, readable storage medium storing program for executing

Publications (1)

Publication Number Publication Date
WO2019119831A1 true WO2019119831A1 (en) 2019-06-27

Family

ID=62870649

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/100543 WO2019119831A1 (en) 2017-12-19 2018-08-15 Method and apparatus for accessing camera, server, and readable storage medium

Country Status (2)

Country Link
CN (1) CN108304247A (en)
WO (1) WO2019119831A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113220445A (en) * 2021-03-26 2021-08-06 西安神鸟软件科技有限公司 Image or video data acquisition method and terminal equipment
CN114302055A (en) * 2021-12-14 2022-04-08 北京鲸鲮信息系统技术有限公司 Linux-based camera control method, device, equipment and storage medium
CN114500877A (en) * 2021-12-30 2022-05-13 惠州华阳通用智慧车载系统开发有限公司 Camera sharing method, system and storage medium
CN117112083A (en) * 2023-10-23 2023-11-24 南京芯驰半导体科技有限公司 Method for calling camera data for multi-hardware-domain SoC and multi-hardware-domain SoC

Families Citing this family (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108304247A (en) * 2017-12-19 2018-07-20 华为技术有限公司 The method and apparatus of access camera, server, readable storage medium storing program for executing
CN109040786B (en) * 2018-09-03 2022-01-11 锐捷网络股份有限公司 Camera data transmission method, device and system and storage medium
CN111314799A (en) * 2018-12-11 2020-06-19 中兴通讯股份有限公司 Terminal system architecture, communication system, communication method, and storage medium
CN111327758B (en) * 2018-12-17 2022-08-02 中兴通讯股份有限公司 Camera sharing method and device
CN110602378B (en) * 2019-08-12 2021-03-23 创新先进技术有限公司 Processing method, device and equipment for images shot by camera
WO2021120092A1 (en) * 2019-12-19 2021-06-24 Intel Corporation Hardware based abstraction sharing of hardware devices across computing platforms
CN111314646B (en) * 2020-02-27 2021-04-23 Oppo(重庆)智能科技有限公司 Image acquisition method, image acquisition device, terminal device and readable storage medium
CN111491102B (en) * 2020-04-22 2022-01-07 Oppo广东移动通信有限公司 Detection method and system for photographing scene, mobile terminal and storage medium
CN111614900B (en) * 2020-05-26 2022-07-15 上海龙旗科技股份有限公司 Camera driving method and apparatus
CN114201249A (en) * 2020-09-17 2022-03-18 中兴通讯股份有限公司 Video equipment redirection method, client, virtual machine desktop and storage medium
CN112463897B (en) * 2020-10-14 2023-06-02 麒麟软件有限公司 Method and system for redirecting positioning data
CN112612536B (en) * 2020-12-15 2022-11-18 麒麟软件有限公司 Method and device for controlling camera shooting based on Android application program in Linux system
CN113505007A (en) * 2021-07-12 2021-10-15 北京鲸鲮信息系统技术有限公司 Protocol stack data transmission method based on Linux system, computer equipment and storage medium
CN113784049B (en) * 2021-09-17 2023-08-01 西安万像电子科技有限公司 Camera calling method of android system virtual machine, electronic equipment and storage medium
CN113938457B (en) * 2021-09-30 2023-11-10 北京润信恒达科技有限公司 Method, system and equipment for cloud mobile phone to apply remote camera
CN114040017A (en) * 2021-11-08 2022-02-11 麒麟软件有限公司 Remote desktop server camera relocation system and method for Android system
CN114116140B (en) * 2022-01-27 2022-07-26 荣耀终端有限公司 Method for acquiring data and electronic equipment
CN114727010B (en) * 2022-02-28 2023-08-22 荣耀终端有限公司 Control method, equipment and storage medium of camera
CN114661379B (en) * 2022-04-02 2024-01-05 经纬恒润(天津)研究开发有限公司 Method and related device for modifying deserializer driving program of vehicle-mounted camera system
CN115118719B (en) * 2022-06-20 2023-11-10 福建升腾资讯有限公司 Method and system for connecting camera equipment of cloud desktop
CN115567518B (en) * 2022-12-06 2023-02-28 西安雷风电子科技有限公司成都分公司 Device, system and method for reorienting camera of cloud desktop

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110161482A1 (en) * 2008-08-22 2011-06-30 Bonola Thomas J Remote graphics console and virtual media access to virtual machine guests
CN103559150A (en) * 2013-11-08 2014-02-05 深圳市道通科技有限公司 Realizing method and device for external camera of host, and mobile terminal
CN104394305A (en) * 2014-11-24 2015-03-04 上海盈方微电子有限公司 Compatibility method for supporting external mobile camera and built-in camera of mobile equipment in Android system
CN108304247A (en) * 2017-12-19 2018-07-20 华为技术有限公司 The method and apparatus of access camera, server, readable storage medium storing program for executing

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102567074B (en) * 2011-11-29 2015-01-21 中标软件有限公司 USB (universal serial bus) device redirecting method facing virtual machines
CN102819449A (en) * 2012-07-04 2012-12-12 深圳市京华科讯科技有限公司 Method and system for graphic card redirection
CN103269356A (en) * 2013-04-23 2013-08-28 深圳市京华科讯科技有限公司 Audio redirection method and system
CN106101548A (en) * 2016-07-08 2016-11-09 北京国电通网络技术有限公司 A kind of method and apparatus of cloud terminal processes camera video data
CN106970786A (en) * 2017-02-22 2017-07-21 深信服科技股份有限公司 The reorientation method and system of display device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110161482A1 (en) * 2008-08-22 2011-06-30 Bonola Thomas J Remote graphics console and virtual media access to virtual machine guests
CN103559150A (en) * 2013-11-08 2014-02-05 深圳市道通科技有限公司 Realizing method and device for external camera of host, and mobile terminal
CN104394305A (en) * 2014-11-24 2015-03-04 上海盈方微电子有限公司 Compatibility method for supporting external mobile camera and built-in camera of mobile equipment in Android system
CN108304247A (en) * 2017-12-19 2018-07-20 华为技术有限公司 The method and apparatus of access camera, server, readable storage medium storing program for executing

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113220445A (en) * 2021-03-26 2021-08-06 西安神鸟软件科技有限公司 Image or video data acquisition method and terminal equipment
CN114302055A (en) * 2021-12-14 2022-04-08 北京鲸鲮信息系统技术有限公司 Linux-based camera control method, device, equipment and storage medium
CN114500877A (en) * 2021-12-30 2022-05-13 惠州华阳通用智慧车载系统开发有限公司 Camera sharing method, system and storage medium
CN117112083A (en) * 2023-10-23 2023-11-24 南京芯驰半导体科技有限公司 Method for calling camera data for multi-hardware-domain SoC and multi-hardware-domain SoC
CN117112083B (en) * 2023-10-23 2024-02-23 南京芯驰半导体科技有限公司 Method for calling camera data for multi-hardware-domain SoC and multi-hardware-domain SoC

Also Published As

Publication number Publication date
CN108304247A (en) 2018-07-20

Similar Documents

Publication Publication Date Title
WO2019119831A1 (en) Method and apparatus for accessing camera, server, and readable storage medium
US10778521B2 (en) Reconfiguring a server including a reconfigurable adapter device
US10341251B2 (en) Method and system for securely transmitting volumes into cloud
KR101530472B1 (en) Method and apparatus for remote delivery of managed usb services via a mobile computing device
US9294567B2 (en) Systems and methods for enabling access to extensible storage devices over a network as local storage via NVME controller
US10958633B2 (en) Method and system for securely transmitting volumes into cloud
US10708232B2 (en) Techniques for communication in hybrid cloud system
US20150032910A1 (en) Input/output monitoring mechanism
US11188374B2 (en) Data mobility for immobile storage services
US9582444B1 (en) Selective partition based redirection for multi-partitioned USB devices
US9892074B2 (en) System and method to support USB devices in an unsupported operating system in VDI environments
US9936049B2 (en) Protocol independent way for dynamically selecting data compression methods for redirected USB devices
WO2021222406A1 (en) Image acquisition device virtualization for remote computing
US9760524B2 (en) System and method to redirect UASP mass storage devices to an unsupported operating system in a VDI environment
TW201732633A (en) Distributed input/output virtualization
US11003618B1 (en) Out-of-band interconnect control and isolation
US10979289B2 (en) Apparatuses and methods for remote computing node registration and authentication
US9904475B2 (en) Systems and methods for setting the operating system properties for a storage device
US11635970B2 (en) Integrated network boot operating system installation leveraging hyperconverged storage
US11847316B2 (en) System and method for managing data storage in network interface controllers
US11748038B1 (en) Physical hardware controller for provisioning remote storage services on processing devices
CN115963970A (en) Display method, display device, electronic equipment and storage medium

Legal Events

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

Ref document number: 18892248

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18892248

Country of ref document: EP

Kind code of ref document: A1