CN117729425A - Camera distribution method and electronic equipment - Google Patents
Camera distribution method and electronic equipment Download PDFInfo
- Publication number
- CN117729425A CN117729425A CN202310492723.7A CN202310492723A CN117729425A CN 117729425 A CN117729425 A CN 117729425A CN 202310492723 A CN202310492723 A CN 202310492723A CN 117729425 A CN117729425 A CN 117729425A
- Authority
- CN
- China
- Prior art keywords
- camera
- module
- function
- functional module
- release
- Prior art date
- Legal status (The legal status 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 status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 94
- 230000006870 function Effects 0.000 claims abstract description 592
- 230000004044 response Effects 0.000 claims abstract description 83
- 238000004590 computer program Methods 0.000 claims description 6
- 230000001960 triggered effect Effects 0.000 claims description 5
- 238000004891 communication Methods 0.000 description 17
- 238000010586 diagram Methods 0.000 description 12
- 230000008569 process Effects 0.000 description 11
- 238000005516 engineering process Methods 0.000 description 9
- 238000012545 processing Methods 0.000 description 9
- 230000005236 sound signal Effects 0.000 description 9
- 238000004458 analytical method Methods 0.000 description 7
- 238000007726 management method Methods 0.000 description 7
- 230000000694 effects Effects 0.000 description 6
- 238000010191 image analysis Methods 0.000 description 6
- 239000002699 waste material Substances 0.000 description 5
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000013461 design Methods 0.000 description 3
- 230000003993 interaction Effects 0.000 description 3
- 238000013500 data storage Methods 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 230000003213 activating effect Effects 0.000 description 1
- 239000008186 active pharmaceutical agent Substances 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 238000013528 artificial neural network Methods 0.000 description 1
- 230000003190 augmentative effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000003062 neural network model Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000005855 radiation Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000008093 supporting effect Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Landscapes
- Telephone Function (AREA)
Abstract
Description
技术领域Technical field
本申请实施例涉及电子技术领域,尤其涉及一种摄像头的分配方法及电子设备。Embodiments of the present application relate to the field of electronic technology, and in particular, to a camera distribution method and electronic equipment.
背景技术Background technique
用户使用电子设备时,如果眼睛距离电子设备显示屏的距离过近,则容易损害用户的视力。因此,为了在用户使用电子设备时保护用户的视力,电子设备可以在用户使用电子设备时对用户眼睛与电子设备显示屏的距离进行监控,并在检测到用户眼睛与显示屏之间距离过近时进行提醒。When a user uses an electronic device, if the distance between the eyes and the display screen of the electronic device is too close, the user's vision may be easily damaged. Therefore, in order to protect the user's vision when the user uses the electronic device, the electronic device can monitor the distance between the user's eyes and the display screen of the electronic device when the user uses the electronic device, and detect that the distance between the user's eyes and the display screen is too close. Reminder when needed.
相关技术中,为了实现近距离观看提醒这一功能,可以使用摄像头来获取显示屏前的图像。而电子设备的摄像头通常同时只能被一个功能模块使用。在打开近距离观看提醒功能的前提下,如果有其他功能模块需要使用该摄像头,并且其他功能模块的摄像头使用优先权高于近距离观看提醒模块,则近距离观看提醒功能将会被迫中断。关于如何恢复近距离观看提醒功能,成为亟待解决的技术问题。In the related technology, in order to realize the close viewing reminder function, a camera can be used to obtain the image in front of the display screen. The camera of an electronic device can usually only be used by one functional module at a time. On the premise that the close viewing reminder function is turned on, if there are other functional modules that need to use the camera, and the camera use priority of other functional modules is higher than that of the close viewing reminder module, the close viewing reminder function will be forced to interrupt. How to restore the close viewing reminder function has become an urgent technical issue that needs to be solved.
发明内容Contents of the invention
本申请实施例提供一种摄像头的分配方法及电子设备,用于解决其他功能模块退出使用摄像头之后,无法及时恢复近距离观看提醒功能的问题。Embodiments of the present application provide a camera allocation method and electronic equipment to solve the problem that the close viewing reminder function cannot be restored in time after other functional modules quit using the camera.
为达到上述目的,本申请的实施例采用如下技术方案:In order to achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
第一方面,提供了一种摄像头的分配方法,该方法应用于电子设备,该电子设备包括摄像头,以及支持使用摄像头实现对应功能的第一功能模块和第二功能模块;第一功能模块对应的第一功能处于开启的状态,且当前摄像头被分配给第二功能模块。该方法包括:In a first aspect, a camera allocation method is provided. The method is applied to an electronic device. The electronic device includes a camera, and a first functional module and a second functional module that support using the camera to implement corresponding functions; the first functional module corresponds to The first function is turned on, and the current camera is assigned to the second function module. The method includes:
在摄像头被分配给第二功能模块的情况下,如果第二功能模块需要退出使用摄像头,用户可以针对第二功能模块发起第一操作。电子设备响应于第一操作,将摄像头从第二功能模块释放。由于第一功能模块对应的第一功能处于开启状态,因此,电子设备在释放摄像头之后,还会将摄像头分配给第一功能模块。从而,第一功能模块可以使用摄像头实现第一功能。这样,第一功能模块可以在摄像头被释放之后,及时的调用摄像头来实现第一功能。同时,第一功能模块不需要持续尝试打开摄像头,可以避免cpu资源的浪费。In the case where the camera is assigned to the second functional module, if the second functional module needs to quit using the camera, the user can initiate the first operation for the second functional module. In response to the first operation, the electronic device releases the camera from the second functional module. Since the first function corresponding to the first functional module is in the on state, after releasing the camera, the electronic device will also allocate the camera to the first functional module. Therefore, the first functional module can use the camera to implement the first function. In this way, the first function module can promptly call the camera to implement the first function after the camera is released. At the same time, the first functional module does not need to continuously try to open the camera, which can avoid waste of CPU resources.
在第一方面的一种可能的实施方式中,电子设备还包括摄像头功能模块,上述响应于第一操作,将摄像头从第二功能模块释放,并将摄像头分配给第一功能模块,具体可以包括:In a possible implementation of the first aspect, the electronic device further includes a camera function module. In response to the first operation, releasing the camera from the second function module and assigning the camera to the first function module may include: :
摄像头功能模块响应于第一操作,将摄像头从第二功能模块释放,并触发向第一功能模块发送摄像头被释放的通知消息。第一功能模块接收到该通知消息之后,可以感知到摄像头被释放。之后,第一功能模块即可调用摄像头。第一功能模块基于通知消息向摄像头功能模块发送第一摄像头调用指令。响应于第一摄像头调用指令,摄像头功能模块将摄像头分配给第一功能模块。这样,在其他功能模块释放摄像头之后,摄像头功能模块可以触发向第一功能模块发送通知消息,以告知第一功能模块摄像头被释放的消息,便于第一功能模块可以及时的调用摄像头,以启动第一功能。In response to the first operation, the camera function module releases the camera from the second function module and triggers sending a notification message that the camera is released to the first function module. After receiving the notification message, the first functional module can sense that the camera is released. After that, the first function module can call the camera. The first functional module sends a first camera calling instruction to the camera functional module based on the notification message. In response to the first camera calling instruction, the camera function module assigns the camera to the first function module. In this way, after other functional modules release the camera, the camera functional module can trigger sending a notification message to the first functional module to inform the first functional module that the camera is released, so that the first functional module can call the camera in time to start the second functional module. One function.
在第一方面的一种可能的实施方式中,第一功能模块对于摄像头的使用优先权低于第二功能模块对于摄像头的使用优先权。这样,在第一功能模块正在使用摄像头的情况下,如果第二功能模块请求调用摄像头,电子设备将会将摄像头的使用权分配给第二功能模块。即,允许第二功能模块抢占第一功能模块对于摄像头的使用优先权。而如果第二功能模块正在使用摄像头的情况下,如果第一功能模块请求调用摄像头,电子设备将不允许第一功能模块抢占第二功能模块对于摄像头的使用权。In a possible implementation of the first aspect, the use priority of the first functional module for the camera is lower than the use priority of the second functional module for the camera. In this way, when the first functional module is using the camera, if the second functional module requests to call the camera, the electronic device will allocate the right to use the camera to the second functional module. That is, the second functional module is allowed to seize the priority of using the camera from the first functional module. If the second functional module is using the camera, and the first functional module requests to call the camera, the electronic device will not allow the first functional module to seize the second functional module's right to use the camera.
在第一方面的另一种可能的实施方式中,在上述获取针对第二功能模块的第一操作之前,上述方法还包括:获取针对第二功能模块的第二操作。响应于第二操作,电子设备将摄像头分配给第二功能模块。In another possible implementation of the first aspect, before obtaining the first operation for the second functional module, the above method further includes: obtaining the second operation for the second functional module. In response to the second operation, the electronic device assigns the camera to the second functional module.
在第一方面的另一种可能的实施方式中,在获取针对第二功能模块的第二操作之前,上述方法还包括:获取针对第一功能模块的第三操作。由于针对第一功能模块的第三操作是在针对第二功能模块的第一操作之前发生,即表示摄像头当前未被分配给其他功能模块。因此,响应于第三操作,电子设备启动第一功能,并且可以将摄像头分配给第一功能模块。也就是说,在该实施方式中,上述获取到针对第二功能模块的第二操作之前,摄像头已经被分配给第一功能模块。上述响应于第二操作,将摄像头分配给第二功能模块,具体可以包括:响应于第二操作,电子设备需要先将摄像头从第一功能模块释放。然后才可以将摄像头分配给第二功能模块。In another possible implementation of the first aspect, before obtaining the second operation for the second functional module, the above method further includes: obtaining the third operation for the first functional module. Since the third operation on the first functional module occurs before the first operation on the second functional module, it means that the camera is currently not assigned to other functional modules. Therefore, in response to the third operation, the electronic device activates the first function, and the camera can be assigned to the first functional module. That is to say, in this embodiment, before the second operation for the second functional module is acquired, the camera has been assigned to the first functional module. The above allocation of the camera to the second functional module in response to the second operation may specifically include: in response to the second operation, the electronic device needs to first release the camera from the first functional module. Only then can the camera be assigned to the second functional module.
在该方案中,如果是先打开第一功能,那么摄像头将会被分配给第一功能模块。之后再打开第二功能模块对应的功能,则第二功能模块将会抢占摄像头的使用权,使第一功能暂时中断。此时,需要将摄像头从第一功能模块释放,然后将摄像头分配给第二功能模块。再然后,在第二功能模块释放摄像头时,通知第一功能模块摄像头被释放的消息,使第一功能模块可以及时的重新调用摄像头,恢复第一功能。In this solution, if the first function is turned on first, the camera will be assigned to the first function module. If the function corresponding to the second function module is turned on later, the second function module will seize the right to use the camera, causing the first function to be temporarily interrupted. At this time, the camera needs to be released from the first functional module and then assigned to the second functional module. Then, when the second functional module releases the camera, it notifies the first functional module that the camera is released, so that the first functional module can re-call the camera in time and restore the first function.
在第一方面的另一种可能的实施方式中,如果第一功能模块调用摄像头在前,第二功能模块调用摄像头在后,那么在响应于第二操作,将摄像头分配给第二功能模块之前,上述方法还可以包括:判断第一功能模块与第二功能模块对于摄像头的使用优先权。在该实施方式中,电子设备具体可以在确定第二功能模块对于摄像头的使用优先权高于第一功能模块之后,再响应于第二操作,将摄像头分配给第二功能模块。In another possible implementation of the first aspect, if the first function module calls the camera at the front and the second function module calls the camera at the back, then in response to the second operation, before assigning the camera to the second function module , the above method may further include: determining the priority of using the camera between the first functional module and the second functional module. In this embodiment, the electronic device may assign the camera to the second functional module in response to the second operation after determining that the second functional module has a higher priority for using the camera than the first functional module.
在第一方面的另一种可能的实施方式中,电子设备还包括摄像头功能模块。在获取针对第一功能模块的第三操作之后,上述方法还可以包括:第一功能模块发起注册摄像头释放回调函数的第一注册请求。响应于第一注册请求,电子设备可以添加第一功能模块对摄像头释放回调函数的注册记录。这样,便于在调用摄像头释放回调函数的时候,基于注册记录可以向第一功能模块发送通知消息。之后,在摄像头被释放之后,摄像头功能模块可以触发调用摄像头释放回调函数,并且,基于该注册记录,调用摄像头释放回调函数之后可以向第一功能模块发送摄像头被释放的通知消息。In another possible implementation of the first aspect, the electronic device further includes a camera function module. After obtaining the third operation for the first functional module, the above method may further include: the first functional module initiates a first registration request to register the camera release callback function. In response to the first registration request, the electronic device may add a registration record of the camera release callback function of the first functional module. In this way, when the camera release callback function is called, a notification message can be sent to the first functional module based on the registration record. Later, after the camera is released, the camera function module can trigger a call to the camera release callback function, and based on the registration record, after calling the camera release callback function, a notification message that the camera is released can be sent to the first function module.
在该方案中,在第一功能模块在启动第一功能时,即可注册摄像头释放回调函数。电子设备响应于第一功能模块发起的注册摄像头释放回调函数的注册请求,可以在电子设备中添加第一功能模块对摄像头释放回调函数的注册记录。之后,如果第一功能模块的摄像头使用权被其他功能模块(如第二功能模块)抢占,在该其他功能模块释放摄像头时,电子设备可以调用该摄像头释放回调函数,向第一功能模块发送摄像头被释放的通知消息。从而,使第一功能模块可以及时的感知到摄像头被释放,及时重新调用摄像头,实现第一功能。In this solution, when the first function module starts the first function, the camera release callback function can be registered. In response to the registration request initiated by the first functional module to register the camera release callback function, the electronic device may add a registration record of the camera release callback function by the first functional module in the electronic device. Afterwards, if the right to use the camera of the first functional module is preempted by other functional modules (such as the second functional module), when the other functional module releases the camera, the electronic device can call the camera release callback function to send the camera to the first functional module. Released notification message. Therefore, the first functional module can sense that the camera is released in time, and re-call the camera in time to realize the first function.
在第一方面的另一种可能的实施方式中,电子设备还包括摄像头功能模块。第一功能启动在前,第二功能模块调用摄像头在后。由于第一功能模块启动时,摄像头处于空闲状态,因此电子设备可以直接将摄像头分配给第一功能模块,即第一功能模块可以获得摄像头的使用权。但是之后,第二功能模块调用摄像头,则摄像头使用权将会被分配给第二功能模块,即摄像头使用权被第二功能模块抢占。在该实施方式中,第一功能模块可以在摄像头的使用权被抢占的时候,再注册摄像头释放回调函数。具体的,在上述响应于第二操作,将摄像头从第一功能模块释放之后,上述方法还包括:第一功能模块发起注册摄像头释放回调函数的第二注册请求。响应于第二注册请求,添加第一功能模块对摄像头释放回调函数的注册记录。同样的,在摄像头被释放之后,摄像头功能模块可以触发调用摄像头释放回调函数,并且,基于该注册记录,调用摄像头释放回调函数之后可以向第一功能模块发送摄像头被释放的通知消息。In another possible implementation of the first aspect, the electronic device further includes a camera function module. The first function is started in the front, and the second function module calls the camera in the back. Since the camera is in an idle state when the first functional module is started, the electronic device can directly assign the camera to the first functional module, that is, the first functional module can obtain the right to use the camera. But later, if the second functional module calls the camera, the right to use the camera will be assigned to the second functional module, that is, the right to use the camera will be preempted by the second functional module. In this embodiment, the first functional module can register the camera release callback function when the right to use the camera is preempted. Specifically, after the camera is released from the first functional module in response to the second operation, the above method further includes: the first functional module initiating a second registration request to register the camera release callback function. In response to the second registration request, add a registration record of the camera release callback function of the first functional module. Similarly, after the camera is released, the camera function module can trigger the call of the camera release callback function, and based on the registration record, after calling the camera release callback function, a notification message that the camera is released can be sent to the first function module.
这样,第一功能模块在摄像头使用权被其他功能模块抢占的时候再注册摄像头释放回调函数,也可以实现在第二功能模块退出使用摄像头时,由摄像头功能模块触发调用摄像头释放回调函数,向第一功能模块发送通知消息。同样可以使第一功能模块可以及时的感知到摄像头被释放,及时重新调用摄像头,恢复第一功能。In this way, the first functional module registers the camera release callback function when the right to use the camera is preempted by other functional modules. It can also be implemented that when the second functional module quits using the camera, the camera function module triggers the call of the camera release callback function and sends the callback function to the third functional module. A functional module sends a notification message. Likewise, the first function module can sense that the camera is released in time, and promptly re-call the camera to restore the first function.
在第一方面的另一种可能的实施方式中,电子设备还包括摄像头功能模块。第一功能模块请求调用摄像头也可能是在摄像头被分配给第二功能模块之后。即,在响应于第二操作,将摄像头分配给第二功能模块之后,上述方法还包括:获取针对第一功能模块的第四操作。响应于第四操作,电子设备启动第一功能。由于当前摄像头处于占用状态,电子设备无法将摄像头分配给第一功能模块。因此,在启动第一功能在之后,第一功能模块可以先注册摄像头释放回调函数,以在其他功能模块释放摄像头的时候,及时感知到摄像头被释放的消息。即,响应于第四操作,第一功能模块还会发起摄像头释放回调函数的第三注册请求。响应于第三注册请求,电子设备添加第一功能模块对摄像头释放回调函数的注册记录。同样的,在摄像头被释放之后,摄像头功能模块可以触发调用摄像头释放回调函数,并且,基于该注册记录,调用摄像头释放回调函数之后可以向第一功能模块发送摄像头被释放的通知消息。这样,可以使第一功能模块在摄像头被其他功能模块释放之后及时感知到摄像头被释放的消息,及时的调用摄像头,实现第一功能。In another possible implementation of the first aspect, the electronic device further includes a camera function module. The first functional module may also request to call the camera after the camera is assigned to the second functional module. That is, after allocating the camera to the second functional module in response to the second operation, the above method further includes: obtaining a fourth operation for the first functional module. In response to the fourth operation, the electronic device activates the first function. Since the camera is currently occupied, the electronic device cannot assign the camera to the first functional module. Therefore, after starting the first function, the first function module can first register the camera release callback function, so that when other function modules release the camera, they can promptly sense the news that the camera has been released. That is, in response to the fourth operation, the first functional module will also initiate a third registration request for the camera release callback function. In response to the third registration request, the electronic device adds a registration record of the camera release callback function of the first functional module. Similarly, after the camera is released, the camera function module can trigger the call of the camera release callback function, and based on the registration record, after calling the camera release callback function, a notification message that the camera is released can be sent to the first function module. In this way, the first functional module can promptly sense the news that the camera is released after the camera is released by other functional modules, and call the camera in time to realize the first function.
在第一方面的另一种可能的实施方式中,在将摄像头分配给第二功能模块的情况下,电子设备获取到针对第一功能模块的第四操作之后,响应于第四操作,电子设备启动第一功能,并判断第一功能模块与第二功能模块对于摄像头的使用优先权。在确定第一功能模块对于摄像头的使用优先权低于第二功能模块的情况下,电子设备不会立即响应于第四操作将摄像头分配给第一功能模块,而是由第一功能模块先注册摄像头释放回调函数。之后,在第二功能模块释放摄像头之后,电子设备可以调用摄像头释放回调函数,并向第一功能模块发送通知消息。从而,使第一功能模块可以在接收到通知消息之后,及时的调用摄像头,之后,电子设备可以将摄像头分配给第一功能模块。In another possible implementation of the first aspect, in the case where the camera is assigned to the second functional module, after the electronic device obtains the fourth operation for the first functional module, in response to the fourth operation, the electronic device The first function is started, and the priority of using the camera between the first functional module and the second functional module is determined. When it is determined that the first functional module has a lower priority for using the camera than the second functional module, the electronic device will not immediately allocate the camera to the first functional module in response to the fourth operation, but the first functional module will register first. Camera release callback function. Later, after the second functional module releases the camera, the electronic device can call the camera release callback function and send a notification message to the first functional module. Therefore, the first functional module can promptly call the camera after receiving the notification message, and then the electronic device can assign the camera to the first functional module.
在第一方面的另一种可能的实施方式中,第一功能模块包括近距离观看提醒模块。在该实施方式中,在将摄像头分配给第一功能模块(即近距离观看提醒模块)之后,上述方法还包括:近距离观看提醒模块获取摄像头采集的图像。并且,近距离观看提醒模块分析图像,根据分析图像得到的结果,对用户的观看距离进行提醒。In another possible implementation of the first aspect, the first functional module includes a close viewing reminder module. In this embodiment, after the camera is assigned to the first functional module (ie, the close viewing reminder module), the above method further includes: the close viewing reminder module acquires the image collected by the camera. Moreover, the close viewing reminder module analyzes the image and reminds the user of the viewing distance based on the results obtained from analyzing the image.
第二方面,提供了一种摄像头的分配方法,该方法应用于电子设备,该电子设备包括摄像头,以及摄像头功能模块、支持使用摄像头实现对应功能的第一功能模块和第二功能模块和;第一功能模块对应的第一功能处于开启的状态,且当前摄像头被分配给第二功能模块。In a second aspect, a camera allocation method is provided. The method is applied to an electronic device. The electronic device includes a camera, a camera functional module, a first functional module and a second functional module that support using the camera to implement corresponding functions; The first function corresponding to a functional module is in an enabled state, and the current camera is assigned to the second functional module.
该方法包括:The method includes:
第二功能模块向摄像头功能模块发送摄像头释放指令;响应于第二功能模块发送的摄像头释放指令,摄像头功能模块释放摄像头,并将摄像头分配给第一功能模块。这样,第一功能模块可以在摄像头被释放之后,及时的调用摄像头来实现第一功能。同时,第一功能模块不需要持续尝试打开摄像头,可以避免cpu资源的浪费。The second function module sends a camera release instruction to the camera function module; in response to the camera release instruction sent by the second function module, the camera function module releases the camera and assigns the camera to the first function module. In this way, the first function module can promptly call the camera to implement the first function after the camera is released. At the same time, the first functional module does not need to continuously try to open the camera, which can avoid waste of CPU resources.
在第二方面的另一种可能的实现方式中,上述将摄像头分配给第一功能模块,具体可以包括:摄像头功能模块向第一功能模块发送摄像头被释放的通知消息。第一功能模块基于通知消息,向摄像头功能模块发送第二摄像头调用指令。响应于第二摄像头调用指令,摄像头功能模块将摄像头分配给第一功能模块。在该方案中,在第二功能模块释放摄像头之后,由摄像头功能模块主动通知第一功能模块摄像头被释放的消息。这样可以避免第一功能模块无法及时感知摄像头被释放的消息,也可以避免第一功能模块持续尝试打开摄像头,可以避免cpu资源的浪费。In another possible implementation of the second aspect, the above allocation of the camera to the first functional module may specifically include: the camera functional module sending a notification message that the camera is released to the first functional module. Based on the notification message, the first functional module sends a second camera calling instruction to the camera functional module. In response to the second camera calling instruction, the camera function module assigns the camera to the first function module. In this solution, after the second functional module releases the camera, the camera functional module actively notifies the first functional module that the camera is released. This can prevent the first functional module from not being able to detect the news that the camera is released in time, and can also prevent the first functional module from continuously trying to open the camera, which can avoid waste of CPU resources.
在第二方面的一种可能的实现方式中,在第二功能模块向摄像头功能模块发送摄像头释放指令之前,上述方法还包括:第二功能模块向摄像头功能模块发送第三摄像头调用指令;响应于第二摄像头调用指令,摄像头功能模块将摄像头分配给第二功能模块。第二功能模块需要使用摄像头时,可以向摄像头功能模块发送第三摄像头调用指令,之后,摄像头功能模块可以将摄像头分配给第二功能模块。In a possible implementation of the second aspect, before the second functional module sends a camera release instruction to the camera function module, the above method further includes: the second functional module sends a third camera calling instruction to the camera function module; in response to The second camera calls the instruction, and the camera function module allocates the camera to the second function module. When the second functional module needs to use the camera, it can send a third camera calling instruction to the camera functional module. After that, the camera functional module can assign the camera to the second functional module.
在第二方面的另一种可能的实现方式中,第一功能模块对于摄像头的使用优先权低于第二功能模块对于摄像头的使用优先权。这样,在第一功能模块正在使用摄像头的情况下,如果第二功能模块请求调用摄像头,电子设备将会将摄像头的使用权分配给第二功能模块。即,允许第二功能模块抢占第一功能模块对于摄像头的使用优先权。而如果第二功能模块正在使用摄像头的情况下,如果第一功能模块请求调用摄像头,电子设备将不允许第一功能模块抢占第二功能模块对于摄像头的使用权。In another possible implementation of the second aspect, the first functional module's priority for using the camera is lower than the second functional module's priority for using the camera. In this way, when the first functional module is using the camera, if the second functional module requests to call the camera, the electronic device will allocate the right to use the camera to the second functional module. That is, the second functional module is allowed to seize the priority of using the camera from the first functional module. If the second functional module is using the camera, and the first functional module requests to call the camera, the electronic device will not allow the first functional module to seize the second functional module's right to use the camera.
在第二方面的另一种可能的实现方式中,在第二功能模块向摄像头功能模块发送第三摄像头调用指令之前,上述方法还包括:响应于对第一功能的打开操作,第一功能模块启动第一功能。并且,第一功能模块向摄像头功能模块发送第四摄像头调用指令。摄像头功能模块在接收到第四摄像头调用指令之后,响应于第四摄像头调用指令,摄像头功能模块将摄像头分配给第一功能模块。In another possible implementation of the second aspect, before the second function module sends the third camera calling instruction to the camera function module, the above method further includes: in response to the opening operation of the first function, the first function module Start the first function. Furthermore, the first function module sends a fourth camera calling instruction to the camera function module. After receiving the fourth camera calling instruction, the camera function module allocates the camera to the first function module in response to the fourth camera calling instruction.
在该实施方式中,摄像头被分配给第一功能模块之后,第二功能模块再发起第三摄像头调用指令的情况下,则响应于该第三摄像头调用指令,摄像头功能模块需要将摄像头从第一功能模块释放,然后才可以将摄像头分配给第二功能模块。In this embodiment, after the camera is assigned to the first functional module, if the second functional module initiates a third camera calling instruction, then in response to the third camera calling instruction, the camera function module needs to transfer the camera from the first The functional module is released, and then the camera can be assigned to the second functional module.
在该方案中,如果是先打开第一功能,那么摄像头将会被分配给第一功能模块。之后再打开第二功能模块对应的功能,则第二功能模块将会抢占摄像头的使用权,使第一功能暂时中断。此时,需要将摄像头从第一功能模块释放,然后将摄像头分配给第二功能模块。再然后,在第二功能模块退出使用摄像头时,摄像头功能模块通知第一功能模块摄像头被释放的消息,使第一功能模块可以及时的重新调用摄像头,恢复第一功能。In this solution, if the first function is turned on first, the camera will be assigned to the first function module. If the function corresponding to the second function module is turned on later, the second function module will seize the right to use the camera, causing the first function to be temporarily interrupted. At this time, the camera needs to be released from the first functional module and then assigned to the second functional module. Then, when the second function module quits using the camera, the camera function module notifies the first function module that the camera is released, so that the first function module can re-call the camera in time and restore the first function.
在第二方面的另一种可能的实现方式中,电子设备还包括HIDL摄像头接口服务模块。在第一功能模块启动第一功能之后,上述方法还包括:第一功能模块向HIDL摄像头接口服务模块发送注册摄像头释放回调函数的第四注册请求。响应于该第四注册请求,注册摄像头释放回调函数添加第一功能模块对摄像头释放回调函数的注册记录。在该实施方式中,上述摄像头功能模块向第一功能模块发送摄像头被释放的通知消息,具体可以包括:摄像头功能模块触发向HIDL摄像头接口服务模块发送摄像头被释放的第一通知消息。响应于第一通知消息,HIDL摄像头接口服务模块调用摄像头释放回调函数,向第一功能模块发送摄像头被释放的第二通知消息。In another possible implementation of the second aspect, the electronic device further includes a HIDL camera interface service module. After the first function module starts the first function, the above method also includes: the first function module sends a fourth registration request to register the camera release callback function to the HIDL camera interface service module. In response to the fourth registration request, the registered camera release callback function adds the registration record of the camera release callback function by the first functional module. In this implementation, the above-mentioned camera function module sends a notification message that the camera is released to the first functional module, which may specifically include: the camera function module triggers the sending of a first notification message that the camera is released to the HIDL camera interface service module. In response to the first notification message, the HIDL camera interface service module calls the camera release callback function and sends a second notification message that the camera is released to the first functional module.
在该方案中,第一功能模块在启动时即在HIDL摄像头接口服务模块中注册摄像头释放回调函数。之后,在第一功能处于开启的状态下,如果其他功能模块退出使用摄像头,摄像头功能模块通知HIDL摄像头接口服务模块,使HIDL摄像头接口服务模块调用该摄像头释放回调函数,以通知第一功能模块摄像头被释放的消息。从而,使第一功能模块可以及时的感知到摄像头被释放,及时重新调用摄像头,实现第一功能。In this solution, the first functional module registers the camera release callback function in the HIDL camera interface service module when it is started. Afterwards, when the first function is turned on, if other functional modules quit using the camera, the camera function module notifies the HIDL camera interface service module, causing the HIDL camera interface service module to call the camera release callback function to notify the first functional module of the camera. News of being released. Therefore, the first functional module can sense that the camera is released in time, and re-call the camera in time to realize the first function.
在第二方面的另一种可能的实现方式中,在响应于第三摄像头调用指令,摄像头功能模块将摄像头从第一功能模块释放之后,上述方法还包括:第一功能模块向HIDL摄像头接口服务模块发送注册摄像头释放回调函数的第五注册请求。响应于该第五注册请求,注册摄像头释放回调函数添加第一功能模块对摄像头释放回调函数的注册记录。在该实施方式中,上述摄像头功能模块向第一功能模块发送摄像头被释放的通知消息,具体可以包括:摄像头功能模块触发向HIDL摄像头接口服务模块发送摄像头被释放的第一通知消息。响应于第一通知消息,HIDL摄像头接口服务模块基于注册记录调用摄像头释放回调函数,向第一功能模块发送摄像头被释放的第二通知消息。In another possible implementation of the second aspect, after the camera function module releases the camera from the first function module in response to the third camera calling instruction, the above method further includes: the first function module provides services to the HIDL camera interface The module sends the fifth registration request to register the camera release callback function. In response to the fifth registration request, the registered camera release callback function adds the registration record of the camera release callback function of the first functional module. In this implementation, the above-mentioned camera function module sends a notification message that the camera is released to the first functional module, which may specifically include: the camera function module triggers the sending of a first notification message that the camera is released to the HIDL camera interface service module. In response to the first notification message, the HIDL camera interface service module calls the camera release callback function based on the registration record, and sends a second notification message that the camera is released to the first functional module.
在该方案中,第一功能模块在摄像头被其他功能模块抢占时,即将摄像头从第一功能模块释放之后,第一功能模块再注册摄像头释放回调函数。这样,在第二功能模块退出使用摄像头时,摄像头功能模块也可以HIDL摄像头接口服务模块触发调用摄像头释放回调函数,基于注册记录向第一功能模块发送摄像头被释放的通知消息。同样可以使第一功能模块可以及时的感知到摄像头被释放,及时重新调用摄像头,实现第一功能。In this solution, when the camera is preempted by other functional modules, that is, after the camera is released from the first functional module, the first functional module registers the camera release callback function. In this way, when the second functional module exits the use of the camera, the camera functional module can also trigger the HIDL camera interface service module to call the camera release callback function, and send a notification message that the camera is released to the first functional module based on the registration record. Likewise, the first functional module can sense the release of the camera in time and re-call the camera in time to realize the first function.
在第二方面的另一种可能的实现方式中,第一功能模块启动也可能是在摄像头被分配给第二功能模块之后。在该实施方式中,在响应于第三摄像头调用指令,摄像头功能模块将摄像头分配给第二功能模块之后,上述方法还包括:响应于对第一功能的打开操作,第一功能模块启动第一功能。第一功能模块向HIDL摄像头接口服务模块发送第六注册请求,HIDL摄像头接口服务模块先添加第一功能模块对摄像头释放回调函数的注册记录。之后,在第二功能模块向摄像头功能模块发送摄像头释放指令时,再由摄像头功能模块触发HIDL摄像头接口服务模块调用摄像头释放回调函数,基于注册记录向第一功能模块发送摄像头被释放的通知消息。In another possible implementation of the second aspect, the first functional module may be started after the camera is assigned to the second functional module. In this embodiment, after the camera function module assigns the camera to the second function module in response to the third camera calling instruction, the above method further includes: in response to the opening operation of the first function, the first function module starts the first function module. Function. The first functional module sends a sixth registration request to the HIDL camera interface service module. The HIDL camera interface service module first adds the registration record of the camera release callback function of the first functional module. Later, when the second functional module sends a camera release instruction to the camera function module, the camera function module triggers the HIDL camera interface service module to call the camera release callback function, and sends a notification message that the camera is released to the first functional module based on the registration record.
在该方案中,第一功能模块启动时如果摄像头处于占用状态,那么第一功能模块可以先注册摄像头释放回调函数。在占用摄像头的功能模块退出使用摄像头时,由摄像头功能模块触发HIDL摄像头接口服务模块调用该摄像头释放回调函数,基于注册记录通知第一功能模块摄像头被释放的消息。这样,可以使第一功能模块在摄像头被释放之后及时的调用摄像头,实现第一功能。In this solution, if the camera is in an occupied state when the first functional module is started, the first functional module can first register the camera release callback function. When the function module occupying the camera exits from using the camera, the camera function module triggers the HIDL camera interface service module to call the camera release callback function, and notifies the first function module that the camera is released based on the registration record. In this way, the first function module can call the camera in time after the camera is released to realize the first function.
第三方面,提供了一种电子设备,包括:处理器、摄像头和存储器;存储器、摄像头分别与处理器耦合。该摄像头用于采集图像。该存储器用于存储计算机执行指令,当该电子设备运行时,该处理器执行该存储器存储的该计算机执行指令,以使该电子设备执行如上述第一方面中任一项的摄像头的分配方法。In a third aspect, an electronic device is provided, including: a processor, a camera and a memory; the memory and the camera are respectively coupled to the processor. This camera is used to capture images. The memory is used to store computer-executed instructions. When the electronic device is running, the processor executes the computer-executed instructions stored in the memory, so that the electronic device performs the camera allocation method in any one of the above-mentioned first aspects.
第四方面,提供了一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机可以执行上述第一方面中任一项的摄像头的分配方法。In a fourth aspect, a computer-readable storage medium is provided. Instructions are stored in the computer-readable storage medium. When the computer-readable storage medium is run on a computer, the computer can execute the camera allocation method of any one of the above-mentioned first aspects. .
第五方面,提供了一种包含指令的计算机程序产品,当其在电子设备上运行时,使得电子设备可以执行上述第一方面中任一项的摄像头的分配方法。A fifth aspect provides a computer program product containing instructions that, when run on an electronic device, enables the electronic device to execute the camera allocation method of any one of the above first aspects.
第六方面,提供了一种装置(例如,该装置可以是芯片系统),该装置包括处理器,用于支持电子设备实现上述第一方面中所涉及的功能。在一种可能的设计中,该装置还包括存储器,该存储器,用于保存电子设备必要的程序指令和数据。该装置是芯片系统时,可以由芯片构成,也可以包含芯片和其他分立器件。A sixth aspect provides a device (for example, the device may be a chip system). The device includes a processor and is used to support an electronic device to implement the functions involved in the above-mentioned first aspect. In a possible design, the device further includes a memory, which is used to store necessary program instructions and data of the electronic device. When the device is a chip system, it may be composed of a chip or may include a chip and other discrete components.
其中,第二方面至第六方面中任一种设计方式所带来的技术效果可参见第一方面中不同设计方式所带来的技术效果,此处不再赘述。Among them, the technical effects brought by any one of the design methods in the second to sixth aspects can be found in the technical effects brought by different design methods in the first aspect, and will not be described again here.
附图说明Description of the drawings
图1A为本申请实施例提供的一种用户使用智慧屏的场景示意图;Figure 1A is a schematic diagram of a user using a smart screen provided by an embodiment of the present application;
图1B为本申请实施例提供的一种智慧屏的显示界面示意图;Figure 1B is a schematic diagram of a display interface of a smart screen provided by an embodiment of the present application;
图1C为本申请实施例提供的一种智慧屏的显示界面示意图;Figure 1C is a schematic diagram of a display interface of a smart screen provided by an embodiment of the present application;
图1D为本申请实施例提供的一种智慧屏的显示界面示意图;Figure 1D is a schematic diagram of a display interface of a smart screen provided by an embodiment of the present application;
图1E为本申请实施例提供的一种智慧屏的显示界面示意图;Figure 1E is a schematic diagram of a display interface of a smart screen provided by an embodiment of the present application;
图2A为本申请实施例提供的一种电子设备的硬件结构示意图;Figure 2A is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application;
图2B为本申请实施例提供的一种电子设备的软件架构示意图;Figure 2B is a schematic diagram of the software architecture of an electronic device provided by an embodiment of the present application;
图3为本申请实施例提供的近距离观看提醒模块调用摄像头的流程示意图;Figure 3 is a schematic flow chart of the close viewing reminder module calling the camera provided by the embodiment of the present application;
图4A为本申请实施例提供的一种摄像头的分配方法的流程示意图;Figure 4A is a schematic flowchart of a camera allocation method provided by an embodiment of the present application;
图4B为本申请实施例提供的一种摄像头的分配方法的流程示意图;Figure 4B is a schematic flowchart of a camera allocation method provided by an embodiment of the present application;
图4C为本申请实施例提供的一种摄像头的分配方法的流程示意图;Figure 4C is a schematic flowchart of a camera allocation method provided by an embodiment of the present application;
图5为本申请实施例提供的一种摄像头的分配方法的流程示意图;Figure 5 is a schematic flow chart of a camera allocation method provided by an embodiment of the present application;
图6为本申请实施例提供的一种摄像头的分配方法的流程示意图;Figure 6 is a schematic flowchart of a camera allocation method provided by an embodiment of the present application;
图7为本申请实施例提供的一种摄像头的分配方法的流程示意图;Figure 7 is a schematic flow chart of a camera allocation method provided by an embodiment of the present application;
图8为本申请实施例提供的智慧屏的软件架构示意图;Figure 8 is a schematic diagram of the software architecture of the smart screen provided by the embodiment of the present application;
图9为本申请实施例提供的一种摄像头的分配方法的流程示意图;Figure 9 is a schematic flowchart of a camera allocation method provided by an embodiment of the present application;
图10为本申请实施例提供的一种摄像头的分配方法的流程示意图;Figure 10 is a schematic flow chart of a camera allocation method provided by an embodiment of the present application;
图11为本申请实施例提供的一种芯片系统的结构示意图。Figure 11 is a schematic structural diagram of a chip system provided by an embodiment of the present application.
具体实施方式Detailed ways
用户使用电子设备时,如果眼睛距离电子设备显示屏的距离过近,则容易损害用户的视力。因此,为了在用户使用电子设备时尽可能保护用户的视力,电子设备可以在使用电子设备时对用户眼睛与电子设备显示屏的距离进行监控,并在检测到用户眼睛与显示屏之间距离过近时进行提醒。When a user uses an electronic device, if the distance between the eyes and the display screen of the electronic device is too close, the user's vision may be easily damaged. Therefore, in order to protect the user's vision as much as possible when the user uses the electronic device, the electronic device can monitor the distance between the user's eyes and the display screen of the electronic device when using the electronic device, and detect that the distance between the user's eyes and the display screen has exceeded Reminder in the near future.
在如图1A所示的场景中,用户10在使用智慧屏1时,智慧屏1可以监控用户的眼睛(或者面部)与显示屏之间的距离。在一些实施例中,智慧屏1在检测到用户10的眼睛与智慧屏1的显示屏的距离过近时,可以对用户10进行提醒。示例性的,智慧屏1可以在显示屏上显示如图1B所示的提示信息11,用于提醒用户观看距离。In the scene shown in Figure 1A, when the user 10 is using the smart screen 1, the smart screen 1 can monitor the distance between the user's eyes (or face) and the display screen. In some embodiments, when the smart screen 1 detects that the distance between the user's 10 eyes and the display screen of the smart screen 1 is too close, it can remind the user 10 . For example, the smart screen 1 can display prompt information 11 as shown in Figure 1B on the display screen to remind the user of the viewing distance.
部分青少年或者儿童可能没有足够的自制力,在使用电子设备时,就容易出现眼睛距离显示屏过近的问题。目前部分电子设备已有青少年模式或者儿童模式,专用于给青少年或者儿童使用电子设备时使用。在青少年模式或者儿童模式中,提供近距离观看提醒功能,家长用户可以通过在青少年模式或者儿童模式中,打开近距离观看模式提醒功能。Some teenagers or children may not have enough self-control and may easily have their eyes too close to the display screen when using electronic devices. At present, some electronic devices have youth mode or child mode, which are specially designed for teenagers or children to use electronic devices. In youth mode or child mode, a close viewing reminder function is provided. Parents can turn on the close viewing mode reminder function in youth mode or child mode.
在一些实施例中,如图1C所示,智慧屏1在全部应用的显示界面12中可以显示智慧屏已安装的多个应用的应用图标。其中包括:媒体中心、设置、时钟、应用商城、儿童模式以及家庭相机等等应用对应的图标。在界面12中,用户可以选择儿童模式对应的图标12a,以进入儿童模式的功能设置界面,如图1D所示的智慧屏1提供的儿童模式的功能设置界面13。In some embodiments, as shown in FIG. 1C , the smart screen 1 can display application icons of multiple applications installed on the smart screen in the display interface 12 of all applications. These include: icons corresponding to applications such as media center, settings, clock, app store, child mode, and family camera. In the interface 12, the user can select the icon 12a corresponding to the child mode to enter the child mode function setting interface, such as the child mode function setting interface 13 provided by the smart screen 1 as shown in Figure 1D.
该功能设置界面13包括儿童模式的开关14,开关14用于开启或关闭儿童模式。功能设置界面13还包括近距离观看提醒功能的开关15。开关15用于开启或关闭近距离观看提醒功能。智慧屏1的近距离观看提醒功能开启后,智慧屏1即可在儿童模式下,对观看智慧屏1的用户的眼睛与智慧屏1的显示屏之间的距离进行监控。并且,在监测到用户的眼睛与智慧屏1的显示屏之间的距离过近时,发出提示信息,如图1B所示的提示信息11。The function setting interface 13 includes a child mode switch 14, and the switch 14 is used to turn on or off the child mode. The function setting interface 13 also includes a switch 15 for a close viewing reminder function. Switch 15 is used to turn on or off the close viewing reminder function. After the close viewing reminder function of smart screen 1 is turned on, smart screen 1 can monitor the distance between the eyes of the user viewing smart screen 1 and the display screen of smart screen 1 in child mode. Moreover, when it is detected that the distance between the user's eyes and the display screen of the smart screen 1 is too close, a prompt message is issued, such as prompt message 11 shown in Figure 1B.
图1D所示的功能设置界面13中还包括躺姿提醒的开关16,仅对儿童进行近距离观看和躺姿提醒的开关17,单次使用时长的设置选项18等等。其中,开关16用于开启或关闭监测用户是否处于躺姿观看智慧屏1的提醒功能,开关17用于开启或关闭是否仅对儿童进行距离和躺姿提醒的开关,设置选项18用于设置单次允许儿童使用智慧屏1的最大时长。应理解,在其他实施例中,功能设置界面13中还可以包括其他设置选项或者开关。The function setting interface 13 shown in Figure 1D also includes a switch 16 for lying down reminders, a switch 17 for only close viewing and lying down reminders for children, a single use duration setting option 18, and so on. Among them, switch 16 is used to turn on or off the reminder function that monitors whether the user is in a lying position to watch the smart screen 1, switch 17 is used to turn on or off the switch of whether to only remind children about distance and lying posture, and setting option 18 is used to set the unit. The maximum time a child is allowed to use the smart screen 1 at a time. It should be understood that in other embodiments, the function setting interface 13 may also include other setting options or switches.
在一些实施例中,用户对于儿童模式应用提供的不同功能设置之后,儿童模式应用将会保存用户对于各功能的设置情况。示例性的,用户可以在图1D所示的界面中对各功能设置为以下模式:近距离观看提醒功能打开,躺姿提醒功能打开,仅对儿童进行近距离观看提醒和躺姿提醒功能关闭,以及单次使用时长限制为30分钟。之后,每次用户打开儿童模式(打开图1D所示的开关14),都会按照以上功能设置的模式进行提醒。In some embodiments, after the user sets different functions provided by the child mode application, the child mode application will save the user's settings for each function. For example, the user can set each function to the following modes in the interface shown in Figure 1D: the close viewing reminder function is turned on, the lying posture reminder function is turned on, and the close viewing reminder function and the lying posture reminding function are turned off for children only, And the duration of single use is limited to 30 minutes. After that, every time the user turns on the child mode (turns on the switch 14 shown in Figure 1D), a reminder will be given according to the mode set by the above function.
相关技术中,为了实现近距离观看提醒这一功能,可以使用智慧屏1的摄像头来获取显示屏前方的图像,并根据图像分析是否需要提醒用户的观看距离。在用户通过对图1D所示的开关15进行操作以开启近距离观看提醒功能之后,智慧屏1可以进入如图1D所示的界面19。同时,智慧屏1可以升起隐藏的摄像头(如图1D所示的摄像头20),进而通过该摄像头采集显示屏前方的图像。In related technology, in order to realize the function of close viewing reminder, the camera of the smart screen 1 can be used to obtain the image in front of the display screen, and based on the image analysis, whether it is necessary to remind the user of the viewing distance. After the user turns on the close viewing reminder function by operating the switch 15 shown in Figure 1D, the smart screen 1 can enter the interface 19 shown in Figure 1D. At the same time, the smart screen 1 can raise a hidden camera (the camera 20 shown in Figure 1D), and then collect the image in front of the display screen through the camera.
然而,智慧屏1的摄像头通常同时只能被一个功能模块使用。在打开近距离观看提醒功能的前提下,如果有其他功能模块需要使用该摄像头,并且其他功能模块的摄像头使用优先权高于近距离观看提醒模块,此时,近距离观看提醒功能将会被迫中断。需要说明的是,在其他实施例中,上述近距离观看提醒功能也可以命名为如距离提醒功能、视力保护功能等等其他名称。However, the camera of the smart screen 1 can usually only be used by one functional module at the same time. On the premise that the close viewing reminder function is turned on, if there are other functional modules that need to use the camera, and the camera use priority of other functional modules is higher than that of the close viewing reminder module, at this time, the close viewing reminder function will be forced Interrupt. It should be noted that in other embodiments, the above-mentioned close viewing reminder function may also be named by other names such as distance reminder function, vision protection function, etc.
以其他功能模块是家庭相机为例,与近距离观看提醒模块相比,家庭相机对于摄像头的使用优先权高于近距离观看提醒模块。因此,在开启了近距离观看提醒功能的情况下,如果用户打开了家庭相机,那么摄像头将会被家庭相机占用。并且,在家庭相机使用摄像头的过程中,近距离观看提醒模块由于无法使用摄像头,因此近距离观看提醒将会被迫中断。也就是说,智慧屏无法继续对用户的眼睛与显示屏之间的距离进行监控并提醒。在一些实施例中,在摄像头被其他功能模块抢占时,智慧屏可以在显示屏上显示提示信息。Taking the other functional module as a home camera as an example, compared with the close viewing reminder module, the home camera has a higher priority for the use of the camera than the close viewing reminder module. Therefore, when the close viewing reminder function is turned on, if the user turns on the home camera, the camera will be occupied by the home camera. Moreover, when the home camera is using the camera, the close viewing reminder module cannot use the camera, so the close viewing reminder will be interrupted. In other words, the smart screen cannot continue to monitor and remind the user of the distance between the eyes and the display. In some embodiments, when the camera is preempted by other functional modules, the smart screen can display prompt information on the display screen.
在开启儿童模式的近距离观看提醒功能之后,用户可以在界面13中选择“返回”选项,以返回到如图1C所示的全部应用界面12。在一些实施例中,在开启儿童模式之后,部分应用在儿童模式下可能不支持给儿童使用。因此,用户在界面13中选择“返回”选项之后,也可以返回到仅对儿童展示的全部应用界面,其中界面12中所展示的部分应用的图标不再对儿童展示。在本申请实施例中,以儿童模式下允许使用家庭相机这一功能为例进行说明。即,用户在界面13中选择“返回”选项,返回全部应用的界面时,界面中仍展示家庭相机的图标12b。After turning on the close viewing reminder function of the child mode, the user can select the "return" option in the interface 13 to return to the entire application interface 12 as shown in Figure 1C. In some embodiments, after turning on the child mode, some applications may not be supported for use by children in the child mode. Therefore, after the user selects the "return" option in the interface 13, the user can also return to all application interfaces that are only displayed to children, where some of the application icons displayed in the interface 12 are no longer displayed to children. In the embodiment of this application, the function of allowing the use of a family camera in child mode is taken as an example for description. That is, when the user selects the "return" option in the interface 13 and returns to the interface of all applications, the icon 12b of the home camera is still displayed in the interface.
进一步的,在开启儿童模式之后,在全部应用的界面中,用户还可以选择如图1C所示的家庭相机的图标12b,以进入如图1E所示的家庭相机的界面21。在打开家庭相机,进入界面21之后,家庭相机将会抢占智慧屏的摄像头的使用权,导致近距离观看提醒模块无法使用摄像头进行近距离观看提醒。在该场景下,智慧屏1可以在显示屏上显示如图1E所示的界面的提示信息22,用于提示用户当前近距离观看提醒功能暂时无法使用。Furthermore, after turning on the child mode, the user can also select the home camera icon 12b as shown in Figure 1C in the interface of all applications to enter the home camera interface 21 as shown in Figure 1E. After opening the home camera and entering interface 21, the home camera will seize the right to use the camera of the smart screen, causing the close viewing reminder module to be unable to use the camera for close viewing reminders. In this scenario, the smart screen 1 can display the prompt information 22 of the interface as shown in Figure 1E on the display screen to remind the user that the current close viewing reminder function is temporarily unavailable.
用户可以通过在图1E所示的界面21中选择“退出”选项23,以退出家庭相机。用户退出家庭相机之后,摄像头将会被释放。此时,摄像头再次变为空闲。由于近距离观看提醒功能仍处于开启状态,因此在家庭相机退出使用摄像头之后,智慧屏应当恢复近距离观看提醒功能。但是,近距离观看提醒模块通常无法及时感知摄像头被释放。也就是说,在家庭相机退出使用摄像头之后,近距离观看提醒模块无法及时调用摄像头,即,智慧屏无法及时的恢复近距离观看提醒功能。The user can exit the home camera by selecting the "Exit" option 23 in the interface 21 shown in Figure 1E. After the user exits the home camera, the camera will be released. At this point, the camera becomes idle again. Since the close viewing reminder function is still on, the smart screen should resume the close viewing reminder function after the home camera quits using the camera. However, the close viewing reminder module usually cannot detect the release of the camera in time. In other words, after the home camera quits using the camera, the close viewing reminder module cannot call the camera in time, that is, the smart screen cannot restore the close viewing reminder function in time.
在图1E所示的家庭相机的界面中还包括家庭相机提供的功能选项“拍摄”选项24,“录像”选项25,以及“图库”选项26。其中,“拍摄”选项24用于用户使用家庭相机拍摄图像;“录像”选项25用于用户使用家庭相机录制视频;“图库”选项26用于用户查看使用家庭相机拍摄的图像和视频等。用户通过“拍摄”选项24或“录像”选项25使用家庭相机拍摄图像或录制视频,以及用户使用“图库”选项26查看图像的具体操作过程,可以参照相关技术中的描述,在本申请实施例中不予赘述。应理解,在其他实施例中,家庭相机的功能界面还可以包括其他功能选项。The interface of the home camera shown in FIG. 1E also includes the function options "shooting" option 24, "video recording" option 25, and "gallery" option 26 provided by the home camera. Among them, the "shooting" option 24 is used for the user to capture images using the home camera; the "video recording" option 25 is used for the user to record videos using the home camera; and the "gallery" option 26 is used for the user to view images and videos captured using the home camera, etc. The user can use the "shooting" option 24 or the "video" option 25 to capture images or record videos using a home camera, and the specific operation process of the user using the "gallery" option 26 to view images can be referred to the description in the related art. In the embodiments of the present application No further details will be given. It should be understood that in other embodiments, the functional interface of the home camera may also include other functional options.
基于此,本申请实施例提供一种摄像头的分配方法,在第一功能模块对应的第一功能处于开启的状态,并且当前摄像头被分配给第二功能模块的前提下,在检测到针对第二功能模块的第一操作之后,智慧屏响应于第一操作,将摄像头从第二功能模块释放。然后,由于第一功能处于开启的状态,智慧屏将摄像头分配给第一功能模块,以使第一功能模块使用摄像头实现第一功能。这样,只要第一功能处于开启的状态,则智慧屏可以在其他功能模块退出使用摄像头(即释放摄像头)之后,将摄像头分配给第一功能模块。从而使第一功能模块可以及时的调用摄像头,实现第一功能。Based on this, embodiments of the present application provide a camera allocation method. On the premise that the first function corresponding to the first functional module is in an open state and the current camera is allocated to the second functional module, when a target for the second functional module is detected. After the first operation of the functional module, the smart screen releases the camera from the second functional module in response to the first operation. Then, since the first function is turned on, the smart screen assigns the camera to the first functional module, so that the first functional module uses the camera to implement the first function. In this way, as long as the first function is turned on, the smart screen can allocate the camera to the first functional module after other functional modules quit using the camera (that is, release the camera). Thus, the first functional module can call the camera in time to realize the first function.
示例性的,第一功能模块具体可以是上述近距离观看提醒模块或者其他需要实时感知摄像头是否可用的功能模块,第二功能模块具体可以是上述家庭相机功能模块、视频通话功能模块或者其他需要使用摄像头实现对应功能的模块。在一些实施例中,第二功能模块对于摄像头的使用优先权高于第一功能模块。第一功能模块启动之后可以在电子设备的后台常驻。For example, the first functional module may be the above-mentioned close viewing reminder module or other functional modules that need to sense whether the camera is available in real time. The second functional module may be the above-mentioned home camera functional module, video call functional module or other functional modules that need to be used. The camera implements the corresponding function module. In some embodiments, the second functional module has a higher priority for using the camera than the first functional module. After being started, the first functional module can reside in the background of the electronic device.
在一些实施例中,上述方法可以应用于包括摄像头的电子设备。示例性的,电子设备可以是手机、平板电脑、个人计算机(personal computer,PC)、智慧屏、桌面型、膝上型、手持计算机、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、智能手表等穿戴设备、人工智能(artificial intelligence,AI)音箱以及车载设备,也可以是各种教学辅助工具(例如学习机、早教机)、智能玩具、便携式机器人、个人数字助理(personal digital assistant,PDA)、增强现实(augmented reality,AR)\虚拟现实(virtual reality,VR)设备、媒体播放器等设备,还可以是具有移动办公功能的设备、具有智能家居功能的设备、具有影音娱乐功能的设备、支持智能出行的设备等。本申请实施例对该设备的具体形态不作特殊限制。In some embodiments, the above method may be applied to an electronic device including a camera. For example, the electronic device may be a mobile phone, a tablet computer, a personal computer (PC), a smart screen, a desktop, a laptop, a handheld computer, a notebook computer, or an ultra-mobile personal computer (UMPC). ), netbooks, smart watches and other wearable devices, artificial intelligence (AI) speakers and vehicle-mounted equipment, or various teaching aids (such as learning machines, early childhood education machines), smart toys, portable robots, personal digital assistants ( Personal digital assistant (PDA), augmented reality (AR)\virtual reality (VR) equipment, media player and other equipment, it can also be a device with mobile office function, a device with smart home function, a device with Equipment with audio-visual entertainment functions, equipment supporting smart travel, etc. The embodiments of the present application do not place any special restrictions on the specific form of the device.
如图2A所示为本申请一实施例提供的电子设备100的结构示意图。电子设备100可以包括处理器110,外部存储器接口120,内部存储器130,电源模块140,通信接口150,无线通信模块160,音频模块170,显示屏180,摄像头190,以及按键191等。FIG. 2A is a schematic structural diagram of an electronic device 100 provided by an embodiment of the present application. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 130, a power module 140, a communication interface 150, a wireless communication module 160, an audio module 170, a display screen 180, a camera 190, a button 191, and the like.
示例性的,电子设备100可以是上述智慧屏1。可以理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。By way of example, the electronic device 100 may be the above-mentioned smart screen 1 . It can be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100 . In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figures, or some components may be combined, some components may be separated, or some components may be arranged differently. The components illustrated may be implemented in hardware, software, or a combination of software and hardware.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processingunit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。例如,处理器110用于执行本申请实施例中的摄像头的分配方法。The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (GPU), an image signal processor ( image signal processor (ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU), etc. . Among them, different processing units can be independent devices or integrated in one or more processors. For example, the processor 110 is configured to execute the camera allocation method in the embodiment of the present application.
其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller may be the nerve center and command center of the electronic device 100 . The controller can generate operation control signals based on the instruction operation code and timing signals to complete the control of fetching and executing instructions.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in processor 110 is cache memory. This memory may hold instructions or data that have been recently used or recycled by processor 110 . If the processor 110 needs to use the instructions or data again, it can be called directly from the memory. Repeated access is avoided and the waiting time of the processor 110 is reduced, thus improving the efficiency of the system.
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100 . The external memory card communicates with the processor 110 through the external memory interface 120 to implement the data storage function. Such as saving music, videos, etc. files in external memory card.
内部存储器130可以用于存储计算机可执行程序代码,可执行程序代码包括指令。处理器110通过运行存储在内部存储器130的指令,从而执行电子设备100的各种功能应用以及数据处理。内部存储器130可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)。Internal memory 130 may be used to store computer executable program code, which includes instructions. The processor 110 executes instructions stored in the internal memory 130 to execute various functional applications and data processing of the electronic device 100 . The internal memory 130 may include a program storage area and a data storage area. Among them, the stored program area can store the operating system and at least one application program required for a function (such as a sound playback function, an image playback function, etc.).
此外,内部存储器130可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。In addition, the internal memory 130 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
电源模块140,可以用于接收电源输入,并为处理器110、内部存储器130、无线通信模块160、显示屏180和摄像头190等供电。在一些实施例中,电源模块140也可以设置于处理器110中。The power module 140 can be used to receive power input and provide power to the processor 110, the internal memory 130, the wireless communication module 160, the display screen 180, the camera 190, etc. In some embodiments, the power module 140 may also be disposed in the processor 110 .
通信接口150,可以用于与控制设备、机顶盒、路由器和U盘等外部设备通讯。通信接口150可以为网口或通用串行总线(universal serial bus,USB)接口等任意可能的接口。The communication interface 150 can be used to communicate with external devices such as control equipment, set-top boxes, routers, and USB flash drives. The communication interface 150 can be a network port or a universal serial bus (universal serial bus, USB) interface or any other possible interface.
USB接口是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。The USB interface is an interface that complies with the USB standard specifications. It can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc.
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wirelesslocal area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线转为电磁波辐射出去。The wireless communication module 160 can provide applications on the electronic device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), Bluetooth (bluetooth, BT), and global navigation satellite system. (global navigation satellite system, GNSS), frequency modulation (FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves through the antenna, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 . The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves through the antenna for radiation.
电子设备100可以通过音频模块170,以及应用处理器等实现音频功能。例如音乐播放,录音等。The electronic device 100 can implement audio functions through the audio module 170, an application processor, and the like. Such as music playback, recording, etc.
音频模块170用于将数字音频信号转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。音频模块170可以包括扬声器170A和麦克风170B。The audio module 170 is used to convert digital audio signals into analog audio signal outputs, and is also used to convert analog audio inputs into digital audio signals. Audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be provided in the processor 110 , or some functional modules of the audio module 170 may be provided in the processor 110 . Audio module 170 may include speaker 170A and microphone 170B.
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备100可以通过扬声器170A收听音乐,或进行视频会议等。Speaker 170A, also called "speaker", is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music through the speaker 170A, or conduct video conferencing, etc.
麦克风170B,也称“话筒”,用于将声音信号转换为电信号。当视频通话、视频会议或使用语音助手时,用户可以通过人嘴靠近麦克风170B发声,将声音信号输入到麦克风170B。电子设备100可以设置至少一个麦克风170B。在另一些实施例中,电子设备100可以设置两个麦克风170B,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,电子设备100还可以设置三个,四个或更多麦克风170B,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。Microphone 170B, also called a "microphone", is used to convert sound signals into electrical signals. When making a video call, video conference, or using a voice assistant, the user can speak by approaching the microphone 170B with the human mouth and input the sound signal to the microphone 170B. The electronic device 100 may be provided with at least one microphone 170B. In other embodiments, the electronic device 100 may be provided with two microphones 170B, which in addition to collecting sound signals, may also implement a noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170B to collect sound signals, reduce noise, identify sound sources, and implement directional recording functions, etc.
显示屏180用于显示图像,视频等。电子设备100通过GPU,显示屏180,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏180和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The display screen 180 is used to display images, videos, etc. The electronic device 100 implements display functions through a GPU, a display screen 180, an application processor, and the like. The GPU is an image processing microprocessor and is connected to the display screen 180 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
摄像头190用于捕获静态图像或视频。在一些实施例中,电子设备100可以包括1个或N个摄像头190,N为大于1的正整数。在一些实施例中,摄像头190可以为升降式摄像头。通常,升降式摄像头隐藏在电子设备100的内部,对用户不可见。当用户使用电子设备100与其他用户进行视频通话或视频会议时,升降式摄像头可以从电子设备100的顶部弹出,从而升降式摄像头可以采集用户图像,并通过无线通信模块160和天线等将用户图像发送至其他用户的设备。在另一些实施例中,摄像头190也可以是嵌入设置在电子设备100的显示屏内部。Camera 190 is used to capture still images or video. In some embodiments, the electronic device 100 may include 1 or N cameras 190, where N is a positive integer greater than 1. In some embodiments, the camera 190 may be a lifting camera. Usually, the pop-up camera is hidden inside the electronic device 100 and is not visible to the user. When the user uses the electronic device 100 to conduct a video call or video conference with other users, the lifting camera can pop up from the top of the electronic device 100 so that the lifting camera can collect the user's image and transmit the user's image through the wireless communication module 160 and the antenna. Sent to other users' devices. In other embodiments, the camera 190 may also be embedded inside the display screen of the electronic device 100 .
按键191包括开机键,音量键以及设置键等。按键191可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。The buttons 191 include a power button, a volume button, a setting button, etc. The key 191 may be a mechanical key. It can also be a touch button. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100 .
以下实施例中的摄像头的分配方法均可以在具备上述硬件结构的电子设备100中实现。The camera allocation methods in the following embodiments can be implemented in the electronic device 100 having the above hardware structure.
图2B是本申请实施例的电子设备100的软件结构框图。FIG. 2B is a software structure block diagram of the electronic device 100 according to the embodiment of the present application.
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为五层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime,ART)和原生C/C++库,硬件抽象层(HardwareAbstract Layer,HAL)以及内核层。The layered architecture divides the software into several layers, and each layer has clear roles and division of labor. The layers communicate through software interfaces. In some embodiments, the Android system is divided into five layers, from top to bottom: application layer, application framework layer, Android runtime (Android runtime, ART) and native C/C++ library, hardware abstraction layer (HardwareAbstract) Layer, HAL) and kernel layer.
应用程序层可以包括一系列应用程序包。The application layer can include a series of application packages.
如图2B所示,应用程序包可以包括媒体中心、设置、时钟、应用商城、二通模式、家庭相机、第一功能模块以及第二功能模块等应用程序。As shown in FIG. 2B , the application package may include applications such as media center, settings, clock, application mall, two-way mode, home camera, first functional module, and second functional module.
应用程序框架层为应用程序层的应用程序提供应用编程接口(applicationprogramming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.
如图2B所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,资源管理器,通知管理器,活动管理器,输入管理器等。As shown in Figure 2B, the application framework layer can include a window manager, content provider, view system, resource manager, notification manager, activity manager, input manager, etc.
窗口管理器提供窗口管理服务(Window Manager Service,WMS),WMS可以用于窗口管理、窗口动画管理、surface管理以及作为输入系统的中转站。The window manager provides window management service (Window Manager Service, WMS). WMS can be used for window management, window animation management, surface management, and as a transfer station for the input system.
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。该数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。Content providers are used to store and retrieve data and make this data accessible to applications. This data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。The view system includes visual controls, such as controls that display text, controls that display pictures, etc. A view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface including a text message notification icon may include a view for displaying text and a view for displaying pictures.
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。The resource manager provides various resources to applications, such as localized strings, icons, pictures, layout files, video files, etc.
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。The notification manager allows applications to display notification information in the status bar, which can be used to convey notification-type messages and can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be notifications that appear in the status bar at the top of the system in the form of charts or scroll bar text, such as notifications for applications running in the background, or notifications that appear on the screen in the form of conversation windows. For example, text information is prompted in the status bar, a beep sounds, the electronic device vibrates, the indicator light flashes, etc.
活动管理器可以提供活动管理服务(Activity Manager Service,AMS),AMS可以用于系统组件(例如活动、服务、内容提供者、广播接收器)的启动、切换、调度以及应用进程的管理和调度工作。The Activity Manager can provide Activity Management Service (AMS), which can be used for the startup, switching, and scheduling of system components (such as activities, services, content providers, and broadcast receivers) as well as the management and scheduling of application processes. .
输入管理器可以提供输入管理服务(Input Manager Service,IMS),IMS可以用于管理系统的输入,例如触摸屏输入、按键输入、传感器输入等。IMS从输入设备节点取出事件,通过和WMS的交互,将事件分配至合适的窗口。The input manager can provide input management service (Input Manager Service, IMS), and IMS can be used to manage system input, such as touch screen input, key input, sensor input, etc. IMS takes out events from the input device node and distributes the events to appropriate windows through interaction with WMS.
安卓运行时包括核心库和安卓运行时。安卓运行时负责将源代码转换为机器码。安卓运行时主要包括采用提前(ahead or time,AOT)编译技术和及时(just in time,JIT)编译技术。The Android runtime includes core libraries and Android runtime. The Android runtime is responsible for converting source code into machine code. The Android runtime mainly includes the use of ahead of time (AOT) compilation technology and just in time (JIT) compilation technology.
核心库主要用于提供基本的Java类库的功能,例如基础数据结构、数学、IO、工具、数据库、网络等库。核心库为用户进行安卓应用开发提供了API。The core library is mainly used to provide basic Java class library functions, such as basic data structures, mathematics, IO, tools, databases, networks and other libraries. The core library provides APIs for users to develop Android applications.
原生C/C++库可以包括多个功能模块。例如:表面管理器(surface manager),媒体框架(Media Framework),libc,OpenGL ES、SQLite、Webkit等。Native C/C++ libraries can include multiple function modules. For example: surface manager, media framework, libc, OpenGL ES, SQLite, Webkit, etc.
其中,表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。媒体框架支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。OpenGL ES提供应用程序中2D图形和3D图形的绘制和操作。SQLite为电子设备100的应用程序提供轻量级关系型数据库。Among them, the surface manager is used to manage the display subsystem and provides the integration of 2D and 3D layers for multiple applications. The media framework supports a variety of commonly used audio and video formats for playback and recording, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. OpenGL ES provides the drawing and manipulation of 2D graphics and 3D graphics in applications. SQLite provides a lightweight relational database for electronic device 100 applications.
硬件抽象层运行于用户空间(user space),对内核层驱动进行封装,向上层提供调用接口。硬件抽象层可以包括显示模块、音频模块、摄像头模块(camera HAL)以及蓝牙模块。The hardware abstraction layer runs in user space, encapsulates the kernel layer driver, and provides a calling interface to the upper layer. The hardware abstraction layer can include a display module, an audio module, a camera module (camera HAL), and a Bluetooth module.
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
在本申请实施例中,儿童模式、家庭相机等应用需要使用摄像头时,可以通过framework层的摄像头服务模块(camera server)调用HAL层的摄像头模块(camera HAL),再由camera HAL调用摄像头硬件(camera hardware)来实现。进一步的,camera HAL调用内核层的摄像头驱动,以驱动摄像头为应用提供对应的功能服务。In the embodiment of this application, when applications such as child mode and home cameras need to use the camera, the camera module of the HAL layer (camera HAL) can be called through the camera service module (camera server) of the framework layer, and then the camera HAL calls the camera hardware ( camera hardware) to achieve. Further, the camera HAL calls the camera driver at the kernel layer to drive the camera to provide corresponding functional services for the application.
本申请实施例提出的摄像头的分配方法,具体可以应用于需要使用摄像头实现的第一功能模块启动之后,由于摄像头被其他摄像头使用优先权更高的第二功能模块抢占使用,而导致第一功能模块使用摄像头实现的功能被迫中断的场景。在该场景下,如果第二功能模块退出使用摄像头,则表示摄像头被释放,回到空闲的状态。在本申请实施例提供的摄像头的分配方法中,在检测到第二功能模块退出使用摄像头的情况下,可以向第一功能模块发送第一通知消息,以通知第一功能模块摄像头被释放。这样,可以使第一功能模块及时感知到摄像头被释放,然后重新调用摄像头,以及时恢复第一功能模块使用摄像头实现的功能。The camera allocation method proposed in the embodiment of the present application can be specifically applied to the fact that after the first functional module that needs to be implemented using a camera is started, the camera is preempted by a second functional module with a higher priority for use by other cameras, resulting in the first function being lost. Scenarios where the functions implemented by the module using the camera are forced to be interrupted. In this scenario, if the second function module quits using the camera, it means that the camera is released and returns to the idle state. In the camera allocation method provided by the embodiment of the present application, when it is detected that the second functional module quits using the camera, a first notification message can be sent to the first functional module to notify the first functional module that the camera is released. In this way, the first functional module can promptly sense that the camera is released, and then re-call the camera to promptly restore the functions implemented by the first functional module using the camera.
以第一功能模块是近距离观看提醒模块,近距离观看提醒模块调用摄像头实现近距离观看提醒功能为例,对近距离观看提醒模块调用摄像头的具体过程进行介绍。近距离观看提醒模块可以是儿童模式应用中的一个功能模块。或者,近距离观看提醒模块也可以是一个独立的应用。如图3所示,为本申请一些实施例中近距离观看提醒模块调用摄像头的具体实现过程。Taking the first functional module as a close viewing reminder module and the close viewing reminder module calling the camera to implement the close viewing reminder function as an example, the specific process of the close viewing reminder module calling the camera will be introduced. The close viewing reminder module can be a functional module in the child mode application. Alternatively, the close viewing reminder module can also be a standalone application. As shown in Figure 3, it is the specific implementation process of calling the camera by the close viewing reminder module in some embodiments of the present application.
响应于对近距离观看提醒功能的打开操作,近距离观看提醒模块向摄像头功能模块发送摄像头调用指令。In response to the opening operation of the close viewing reminder function, the close viewing reminder module sends a camera calling instruction to the camera function module.
其中,摄像头功能模块可以包括framework层的camera server模块和HAL层的camera HAL模块。Among them, the camera function module may include a camera server module in the framework layer and a camera HAL module in the HAL layer.
摄像头服务模块响应于摄像头调用指令,启动摄像头。并且,响应于该摄像头调用指令,摄像头功能模块还会将摄像头分配给近距离观看提醒模块。The camera service module responds to the camera calling instruction and starts the camera. Moreover, in response to the camera calling instruction, the camera function module will also assign the camera to the close viewing reminder module.
需要说明的是,摄像头被分配给近距离观看提醒模块之后,近距离观看提醒模块可以对摄像头进行控制,并与摄像头进行图像传输。It should be noted that after the camera is assigned to the close viewing reminder module, the close viewing reminder module can control the camera and transmit images with the camera.
摄像头采集图像。摄像头向摄像头功能模块发送图像。之后,摄像头功能模块向近距离观看提醒模块发送摄像头采集的图像。The camera collects images. The camera sends images to the camera function module. Afterwards, the camera function module sends the image collected by the camera to the close viewing reminder module.
近距离观看提醒模块对图像进行分析。近距离观看提醒模块根据分析结果确定是否需要提醒用户注意观看距离。The Close View Alert module analyzes the image. The close viewing reminder module determines whether it is necessary to remind the user to pay attention to the viewing distance based on the analysis results.
对用户进行近距离观看提醒,主要是对用户的眼睛与显示屏之间的距离进行监控,并在用户的眼睛与显示屏之间的距离过近时,提醒用户注意观看距离。因此,在一些实施例中,具体可以检测用户的眼睛与显示屏之间的距离是否小于预设距离,决定是否需要对用户的观看距离进行提醒。进一步的,如果检测到用户的眼睛与显示屏之间的距离小于预设距离,智慧屏可以对用户进行近距离观看提醒。其中,分析图像确定用户的眼睛与显示屏之间的距离,具体可以通过图像分析等算法、相关的神经网络模型等实现,其具体实现过程,可以参照相关技术中的介绍,在本申请实施例中不予赘述。Providing users with close viewing reminders mainly monitors the distance between the user's eyes and the display screen, and reminds the user to pay attention to the viewing distance when the distance between the user's eyes and the display screen is too close. Therefore, in some embodiments, it may be specifically detected whether the distance between the user's eyes and the display screen is less than a preset distance, and whether it is necessary to remind the user of the viewing distance. Furthermore, if it is detected that the distance between the user's eyes and the display screen is less than the preset distance, the smart screen can remind the user to watch at a close distance. Among them, analyzing the image to determine the distance between the user's eyes and the display screen can be implemented specifically through image analysis and other algorithms, related neural network models, etc. The specific implementation process can be referred to the introduction in related technologies. In the embodiments of this application No further details will be given.
智慧屏的摄像头通常设置在智慧屏的显示屏附近,如图1D所示的摄像头20设置在智慧屏的显示屏的上方,为隐藏式的升降摄像头。那么,如果用户的眼睛与显示屏的距离越近,在通过摄像头采集的图像中,用户的眼睛在图像中所采集的图像中的占比越大。相反,如果用户的眼睛与显示屏的距离越远,那么用户的眼睛在摄像头所采集的图像中的占比越小。因此,在另一些实施例中,近距离观看提醒模块也可以检测用户的眼睛在摄像头所采集的图像中的占比是否大于预设占比,来决定是否需要对用户的观看距离进行提醒。进一步的,如果确定用户的眼睛在摄像头所采集的图像中的占比大于预设占比,智慧屏可以对用户进行近距离观看提醒。The camera of the smart screen is usually set near the display screen of the smart screen. The camera 20 shown in Figure 1D is set above the display screen of the smart screen and is a hidden lifting camera. Then, if the distance between the user's eyes and the display screen is closer, the user's eyes will account for a larger proportion of the images collected by the camera. On the contrary, if the distance between the user's eyes and the display screen is farther, the user's eyes will account for a smaller proportion of the image captured by the camera. Therefore, in other embodiments, the close viewing reminder module can also detect whether the proportion of the user's eyes in the image collected by the camera is greater than the preset proportion to determine whether it is necessary to remind the user of the viewing distance. Furthermore, if it is determined that the proportion of the user's eyes in the image collected by the camera is greater than the preset proportion, the smart screen can remind the user of close viewing.
应理解,上述实施例中的预设距离、预设占比均可以根据实际情况设置为任意合适的数值,在本申请实施例中不予限定。在其他实施例中,智慧屏也可以通过其他方式分析摄像头所采集的图像,并根据分析结果决定是否需要对用户的观看距离进行提醒。It should be understood that the preset distance and the preset proportion in the above embodiments can be set to any appropriate value according to the actual situation, and are not limited in the embodiments of the present application. In other embodiments, the smart screen can also analyze the images collected by the camera in other ways, and determine whether it is necessary to remind the user of the viewing distance based on the analysis results.
如果根据分析结果确定需要进行提醒,则近距离观看提醒模块发出提示信息。如果根据分析结果确定不需要进行提醒,可以继续接收新的图像进行分析,并判断是否需要进行提醒。If it is determined that a reminder is needed based on the analysis results, the close viewing reminder module will issue a prompt message. If it is determined based on the analysis results that no reminder is needed, you can continue to receive new images for analysis and determine whether a reminder is needed.
以下对本申请实施例中可能涉及的技术名词进行简单说明。The technical terms that may be involved in the embodiments of this application are briefly described below.
硬件抽象层接口定义语言,(HAL interface definition language,HIDL),是Android framework与Android HAL之间的接口。HIDL旨在用于进程间的通信。Hardware abstraction layer interface definition language (HAL interface definition language, HIDL) is the interface between the Android framework and Android HAL. HIDL is intended for inter-process communication.
以下将结合附图对本申请实施例提供的摄像头的分配方法进行详细说明。请参照图4A,为本申请实施例提供的摄像头的分配方法的流程示意图。在该实施例中,以电子设备是智慧屏,第一功能模块是近距离观看提醒模块,第二功能模块是家庭相机功能模块为例进行说明。应理解,在其他实施例中,第一功能模块和第二功能模块还可以是其他功能模块。该方法包括S201-S210,其中:The camera allocation method provided by the embodiment of the present application will be described in detail below with reference to the accompanying drawings. Please refer to FIG. 4A , which is a schematic flow chart of a camera allocation method provided by an embodiment of the present application. In this embodiment, the electronic device is a smart screen, the first functional module is a close viewing reminder module, and the second functional module is a home camera functional module. It should be understood that in other embodiments, the first functional module and the second functional module may also be other functional modules. The method includes S201-S210, where:
S201.智慧屏启动。S201. The smart screen starts.
S202.智慧屏获取针对近距离观看提醒模块的启动操作。S202. The smart screen obtains the startup operation of the close viewing reminder module.
在一些实施例中,S202具体可以是用户针对近距离观看提醒模块执行启动操作。在一些实施例中,近距离观看提醒模块可以是儿童模式的一个功能。示例性的,用户可以在图1D所示的界面中打开开关15,以启动近距离观看提醒功能。In some embodiments, S202 may be that the user performs a startup operation for the close viewing reminder module. In some embodiments, the close viewing reminder module may be a feature of Kids Mode. For example, the user can turn on the switch 15 in the interface shown in FIG. 1D to activate the close viewing reminder function.
S203.响应于针对近距离观看提醒模块的启动操作,智慧屏启动近距离观看提醒功能。S203. In response to the startup operation of the close viewing reminder module, the smart screen activates the close viewing reminder function.
S204.智慧屏将摄像头分配给近距离观看提醒模块。S204. The smart screen assigns the camera to the close viewing reminder module.
S205.智慧屏获取针对家庭相机功能模块的启动操作。S205. The smart screen obtains the startup operation for the home camera function module.
在一些实施例中,家庭相机功能模块可以在启动之后调用摄像头。因此,智慧屏可以在获取到针对家庭相机功能模块的启动操作之后,启动家庭相机功能模块。之后,为了实现家庭相机的功能,家庭相机功能模块将会发送摄像头的摄像头调用指令。In some embodiments, the home camera function module may invoke the camera after startup. Therefore, the smart screen can start the home camera function module after obtaining the startup operation for the home camera function module. Afterwards, in order to realize the function of the home camera, the home camera function module will send the camera calling instruction of the camera.
S206.响应于针对家庭相机功能模块的启动操作,将摄像头从近距离观看提醒模块释放。S206. In response to the startup operation of the home camera function module, release the camera from the close viewing reminder module.
S207.智慧屏将摄像头分配给家庭相机功能模块。S207. The smart screen assigns the camera to the home camera function module.
智慧屏将摄像头分配给家庭相机功能模块之后,家庭相机的相关功能即可使用。After the smart screen assigns the camera to the home camera function module, the related functions of the home camera can be used.
S208.智慧屏接收针对家庭相机功能模块的退出操作。S208. The smart screen receives the exit operation for the home camera function module.
需要说明的是,上述针对近距离观看提醒模块的启动操作,以及针对家庭相机功能模块的启动操作和退出操作,也可以以其他名称命名。示例性的,针对家庭相机功能模块的退出操作可以命名为第一操作,针对家庭相机功能模块的启动操作可以命名为第二操作,以及,针对近距离观看提醒模块的启动操作可以命名为第三操作,等等。It should be noted that the above-mentioned startup operation for the close viewing reminder module and the startup operation and exit operation for the home camera function module can also be named by other names. For example, the exit operation for the home camera function module may be named the first operation, the start operation for the home camera function module may be named the second operation, and the start operation for the close viewing reminder module may be named the third operation. Operation, etc.
S209.响应于针对家庭相机功能模块的退出操作,智慧屏将摄像头从家庭相机功能模块释放。S209. In response to the exit operation of the home camera function module, the smart screen releases the camera from the home camera function module.
由于近距离观看提醒功能仍处于开启状态,因此,摄像头从家庭相机功能模块释放之后,智慧屏可以再重新将摄像头分配给近距离观看提醒模块,如S210。Since the close viewing reminder function is still on, after the camera is released from the home camera function module, the smart screen can reassign the camera to the close viewing reminder module, such as the S210.
S210.智慧屏将摄像头分配给近距离观看提醒模块。S210. The smart screen assigns the camera to the close viewing reminder module.
可以理解的,在S210之后,近距离观看提醒模块可以获取摄像头采集的图像,并基于该图像分析是否需要提醒用户观看距离。具体的,近距离观看提醒模块在分析图像确定用户的观看距离过近时,向用户发出提醒信息。It is understandable that after S210, the close viewing reminder module can obtain the image collected by the camera, and analyze whether it is necessary to remind the user of the viewing distance based on the image. Specifically, the close viewing reminder module sends a reminder message to the user when analyzing the image to determine that the user's viewing distance is too close.
在一些实施例中,上述S210具体可以是智慧屏先向近距离观看提醒模块发送摄像头被释放的通知消息,然后再由近距离观看提醒模块基于通知消息对摄像头发起摄像头调用指令。由于当前摄像头已被释放,处于空闲状态,因此响应于该近距离观看提醒模块发送的摄像头调用指令,智慧屏可以将摄像头分配给近距离观看提醒模块。需要说明的是,为了区分不同时刻,不同功能模块发送的摄像头调用指令,可以用“第一”、“第二”来区分不同的摄像头调用指令。示例性的,上述近距离观看提醒模块基于通知消息发送的摄像头调用指令可以命名为第一摄像头调用指令。In some embodiments, the above-mentioned S210 may be that the smart screen first sends a notification message that the camera is released to the close viewing reminder module, and then the close viewing reminder module initiates a camera calling instruction to the camera based on the notification message. Since the current camera has been released and is in an idle state, in response to the camera calling instruction sent by the close viewing reminder module, the smart screen can assign the camera to the close viewing reminder module. It should be noted that in order to distinguish the camera calling instructions sent by different functional modules at different times, "first" and "second" can be used to distinguish different camera calling instructions. For example, the camera calling instruction sent by the close viewing reminder module based on the notification message may be named the first camera calling instruction.
进一步的,在一些实施例中,智慧屏在摄像头被释放之后向近距离观看提醒模块发送通知消息,可以通过调用摄像头释放回调函数实现。可以理解的,在智慧屏调用摄像头释放回调函数向近距离观看提醒模块发送通知消息之前,近距离观看提醒模块需要先注册摄像头释放回调函数。该摄像头释放回调函数是用于在摄像头被释放之后调用,并且调用摄像头释放回调函数之后,可以触发向注册了摄像头释放回调函数的功能模块发送通知消息。Further, in some embodiments, the smart screen sends a notification message to the close viewing reminder module after the camera is released, which can be implemented by calling the camera release callback function. It is understandable that before the smart screen calls the camera release callback function to send a notification message to the close viewing reminder module, the close viewing reminder module needs to register the camera release callback function first. The camera release callback function is used to be called after the camera is released, and after calling the camera release callback function, it can trigger sending a notification message to the function module registered with the camera release callback function.
近距离观看提醒模块注册了摄像头释放回调函数,即可在摄像头被占用的时候,等待智慧屏调用摄像头释放回调函数以获得摄像头被释放的通知消息。并且,近距离观看提醒模块在接收到摄像头被释放的通知消息之后,可以调用摄像头。在一些实施例中,近距离观看提醒模块可以在启动近距离观看提醒功能的同时,注册摄像头释放回调函数。这样,如果近距离观看提醒模块在使用摄像头的过程中,摄像头的使用权被其他功能模块抢占,也可以在其他功能模块释放摄像头之后,获取智慧屏通过调用摄像头释放回调函数发送的摄像头被释放的消息。The close viewing reminder module has registered the camera release callback function. When the camera is occupied, it waits for the smart screen to call the camera release callback function to obtain the notification message that the camera is released. Moreover, the close viewing reminder module can call the camera after receiving the notification message that the camera is released. In some embodiments, the close viewing reminder module can register the camera release callback function while activating the close viewing reminder function. In this way, if the close viewing reminder module uses the camera and the right to use the camera is preempted by other functional modules, it can also obtain the released camera information sent by the smart screen by calling the camera release callback function after other functional modules release the camera. information.
即,在一些实施例中,在上述S202之后,上述方法还包括:近距离观看提醒模块发起对摄像头释放回调函数的注册请求。响应于该注册请求,智慧屏可以添加近距离观看提醒模块注册摄像头释放回调函数的注册记录。之后,只要检测到摄像头被释放(如上述S209)之后,智慧屏即可调用摄像头释放回调函数,并基于注册记录向注册了该摄像头释放回调函数(近距离观看提醒模块)发送摄像头被释放的通知消息。That is, in some embodiments, after the above S202, the above method further includes: the close viewing reminder module initiates a registration request for the camera release callback function. In response to the registration request, the smart screen can add the close viewing reminder module to register the registration record of the camera release callback function. After that, as long as it detects that the camera is released (such as S209 above), the smart screen can call the camera release callback function and send a notification that the camera is released to the registered camera release callback function (close viewing reminder module) based on the registration record. information.
在另一些实施例中,近距离观看提醒模块也可以在摄像头使用权被其他功能模块抢占之后,再注册上述摄像头释放回调函数。即,在一些实施例中,在上述S206之后,上述方法还包括:近距离观看提醒模块发起对摄像头释放回调函数的注册请求。同样的,响应于该注册请求,智慧屏可以添加近距离观看提醒模块对摄像头释放回调函数的注册记录。这样,在上述S209之后,智慧屏也可以调用摄像头释放回调函数,并基于注册记录向注册了该摄像头释放回调函数(近距离观看提醒模块)发送摄像头被释放的通知消息。In other embodiments, the close viewing reminder module can also register the above-mentioned camera release callback function after the right to use the camera is preempted by other functional modules. That is, in some embodiments, after the above S206, the above method further includes: the close viewing reminder module initiates a registration request for the camera release callback function. Similarly, in response to the registration request, the smart screen can add a registration record of the close viewing reminder module to the camera release callback function. In this way, after the above S209, the smart screen can also call the camera release callback function, and send a notification message that the camera is released to the registered camera release callback function (close viewing reminder module) based on the registration record.
在本申请实施例提供的技术方案中,近距离观看提醒模块在启动的同时,或者在摄像头使用权被其他功能模块抢占的时候注册摄像头释放回调函数,近距离观看提醒模块都可以在摄像头被其他功能模块(如家庭相机功能模块)释放之后,及时的感知到智慧屏通过调用摄像头释放回调函数发送的通知消息。这样,便于近距离观看提醒模块及时的重新请求调用摄像头,以便智慧屏重新将摄像头分配给近距离观看提醒模块。In the technical solution provided by the embodiment of this application, the close viewing reminder module registers the camera release callback function when the camera usage right is preempted by other functional modules. The close viewing reminder module can also register the camera release callback function when the camera is used by other functional modules. After the function module (such as the home camera function module) is released, the notification message sent by the smart screen by calling the camera release callback function is promptly perceived. In this way, it is convenient for the close viewing reminder module to re-request to call the camera in time, so that the smart screen can reassign the camera to the close viewing reminder module.
在本申请实施例提供的技术方案中,在近距离观看提醒功能开启的情况下,如果摄像头被分配给家庭相机或其他功能模块,则在家庭相机或者其他功能模块释放摄像头之后,智慧屏将会重新将摄像头分配给近距离观看提醒模块。这样,可以使近距离观看提醒模块可以在摄像头被释放之后及时的重新获得摄像头的使用权,以便实现近距离观看提醒功能。同时,在摄像头被其他功能模块占用的情况下,近距离观看提醒模块不需要持续尝试打开摄像头,可以避免cpu资源的浪费。In the technical solution provided by the embodiment of this application, when the close viewing reminder function is turned on, if the camera is assigned to a home camera or other functional module, after the home camera or other functional module releases the camera, the smart screen will Reassign the camera to the close view reminder module. In this way, the close viewing reminder module can promptly regain the right to use the camera after the camera is released, so as to realize the close viewing reminder function. At the same time, when the camera is occupied by other functional modules, the close viewing reminder module does not need to continuously try to open the camera, which can avoid waste of CPU resources.
上述实施例中是以近距离观看提醒模块启动在前,家庭相机功能模块启动在后进行说明的。在另一些实施例中,近距离观看提醒模块启动也可能是在家庭相机功能模块启动之后。也就是说,在近距离观看提醒模块启动之前,智慧屏已经将摄像头分配给了家庭相机功能模块,近距离观看提醒模块启动时,摄像头处于被占用的状态。此时,近距离观看提醒模块可以先在后台启动近距离观看提醒功能模块,但是由于摄像头被占用,因此,近距离观看提醒功能无法正常进行提醒。同时,近距离观看提醒模块可以请求注册摄像头释放回调函数,以便智慧屏在摄像头被释放之后,通过调用摄像头释放回调函数,向近距离观看提醒模块发送摄像头被释放的通知消息。In the above embodiment, the close viewing reminder module is activated first and the home camera function module is activated later. In other embodiments, the close viewing reminder module may be started after the home camera function module is started. In other words, before the close viewing reminder module is activated, the smart screen has assigned the camera to the home camera function module. When the close viewing reminder module is activated, the camera is occupied. At this time, the close viewing reminder module can first start the close viewing reminder function module in the background, but because the camera is occupied, the close viewing reminder function cannot remind normally. At the same time, the close viewing reminder module can request to register the camera release callback function, so that after the camera is released, the smart screen can send a notification message that the camera is released to the close viewing reminder module by calling the camera release callback function.
请参照图4B,为本申请实施例提供的摄像头的分配方法的流程示意图。该方法包括S301-S309。其中:Please refer to FIG. 4B , which is a schematic flow chart of a camera allocation method provided by an embodiment of the present application. The method includes S301-S309. in:
S301.智慧屏启动。S301. The smart screen starts.
S302.智慧屏获取针对家庭相机功能模块的启动操作。S302. The smart screen obtains the startup operation for the home camera function module.
S303.响应于针对家庭相机功能模块的启动操作,智慧屏将摄像头分配给家庭相机功能模块。S303. In response to the startup operation of the home camera function module, the smart screen assigns the camera to the home camera function module.
S304.智慧屏获取针对近距离观看提醒功能模块的启动操作。S304. The smart screen obtains the startup operation of the close viewing reminder function module.
S305.响应于针对近距离观看提醒模块的启动操作,智慧屏启动近距离观看提醒功能。S305. In response to the startup operation of the close viewing reminder module, the smart screen activates the close viewing reminder function.
由上述实施例的说明可知,当前摄像头被家庭相机功能模块占用,近距离观看提醒模块无法获得摄像头的使用权,因此近距离观看提醒功能无法正常使用。因此,近距离观看提醒模块可以先注册摄像头释放回调函数,即,近距离观看提醒模块发起对摄像头释放回调函数的注册请求。在一些实施例中,在S304之后,如果检测到当前摄像头处于被占用,则近距离观看提醒模块可以发起对摄像头释放回调函数的注册请求。It can be seen from the description of the above embodiment that the current camera is occupied by the home camera function module, and the close viewing reminder module cannot obtain the right to use the camera, so the close viewing reminder function cannot be used normally. Therefore, the close viewing reminder module can first register the camera release callback function, that is, the close viewing reminder module initiates a registration request for the camera release callback function. In some embodiments, after S304, if it is detected that the current camera is occupied, the close viewing reminder module may initiate a registration request for the camera release callback function.
S306.智慧屏添加近距离观看提醒模块对摄像头释放回调函数的注册记录。S306. The smart screen adds the registration record of the camera release callback function by the close viewing reminder module.
需要说明的是,上述S307具体可以包括:智慧屏接收近距离观看提醒模块发起的对摄像头释放回调函数的注册请求;响应于该注册请求,智慧屏添加近距离观看提醒模块对摄像头释放回调函数的注册记录。It should be noted that the above-mentioned S307 may specifically include: the smart screen receives a registration request for the camera release callback function initiated by the close viewing reminder module; in response to the registration request, the smart screen adds a close viewing reminder module to register the camera release callback function. Registration records.
S307.智慧屏获取针对家庭相机功能模块的退出操作。S307. The smart screen obtains the exit operation for the home camera function module.
S308.响应于针对家庭相机功能模块的退出操作,智慧屏将摄像头从家庭相机功能模块释放。S308. In response to the exit operation of the home camera function module, the smart screen releases the camera from the home camera function module.
S309.智慧屏调用摄像头释放回调函数,基于注册记录将摄像头分配给近距离观看提醒模块。S309. The smart screen calls the camera release callback function and assigns the camera to the close viewing reminder module based on the registration record.
之后,近距离观看提醒模块可以基于摄像头实现近距离观看提醒功能。Afterwards, the close viewing reminder module can implement the close viewing reminder function based on the camera.
S301-S309的具体实现方式,可以参照S201-S210的实施例中的说明,在此不予赘述。For the specific implementation of S301-S309, reference can be made to the description in the embodiment of S201-S210, which will not be described again here.
在本申请实施例提供的技术方案中,如果摄像头被分配给家庭相机或其他功能模块之后,用户启动近距离观看提醒功能模块,则近距离观看提醒模块无法直接获得摄像头的使用权。此时,在启动近距离观看提醒功能模块的同时,近距离观看提醒模块注册摄像头释放回调函数。这样,可以使近距离观看提醒模块可以在摄像头被释放之后及时的感知摄像头被释放,及时调用摄像头,获得摄像头的使用权,以便实现近距离观看提醒功能。同时,在摄像头被其他功能模块占用的情况下,近距离观看提醒模块不需要持续尝试打开摄像头,可以避免cpu资源的浪费。In the technical solution provided by the embodiment of this application, if the user activates the close viewing reminder function module after the camera is assigned to a home camera or other functional module, the close viewing reminder module cannot directly obtain the right to use the camera. At this time, while starting the close viewing reminder function module, the close viewing reminder module registers the camera release callback function. In this way, the close viewing reminder module can promptly sense that the camera is released after the camera is released, call the camera in time, and obtain the right to use the camera, so as to realize the close viewing reminder function. At the same time, when the camera is occupied by other functional modules, the close viewing reminder module does not need to continuously try to open the camera, which can avoid waste of CPU resources.
进一步的,以下以电子设备内部的功能模块之间的交互进行说明。请参照图4C,为本申请实施例提供的摄像头的分配方法的流程示意图。在该实施例中,以电子设备是智慧屏,第一功能模块是近距离观看提醒模块,第二功能模块是家庭相机功能模块为例进行说明。应理解,在其他实施例中,第一功能模块和第二功能模块还可以是其他功能模块。该方法包括S401-S413,其中:Further, the following description will be based on the interaction between functional modules within the electronic device. Please refer to FIG. 4C , which is a schematic flow chart of a camera allocation method according to an embodiment of the present application. In this embodiment, the electronic device is a smart screen, the first functional module is a close viewing reminder module, and the second functional module is a home camera functional module. It should be understood that in other embodiments, the first functional module and the second functional module may also be other functional modules. The method includes S401-S413, among which:
S401.响应于对近距离观看提醒功能的打开操作,近距离观看提醒模块向摄像头功能模块发送摄像头调用指令。S401. In response to the opening operation of the close viewing reminder function, the close viewing reminder module sends a camera calling instruction to the camera function module.
在一些实施例中,近距离观看提醒功能可以是儿童模式应用中的一个功能模块。示例性的,用户对近距离观看提醒功能的打开操作,具体可以是用户打开如图1D中的开关15。在另一些实施例中,近距离观看提醒功能也可以是一个独立的应用,或者还可以是一个小程序。In some embodiments, the close viewing reminder function may be a functional module in the child mode application. For example, the user's operation to turn on the close viewing reminder function may be that the user turns on the switch 15 as shown in Figure 1D. In other embodiments, the close viewing reminder function may also be an independent application or a small program.
在近距离观看提醒模块是某一个应用中的一个功能模块的情况下,该应用可以是儿童模式应用。结合上述说明可知,用户在儿童模式中提前将近距离观看提醒功能设置为打开,那么只要用户打开儿童模式,就会自动打开近距离观看提醒模块。因此,在一些实施例中,如果儿童模式的近距离观看提醒功能为默认打开,那么上述S401也可以包括:响应于对儿童模式的打开操作,在近距离观看提醒功能处于开启的情况下,近距离观看提醒模块向摄像头功能模块发送摄像头调用指令。When the close viewing reminder module is a functional module in a certain application, the application may be a child mode application. Based on the above description, it can be seen that if the user sets the close viewing reminder function to open in advance in the child mode, then as long as the user turns on the child mode, the close viewing reminder module will be automatically turned on. Therefore, in some embodiments, if the close viewing reminder function of the child mode is turned on by default, the above S401 may also include: in response to the opening operation of the child mode, when the close viewing reminder function is turned on, the near viewing reminder function is turned on. The distance viewing reminder module sends a camera calling instruction to the camera function module.
由上述实施例的说明可知,在一些实施例中,摄像头功能模块包括camera server模块和HAL层的camera HAL模块。在该实施例中,上述S401中近距离观看提醒模块具体可以是向camera server模块发送摄像头调用指令。As can be seen from the description of the above embodiments, in some embodiments, the camera function module includes a camera server module and a camera HAL module of the HAL layer. In this embodiment, the close viewing reminder module in S401 may specifically send a camera calling instruction to the camera server module.
需要说明的是,上述S401中对近距离观看提醒功能的打开操作,也可以理解为对近距离观看提醒模块的打开操作、启动操作。It should be noted that the opening operation of the close viewing reminder function in the above S401 can also be understood as the opening operation and starting operation of the close viewing reminder module.
S402.摄像头功能模块响应于摄像头调用指令,启动摄像头。S402. The camera function module responds to the camera calling instruction and starts the camera.
由上述实施例的说明可知,在一些实施例中,摄像头功能模块包括framework层的camera server模块和HAL层的camera HAL模块。在该实施例中,上述S402具体可以包括:响应于摄像头调用指令,camera server模块通过camera HAL模块,启动摄像头。As can be seen from the description of the above embodiments, in some embodiments, the camera function module includes a camera server module in the framework layer and a camera HAL module in the HAL layer. In this embodiment, the above-mentioned S402 may specifically include: in response to the camera calling instruction, the camera server module starts the camera through the camera HAL module.
在一些实施例中,摄像头功能模块在接收到近距离观看提醒模块发送的摄像头调用指令之后,可以先判断当前摄像头是否处于空闲状态。若确定摄像头处于空闲状态,即表示摄像头是可以被调用的,此时摄像头功能模块可以响应于该摄像头调用指令,启动摄像头。In some embodiments, after receiving the camera calling instruction sent by the close viewing reminder module, the camera function module may first determine whether the current camera is in an idle state. If it is determined that the camera is in an idle state, it means that the camera can be called. At this time, the camera function module can start the camera in response to the camera calling instruction.
在另一些实施例中,在接收到近距离观看提醒模块发送的摄像头调用指令之前,摄像头也有可能正在被其他功能模块(如第三功能模块)使用,即接收到近距离观看提醒模块发送的摄像头调用指令时,摄像头处于占用状态。此时,摄像头功能模块可以先通知正在使用摄像头的第三功能模块释放摄像头,然后再响应于近距离观看提醒模块的摄像头调用指令启动摄像头。In other embodiments, before receiving the camera calling instruction sent by the close viewing reminder module, the camera may also be being used by other functional modules (such as the third functional module), that is, the camera may be in use by the close viewing reminder module. When calling the command, the camera is occupied. At this time, the camera function module can first notify the third function module that is using the camera to release the camera, and then start the camera in response to the camera calling instruction of the close viewing reminder module.
其中,如果在接收到近距离观看提醒模块发送的摄像头调用指令时,摄像头功能模块检测到摄像头处于被第三功能模块占用的状态,摄像头功能模块可以先比较第三功能模块与近距离观看提醒模块对于摄像头的使用优先权。如果确定近距离观看提醒模块对于摄像头的使用优先权高于第三功能模块对于摄像头的使用优先权,则摄像头功能模块可以通知第三功能模块释放摄像头。之后,摄像头功能模块再响应于近距离观看提醒模块发送的摄像头调用指令,启动摄像头。Among them, if the camera function module detects that the camera is occupied by the third functional module when receiving the camera calling instruction sent by the close viewing reminder module, the camera function module can first compare the third functional module with the close viewing reminder module Priority for camera use. If it is determined that the close viewing reminder module has a higher priority for using the camera than the third functional module, the camera function module may notify the third functional module to release the camera. Afterwards, the camera function module starts the camera in response to the camera calling instruction sent by the close viewing reminder module.
在另一些实施例中,如果近距离观看提醒模块对于摄像头的使用优先权低于第三功能模块对于摄像头的使用优先权,则对于摄像头被分配给第三功能模块的情况下接收到的近距离观看提醒模块的摄像头调用指令,应不予响应。也就是说,在有对于摄像头使用优先权更高的第三功能模块正在使用摄像头的情况下,近距离观看提醒功能无法正常启动。In other embodiments, if the close viewing reminder module has a lower priority for using the camera than the third functional module for using the camera, then for the short distance received when the camera is assigned to the third functional module There should be no response to the camera call command of the viewing reminder module. That is to say, when a third functional module with a higher priority for camera use is using the camera, the close viewing reminder function cannot be started normally.
在本申请实施例提供的技术方案中,在近距离观看提醒模块请求使用摄像头时,摄像头功能模块在当前摄像头处于空闲的状态,或者当前没有其他对摄像头的使用优先权更高的功能模块使用摄像头的情况下,摄像头功能模块可以响应于近距离观看提醒模块发送的摄像头调用指令启动摄像头。这样,可以确保摄像头同时只被一个功能模块使用,避免摄像头的资源抢占的问题。In the technical solution provided by the embodiment of the present application, when the close viewing reminder module requests the use of the camera, the camera function module is currently in an idle state, or there is currently no other functional module with a higher priority for using the camera to use the camera. In this case, the camera function module can start the camera in response to the camera calling instruction sent by the close viewing reminder module. In this way, it can be ensured that the camera is only used by one functional module at the same time to avoid the problem of camera resource preemption.
S403.摄像头功能模块将摄像头分配给近距离观看提醒模块。S403. The camera function module assigns the camera to the close viewing reminder module.
摄像头功能模块将摄像头分配给近距离观看提醒模块,也可以称为摄像头功能模块将摄像头的资源分配给近距离观看提醒模块。其中,摄像头的资源可以包括摄像头的硬件资源和/或软件资源。The camera function module allocates the camera to the close viewing reminder module, which can also be called the camera function module and allocates the resources of the camera to the close viewing reminder module. The camera resources may include camera hardware resources and/or software resources.
S404.近距离观看提醒模块控制摄像头,并与摄像头进行图像数据传输。S404. The close viewing reminder module controls the camera and transmits image data with the camera.
摄像头功能模块将摄像头分配给近距离观看提醒模块之后,近距离观看提醒模块获得摄像头的控制权和使用权。此时,近距离观看提醒模块可以通过摄像头采集图像,并分析图像中用户的观看距离是否需要提醒。After the camera function module assigns the camera to the close viewing reminder module, the close viewing reminder module obtains the control and use rights of the camera. At this time, the close viewing reminder module can collect images through the camera and analyze whether the user's viewing distance in the image needs to be reminded.
结合上述对图3的说明可知,近距离观看提醒模块通过摄像头采集图像,具体需要通过摄像头功能模块在摄像头与近距离观看提醒模块之间传输图像。在一些实施例中,上述S404具体可以包括:近距离观看提醒模块控制摄像头采集图像,摄像头向摄像头功能模块发送图像。之后,由于当前摄像头的控制权和使用权属于近距离观看提醒模块,因此,摄像头功能模块向近距离观看提醒模块发送摄像头所采集的图像。Based on the above description of Figure 3, it can be seen that the close viewing reminder module collects images through the camera, and specifically needs to transmit images between the camera and the close viewing reminder module through the camera function module. In some embodiments, the above-mentioned S404 may specifically include: the close viewing reminder module controls the camera to collect images, and the camera sends the image to the camera function module. Afterwards, since the current control rights and usage rights of the camera belong to the close viewing reminder module, the camera function module sends the image collected by the camera to the close viewing reminder module.
由上述说明可知,在开启近距离观看提醒功能的前提下,近距离观看提醒模块可以通过摄像头功能模块控制摄像头采集图像。在一些实施例中,近距离观看提醒模块获得摄像头功能模块分配的摄像头之后,通过摄像头功能模块向摄像头发送第一控制指令,该第一控制指令可以用于控制摄像头每隔预设时间进行一次图像采集。在另一些实施例中,近距离观看提醒模块也可以每隔预设时间通过摄像头服务模块向摄像头发送第二控制指令,该第二控制指令用于指示摄像头进行一次图像采集。其中,预设时间可以根据实际情况设置为5分钟(min)、1分钟、30秒(s)等等。It can be seen from the above description that, on the premise that the close viewing reminder function is turned on, the close viewing reminder module can control the camera to collect images through the camera function module. In some embodiments, after the close viewing reminder module obtains the camera assigned by the camera function module, it sends a first control instruction to the camera through the camera function module. The first control instruction can be used to control the camera to perform image processing every preset time. collection. In other embodiments, the close viewing reminder module may also send a second control instruction to the camera through the camera service module at preset intervals. The second control instruction is used to instruct the camera to perform image collection once. Among them, the preset time can be set to 5 minutes (min), 1 minute, 30 seconds (s), etc. according to the actual situation.
进一步的,摄像头完成一次图像采集即可将所采集的图像通过摄像头功能模块发送给近距离观看模块。并且,近距离观看提醒模块获取到图像之后,可以对图像进行分析,确定是否需要对用户的观看距离进行提醒。由上述说明可知,近距离观看提醒模块分析图像可以确定在该图像中用户的眼睛与智慧屏的显示屏之间的距离。用户的眼睛与显示屏之间的距离较近时,则容易出现观看智慧屏损伤用户的视力的问题。因此,在分析图像确定用户的眼睛与显示屏之间的距离较近时,近距离观看提醒模块可以提醒用户注意观看距离。Further, after the camera completes one image collection, the collected images can be sent to the close-range viewing module through the camera function module. Moreover, after the close viewing reminder module obtains the image, it can analyze the image to determine whether it is necessary to remind the user of the viewing distance. As can be seen from the above description, the close viewing reminder module analyzes the image to determine the distance between the user's eyes and the display screen of the smart screen in the image. When the distance between the user's eyes and the display screen is close, viewing the smart screen may easily damage the user's vision. Therefore, when analyzing the image to determine that the distance between the user's eyes and the display screen is close, the close viewing reminder module can remind the user to pay attention to the viewing distance.
S405.响应于对家庭相机的打开操作,家庭相机功能模块向摄像头功能模块发送摄像头调用指令。S405. In response to the opening operation of the home camera, the home camera function module sends a camera calling instruction to the camera function module.
在一些实施例中,家庭相机功能可以是一个独立的应用。示例性的,用户对近距离观看提醒功能的打开操作,具体可以是用户在图1C所示的界面12中选择家庭相机对应的图标12b,以打开家庭相机应用,进入如图1E所示的家庭相机的界面21。在另一些实施例中,家庭相机功能也可以是某个应用中的一个功能模块,或者还可以是一个小程序等等。In some embodiments, the home camera functionality may be a standalone application. For example, the user's operation to open the close viewing reminder function may be that the user selects the icon 12b corresponding to the home camera in the interface 12 shown in FIG. 1C to open the home camera application and enter the home as shown in FIG. 1E Camera interface 21. In other embodiments, the home camera function can also be a functional module in an application, or it can also be a small program, etc.
可以理解的,上述S405也可以表示为摄像头功能模块接收家庭相机功能模块发送的摄像头调用指令,该摄像头调用指令是家庭相机功能模块响应于对家庭相机的打开操作发送的。It can be understood that the above S405 can also be expressed as the camera function module receiving the camera calling instruction sent by the home camera function module. The camera calling instruction is sent by the home camera function module in response to the opening operation of the home camera.
S406.摄像头功能模块响应于摄像头调用指令,将摄像头分配给家庭相机功能模块。S406. The camera function module responds to the camera calling instruction and allocates the camera to the home camera function module.
由于通常摄像头同时只允许被一个功能模块使用,因此,部分电子设备对于不同应用或者不同的功能模块使用摄像头,设置了不一样的使用优先权。当多个应用或者功能模块同时请求使用摄像头时,摄像头功能模块可以结合预先设置各应用或功能模块对摄像头的使用优先权的顺序,决定将摄像头分配给发起请求的应用或功能模块中使用优先权最高的一个应用或功能模块。Since a camera is usually only allowed to be used by one functional module at a time, some electronic devices set different usage priorities for different applications or different functional modules to use the camera. When multiple applications or functional modules request the use of the camera at the same time, the camera function module can decide to allocate the camera to the requesting application or functional module in combination with the order in which the priority of use of the camera is preset for each application or functional module. The highest application or functional module.
在一些实施例中,在S405之后,摄像头功能模块接收到家庭相机功能模块发送的摄像头调用指令,摄像头功能模块可以先对近距离观看提醒模块和家庭相机功能模块对摄像头的使用优先权进行比较。进一步的,上述S406具体可以包括:在确定家庭相机对于摄像头的使用优先权高于近距离观看提醒模块的情况下,响应于摄像头调用指令,将摄像头分配给家庭相机功能模块。由于家庭相机对于摄像头的使用优先权高于近距离观看提醒模块的使用优先权,因此,在接收到家庭相机功能模块的摄像头调用指令时,摄像头功能模块允许家庭相机打开摄像头。In some embodiments, after S405, the camera function module receives the camera calling instruction sent by the home camera function module. The camera function module can first compare the camera usage priorities of the close viewing reminder module and the home camera function module. Further, the above-mentioned S406 may specifically include: when it is determined that the home camera has a higher priority for the use of the camera than the close viewing reminder module, allocating the camera to the home camera function module in response to the camera calling instruction. Since the home camera has a higher priority for using the camera than the close viewing reminder module, when receiving the camera calling instruction from the home camera function module, the camera function module allows the home camera to turn on the camera.
由于在S406之前,智慧屏已经将摄像头分配给了近距离观看提醒模块,因此,在响应于家庭相机功能模块的摄像头调用指令,将摄像头分配给家庭相机功能模块之前,摄像头功能模块需要先将摄像头从近距离观看提醒模块释放。在一些实施例中,摄像头功能模块将摄像头从近距离观看提醒模块释放,具体可以包括:摄像头功能模块向近距离观看提醒模块发送第三控制指令,该第三控制指令用于控制近距离观看提醒模块释放摄像头。之后,近距离观看提醒模块响应于第三控制指令,可以发送摄像头释放指令,以释放摄像头。在其他实施例中,摄像头功能模块将摄像头从近距离观看提醒模块释放,也可以通过其他方式实现,在本申请实施例中不予赘述。Since the smart screen has assigned the camera to the close viewing reminder module before S406, the camera function module needs to first assign the camera to the home camera function module in response to the camera calling instruction of the home camera function module. Release from close viewing reminder module. In some embodiments, the camera function module releases the camera from the close viewing reminder module. Specifically, the camera function module sends a third control instruction to the close viewing reminder module. The third control instruction is used to control the close viewing reminder. The module releases the camera. Afterwards, the close viewing reminder module responds to the third control instruction and can send a camera release instruction to release the camera. In other embodiments, the camera function module releases the camera from the close viewing reminder module, which can also be implemented in other ways, which will not be described in detail in the embodiments of this application.
在一些实施例中,为了区分近距离观看提醒模块与家庭相机功能模块发送的摄像头调用指令,可以以“第一”、“第二”等为其命名。示例性的,S406中家庭相机功能模块发送的摄像头调用指令可以命名为第三摄像头调用指令,S401中的摄像头调用指令可以命名为第四摄像头调用指令,等等。In some embodiments, in order to distinguish the camera calling instructions sent by the close viewing reminder module from the home camera function module, they can be named with "first", "second", etc. For example, the camera calling instruction sent by the home camera function module in S406 may be named the third camera calling instruction, the camera calling instruction in S401 may be named the fourth camera calling instruction, and so on.
S407.家庭相机功能模块控制摄像头,并与摄像头之间进行图像数据传输。S407. The home camera function module controls the camera and transmits image data with the camera.
可以理解的,摄像头功能模块将摄像头分配给家庭相机功能模块之后,家庭相机功能模块获得摄像头的控制权和使用权。此时,家庭相机功能模块可以控制摄像头进行拍摄、录像等操作。It can be understood that after the camera function module assigns the camera to the home camera function module, the home camera function module obtains the control and use rights of the camera. At this time, the home camera function module can control the camera to perform shooting, video recording and other operations.
在一些实施例中,上述S407具体可以包括家庭相机功能模块获取摄像头实时拍摄的画面,将该画面显示在智慧屏的显示屏上。示例性的,用户在启动家庭相机之后,智慧屏将会进入图1E所示的界面21,在该界面21中,智慧屏1的显示屏上显示的画面是当前摄像头实时拍摄的画面,其中包括了一个人像。In some embodiments, the above-mentioned S407 may specifically include the home camera function module acquiring the picture captured by the camera in real time and displaying the picture on the display screen of the smart screen. For example, after the user starts the home camera, the smart screen will enter the interface 21 shown in Figure 1E. In this interface 21, the picture displayed on the display screen of the smart screen 1 is the picture captured by the current camera in real time, including A portrait.
在另一些实施例中,上述S407还可以包括家庭相机功能模块控制摄像头拍摄图像、录制视频等。示例性的,用户在启动家庭相机之后,智慧屏将会进入图1E所示的界面21,在该界面21中,用户可以通过选择家庭相机提供的功能选项“拍摄”选项24进行图像拍摄,即拍照;或者,用户也可以通过选择家庭相机提供的功能选项“录像”选项25进行视频录制。In other embodiments, the above S407 may also include the home camera function module controlling the camera to capture images, record videos, etc. For example, after the user starts the home camera, the smart screen will enter the interface 21 shown in Figure 1E. In this interface 21, the user can capture images by selecting the function option "shoot" option 24 provided by the home camera, that is, Take photos; alternatively, the user can also record videos by selecting the function option "video recording" option 25 provided by the home camera.
进一步的,用户通过家庭相机提供的选项使用家庭相机通过摄像头拍摄图像或者录制视频之后,摄像头所拍摄的图像和视频均可以存储到预设的指定路径。之后,用户可以通过如图1E所示的界面中的“图库”选项查看拍摄的图像和录制的视频。Further, after the user uses the home camera to capture images or record videos through the camera through the options provided by the home camera, the images and videos captured by the camera can be stored in a preset designated path. Afterwards, the user can view the captured images and recorded videos through the “Gallery” option in the interface as shown in Figure 1E.
应理解,在其他实施例中,家庭相机功能模块与摄像头进行图像数据传输,还可以用于其他功能。It should be understood that in other embodiments, the home camera function module transmits image data with the camera and can also be used for other functions.
S408.响应于对家庭相机的退出操作,家庭相机功能模块向摄像头功能模块发送摄像头释放指令。S408. In response to the exit operation of the home camera, the home camera function module sends a camera release instruction to the camera function module.
示例性的,用户对家庭相机的退出操作,具体可以是用户在如图1E所示的界面21中选择“退出”选项。通常用户选择退出家庭相机,即表示家庭相机将会退出使用摄像头,此时家庭相机功能模块释放摄像头。因此,在S408中,智慧屏在检测到用户对家庭相机的退出操作,家庭相机功能模块向摄像头功能模块发送摄像头释放指令,用于指示家庭相机功能模块释放摄像头。For example, the user's exit operation for the home camera may be the user selecting the "Exit" option in the interface 21 as shown in Figure 1E. Usually the user chooses to exit the home camera, which means that the home camera will exit the use of the camera. At this time, the home camera function module releases the camera. Therefore, in S408, the smart screen detects the user's exit operation on the home camera, and the home camera function module sends a camera release instruction to the camera function module to instruct the home camera function module to release the camera.
需要说明的是,上述对近距离观看提醒模块功能和家庭相机的打开操作、退出操作,均可以是由用户来操作。或者,上述打开操作和退出操作也可以是智慧屏基于其他指令(如定时指令,其他功能模块的调用指令等等)自动触发的。It should be noted that the above-mentioned opening and exit operations of the close viewing reminder module function and the home camera can be operated by the user. Alternatively, the above-mentioned opening operation and exit operation can also be automatically triggered by the smart screen based on other instructions (such as timing instructions, calling instructions of other functional modules, etc.).
S409.响应于摄像头释放指令,摄像头功能模块将摄像头从家庭相机功能模块释放。S409. In response to the camera release instruction, the camera function module releases the camera from the home camera function module.
S410.摄像头功能模块向近距离观看提醒模块发送第一通知消息。S410. The camera function module sends the first notification message to the close viewing reminder module.
在本申请实施例中,由于在打开家庭相机之前,用户开启了近距离观看提醒功能,因此,在家庭相机退出使用摄像头之后,应恢复近距离观看提醒模块使用摄像头继续对用户的观看距离进行提醒。因此,为了使近距离观看提醒模块可以尽快感知到摄像头已被释放的消息,在本申请实施例中,在检测到用户对家庭相机的退出操作之后,由摄像头功能模块主动向近距离观看提醒模块发送第一通知消息。该第一通知消息用于告知近距离观看提醒模块当前摄像头已被释放,重新回到空闲状态,便于近距离观看提醒模块重新调用摄像头,实现近距离观看提醒功能。In the embodiment of this application, since the user has turned on the close viewing reminder function before turning on the home camera, after the home camera exits from using the camera, the close viewing reminder module should be restored and uses the camera to continue to remind the user of the viewing distance. . Therefore, in order to enable the close viewing reminder module to sense the news that the camera has been released as soon as possible, in the embodiment of the present application, after detecting the user's exit operation on the home camera, the camera function module actively sends a message to the close viewing reminder module Send the first notification message. The first notification message is used to inform the close viewing reminder module that the current camera has been released and returned to the idle state, so that the close viewing reminder module can re-call the camera to implement the close viewing reminder function.
可以理解的,S410也可以表示为近距离观看提醒模块接收来自摄像头功能模块的第一通知消息。It can be understood that S410 can also be represented as the close viewing reminder module receiving the first notification message from the camera function module.
在一些实施例中,摄像头功能模块在执行S409释放摄像头之后,可以查询近距离观看提醒功能是否处于开启状态。之后,如果查询到近距离观看提醒功能处于开启状态,那么摄像头功能模块再执行S410,即向近距离观看提醒模块发送第一通知消息。In some embodiments, after executing S409 to release the camera, the camera function module may query whether the close viewing reminder function is turned on. After that, if it is found that the close viewing reminder function is turned on, the camera function module then executes S410, that is, sending the first notification message to the close viewing reminder module.
其中,在一些实施例中,摄像头功能模块可以直接与近距离观看提醒模块交互,获取近距离观看提醒功能是否处于开启状态。示例性的,摄像头功能模块在执行S409释放摄像头的之后,向近距离观看提醒模块发送查询请求,然后接收近距离观看提醒模块返回的响应结果,根据该响应结果确定近距离观看提醒功能是否处于开启状态。Among them, in some embodiments, the camera function module can directly interact with the close viewing reminder module to obtain whether the close viewing reminder function is turned on. Exemplarily, after executing S409 to release the camera, the camera function module sends a query request to the close viewing reminder module, then receives the response result returned by the close viewing reminder module, and determines whether the close viewing reminder function is turned on based on the response result. state.
在另一些实施例中,近距离观看提醒功能处于关闭状态,近距离观看提醒模块可能无法接收查询请求,也无法对查询请求进行响应。因此,在该实施例中,摄像头功能模块也可以在执行S409释放摄像头之后,向近距离观看提醒模块发送查询请求,并根据在预设时间段内是否接收到来自近距离观看提醒模块返回的响应消息,来确定近距离观看提醒功能是否处于开启状态。进一步的,如果在预设时间段内接收到近距离观看提醒模块返回的响应消息,则表示近距离观看提醒功能处于开启状态。如果在预设时间段内没有接收到近距离观看提醒模块返回的响应消息,则表示近距离观看提醒模块处于关闭状态。In other embodiments, the close viewing reminder function is turned off, and the close viewing reminder module may not be able to receive the query request or respond to the query request. Therefore, in this embodiment, the camera function module can also send a query request to the close viewing reminder module after executing S409 to release the camera, and determine whether a response returned from the close viewing reminder module is received within the preset time period. message to determine whether the close viewing reminder feature is turned on. Further, if a response message returned by the close viewing reminder module is received within the preset time period, it means that the close viewing reminder function is on. If no response message returned by the close viewing reminder module is received within the preset time period, it means that the close viewing reminder module is in a closed state.
除了与近距离观看提醒模块交互获取近距离观看提醒功能的状态以外,智慧屏也可以设置一个标识,用于表征近距离观看提醒功能是否开启。示例性的,在智慧屏启动近距离观看提醒功能之后,智慧屏可以将该标识设置为1,用于表征近距离观看提醒功能处于开启状态;在关闭近距离观看提醒功能之后,智慧屏可以将该标识设置为0,用于表征近距离观看提醒功能处于关闭状态。进一步的,在摄像头功能模块执行S409释放摄像头之后,可以通过查询这一标识的数值,来确定近距离观看提醒功能是否处于开启状态。In addition to interacting with the close viewing reminder module to obtain the status of the close viewing reminder function, the smart screen can also set a logo to indicate whether the close viewing reminder function is turned on. For example, after the smart screen activates the close viewing reminder function, the smart screen can set this flag to 1 to indicate that the close viewing reminder function is on; after turning off the close viewing reminder function, the smart screen can set This flag is set to 0 to indicate that the close viewing reminder function is turned off. Further, after the camera function module performs S409 to release the camera, it can be determined whether the close viewing reminder function is turned on by querying the value of this identifier.
在本申请实施例提供的技术方案中,摄像头功能模块在释放摄像头之后,如果检测到有近距离观看提醒功能处于开启状态,则摄像头功能模块向近距离观看提醒模块发送第一通知消息。以便通知近距离观看提醒模块摄像头已被释放,可以使近距离观看提醒模块尽快重新调用摄像头,以恢复近距离观看提醒功能。In the technical solution provided by the embodiment of the present application, after the camera function module releases the camera, if it detects that the close viewing reminder function is turned on, the camera function module sends a first notification message to the close viewing reminder module. In order to notify the close viewing reminder module that the camera has been released, the close viewing reminder module can re-call the camera as soon as possible to restore the close viewing reminder function.
可以理解的,上述近距离观看提醒模块也可以替换为其他使用摄像头实现对应功能的模块。即,摄像头功能模块在执行S409家庭相机功能模块释放摄像头之后,查询是否存在需要使用摄像头实现的功能处于开启状态,则摄像头功能模块响应于摄像头释放指令,还会向该功能对应的功能模块发送摄像头被释放的第一通知消息。It is understandable that the above-mentioned close viewing reminder module can also be replaced by other modules that use cameras to implement corresponding functions. That is, after the camera function module executes S409 home camera function module to release the camera, it queries whether there is a function that needs to be implemented using the camera in the enabled state. Then the camera function module responds to the camera release command and also sends the camera to the function module corresponding to the function. The first notification message is released.
在一些实施例中,上述S410中摄像头功能模块向近距离观看提醒模块发送第一通知消息,具体可以在摄像头被释放之后,触发向近距离观看提醒模块发送第一通知消息。进一步的,上述触发向近距离观看提醒模块发送第一通知消息,具体可以在摄像头被释放之后,通过调用摄像头释放回调函数来实现。其中,摄像头释放回调函数的注册过程,以及摄像头功能模块在摄像头被释放之后调用摄像头释放回调函数的具体实现过程,可以参照在后实施例的详细说明,在此不予赘述。In some embodiments, the camera function module in S410 above sends a first notification message to the close viewing reminder module. Specifically, after the camera is released, the camera function module may trigger sending the first notification message to the close viewing reminder module. Further, the above trigger sends a first notification message to the close viewing reminder module, which can be implemented by calling the camera release callback function after the camera is released. The registration process of the camera release callback function and the specific implementation process of the camera function module calling the camera release callback function after the camera is released can be referred to the detailed description of the following embodiments and will not be described again here.
S411.近距离观看提醒模块基于第一通知消息,向摄像头功能模块发送摄像头调用指令。S411. The close viewing reminder module sends a camera calling instruction to the camera function module based on the first notification message.
由于第一通知消息表示当前摄像头已被释放,因此,近距离观看提醒模块接收到第一通知消息之后,可以重新调用摄像头,以实现近距离观看提醒功能。在本申请实施例中,近距离观看提醒模块在接收到来自摄像头功能模块的第一通知消息,向摄像头功能模块再次发送摄像头调用指令。在一些实施例中,为了与其他摄像头调用指令区分,S411中近距离观看提醒模块发送的摄像头调用指令可以命名为第二摄像头调用指令。Since the first notification message indicates that the current camera has been released, after receiving the first notification message, the close viewing reminder module can re-call the camera to implement the close viewing reminder function. In the embodiment of the present application, after receiving the first notification message from the camera function module, the close viewing reminder module sends the camera calling instruction to the camera function module again. In some embodiments, in order to distinguish it from other camera calling instructions, the camera calling instruction sent by the close viewing reminder module in S411 may be named the second camera calling instruction.
S412.摄像头功能模块响应于摄像头调用指令,将摄像头分配给近距离观看提醒模块。S412. The camera function module responds to the camera calling instruction and allocates the camera to the close viewing reminder module.
由上述实施例的说明可知,在S409中摄像头功能模块响应于家庭相机功能模块的摄像头释放指令释放了摄像头,因此,在S412摄像头功能模块再将摄像头分配给近距离观看提醒模块之前,需先重新启动摄像头,然后再将摄像头分配给近距离观看提醒模块。It can be seen from the description of the above embodiment that in S409, the camera function module releases the camera in response to the camera release instruction of the home camera function module. Therefore, before the camera function module allocates the camera to the close viewing reminder module in S412, it needs to be reset first. Activate the camera before assigning it to the Close View Alert module.
S413.近距离观看提醒模块控制摄像头,并与摄像头进行图像数据传输。S413. The close viewing reminder module controls the camera and transmits image data with the camera.
至此,近距离观看提醒模块重新获得了摄像头的控制权和使用权。之后,近距离观看提醒模块可以通过摄像头功能模块获取摄像头采集的图像,并对图像进行分析,确定是否需要提醒用户观看距离。At this point, the close viewing reminder module has regained control and use of the camera. Afterwards, the close viewing reminder module can obtain the image collected by the camera through the camera function module, and analyze the image to determine whether it is necessary to remind the user of the viewing distance.
在本申请实施例提供的摄像头的分配方法中,在近距离观看提醒模块使用摄像头进行近距离观看提醒的前提下,如果摄像头被家庭相机等功能模块抢占使用,在家庭相机等功能模块退出使用摄像头时,摄像头功能模块将会向近距离观看提醒模块发送第一通知消息。这样,可以使近距离观看提醒模块及时感知到摄像头被释放。之后,近距离观看提醒模块可以及时的重新调用摄像头,继续对用户的观看距离进行监控并提醒。避免在开启了近距离观看提醒的前提下,使用家庭相机功能模块再退出,无法及时恢复近距离观看提醒的问题。同时也可以避免在家庭相机使用摄像头的期间,近距离观看提醒模块不断轮询尝试打开摄像头导致cpu资源浪费的问题,提升智慧屏的性能。In the camera allocation method provided by the embodiment of the present application, on the premise that the close viewing reminder module uses the camera for close viewing reminder, if the camera is preempted for use by a functional module such as a home camera, the camera will be used after the functional module such as the home camera exits. When, the camera function module will send the first notification message to the close viewing reminder module. In this way, the close viewing reminder module can promptly sense that the camera is released. Afterwards, the close viewing reminder module can re-call the camera in time to continue to monitor and remind the user's viewing distance. Avoid the problem of being unable to restore the close viewing reminder in time when using the home camera function module and then exiting with the close viewing reminder turned on. At the same time, it can also avoid the problem of wasting CPU resources caused by the close viewing reminder module constantly polling and trying to open the camera while the home camera is in use, and improve the performance of the smart screen.
由上述实施例的说明可知,上述S410具体可以通过调用摄像头释放回调函数来实现。该摄像头释放回调函数是近距离观看提醒模块注册生成的。在一些实施例中,近距离观看提醒模块可以在启动之后立即注册摄像头释放回调函数。请参照图5,在智慧屏检测到用户对近距离观看提醒功能的打开操作之后,上述方法还可以包括S501:It can be known from the description of the above embodiments that the above S410 can be implemented by calling the camera release callback function. The camera release callback function is registered and generated by the close viewing reminder module. In some embodiments, the close view reminder module may register a camera release callback function immediately after startup. Please refer to Figure 5. After the smart screen detects the user's opening operation of the close viewing reminder function, the above method may also include S501:
S501.近距离观看提醒模块注册摄像头释放回调函数。S501. The close viewing reminder module registers the camera release callback function.
其中,摄像头释放回调函数可以用于在摄像头被释放之后调用该摄像头释放回调函数,用于触发向注册了该摄像头释放回调函数的功能模块,发送摄像头被释放的第一通知消息。Among them, the camera release callback function can be used to call the camera release callback function after the camera is released, and is used to trigger sending the first notification message that the camera is released to the functional module registered with the camera release callback function.
在一些实施例中,近距离观看提醒模块注册摄像头释放回调函数之后,智慧屏可以添加近距离观看提醒模块对摄像头释放回调函数的注册记录。之后,在摄像头被其他功能模块释放之后,摄像头服务模块可以触发调用该摄像头释放回调函数,并基于该注册记录,向注册了该摄像头释放回调函数的功能模块发送通知消息。也就是说,在本申请实施例中,近距离观看提醒模块注册了摄像头释放回调函数之后,如果摄像头被其他功能模块释放,那么摄像头功能模块将会触发调用摄像头释放回调函数。根据注册记录可以确定近距离观看提醒模块注册了摄像头释放回调函数,因此,调用摄像头释放回调函数将会向近距离观看提醒模块发送摄像头被释放的通知消息。In some embodiments, after the close viewing reminder module registers the camera release callback function, the smart screen can add a registration record of the close viewing reminder module for the camera release callback function. Later, after the camera is released by other functional modules, the camera service module can trigger the call of the camera release callback function, and based on the registration record, send a notification message to the functional module that has registered the camera release callback function. That is to say, in the embodiment of this application, after the close viewing reminder module registers the camera release callback function, if the camera is released by other functional modules, the camera function module will trigger the call of the camera release callback function. According to the registration record, it can be determined that the close viewing reminder module has registered the camera release callback function. Therefore, calling the camera release callback function will send a notification message that the camera is released to the close viewing reminder module.
进一步的,在一些实施例中,上述近距离观看提醒模块注册摄像头释放回调函数,具体可以是近距离观看提醒模块在HAL层注册摄像头释放回调函数。Further, in some embodiments, the above-mentioned close viewing reminder module registers a camera release callback function. Specifically, the close viewing reminder module registers a camera release callback function at the HAL layer.
进一步的,如图6所示,上述S501具体可以包括S501a和S501b:Further, as shown in Figure 6, the above S501 may specifically include S501a and S501b:
S501a.近距离观看提醒模块向HIDL摄像头接口服务模块发送对摄像头释放回调函数的注册请求。S501a. The close viewing reminder module sends a registration request for the camera release callback function to the HIDL camera interface service module.
HIDL摄像头接口服务模块,是硬件抽象层接口定义语言服务中的摄像头接口服务模块(HIDL service camera proxy,以下简称HIDL摄像头接口服务模块)。可以理解的,上述S501a也可以理解为HIDL摄像头接口服务模块接收近距离观看提醒模块发送的对摄像头释放回调函数的注册请求。The HIDL camera interface service module is the camera interface service module (HIDL service camera proxy, hereinafter referred to as the HIDL camera interface service module) in the hardware abstraction layer interface definition language service. It is understandable that the above S501a can also be understood as the HIDL camera interface service module receiving the registration request for the camera release callback function sent by the close viewing reminder module.
S501b.响应于注册请求,HIDL摄像头接口服务模块添加近距离观看提醒模块对摄像头释放回调函数的注册记录。S501b. In response to the registration request, the HIDL camera interface service module adds a registration record of the camera release callback function of the close viewing reminder module.
在近距离观看提醒模块注册摄像头释放回调函数的实施例中,在摄像头功能模块从其他功能模块摄像头释放之后,可以通过调用该摄像头释放回调函数,以实现摄像头功能模块向近距离观看提醒模块发送第一通知消息。In the embodiment where the close viewing reminder module registers the camera release callback function, after the camera function module is released from the camera of other functional modules, the camera release callback function can be called to realize that the camera function module sends the third callback function to the close viewing reminder module. A notification message.
需要说明的是,上述S501可以在S401和S402之后执行,也可以在S401和S402之前执行,或者S401、S402可以与S501可以同步执行。在本申请实施例中,对于S401、S402以及S501执行的先后顺序不予显限定。It should be noted that the above S501 may be executed after S401 and S402, or may be executed before S401 and S402, or S401 and S402 may be executed simultaneously with S501. In the embodiment of the present application, the order in which S401, S402 and S501 are executed is not explicitly limited.
结合本申请实施例中上述S501可知,近距离观看提醒模块启动之后,注册了摄像头释放回调函数。因此,在S409从家庭相机功能模块释放摄像头之后,摄像头功能模块可以通过调用该摄像头释放回调函数,基于注册记录以向近距离观看提醒模块发送第一通知消息。请继续参照图5,上述S410具体可以包括S410a:Based on the above-mentioned S501 in the embodiment of this application, it can be seen that after the close viewing reminder module is started, the camera release callback function is registered. Therefore, after S409 releases the camera from the home camera function module, the camera function module can send the first notification message to the close viewing reminder module based on the registration record by calling the camera release callback function. Please continue to refer to Figure 5. The above S410 may specifically include S410a:
S410a.摄像头功能模块触发调用摄像头释放回调函数,基于注册记录以向近距离观看提醒模块发送第一通知消息。S410a. The camera function module triggers a call to the camera release callback function, and sends a first notification message to the close viewing reminder module based on the registration record.
在近距离观看提醒模块在HIDL摄像头接口服务模块中注册摄像头释放回调函数的实施例中,请继续参照图6,上述S410a具体可以包括S601和S602:In the embodiment where the close viewing reminder module registers the camera release callback function in the HIDL camera interface service module, please continue to refer to Figure 6. The above S410a may specifically include S601 and S602:
S601.摄像头功能模块向HIDL摄像头接口服务模块发送第二通知消息。S601. The camera function module sends a second notification message to the HIDL camera interface service module.
其中,第二通知消息用于通知HIDL摄像头接口服务模块摄像头被释放的消息。因此,HIDL摄像头接口服务模块接收到第二通知消息之后,可以调用摄像头释放回调函数,基于注册记录以向近距离观看提醒模块发送第一通知消息。The second notification message is used to notify the HIDL camera interface service module that the camera is released. Therefore, after receiving the second notification message, the HIDL camera interface service module can call the camera release callback function to send the first notification message to the close viewing reminder module based on the registration record.
在一些实施例中,上述S410a具体可以是摄像头功能模块中的camera HAL模块向HIDL摄像头接口服务模块发送第二通知消息。In some embodiments, the above-mentioned S410a may be that the camera HAL module in the camera function module sends a second notification message to the HIDL camera interface service module.
S602.HIDL摄像头接口服务模块响应于第二通知消息,调用摄像头释放回调函数,基于注册记录向近距离观看提醒模块发送第一通知消息。S602. The HIDL camera interface service module responds to the second notification message, calls the camera release callback function, and sends the first notification message to the close viewing reminder module based on the registration record.
由上述实施例的说明可知,第二通知消息用于通知HIDL摄像头接口服务模块摄像头被释放的消息,因此,HIDL摄像头接口服务模块接收到第二通知消息之后,可以调用摄像头释放回调函数,触发向近距离观看提醒模块发送第一通知消息。It can be seen from the description of the above embodiment that the second notification message is used to notify the HIDL camera interface service module that the camera is released. Therefore, after receiving the second notification message, the HIDL camera interface service module can call the camera release callback function to trigger the The close viewing reminder module sends the first notification message.
在一些实施例中,对于摄像头功能模块而言,在摄像头被释放之前,可能并不清楚是否有功能模块注册了摄像头释放回调函数,或者哪些功能模块注册了摄像头释放回调函数。因此,在摄像头功能模块向HIDL摄像头接口服务模块发送第二通知消息之前,摄像头功能模块先可以在注册记录中查询哪些功能模块注册了摄像头释放回调函数。之后,摄像头功能模块在摄像头被释放之后,可以向这部分注册了摄像头释放回调函数的功能模块发送第一通知消息。在本申请实施例中,近距离观看提醒模块在启动之后注册了摄像头释放回调函数,因此,在该实施例中,摄像头功能模块可以向HIDL摄像头接口服务模块发送第二通知消息,以使HIDL摄像头接口服务模块向近距离观看提醒模块发送第一通知消息。In some embodiments, for the camera function module, before the camera is released, it may not be clear whether any function module has registered the camera release callback function, or which functional modules have registered the camera release callback function. Therefore, before the camera function module sends the second notification message to the HIDL camera interface service module, the camera function module can first query in the registration record which functional modules have registered the camera release callback function. Afterwards, after the camera is released, the camera function module can send the first notification message to this part of the function module that has registered the camera release callback function. In the embodiment of this application, the close viewing reminder module registers the camera release callback function after startup. Therefore, in this embodiment, the camera function module can send a second notification message to the HIDL camera interface service module to enable the HIDL camera The interface service module sends the first notification message to the close viewing reminder module.
具体的,在一些实施例中,在将摄像头从家庭相机功能模块释放之后,摄像头功能模块可以在HIDL摄像头接口服务模块查询哪些功能模块注册了摄像头释放回调函数。Specifically, in some embodiments, after releasing the camera from the home camera function module, the camera function module can query the HIDL camera interface service module which functional modules have registered the camera release callback function.
在本申请实施例中,近距离观看提醒模块启动之后,注册了摄像头释放回调函数。而摄像头功能模块在摄像头被释放之后,即可调用摄像头释放回调函数。调用摄像头释放回调函数之后,即可触发向近距离观看提醒模块发送第一通知消息,以使近距离观看提醒模块及时感知到摄像头被释放的消息,便于近距离观看提醒模块及时的重新调用摄像头,以恢复近距离观看提醒功能。In the embodiment of this application, after the close viewing reminder module is started, the camera release callback function is registered. The camera function module can call the camera release callback function after the camera is released. After the camera release callback function is called, the first notification message can be triggered to be sent to the close viewing reminder module, so that the close viewing reminder module can promptly perceive the news that the camera has been released, so that the close viewing reminder module can promptly re-call the camera. to restore the close viewing reminder function.
结合上述实施例的说明可知,如果近距离观看提醒功能启动的时候,摄像头处于空闲状态,那么摄像头将会被分配给近距离观看提醒模块,即图4C所示的S403和S404。而在此之后,家庭相机启动,将会抢占摄像头的控制权和使用权,导致近距离观看提醒模块暂时中断。因此,在一些实施例中,近距离观看提醒模块可以在摄像头被抢占的时候,再注册摄像头释放回调函数,这样也可以保证家庭相机功能模块退出使用摄像头时,能够调用摄像头释放回调函数通知近距离观看提醒模块摄像头被释放的消息。从而保证近距离观看提醒模块可以及时的重新调用摄像头,恢复近距离观看提醒功能。Based on the description of the above embodiment, it can be seen that if the camera is in an idle state when the close viewing reminder function is activated, the camera will be assigned to the close viewing reminder module, that is, S403 and S404 shown in Figure 4C. After that, when the home camera is started, it will seize the control and use rights of the camera, causing the close viewing reminder module to be temporarily interrupted. Therefore, in some embodiments, the close viewing reminder module can register the camera release callback function when the camera is preempted. This can also ensure that when the home camera function module exits the use of the camera, it can call the camera release callback function to notify the close range user. Watch the message that reminds the module camera to be released. This ensures that the close viewing reminder module can promptly re-call the camera and restore the close viewing reminder function.
由上述实施例的说明可知,近距离观看提醒模块被家庭相机功能模块抢占摄像头的控制权和使用权的过程,具体可以包括从近距离观看提醒模块释放摄像头,再由摄像头功能模块将摄像头分配给家庭相机功能模块。如图7所示,S406具体可以包括S406a-S406c:As can be seen from the description of the above embodiments, the process in which the close viewing reminder module seizes the control rights and usage rights of the camera by the home camera function module may specifically include releasing the camera from the close viewing reminder module, and then assigning the camera to the home camera function module. Home camera function module. As shown in Figure 7, S406 may specifically include S406a-S406c:
S406a.摄像头功能模块响应于摄像头调用指令,向近距离观看提醒模块发送第三控制指令。S406a. The camera function module responds to the camera calling instruction and sends the third control instruction to the close viewing reminder module.
S406b.响应于第三控制指令,近距离观看提醒模块释放摄像头。S406b. In response to the third control instruction, the close viewing reminder module releases the camera.
同时,在近距离观看功能模块摄像头释放摄像头之后,近距离观看提醒模块即可注册摄像头释放回调函数,如图7所示的S701:At the same time, after the close viewing function module releases the camera, the close viewing reminder module can register the camera release callback function, as shown in S701 in Figure 7:
S701.近距离观看提醒模块注册摄像头释放回调函数。S701. The close viewing reminder module registers the camera release callback function.
需要说明的是,上述S701可以在S406b之前执行,也可以在S406b之后执行,或者,S701与S406b还可以同时执行。在本申请实施例中,对于S701和S406b的执行先后顺序不予限定。It should be noted that the above S701 may be executed before S406b, or may be executed after S406b, or S701 and S406b may be executed at the same time. In the embodiment of the present application, the execution order of S701 and S406b is not limited.
S406c.摄像头功能模块将摄像头分配给家庭相机功能模块。S406c. The camera function module assigns the camera to the home camera function module.
可以理解的,在图7所示的实施例中,摄像头功能模块在家庭相机退出使用摄像头时,可以通过触发调用摄像头释放回调函数的方式,向近距离观看提醒模块发送第一通知消息。It can be understood that in the embodiment shown in Figure 7, the camera function module can send a first notification message to the close viewing reminder module by triggering the call of the camera release callback function when the home camera exits the use of the camera.
在本申请实施例提供的技术方案中,近距离观看提醒模块在启动时,如果摄像头处于空闲状态,可以立即获得摄像头的控制权和使用权。而之后,摄像头被分配给其他功能模块如家庭相机,近距离观看提醒模块的摄像头才被抢占,近距离观看提醒功能将会暂时中断。此时,近距离观看提醒模块在释放摄像头时,可以注册摄像头释放回调函数,以使摄像头功能模块在其他功能模块退出使用摄像头之后,可以调用该摄像头释放回调函数,以通知近距离观看提醒模块摄像头被释放的消息。从而也可以保证近距离观看提醒模块及时的重新调用摄像头,以及时的恢复近距离观看提醒功能。In the technical solution provided by the embodiment of the present application, when the close viewing reminder module is started, if the camera is in an idle state, the control and use rights of the camera can be obtained immediately. After that, the camera is assigned to other functional modules such as home cameras, and the camera of the close viewing reminder module is preempted, and the close viewing reminder function will be temporarily interrupted. At this time, when the close viewing reminder module releases the camera, it can register the camera release callback function, so that the camera function module can call the camera release callback function to notify the close viewing reminder module of the camera after other functional modules quit using the camera. News of being released. This can also ensure that the close viewing reminder module can promptly re-call the camera and restore the close viewing reminder function in a timely manner.
另外,在摄像头功能模块通过触发调用摄像头释放回调函数向近距离观看提醒模块发送第一通知消息的实施例中,如果近距离观看提醒功能启动之前,摄像头已经被分配给其他功能模块(如第三功能模块等),并且近距离观看提醒模块对于摄像头的使用优先权低于第三功能模块对于摄像头的使用优先权。响应于近距离观看提醒功能的打开操作,可以先启动近距离观看提醒功能,但由于摄像头被其他功能模块占用,此时近距离观看提醒功能无法正常的实现。In addition, in the embodiment in which the camera function module sends the first notification message to the close viewing reminder module by triggering the camera release callback function, if the camera has been assigned to other functional modules (such as the third Function module, etc.), and the priority of the close viewing reminder module for the use of the camera is lower than the priority of the third functional module for the use of the camera. In response to the opening operation of the close viewing reminder function, the close viewing reminder function can be started first, but because the camera is occupied by other functional modules, the close viewing reminder function cannot be implemented normally at this time.
为了在第三功能模块退出使用摄像头时,近距离观看提醒模块可以及时的调用摄像头,来实现近距离观看提醒功能,虽然无法使用摄像头,但是近距离观看提醒模块可以先注册摄像头释放回调函数。这样,在第三功能模块退出使用摄像头时,摄像头功能模块也可以及时触发调用摄像头释放回调函数,基于注册记录以向近距离观看提醒模块发送第一通知消息。近距离观看提醒模块在接收到第一通知消息之后,可以及时的调用摄像头,以实现近距离观看提醒功能。In order to when the third function module exits the use of the camera, the close viewing reminder module can promptly call the camera to implement the close viewing reminder function. Although the camera cannot be used, the close viewing reminder module can first register the camera release callback function. In this way, when the third function module quits using the camera, the camera function module can also trigger and call the camera release callback function in time, and send the first notification message to the close viewing reminder module based on the registration record. After receiving the first notification message, the close viewing reminder module can promptly call the camera to implement the close viewing reminder function.
在一些实施例中,第三功能模块可以是视频通话等相关的功能模块。可以理解的,第三功能模块也可以替换为上述家庭相机功能模块。In some embodiments, the third functional module may be a video call or other related functional module. It is understandable that the third functional module can also be replaced by the above-mentioned home camera functional module.
在一些实施例中,如图8所示,为本申请实施例提供的智慧屏的软件架构示意图,其中示出了与本申请实施例提出的摄像头的分配方法相关的功能模块,以及各个功能模块之间的数据流转情况。In some embodiments, as shown in Figure 8, a schematic diagram of the software architecture of a smart screen provided by an embodiment of the present application is shown, which shows the functional modules related to the camera allocation method proposed by the embodiment of the present application, as well as each functional module. data flow between.
在图8所示的实施例中,上述摄像头功能模块具体可以划分为:位于应用程序框架层的摄像头服务模块,以及位于硬件抽象层的摄像头硬件抽象模块。In the embodiment shown in Figure 8, the above-mentioned camera function module can be specifically divided into: a camera service module located at the application framework layer, and a camera hardware abstraction module located at the hardware abstraction layer.
结合图8所示的功能模块,以下对本申请实施例提供的摄像头的分配方法的完整流程进行说明,请参照图9。在该实施例中,近距离观看提醒模块作为儿童模式应用(APK)的一个功能,家庭相机功能为家庭相机应用。Combined with the functional modules shown in Figure 8, the complete process of the camera allocation method provided by the embodiment of the present application is described below. Please refer to Figure 9. In this embodiment, the close viewing reminder module is a function of the child mode application (APK), and the family camera function is a family camera application.
首先,用户打开智慧屏的儿童模式。之后,儿童模式判断是否打开了近距离观看提醒功能。在检测到儿童模式打开了近距离观看提醒功能之后,儿童模式在HIDL servicecamera proxy中注册摄像头释放回调函数。并且,儿童模式通过camera server模块启动摄像头(camera HAL)。之后,儿童模式通过camera HAL获取图像数据,分析图像数据可以监控用户的观看距离,并在检测到观看距离过近时提醒用户。First, the user turns on the child mode of the smart screen. Afterwards, the child mode determines whether the close viewing reminder function is turned on. After detecting that the child mode has turned on the close viewing reminder function, the child mode registers the camera release callback function in the HIDL servicecamera proxy. Moreover, the child mode starts the camera (camera HAL) through the camera server module. Afterwards, the child mode obtains image data through the camera HAL, analyzes the image data to monitor the user's viewing distance, and alerts the user when it detects that the viewing distance is too close.
然后,用户打开智慧屏的家庭相机。家庭相机启动之后,将会抢占摄像头的控制权和使用权。此时,儿童模式的近距离观看提醒功能将会暂时中断。Then, the user opens the home camera of the smart screen. After the home camera is started, it will seize the control and use rights of the camera. At this time, the close viewing reminder function of children's mode will be temporarily interrupted.
之后,用户再关闭家庭相机。家庭相机关闭的过程中,家庭相机会通过cameraserver控制释放摄像头。在摄像头被释放之后,camera Half从HIDL service cameraproxy调用摄像头释放回调函数,触发向儿童模式发送第一通知消息,以通知儿童模式摄像头已被释放。Afterwards, the user turns off the home camera. During the process of closing the family camera, the family camera will release the camera through camera server control. After the camera is released, camera Half calls the camera release callback function from the HIDL service cameraproxy, triggering the first notification message to be sent to the child mode to notify the child mode that the camera has been released.
儿童模式在接收到第一通知消息之后,可以重新通过camera server模块重读调用摄像头,并获取摄像头采集的图像进行分析。之后,根据图像分析的结果可以继续对用户的观看距离进行监控并提醒。After receiving the first notification message, the child mode can re-read and call the camera through the camera server module, and obtain the images collected by the camera for analysis. Afterwards, the user's viewing distance can be continued to be monitored and reminded based on the results of image analysis.
图10为本申请实施例提供的摄像头的分配方法的流程示意图。在该实施例中,用户首先打开儿童模式,儿童模式将会获取保存的记录中是否打开了近距离观看提醒功能。如果没有打开近距离观看提醒模块,用户可以在儿童模式的功能设置界面手动打开近距离观看提醒功能。在检测到近距离观看提醒功能打开之后,近距离观看提醒模块可以在HIDLservice camera proxy中注册摄像头释放回调函数。Figure 10 is a schematic flowchart of a camera allocation method provided by an embodiment of the present application. In this embodiment, the user first turns on the child mode, and the child mode will obtain whether the close viewing reminder function is turned on in the saved record. If the close viewing reminder module is not turned on, the user can manually turn on the close viewing reminder function in the function setting interface of the child mode. After detecting that the close viewing reminder function is turned on, the close viewing reminder module can register the camera release callback function in the HIDLservice camera proxy.
之后,可以判断摄像头释放可用。如果打开儿童模式(或者打开近距离观看提醒功能)时摄像头可用,那么可以直接将摄像头分配给近距离观看提醒模块。之后,近距离观看提醒模块可以获取摄像头采集的图像,分析图像确定用户的观看距离。并且,在分析图像确定用户的观看距离过近时提醒用户。After that, it can be determined that the camera release is available. If the camera is available when the child mode is turned on (or the close viewing reminder function is turned on), the camera can be directly assigned to the close viewing reminder module. Afterwards, the close viewing reminder module can obtain the image collected by the camera and analyze the image to determine the user's viewing distance. Also, the user is alerted when the image analysis determines that the user's viewing distance is too close.
如果打开儿童模式(或者打开近距离观看提醒功能)时摄像头不可用,那么则需等待HIDL service camera proxy调用摄像头释放回调函数发送的摄像头被释放的通知消息。在判断接收到摄像头被释放的通知消息之后,近距离观看提醒模块可以调用摄像头,智慧屏也可以将摄像头分配给近距离观看提醒模块。之后,近距离观看提醒模块即可获取摄像头采集的图像进行分析,并基于图像分析的结果对用户的观看距离进行监控和提醒。If the camera is not available when child mode is turned on (or the close viewing reminder function is turned on), then you need to wait for the notification message that the camera is released by calling the camera release callback function sent by the HIDL service camera proxy. After determining that the notification message that the camera is released is received, the close viewing reminder module can call the camera, and the smart screen can also assign the camera to the close viewing reminder module. Afterwards, the close viewing reminder module can obtain the images collected by the camera for analysis, and monitor and remind the user's viewing distance based on the results of image analysis.
其中,camera HAL在检测到摄像头被释放之后,将会向HIDL service cameraproxy发送通知消息。而HIDL service camera proxy在接收到该通知消息之后,将会调用摄像头释放回调函数,向注册了摄像头释放回调函数的近距离观看提醒模块发送摄像头被释放的通知消息。Among them, after the camera HAL detects that the camera is released, it will send a notification message to the HIDL service cameraproxy. After receiving the notification message, the HIDL service camera proxy will call the camera release callback function and send a notification message that the camera is released to the close viewing reminder module registered with the camera release callback function.
进一步的,在近距离观看提醒模块获取摄像头采集的图像,并基于图像分析的结果对用户的观看距离近监控并提醒的过程中,摄像头的使用权可能会被其他功能模块抢占。由于在打开近距离观看提醒功能时,近距离观看提醒模块注册了摄像头释放回调函数。因此,在检测到摄像头被抢占之后,近距离观看提醒模块可以检测是否接收到HIDLservice camera proxy发送的摄像头被释放的通知消息。并在接收到摄像头被释放的通知消息之后,重新调用摄像头,以获取摄像头采集的图像并恢复近距离观看提醒功能。Furthermore, in the process of the close viewing reminder module acquiring images collected by the camera and monitoring and reminding the user of the user's close viewing distance based on the results of image analysis, the right to use the camera may be preempted by other functional modules. Because when the close viewing reminder function is turned on, the close viewing reminder module registers the camera release callback function. Therefore, after detecting that the camera is preempted, the close viewing reminder module can detect whether a notification message sent by the HIDLservice camera proxy that the camera is released is received. And after receiving the notification message that the camera is released, the camera is called again to obtain the images collected by the camera and restore the close viewing reminder function.
本申请另一些实施例提供了一种计算机设备,该计算机设备可以是上述电子设备(如智慧屏1)。该计算机设备可以包括:存储器和一个或多个处理器。该存储器与处理器耦合。该存储器还用于存储计算机程序代码,该计算机程序代码包括计算机指令。当处理器执行计算机指令时,计算机设备可执行上述方法实施例中智慧屏1执行的各个功能或者步骤。该计算机设备是电子设备时,其结构可以参考图2A所示的电子设备100的结构。Other embodiments of the present application provide a computer device, which may be the above-mentioned electronic device (such as smart screen 1). The computer device may include memory and one or more processors. The memory is coupled to the processor. The memory is also used to store computer program code, which includes computer instructions. When the processor executes computer instructions, the computer device can perform each function or step performed by the smart screen 1 in the above method embodiment. When the computer device is an electronic device, its structure may refer to the structure of the electronic device 100 shown in FIG. 2A .
本申请实施例还提供一种芯片系统,如图11所示,该芯片系统1100包括至少一个处理器1101和至少一个接口电路1102。处理器1101和接口电路1102可通过线路互联。例如,接口电路1102可用于从其它装置(例如计算机设备的存储器)接收信号。又例如,接口电路1102可用于向其它装置(例如处理器1101)发送信号。示例性的,接口电路1102可读取存储器中存储的指令,并将该指令发送给处理器1101。当指令被处理器1101执行时,可使得计算机设备执行上述实施例中的各个步骤。当然,该芯片系统还可以包含其他分立器件,本申请实施例对此不作具体限定。An embodiment of the present application also provides a chip system. As shown in FIG. 11 , the chip system 1100 includes at least one processor 1101 and at least one interface circuit 1102 . The processor 1101 and the interface circuit 1102 may be interconnected by wires. For example, interface circuitry 1102 may be used to receive signals from other devices, such as the memory of a computer device. As another example, interface circuit 1102 may be used to send signals to other devices (eg, processor 1101). For example, the interface circuit 1102 can read instructions stored in the memory and send the instructions to the processor 1101. When the instructions are executed by the processor 1101, the computer device can be caused to perform various steps in the above embodiments. Of course, the chip system may also include other discrete devices, which are not specifically limited in the embodiments of this application.
本申请实施例还提供一种计算机可读存储介质,该计算机可读存储介质包括计算机指令,当计算机指令在上述电子设备(如智慧屏1)上运行时,使得该电子设备执行上述方法实施例中智慧屏1执行的各个功能或者步骤。Embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium includes computer instructions. When the computer instructions are run on the above-mentioned electronic device (such as smart screen 1), the electronic device executes the above-mentioned method embodiment. Each function or step performed by the smart screen 1.
本申请实施例还提供一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行上述方法实施例中智慧屏1执行的各个功能或者步骤。其中,该计算机可以是电子设备,如智慧屏1。Embodiments of the present application also provide a computer program product. When the computer program product is run on a computer, it causes the computer to perform each function or step performed by the smart screen 1 in the above method embodiment. The computer may be an electronic device, such as a smart screen 1.
通过以上实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In practical applications, the above functions can be allocated according to needs. Different functional modules are completed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, for example, multiple units or components may be combined or can be integrated into another device, or some features can be ignored, or not implemented. On the other hand, the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。A unit described as a separate component may or may not be physically separate. A component shown as a unit may be one physical unit or multiple physical units, that is, it may be located in one place, or it may be distributed to multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application can be integrated into one processing unit, each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated units can be implemented in the form of hardware or software functional units.
集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。Integrated units may be stored in a readable storage medium if they are implemented in the form of software functional units and sold or used as independent products. Based on this understanding, the technical solutions of the embodiments of the present application are essentially or contribute to the existing technology, or all or part of the technical solution can be embodied in the form of a software product, and the software product is stored in a storage medium , including several instructions to cause a device (which can be a microcontroller, a chip, etc.) or a processor to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage media include: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program codes.
以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。The above contents are only specific implementation modes of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be covered by the protection scope of the present application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310492723.7A CN117729425B (en) | 2023-05-04 | 2023-05-04 | Camera distribution method and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310492723.7A CN117729425B (en) | 2023-05-04 | 2023-05-04 | Camera distribution method and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117729425A true CN117729425A (en) | 2024-03-19 |
CN117729425B CN117729425B (en) | 2025-03-25 |
Family
ID=90200333
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310492723.7A Active CN117729425B (en) | 2023-05-04 | 2023-05-04 | Camera distribution method and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117729425B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103106117A (en) * | 2012-12-25 | 2013-05-15 | 青岛海信电器股份有限公司 | Resource allocation method and electronic equipment |
CN103793246A (en) * | 2014-01-22 | 2014-05-14 | 深圳Tcl新技术有限公司 | Method and system for coordinating camera resources |
CN105068945A (en) * | 2015-08-03 | 2015-11-18 | Tcl集团股份有限公司 | Camera distribution method and system for Android system |
WO2022170856A1 (en) * | 2021-02-09 | 2022-08-18 | 华为技术有限公司 | Method for establishing connection, and electronic device |
-
2023
- 2023-05-04 CN CN202310492723.7A patent/CN117729425B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103106117A (en) * | 2012-12-25 | 2013-05-15 | 青岛海信电器股份有限公司 | Resource allocation method and electronic equipment |
CN103793246A (en) * | 2014-01-22 | 2014-05-14 | 深圳Tcl新技术有限公司 | Method and system for coordinating camera resources |
CN105068945A (en) * | 2015-08-03 | 2015-11-18 | Tcl集团股份有限公司 | Camera distribution method and system for Android system |
WO2022170856A1 (en) * | 2021-02-09 | 2022-08-18 | 华为技术有限公司 | Method for establishing connection, and electronic device |
Also Published As
Publication number | Publication date |
---|---|
CN117729425B (en) | 2025-03-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US12231812B2 (en) | Device interaction method and electronic device | |
WO2020177622A1 (en) | Method for displaying ui assembly and electronic device | |
CN114173204B (en) | Message prompting method, electronic equipment and system | |
JP7537828B2 (en) | Device identification method and related apparatus | |
WO2021213164A1 (en) | Application interface interaction method, electronic device, and computer readable storage medium | |
CN110825469A (en) | Voice assistant display method and device | |
CN110109636A (en) | Throw screen method, electronic equipment and system | |
WO2022017393A1 (en) | Display interaction system, display method, and device | |
CN115002937A (en) | Multi-device cooperation method, electronic device and related product | |
CN114040242B (en) | Screen projection method, electronic device and storage medium | |
WO2022143883A1 (en) | Photographing method and system, and electronic device | |
CN112527174B (en) | Information processing method and electronic equipment | |
CN113806105A (en) | Message processing method and device, electronic equipment and readable storage medium | |
WO2024021519A1 (en) | Card display method and terminal device | |
CN114035721A (en) | Touch screen display method and device and storage medium | |
JP2023546870A (en) | Interface display method and electronic device | |
WO2023184825A1 (en) | Video recording control method of electronic device, electronic device, and readable medium | |
EP4152756A1 (en) | Device recommendation method and electronic device | |
CN117729425A (en) | Camera distribution method and electronic equipment | |
CN111736997B (en) | Memory allocation method and device, electronic equipment and storage medium | |
CN117631950A (en) | A split-screen display method and related devices | |
CN115309316B (en) | Device using method and device | |
CN114173315B (en) | Bluetooth connection method and terminal device | |
CN116708647B (en) | Notification message reply method and electronic device | |
WO2024109481A1 (en) | Window control method and electronic device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information | ||
CB02 | Change of applicant information |
Country or region after: China Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040 Applicant after: Honor Terminal Co.,Ltd. Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong Applicant before: Honor Device Co.,Ltd. Country or region before: China |
|
GR01 | Patent grant | ||
GR01 | Patent grant |