CN117729425A - Camera distribution method and electronic equipment - Google Patents

Camera distribution method and electronic equipment Download PDF

Info

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
functional module
function
close
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.)
Pending
Application number
CN202310492723.7A
Other languages
Chinese (zh)
Inventor
袁文波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202310492723.7A priority Critical patent/CN117729425A/en
Publication of CN117729425A publication Critical patent/CN117729425A/en
Pending legal-status Critical Current

Links

Landscapes

  • Telephone Function (AREA)

Abstract

The embodiment of the application provides a camera distribution method and electronic equipment, relates to the technical field of electronics, and is used for solving the problem that a close-range watching reminding function cannot be timely recovered after other functional modules are out of use of a camera. The method is applied to electronic equipment, wherein the electronic equipment comprises a camera, and a first functional module and a second functional module which support the use of the camera to realize corresponding functions; the first function corresponding to the first function module is in an on state, and the current camera is distributed to the second function module. The method comprises the following steps: acquiring a first operation aiming at a second functional module; in response to a first operation, releasing the camera from the second functional module and assigning the camera to the first functional module.

Description

Camera distribution method and electronic equipment
Technical Field
The embodiment of the application relates to the technical field of electronics, in particular to a camera distribution method and electronic equipment.
Background
When a user uses an electronic device, if the eyes are too close to the display screen of the electronic device, the eyesight of the user is easily damaged. Therefore, in order to protect the eyesight of the user when the user uses the electronic device, the electronic device can monitor the distance between the eyes of the user and the display screen of the electronic device when the user uses the electronic device and remind when the distance between the eyes of the user and the display screen is detected to be too close.
In the related art, in order to realize the function of reminding the user of watching in a short distance, a camera may be used to acquire an image in front of a display screen. While the camera of an electronic device is usually used by only one functional module at a time. On the premise of opening the close-range viewing reminding function, if other functional modules need to use the camera, and the use priority of the cameras of the other functional modules is higher than that of the close-range viewing reminding module, the close-range viewing reminding function is forced to be interrupted. How to recover the close-range watching reminding function becomes a technical problem to be solved urgently.
Disclosure of Invention
The embodiment of the application provides a camera distribution method and electronic equipment, which are used for solving the problem that a close-range watching reminding function cannot be recovered in time after other functional modules are out of use of a camera.
In order to achieve the above purpose, the embodiments of the present application adopt the following technical solutions:
in a first aspect, a method for allocating a camera is provided, where the method is applied to an electronic device, and the electronic device includes a camera, and a first functional module and a second functional module that support implementation of corresponding functions using the camera; the first function corresponding to the first function module is in an on state, and the current camera is distributed to the second function module. The method comprises the following steps:
In the case where a camera is assigned to the second functional module, the user may initiate a first operation for the second functional module if the second functional module needs to be taken out of use of the camera. The electronic device releases the camera from the second functional module in response to the first operation. Because the first function corresponding to the first functional module is in the on state, the electronic device can also allocate the camera to the first functional module after releasing the camera. Thus, the first functional module may implement the first function using the camera. Thus, the first functional module can timely call the camera to realize the first function after the camera is released. Meanwhile, the first functional module does not need to continuously try to open the camera, so that the waste of cpu resources can be avoided.
In a possible implementation manner of the first aspect, the electronic device further includes a camera function module, and in response to the first operation, releasing the camera from the second function module and allocating the camera to the first function module may specifically include:
the camera functional module responds to the first operation, releases the camera from the second functional module and triggers sending of a notification message that the camera is released to the first functional module. After the first functional module receives the notification message, the first functional module can sense that the camera is released. And then, the first functional module can call the camera. The first function module sends a first camera call instruction to the camera function module based on the notification message. And responding to the first camera calling instruction, and distributing the camera to the first functional module by the camera functional module. Thus, after the camera is released by the other functional modules, the camera functional module can trigger to send a notification message to the first functional module so as to inform the first functional module of the released message of the camera, so that the first functional module can timely call the camera to start the first function.
In a possible implementation manner of the first aspect, the first functional module has a lower priority for use of the camera than the second functional module. Thus, in the case where the first functional module is using the camera, if the second functional module requests to call the camera, the electronic device will assign the usage right of the camera to the second functional module. That is, the second functional module is allowed to preempt the priority of use of the first functional module for the camera. And if the second functional module is using the camera, the electronic device will not allow the first functional module to preempt the usage rights of the second functional module for the camera if the first functional module requests to call the camera.
In another possible implementation manner of the first aspect, before the acquiring the first operation for the second functional module, the method further includes: a second operation is obtained 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 manner of the first aspect, before acquiring the second operation for the second functional module, the method further includes: a third operation is acquired for the first functional module. Since the third operation for the first functional module occurs before the first operation for the second functional module, i.e. it means that the camera is not currently assigned to the other functional module. Thus, in response to the third operation, the electronic device starts the first function, and the camera may be assigned to the first function module. That is, in this embodiment, the camera has been allocated to the first functional module before the second operation for the second functional module is acquired as described above. The allocating 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 release the camera from the first functional module first. The camera can then be assigned to the second functional module.
In this scenario, if the first function is first turned on, the camera will be assigned to the first functional module. And then opening the function corresponding to the second functional module, so that the second functional module can preempt the use right of the camera, and the first function is temporarily interrupted. At this time, it is necessary to release the camera from the first functional module and then assign the camera to the second functional module. And then, when the second functional module releases the camera, notifying the first functional module of the released message of the camera, so that the first functional module can timely recall the camera, and the first function is recovered.
In another possible implementation manner of the first aspect, if the first function module calls the camera before and the second function module calls the camera after, before assigning the camera to the second function module in response to the second operation, the method may further include: and judging the use priority of the first functional module and the second functional module for the camera. In this embodiment, the electronic device may specifically allocate the camera to the second functional module in response to the second operation after determining that the second functional module has a higher priority of use of the camera than the first functional module.
In another possible implementation manner of the first aspect, the electronic device further includes a camera function module. After obtaining the third operation for the first functional module, the method may further include: the first functional module initiates a first registration request to register a 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 by 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. After that, after the camera is released, the camera function module may trigger the call of the camera release callback function, and, based on the registration record, may send a notification message that the camera is released to the first function module after the call of the camera release callback function.
In this scheme, when the first function module starts the first function, the camera release callback function can be registered. The electronic device may add a registration record of the camera release callback function by the first functional module in the electronic device in response to a registration request initiated by the first functional module to register the camera release callback function. And then, if the camera use right of the first functional module is preempted by other functional modules (such as the second functional module), when the other functional modules release the camera, the electronic equipment can call the camera release callback function and send a notification message of the released camera to the first functional module. Therefore, the first functional module can timely sense that the camera is released, and timely recall the camera to realize the first function.
In another possible implementation manner of the first aspect, the electronic device further includes a camera function module. The first function is started before, and the second function module calls the camera after. When the first functional module is started, the camera is in an idle state, so that the electronic equipment can directly distribute the camera to the first functional module, namely the first functional module can obtain the use right of the camera. However, after that, the second functional module invokes the camera, and the camera usage right will be assigned to the second functional module, i.e. the camera usage right is preempted by the second functional module. In this embodiment, the first functional module may re-register the camera release callback function when the usage right of the camera is preempted. Specifically, after the releasing the camera from the first functional module in response to the second operation, the method further includes: the first functional module initiates a second registration request to register the camera release callback function. And responding to the second registration request, and adding a registration record of the camera release callback function by the first functional module. Likewise, after the camera is released, the camera function module may trigger the call of the camera release callback function, and, based on the registration record, may send a notification message that the camera is released to the first function module after the call of the camera release callback function.
Therefore, the first functional module registers the camera release callback function when the use right of the camera is preempted by other functional modules, and the camera release callback function can be triggered and called by the camera functional module to send notification information to the first functional module when the second functional module exits from using the camera. The first function module can timely sense that the camera is released, and timely recall the camera to recover the first function.
In another possible implementation manner of the first aspect, the electronic device further includes a camera function module. The first functional module requesting to call the camera may also be after the camera is assigned to the second functional module. That is, after assigning the camera to the second functional module in response to the second operation, the above method further includes: a fourth operation is acquired for the first functional module. In response to the fourth operation, the electronic device initiates the first function. Because the current camera is in an occupied state, the electronic device cannot allocate the camera to the first functional module. Therefore, after the first function is started, the first function module can register the camera release callback function first so as to timely sense the released message of the camera when the other function modules release the camera. That is, in response to the fourth operation, the first functional module may also initiate a third registration request for the camera release callback function. And responding to the third registration request, and adding a registration record of the callback function released by the camera by the first functional module by the electronic equipment. Likewise, after the camera is released, the camera function module may trigger the call of the camera release callback function, and, based on the registration record, may send a notification message that the camera is released to the first function module after the call of the camera release callback function. Therefore, the first functional module can timely sense the released information of the camera after the camera is released by other functional modules and timely call the camera to realize the first function.
In another possible implementation manner of the first aspect, after the electronic device obtains the fourth operation for the first functional module in a case that the camera is allocated to the second functional module, the electronic device starts the first function and determines a usage priority of the first functional module and the second functional module for the camera in response to the fourth operation. In the case that the first function module is determined to have a lower priority for use of the camera than the second function module, the electronic device does not immediately allocate the camera to the first function module in response to the fourth operation, but the first function module registers the camera release callback function first. After the second functional module releases the camera, the electronic device may call a camera release callback function and send a notification message to the first functional module. Therefore, the first functional module can call the camera in time after receiving the notification message, and the electronic equipment can allocate the camera to the first functional module.
In another possible implementation of the first aspect, the first functional module includes a close-range viewing alert module. In this embodiment, after the camera is assigned to the first functional module (i.e., the close-range viewing alert module), the method further includes: the close-range viewing reminding module acquires images acquired by the camera. And the close-range viewing reminding module analyzes the image and reminds the viewing distance of the user according to the result obtained by the analysis of the image.
In a second aspect, a method for allocating a camera is provided, where the method is applied to an electronic device, and the electronic device includes a camera, a camera function module, a first function module and a second function module that support using the camera to implement corresponding functions, and a camera allocation module; the first function corresponding to the first function module is in an on state, and the current camera is distributed to the second function module.
The method comprises the following steps:
the second functional module sends a camera release instruction to the camera functional module; and responding to a camera release instruction sent by the second functional module, releasing the camera by the camera functional module, and distributing the camera to the first functional module. Thus, the first functional module can timely call the camera to realize the first function after the camera is released. Meanwhile, the first functional module does not need to continuously try to open the camera, so that the waste of cpu resources can be avoided.
In another possible implementation manner of the second aspect, the allocating a camera to the first functional module may specifically include: the camera functional module sends a notification message that the camera is released to the first functional module. The first functional module sends a second camera calling instruction to the camera functional module based on the notification message. And responding to the second camera calling instruction, and distributing the camera to the first functional module by the camera functional module. In this scheme, after the second functional module releases the camera, the camera functional module actively notifies the first functional module of the released message of the camera. Therefore, the situation that the first functional module cannot timely sense the released information of the camera can be avoided, the situation that the first functional module continuously tries to open the camera can also be avoided, and the waste of cpu resources can be avoided.
In a possible implementation manner of the second aspect, before the second functional module sends the camera release instruction to the camera functional module, the method further includes: the second functional module sends a third camera calling instruction to the camera functional module; and responding to the second camera calling instruction, and distributing the camera to the second functional module by the camera functional module. When the second functional module needs to use the camera, a third camera calling instruction can be sent to the camera functional module, and then the camera functional module can distribute the camera to the second functional module.
In another possible implementation manner of the second aspect, the first functional module has a lower priority for use of the camera than the second functional module. Thus, in the case where the first functional module is using the camera, if the second functional module requests to call the camera, the electronic device will assign the usage right of the camera to the second functional module. That is, the second functional module is allowed to preempt the priority of use of the first functional module for the camera. And if the second functional module is using the camera, the electronic device will not allow the first functional module to preempt the usage rights of the second functional module for the camera if the first functional module requests to call the camera.
In another possible implementation manner of the second aspect, before the second functional module sends the third camera call instruction to the camera functional module, the method further includes: the first function module initiates the first function in response to an open operation of the first function. And the first functional module sends a fourth camera call instruction to the camera functional module. After receiving the fourth camera call instruction, the camera functional module responds to the fourth camera call instruction and distributes the camera to the first functional module.
In this embodiment, after the camera is allocated to the first functional module, if the second functional module initiates the third camera call instruction again, the camera functional module needs to release the camera from the first functional module in response to the third camera call instruction, and then the camera may be allocated to the second functional module.
In this scenario, if the first function is first turned on, the camera will be assigned to the first functional module. And then opening the function corresponding to the second functional module, so that the second functional module can preempt the use right of the camera, and the first function is temporarily interrupted. At this time, it is necessary to release the camera from the first functional module and then assign the camera to the second functional module. And then, when the second functional module exits the camera, the camera functional module notifies the first functional module of the released message of the camera, so that the first functional module can timely recall the camera to recover the first function.
In another possible implementation manner of the second aspect, the electronic device further includes an HIDL camera interface service module. After the first function module initiates the first function, the method further includes: the first functional module sends a fourth registration request to the HIDL camera interface service module to register the camera release callback function. And responding to the fourth registration request, and adding a registration record of the camera release callback function by the first functional module by the registration camera release callback function. In this embodiment, the sending, by the camera functional module, a notification message that the camera is released to the first functional module may specifically include: the camera function module triggers sending of a first notification message that the camera is released to the HIDL camera interface service module. And responding to the first notification message, the HIDL camera interface service module calls a camera release callback function and sends a second notification message that the camera is released to the first functional module.
In this scheme, the first functional module registers the camera release callback function in the HIDL camera interface service module at start-up. And then, if the other functional modules are out of the use of the camera under the state that the first function is started, the camera functional module notifies the HIDL camera interface service module to enable the HIDL camera interface service module to call the camera release callback function so as to notify the first functional module of the released message of the camera. Therefore, the first functional module can timely sense that the camera is released, and timely recall the camera to realize the first function.
In another possible implementation manner of the second aspect, after the camera functional module releases the camera from the first functional module in response to the third camera call instruction, the method further includes: the first functional module sends a fifth registration request to the HIDL camera interface service module to register the camera release callback function. And responding to the fifth registration request, and adding a registration record of the camera release callback function by the first functional module by the registration camera release callback function. In this embodiment, the sending, by the camera functional module, a notification message that the camera is released to the first functional module may specifically include: the camera function module triggers 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 invokes a camera release callback function based on the registration record, and sends a second notification message to the first functional module that the camera is released.
In this scheme, the first functional module registers the camera release callback function again after the first functional module releases the camera from the first functional module when the camera is preempted by the other functional modules. In this way, when the second functional module exits the camera, the camera functional module may trigger the hid camera interface service module to call a camera release callback function, and send a notification message that the camera is released to the first functional module based on the registration record. The first function module can timely sense that the camera is released and timely recall the camera, so that the first function is realized.
In another possible implementation manner of the second aspect, the first functional module is started up also after the camera is allocated 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 call instruction, the above method further includes: the first function module initiates the first function in response to an open operation of the first function. The first functional module sends a sixth registration request to the HIDL camera interface service module, and the HIDL camera interface service module firstly adds registration records of the first functional module on the camera release callback function. And when the second functional module sends a camera release instruction to the camera functional module, triggering the HIDL camera interface service module to call a camera release callback function by the camera functional module, and sending a notification message of released camera to the first functional module based on the registration record.
In this scheme, when the first functional module is started, if the camera is in an occupied state, the first functional module may register the camera release callback function first. When the function module occupying the camera exits from using the camera, the HIDL camera interface service module is triggered by the camera function module to call the camera release callback function, and the first function module is notified of the released message of the camera based on the registration record. Therefore, the first function module can timely call the camera after the camera is released, and the first function is realized.
In a third aspect, an electronic device is provided, comprising: the device comprises a processor, a camera and a memory; the memory and the camera are respectively coupled with the processor. The camera is used for collecting images. The memory is configured to store computer-executable instructions that, when executed by the electronic device, cause the electronic device to perform the method of assigning cameras as in any of the first aspects above.
In a fourth aspect, there is provided a computer readable storage medium having instructions stored therein which, when run on a computer, cause the computer to perform the method of allocating a camera according to any one of the first aspects above.
In a fifth aspect, there is provided a computer program product comprising instructions which, when run on an electronic device, enable the electronic device to perform the method of allocating a camera of any one of the first aspects above.
In a sixth aspect, there is provided an apparatus (e.g. the apparatus may be a system-on-a-chip) comprising a processor for supporting an electronic device to implement the functions referred to in the first aspect above. In one possible design, the apparatus further includes a memory for storing program instructions and data necessary for the electronic device. When the device is a chip system, the device can be formed by a chip, and can also comprise the chip and other discrete devices.
The technical effects of any one of the design manners of the second aspect to the sixth aspect may be referred to the technical effects of the different design manners of the first aspect, and will not be repeated here.
Drawings
FIG. 1A is a schematic view of a user using a smart screen according to an embodiment of the present application;
FIG. 1B is a schematic diagram of a display interface of an intelligent screen according to an embodiment of the present application;
FIG. 1C is a schematic diagram of a display interface of an intelligent screen according to an embodiment of the present application;
FIG. 1D is a schematic diagram of a display interface of an intelligent screen according to an embodiment of the present application;
FIG. 1E is a schematic diagram of a display interface of an intelligent screen according to an embodiment of the present application;
fig. 2A is a schematic hardware structure of an electronic device according to an embodiment of the present application;
fig. 2B is a schematic software architecture of an electronic device according to an embodiment of the present application;
fig. 3 is a schematic flow chart of invoking a camera by the close-range viewing reminding module according to the embodiment of the present application;
fig. 4A is a flow chart of a method for distributing cameras according to an embodiment of the present application;
fig. 4B is a flow chart of a method for distributing cameras according to an embodiment of the present application;
fig. 4C is a flow chart of a method for distributing cameras according to an embodiment of the present application;
Fig. 5 is a flow chart of a method for distributing cameras according to an embodiment of the present application;
fig. 6 is a flow chart of a method for distributing cameras according to an embodiment of the present application;
fig. 7 is a flow chart of a method for distributing cameras according to an embodiment of the present application;
FIG. 8 is a schematic diagram of a software architecture of an intelligent screen according to an embodiment of the present disclosure;
fig. 9 is a flow chart of a method for distributing cameras according to an embodiment of the present application;
fig. 10 is a flow chart of a method for distributing cameras according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of a chip system according to an embodiment of the present application.
Detailed Description
When a user uses an electronic device, if the eyes are too close to the display screen of the electronic device, the eyesight of the user is easily damaged. Therefore, in order to protect the eyesight of the user as much as possible when the user uses the electronic device, the electronic device can monitor the distance between the eyes of the user and the display screen of the electronic device when the electronic device is used and remind when the distance between the eyes of the user and the display screen is detected to be too close.
In the scenario shown in fig. 1A, the user 10 may monitor the distance between the user's eyes (or face) and the display screen while using the smart screen 1. In some embodiments, the smart screen 1 may alert the user 10 when detecting that the eyes of the user 10 are too close to the display screen of the smart screen 1. For example, the smart screen 1 may display a prompt 11 as shown in fig. 1B on the display screen for reminding the user of the viewing distance.
Some teenagers or children may not have sufficient homemade strength and may easily experience problems with eyes too close to the display screen when using the electronic device. Some electronic devices currently have a teenager mode or a child mode, and are dedicated to use by teenagers or children when using the electronic device. In the teenager mode or the child mode, a near viewing alert function is provided, and a parent user can turn on the near viewing alert function by being in the teenager mode or the child mode.
In some embodiments, as shown in fig. 1C, the smart screen 1 may display application icons of a plurality of applications installed on the smart screen in the display interface 12 of all applications. The method comprises the following steps: media center, settings, clock, application mall, child mode, home camera, etc. In the interface 12, the user may select the icon 12a corresponding to the child mode to enter the function setting interface of the child mode, such as the function setting interface 13 of the child mode provided by the smart screen 1 shown in fig. 1D.
The function setting interface 13 includes a child mode switch 14, the switch 14 being used to turn the child mode on or off. The function setting interface 13 further includes a switch 15 for short-range viewing reminding function. The switch 15 is used to turn on or off the close range viewing alert function. After the close-range viewing reminding function of the intelligent screen 1 is started, the intelligent screen 1 can monitor the distance between the eyes of a user viewing the intelligent screen 1 and the display screen of the intelligent screen 1 in the child mode. And, when the distance between the eyes of the user and the display screen of the intelligent screen 1 is monitored to be too close, prompt information is sent out, such as prompt information 11 shown in fig. 1B.
The function setting interface 13 shown in fig. 1D further includes a lying posture reminding switch 16, a switch 17 for performing close-range viewing and lying posture reminding only for the child, a single-use-period setting option 18, and the like. Wherein the switch 16 is used for turning on or off the reminding function of monitoring whether the user is in a lying position to watch the intelligent screen 1, the switch 17 is used for turning on or off the switch for reminding the distance and the lying position of the child only, and the setting option 18 is used for setting the maximum duration of allowing the child to use the intelligent screen 1 once. It should be appreciated that in other embodiments, other setting options or switches may also be included in the function setting interface 13.
In some embodiments, after the user has set the different functions provided by the child mode application, the child mode application saves the user's settings for each function. By way of example, the user may set the following modes for each function in the interface shown in FIG. 1D: the close range viewing reminding function is opened, the lying posture reminding function is opened, the close range viewing reminding and lying posture reminding functions are closed only for children, and the single use time is limited to 30 minutes. Thereafter, each time the user turns on the child mode (turns on the switch 14 shown in fig. 1D), a reminder is given in accordance with the mode set by the above function.
In the related art, in order to realize the function of reminding the user of watching in a short distance, the camera of the intelligent screen 1 may be used to acquire an image in front of the display screen and analyze whether the watching distance of the user needs to be reminded according to the image. After the user turns on the close range viewing reminder function by operating the switch 15 shown in fig. 1D, the smart screen 1 may enter the interface 19 shown in fig. 1D. Meanwhile, the smart screen 1 can raise a hidden camera (such as the camera 20 shown in fig. 1D), and further collect an image in front of the display screen through the camera.
However, the camera of the smart screen 1 can generally be used only by one functional module at a time. On the premise of opening the close-range viewing reminding function, if other functional modules need to use the camera, the use priority of the cameras of the other functional modules is higher than that of the close-range viewing reminding module, and at the moment, the close-range viewing reminding function is forced to be interrupted. It should be noted that, in other embodiments, the above-mentioned close-range viewing reminding function may be named as distance reminding function, vision protection function, or the like.
Taking the example that the other functional modules are home cameras, compared with the close-range viewing reminding module, the use priority of the home cameras to the cameras is higher than that of the close-range viewing reminding module. Therefore, in the case where the close-range viewing reminding function is turned on, if the user turns on the home camera, the camera will be occupied by the home camera. In addition, in the process of using the camera by the home camera, the close-range watching reminding module cannot use the camera, so that the close-range watching reminding is forced to be interrupted. That is, the smart screen cannot continue to monitor and alert the distance between the user's eyes and the display screen. In some embodiments, the smart screen may display a hint message on the display screen when the camera is preempted by other functional modules.
After turning on the close-up viewing alert function in child mode, the user may select a "back" option in interface 13 to return to all application interfaces 12 as shown in FIG. 1C. In some embodiments, after the child mode is turned on, part of the application may not be supported for use by the child in the child mode. Thus, after selecting the "return" option in interface 13, the user may also return to the full application interface presented only to the child, where icons of the partial applications presented in interface 12 are no longer presented to the child. In the embodiment of the present application, a function of allowing use of a home camera in the child mode is described as an example. 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.
Further, after turning on the child mode, the user may also select the icon 12b of the home camera shown in fig. 1C in the interface of the whole application to enter the interface 21 of the home camera shown in fig. 1E. After the home camera is opened and the interface 21 is entered, the home camera will preempt the right to use the camera of the smart screen, resulting in the close-range viewing reminding module not being able to use the camera to carry out close-range viewing reminding. In this scenario, the smart screen 1 may display a prompt 22 of the interface shown in fig. 1E on the display screen, for prompting the user that the current close-range viewing reminding function is temporarily unavailable.
The user may exit the home camera by selecting the "exit" option 23 in the interface 21 shown in fig. 1E. After the user exits the home camera, the camera will be released. At this time, the camera becomes idle again. Since the close range viewing alert function is still on, the smart screen should resume the close range viewing alert function after the home camera is taken out of use with the camera. However, the close-range viewing alert module generally cannot timely sense that the camera is released. That is, after the home camera is removed from the camera, the close-range viewing reminding module cannot call the camera in time, that is, the intelligent screen cannot timely recover the close-range viewing reminding function.
Also included in the home camera interface shown in fig. 1E are the function options "shoot" option 24, "record" option 25, and "gallery" option 26 provided by the home camera. Wherein the "shoot" option 24 is for the user to shoot images using the home camera; the "video" option 25 is for the user to record video using the home camera; the "gallery" option 26 is used for a user to view images and videos taken using a home camera, etc. The specific operation process of the user to shoot an image or record a video by using the home camera through the "shoot" option 24 or the "record a video" option 25 and to view the image by using the "gallery" option 26 can be referred to the description in the related art, and will not be repeated in the embodiment of the present application. It should be appreciated that in other embodiments, the functional interface of the home camera may also include other functional options.
Based on this, the embodiment of the application provides a method for allocating cameras, on the premise that a first function corresponding to a first functional module is in an on state and a current camera is allocated to a second functional module, after detecting a first operation for the second functional module, the intelligent screen responds to the first operation to release the camera from the second functional module. Then, since the first function is in an on state, the smart screen allocates the camera to the first function module so that the first function module can implement the first function using the camera. Thus, as long as the first function is in an on state, the smart screen may assign the camera to the first function module after the other function modules are out of use (i.e., release the camera). Therefore, the first functional module can timely call the camera to realize the first function.
The first functional module may be the above-mentioned close-range viewing reminding module or other functional modules that need to sense whether the camera is available in real time, and the second functional module may be the above-mentioned home camera functional module, video call functional module or other modules that need to use the camera to realize the corresponding functions. In some embodiments, the second functional module has a higher priority of use for the camera than the first functional module. The first functional module may reside in the background of the electronic device after start-up.
In some embodiments, the above-described methods may be applied to an electronic device that includes a camera. The electronic device may be a mobile phone, a tablet computer, a personal computer (personal computer, PC), a smart screen, a desktop, a laptop, a handheld computer, a notebook, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook, a smart watch, an artificial intelligence (artificial intelligence, AI) speaker, a car-mounted device, various teaching aids (e.g., learning machine, early education machine), a smart toy, a portable robot, a personal digital assistant (personal digital assistant, PDA), an augmented reality (augmented reality, AR) \virtual reality (VR) device, a media player, a mobile office device, an intelligent home device, an entertainment device, a smart travel supporting device, etc., as examples. The embodiment of the present application does not particularly limit the specific form of the apparatus.
Fig. 2A is a schematic structural diagram of an electronic device 100 according to 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 180, a camera 190, and keys 191, etc.
The electronic device 100 may be, for example, the smart screen 1 described above. It is to be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors. For example, the processor 110 is configured to perform the method for allocating cameras in the embodiments of the present application.
The controller may be a neural hub and a command center of the electronic device 100, among others. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it may be called directly from memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to enable expansion of the memory capabilities of the electronic device 100. The external memory card communicates with the processor 110 through an external memory interface 120 to implement data storage functions. For example, files such as music, video, etc. are stored in an external memory card.
The internal memory 130 may be used to store computer executable program code that includes instructions. The processor 110 executes various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 130. The internal memory 130 may include a storage program area and a storage data area. The storage program area may store application programs (such as a sound playing function, an image playing function, etc.) required for at least one function of the operating system.
In addition, the internal memory 130 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like.
The power module 140 may be used to receive power input and to power the processor 110, the internal memory 130, the wireless communication module 160, the display 180, the camera 190, and the like. In some embodiments, the power module 140 may also be disposed in the processor 110.
The communication interface 150 may be used to communicate with external devices such as a control device, a set top box, a router, and a usb disk. The communication interface 150 may be any possible interface such as a network interface or a universal serial bus (universal serial bus, USB) interface.
The USB interface is an interface conforming to the USB standard specification, and can be specifically a Mini USB interface, a Micro USB interface, a USB Type C interface and the like.
The wireless communication module 160 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wireless fidelity (wireless fidelity, wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc., as applied to the electronic device 100. The wireless communication module 160 may be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via an antenna, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it to electromagnetic waves for radiation via an antenna.
The electronic device 100 may implement audio functions through the audio module 170, an application processor, and the like. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio signals to analog audio signal outputs and also to convert analog audio inputs to digital audio signals. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be disposed in the processor 110, or a portion of the functional modules of the audio module 170 may be disposed in the processor 110. The audio module 170 may include a speaker 170A and a microphone 170B.
The speaker 170A, also referred to as a "horn," is used to convert audio electrical signals into sound signals. The electronic device 100 may listen to music, or conduct a video conference, etc., through the speaker 170A.
Microphone 170B, also known as a "microphone," is used to convert sound signals into electrical signals. When a video call, a video conference, or a voice assistant is used, a user can sound near the microphone 170B through the mouth, inputting a 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, and may implement a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 100 may also be provided with three, four, or more microphones 170B to enable collection of sound signals, noise reduction, identification of sound sources, directional recording, etc.
The display 180 is used to display images, videos, and the like. The electronic device 100 implements display functions through a GPU, a display screen 180, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display 180 and the application processor. The GPU is 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 change display information.
The camera 190 is used to capture still images or video. In some embodiments, electronic device 100 may include 1 or N cameras 190, N being a positive integer greater than 1. In some embodiments, camera 190 may be a lift camera. Typically, the lift camera is hidden inside the electronic device 100 and is not visible to the user. When a user uses the electronic device 100 to conduct a video call or a video conference with other users, the lift type camera may pop up from the top of the electronic device 100, so that the lift type camera may collect user images and transmit the user images to the devices of other users through the wireless communication module 160, the antenna, and the like. In other embodiments, camera 190 may be embedded within the display of electronic device 100.
The keys 191 include a power-on key, a volume key, a set key, and the like. The key 191 may be a mechanical key. Or may be a touch key. The electronic device 100 may receive key inputs, generating key signal inputs related to user settings and function controls of the electronic device 100.
The camera allocation methods in the following embodiments may be implemented in the electronic device 100 having the above-described hardware configuration.
Fig. 2B is a software structural block diagram of the electronic device 100 of the embodiment of the present application.
The layered architecture divides the software into several layers, each with distinct roles and branches. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into five layers, from top to bottom, an application layer, an application framework layer, an Zhuoyun row (ART) and native C/c++ libraries, a hardware abstraction layer (Hardware Abstract Layer, HAL), and a kernel layer, respectively.
The application layer may include a series of application packages.
As shown in fig. 2B, the application package may include applications such as a media center, a setting, a clock, an application mall, a two-way mode, a home camera, a first function module, and a second function module.
The application framework layer provides an application programming interface (application programming interface, API) and programming framework for application programs of the application layer. The application framework layer includes a number of predefined functions.
As shown in FIG. 2B, the application framework layer may include a window manager, a content provider, a view system, a resource manager, a notification manager, an activity manager, an input manager, and the like.
The window manager provides window management services (Window Manager Service, WMS) that may be used for window management, window animation management, surface management, and as a transfer station to the input system.
The content provider is used to store and retrieve data and make such data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phonebooks, etc.
The view system includes visual controls, such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, a display interface including a text message notification icon may include a view displaying text and a view displaying a picture.
The resource manager provides various resources for the application program, such as localization strings, icons, pictures, layout files, video files, and the like.
The notification manager allows the application to display notification information in a status bar, can be used to communicate notification type messages, can automatically disappear after a short dwell, and does not require user interaction. Such as notification manager is used to inform that the download is complete, message alerts, etc. The notification manager may also be a notification in the form of a chart or scroll bar text that appears on the system top status bar, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, a text message is prompted in a status bar, a prompt tone is emitted, the electronic device vibrates, and an indicator light blinks, etc.
The activity manager may provide activity management services (Activity Manager Service, AMS) that may be used for system component (e.g., activity, service, content provider, broadcast receiver) start-up, handoff, scheduling, and application process management and scheduling tasks.
The input manager may provide input management services (Input Manager Service, IMS), which may be used to manage inputs to the system, such as touch screen inputs, key inputs, sensor inputs, and the like. The IMS retrieves events from the input device node and distributes the events to the appropriate windows through interactions with the WMS.
The android runtime includes a core library and An Zhuoyun rows. The android runtime is responsible for converting source code into machine code. Android runtime mainly includes employing Advanced Or Time (AOT) compilation techniques and Just In Time (JIT) compilation techniques.
The core library is mainly used for providing the functions of basic Java class libraries, such as basic data structures, mathematics, IO, tools, databases, networks and the like. The core library provides an API for the user to develop the android application.
The native C/c++ library may include a plurality of functional modules. For example: surface manager (surface manager), media Framework (Media Framework), libc, openGL ES, SQLite, webkit, etc.
The surface manager is used for managing the display subsystem and providing fusion of 2D and 3D layers for a plurality of application programs. Media frames support a variety of commonly used audio, video format playback and recording, still image files, and the like. The media library may support a variety of audio and video encoding formats, such as MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, etc. OpenGL ES provides for drawing and manipulation of 2D graphics and 3D graphics in applications. SQLite provides a lightweight relational database for applications of the electronic device 100.
The hardware abstraction layer runs in a user space (user space), encapsulates the kernel layer driver, and provides a call interface to the upper layer. The hardware abstraction layer may include a display module, an audio module, a camera module (camera HAL), and a bluetooth module.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
In this embodiment of the present application, when applications such as a child mode and a home camera need to use a camera, the application may be implemented by calling a camera module (camera HAL) of a HAL layer through a camera service module (camera server) of a frame layer, and then calling camera hardware (camera hardware) by the camera HAL. Further, the camera HAL calls a camera driver of the kernel layer to drive the camera to provide corresponding functional services for the application.
The camera allocation method provided by the embodiment of the application can be particularly applied to a scene that the function realized by the first functional module by using the camera is forced to be interrupted because the camera is preempted by the second functional module with higher use priority by other cameras after the first functional module realized by using the camera is started. In this scenario, if the second functional module exits using the camera, it indicates that the camera is released and returns to an idle state. In the method for allocating cameras provided in the embodiments of the present application, when detecting that the second functional module is out of use of the camera, a first notification message may be sent to the first functional module to notify the first functional module that the camera is released. Therefore, the first functional module can timely sense that the camera is released, and then recall the camera, and timely recover the function realized by the first functional module by using the camera.
Taking the example that the first functional module is a close-range watching reminding module, the close-range watching reminding module calls the camera to realize the close-range watching reminding function, and introducing the specific process of the close-range watching reminding module calling the camera. The close-range viewing alert module may be a functional module in a child mode application. Alternatively, the close-range viewing alert module may be a stand-alone application. As shown in fig. 3, a specific implementation process of the camera is called by the close-range viewing reminding module in some embodiments of the present application.
And responding to the opening operation of the close-range watching reminding function, and sending a camera calling instruction to the camera functional module by the close-range watching reminding module.
The camera functional module may include a camera server module of a frame work layer and a camera HAL module of a HAL layer.
The camera service module responds to a camera calling instruction and starts the camera. And in response to the camera calling instruction, the camera functional module can also distribute the camera to the close-range watching reminding module.
It should be noted that, after the camera is allocated to the close-range viewing reminding module, the close-range viewing reminding module can control the camera and perform image transmission with the camera.
The camera collects images. The camera sends images to the camera functional module. And then, the camera functional module sends the image acquired by the camera to the close-range watching reminding module.
The close-range viewing reminding module analyzes the image. And the close-range viewing reminding module determines whether a user needs to be reminded of the viewing distance according to the analysis result.
The method comprises the steps of reminding a user to watch in a short distance, mainly monitoring the distance between eyes of the user and a display screen, and reminding the user to pay attention to the watching distance when the distance between the eyes of the user and the display screen is too short. Therefore, in some embodiments, it may be specifically detected whether the distance between the eyes of the user and the display screen is smaller than a preset distance, so as to determine whether the viewing distance of the user needs to be reminded. Further, if the distance between the eyes of the user and the display screen is detected to be smaller than the preset distance, the intelligent screen can conduct close-range watching reminding on the user. The image analysis may be specifically implemented by an algorithm such as image analysis, a related neural network model, etc., and the specific implementation process may refer to the description in the related technology, which is not repeated in the embodiments of the present application.
The camera of the smart screen is typically disposed near the display screen of the smart screen, and the camera 20 shown in fig. 1D is disposed above the display screen of the smart screen and is a hidden lifting camera. Then, if the user's eyes are closer to the display screen, the larger the ratio of the user's eyes to the image captured in the image is in the image captured by the camera. Conversely, if the user's eyes are farther from the display screen, the smaller the user's eyes are in the image captured by the camera. Therefore, in other embodiments, the close-range viewing reminding module may also detect whether the ratio of the eyes of the user in the image collected by the camera is greater than a preset ratio, so as to determine whether the viewing distance of the user needs to be reminded. Further, if the proportion of the eyes of the user in the image acquired by the camera is determined to be larger than the preset proportion, the intelligent screen can conduct close-range watching reminding on the user.
It should be understood that the preset distance and the preset duty ratio in the above embodiments may be set to any suitable values according to practical situations, and are not limited in the embodiments of the present application. In other embodiments, the intelligent screen may analyze the image collected by the camera in other manners, and determine whether to remind the user of the viewing distance according to the analysis result.
And if the prompt is determined to be needed according to the analysis result, the close-range watching prompt module sends prompt information. If the reminding is determined not to be needed according to the analysis result, the new image can be continuously received for analysis, and whether the reminding is needed or not is judged.
Technical terms that may be involved in the embodiments of the present application are briefly described below.
The hardware abstraction layer interface definition language, (HAL interface definition language, HIDL), is the interface between Android framework and the Android HAL. HIDL is intended for inter-process communication.
The following describes in detail a method for distributing cameras according to an embodiment of the present application with reference to the accompanying drawings. Fig. 4A is a flow chart of a method for distributing cameras according to an embodiment of the present application. In this embodiment, the electronic device is a smart screen, the first function module is a close-range viewing reminding module, and the second function module is a home camera function module. It should be appreciated that in other embodiments, the first and second functional modules may also be other functional modules. The method comprises S201-S210, wherein:
s201, starting the intelligent screen.
S202, the intelligent screen acquires starting operation aiming at the close-range watching reminding module.
In some embodiments, S202 may specifically be that the user performs a startup operation for the close-range viewing alert module. In some embodiments, the close-up viewing alert module may be a function of the child mode. Illustratively, the user may open the switch 15 in the interface shown in FIG. 1D to activate the close-range viewing alert function.
S203, responding to the starting operation of the short-distance watching reminding module, and starting a short-distance watching reminding function by the intelligent screen.
S204, the intelligent screen distributes the cameras to the close-range watching reminding modules.
S205, the intelligent screen acquires starting operation aiming at the home camera function module.
In some embodiments, the home camera function module may invoke the webcam after startup. Thus, the smart screen can start the home camera function module after acquiring a start operation for the home camera function module. Then, in order to realize the function of the home camera, the home camera function module will send a camera call instruction of the camera.
S206, responding to the starting operation of the home camera function module, and releasing the camera from the close-range viewing reminding module.
S207, the intelligent screen distributes the cameras to the home camera function modules.
After the intelligent screen distributes the cameras to the home camera function modules, the related functions of the home camera can be used.
S208, the intelligent screen receives the exit operation aiming at the home camera function module.
The above-mentioned start operation for the close-range viewing reminding module, and start operation and exit operation for the home camera function module may be named by other names. For example, the exit operation for the home camera function module may be named a first operation, the start operation for the home camera function module may be named a second operation, and the start operation for the close-range viewing reminder module may be named a third operation, and so on.
S209, responding to the exit operation for the home camera function module, and releasing the camera from the home camera function module by the intelligent screen.
Since the close range view reminding function is still in the on state, the smart screen may re-assign the camera to the close range view reminding module after the camera is released from the home camera function module, as in S210.
S210, the intelligent screen distributes the cameras to the close-range watching reminding modules.
It can be appreciated that after S210, the close-range viewing alert module may acquire the image acquired by the camera and analyze whether the user needs to be alerted to the viewing distance based on the image. Specifically, when the close-range viewing reminding module analyzes the image to determine that the viewing distance of the user is too short, reminding information is sent to the user.
In some embodiments, the step S210 may specifically be that the smart screen sends a notification message that the camera is released to the close-range view reminding module, and then the close-range view reminding module initiates a camera call instruction to the camera based on the notification message. Because the current camera is released and is in an idle state, the intelligent screen can allocate the camera to the close-range viewing reminding module in response to the camera calling instruction sent by the close-range viewing reminding module. It should be noted that, in order to distinguish camera call instructions sent by different functional modules at different moments, the "first" and "second" may be used to distinguish different camera call instructions. For example, the camera call instruction sent by the close-range view reminding module based on the notification message may be named as a first camera call instruction.
Further, in some embodiments, the smart screen may send a notification message to the close-range viewing alert module after the camera is released, by invoking a camera release callback function. It can be appreciated that before the intelligent screen calls the camera release callback function to send a notification message to the close-range viewing reminding module, the close-range viewing reminding module needs to register the camera release callback function first. The camera release callback function is used for being called after the camera is released, and after the camera release callback function is called, a notification message can be triggered to be sent to a functional module registered with the camera release callback function.
The close-range viewing reminding module registers a camera release callback function, namely when the camera is occupied, the intelligent screen waits for calling the camera release callback function to obtain a notification message that the camera is released. And, the close-range viewing reminding module can call the camera after receiving the released notification message of the camera. In some embodiments, the close range view alert module may register the camera release callback function while the close range view alert function is enabled. Therefore, if the close-range watching reminding module is in the process of using the camera, the use right of the camera is preempted by other functional modules, and after the other functional modules release the camera, the released information of the camera, which is sent by the intelligent screen through calling the camera release callback function, can be obtained.
That is, in some embodiments, after the step S202, the method further includes: the close-range viewing reminding module initiates a registration request for the camera release callback function. In response to the registration request, the intelligent screen may add a registration record of the close range viewing alert module registration camera release callback function. After that, as long as it is detected that the camera is released (S209 described above), the smart screen may call the camera release callback function and send a notification message of the release of the camera to the registered camera release callback function (close-range viewing reminder module) based on the registration record.
In other embodiments, the close-range viewing reminding module may register the camera release callback function after the camera usage rights are preempted by other functional modules. That is, in some embodiments, after the step S206, the method further includes: the close-range viewing reminding module initiates a registration request for the camera release callback function. Likewise, in response to the registration request, the intelligent screen may add a registration record of the camera release callback function by the close range view alert module. Thus, after S209, the smart screen may 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-range view reminder module) based on the registration record.
In the technical scheme provided by the embodiment of the application, the close-range watching reminding module registers the camera release callback function when being started or when the use right of the camera is preempted by other functional modules, and the close-range watching reminding module can timely sense the notification message sent by the intelligent screen through calling the camera release callback function after the camera is released by the other functional modules (such as a home camera functional module). Therefore, the prompt module is convenient to watch in a short distance and timely re-request to call the camera, so that the intelligent screen can assign the camera to the prompt module in a short distance again.
In the technical scheme provided by the embodiment of the application, under the condition that the close-range viewing reminding function is started, if the camera is distributed to the home camera or other functional modules, after the home camera or other functional modules release the camera, the intelligent screen will distribute the camera to the close-range viewing reminding module again. Therefore, the close-range watching reminding module can timely regain the use right of the camera after the camera is released, so that a close-range watching reminding function is realized. Meanwhile, under the condition that the camera is occupied by other functional modules, the close-range watching reminding module does not need to continuously try to open the camera, and the waste of cpu resources can be avoided.
In the above embodiment, the start of the close-range viewing reminding module is before, and the start of the home camera function module is described after. In other embodiments, the close-range viewing alert module may also be activated after the home camera function module is activated. That is, before the close-range viewing alert module is started, the smart screen has allocated the camera to the home camera function module, and when the close-range viewing alert module is started, the camera is in an occupied state. At this time, the close-range viewing reminding module can start the close-range viewing reminding function module in the background, but the close-range viewing reminding function cannot normally remind because the camera is occupied. Meanwhile, the close-range viewing reminding module can request to register the camera release callback function, so that after the intelligent screen is released, the camera release callback function is called, and a notification message that the camera is released is sent to the close-range viewing reminding module.
Fig. 4B is a flow chart of a method for distributing cameras according to an embodiment of the present application. The method includes S301-S309. Wherein:
s301, starting the intelligent screen.
S302, the intelligent screen acquires starting operation aiming at the home camera function module.
S303, responding to the starting operation of the home camera function module, and distributing the cameras to the home camera function module by the intelligent screen.
S304, the intelligent screen acquires starting operation aiming at the close-range watching reminding function module.
S305, responding to the starting operation of the short-distance watching reminding module, and enabling the intelligent screen to start the short-distance watching reminding function.
As can be seen from the description of the above embodiment, the current camera is occupied by the home camera function module, and the close-range viewing reminding module cannot obtain the right of use of the camera, so that the close-range viewing reminding function cannot be used normally. Therefore, the close-range viewing reminder module may first register the camera release callback function, i.e., the close-range 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 range view alert module may initiate a registration request for a camera release callback function.
S306, the intelligent screen adds registration records of the close range viewing reminding module for releasing callback functions to the camera.
The step S307 may specifically include: the intelligent screen receives a registration request for releasing a callback function of the camera, which is initiated by the close-range watching reminding module; and responding to the registration request, adding registration records of the close-range viewing reminding module for releasing the callback function to the camera by the intelligent screen.
S307, the intelligent screen acquires the exit operation aiming at the home camera function module.
S308, responding to the exit operation for the home camera function module, and releasing the camera from the home camera function module by the intelligent screen.
S309, the intelligent screen calls a camera release callback function, and the camera is distributed to the close-range viewing reminding module based on the registration record.
After that, the close-range viewing reminding module can realize the close-range viewing reminding function based on the camera.
The specific implementation of S301 to S309 may refer to the descriptions in the embodiments of S201 to S210, and will not be described herein.
In the technical scheme provided by the embodiment of the application, if the user starts the close-range viewing reminding function module after the camera is distributed to the home camera or other function modules, the close-range viewing reminding module cannot directly obtain the use right of the camera. At this time, the close-range viewing reminding module registers the camera release callback function while starting the close-range viewing reminding function module. Therefore, the close-range watching reminding module can timely sense that the camera is released after the camera is released, and timely call the camera to obtain the use right of the camera so as to realize the close-range watching reminding function. Meanwhile, under the condition that the camera is occupied by other functional modules, the close-range watching reminding module does not need to continuously try to open the camera, and the waste of cpu resources can be avoided.
Further, the interaction between functional modules within the electronic device is described below. Fig. 4C is a flow chart of a method for distributing cameras according to an embodiment of the present application. In this embodiment, the electronic device is a smart screen, the first function module is a close-range viewing reminding module, and the second function module is a home camera function module. It should be appreciated that in other embodiments, the first and second functional modules may also be other functional modules. The method comprises S401-S413, wherein:
s401, responding to the opening operation of the close-range watching reminding function, and sending a camera calling instruction to the camera functional module by the close-range watching reminding module.
In some embodiments, the close-range viewing alert function may be a functional module in a child mode application. Illustratively, the user may turn on the close-range viewing reminding function, specifically, the user turns on the switch 15 as in fig. 1D. In other embodiments, the close-up viewing alert function may be a stand-alone application, or may be an applet.
In the case where the close-range viewing alert module is a functional module in a certain application, the application may be a child mode application. As can be seen from the above description, the user sets the short-distance viewing reminding function to be on in advance in the child mode, and then the short-distance viewing reminding module is automatically turned on as long as the user turns on the child mode. Thus, in some embodiments, if the close range viewing alert function of the child mode is turned on by default, S401 described above may also include: responding to the opening operation of the child mode, and sending a camera calling instruction to the camera functional module by the close-range watching reminding module under the condition that the close-range watching reminding function is opened.
As can be seen from the description of the above embodiments, in some embodiments, the camera functional module includes a camera server module and a camera HAL module of the HAL layer. In this embodiment, the close-range viewing reminding module in S401 may specifically send a camera calling instruction to the camera server module.
In S401, the operation of opening the close range viewing reminding function may be understood as an operation of opening or starting the close range viewing reminding module.
S402, the camera functional module responds to a camera calling instruction and starts the camera.
As can be seen from the description of the above embodiments, in some embodiments, the camera functional module includes a camera server module of a frame work layer and a camera HAL module of a HAL layer. In this embodiment, the step S402 may specifically include: responding to a camera calling instruction, and starting the camera by the camera server module through the camera HAL module.
In some embodiments, the camera function module may first determine whether the current camera is in an idle state after receiving the camera call instruction sent by the close-range view reminding module. If the camera is determined to be in an idle state, namely the camera is indicated to be capable of being called, the camera function module can respond to the camera calling instruction to start the camera.
In other embodiments, before receiving the camera call instruction sent by the close-range view reminding module, the camera may be used by other functional modules (such as the third functional module), that is, the camera is in an occupied state when receiving the camera call instruction sent by the close-range view reminding module. At this time, the camera functional module may notify the third functional module that uses the camera to release the camera first, and then start the camera in response to the camera call instruction of the close-range viewing reminding module.
If the camera functional module detects that the camera is in a state occupied by the third functional module when receiving the camera calling instruction sent by the close-range viewing reminding module, the camera functional module can compare the use priority of the third functional module and the close-range viewing reminding module to the camera. If the close-range watching reminding module is higher than the third functional module in use priority for the camera, the camera functional module can inform the third functional module to release the camera. And then, the camera functional module responds to the camera calling instruction sent by the close-range watching reminding module to start the camera.
In other embodiments, if the usage priority of the close-range view reminding module for the camera is lower than the usage priority of the third functional module for the camera, the camera call instruction of the close-range view reminding module received in the case that the camera is allocated to the third functional module should not be responded. That is, in the case where the camera is being used by the third functional module having a higher priority for the camera, the close-range viewing reminding function cannot be normally started.
In the technical scheme provided by the embodiment of the application, when the close-range viewing reminding module requests to use the camera, the camera functional module is in an idle state at the current camera, or under the condition that no other functional module with higher use priority to the camera uses the camera at present, the camera functional module can respond to the camera calling instruction sent by the close-range viewing reminding module to start the camera. Therefore, the camera can be ensured to be used by only one functional module at the same time, and the problem of resource preemption of the camera is avoided.
S403, the camera functional module distributes the cameras to the close-range watching reminding module.
The camera function module distributes the camera to the close-range viewing reminding module, and can also be called as the camera function module distributes the resource of the camera to the close-range viewing reminding module. The resources of the camera may include hardware resources and/or software resources of the camera.
S404, the close-range viewing reminding module controls the camera and transmits image data with the camera.
After the camera is distributed to the close-range watching reminding module by the camera functional module, the close-range watching reminding module obtains the control right and the use right of the camera. At this time, the close-range viewing reminding module can collect images through the camera and analyze whether the viewing distance of the user in the images needs reminding.
As can be seen from the above description of fig. 3, the close-range viewing reminding module collects images through the camera, and the image needs to be transmitted between the camera and the close-range viewing reminding module through the camera function module. In some embodiments, the step S404 may specifically include: the close-range viewing reminding module controls the camera to acquire images, and the camera sends the images to the camera functional module. Then, the control right and the use right of the current camera belong to the close-range watching reminding module, so that the camera functional module sends the image acquired by the camera to the close-range watching reminding module.
According to the above description, on the premise that the close-range viewing reminding function is started, the close-range viewing reminding module can control the camera to acquire images through the camera function module. In some embodiments, after the close-range viewing reminding module obtains the camera allocated by the camera functional module, a first control instruction is sent to the camera through the camera functional module, and the first control instruction can be used for controlling the camera to acquire images once every preset time. In other embodiments, the close-range viewing reminding module may also send a second control instruction to the camera through the camera service module at intervals of a preset time, where the second control instruction is used to instruct the camera to perform image acquisition once. The preset time may be set to 5 minutes (min), 1 minute, 30 seconds(s), etc., according to actual conditions.
Further, the camera can send the acquired image to the close-range viewing module through the camera functional module after completing image acquisition once. And after the close-range viewing reminding module acquires the image, the image can be analyzed to determine whether the viewing distance of the user needs to be reminded. From the above description, the close-range viewing alert 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 eyes of the user and the display screen is short, the problem that the eyesight of the user is impaired when the user views the intelligent screen is easy to occur. Accordingly, when the analysis image determines that the distance between the user's eyes and the display screen is relatively close, the close-range viewing alert module may alert the user to the viewing distance.
S405, responding to the opening operation of the home camera, and sending a camera calling instruction to the camera functional module by the home camera functional module.
In some embodiments, the home camera function may be a stand-alone application. For example, the user may specifically select 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 interface 21 of the home camera shown in fig. 1E. In other embodiments, the home camera function may be a functional module in an application, or may be an applet, etc.
It may be appreciated that S405 may also be represented as the camera function module receiving a camera call instruction sent by the home camera function module, where the camera call instruction is sent by the home camera function module in response to an opening operation of the home camera.
S406, the camera functional module responds to a camera calling instruction and distributes the camera to the home camera functional module.
Since the camera is usually allowed to be used by only one functional module at the same time, part of the electronic devices use the camera for different applications or different functional modules, and different use priorities are set. When multiple applications or functional modules simultaneously request to use the camera, the camera functional module can combine the preset order of the use priorities of the applications or functional modules on the camera to determine to allocate the camera to one application or functional module with the highest use priority in the application or functional module which initiates the request.
In some embodiments, after S405, the camera function module receives a camera call instruction sent by the home camera function module, and the camera function module may compare the usage priority of the camera by the close-range viewing reminder module and the home camera function module. Further, the step S406 may specifically include: and under the condition that the use priority of the home camera to the camera is higher than that of the close-range watching reminding module, responding to a camera calling instruction, and distributing the camera to the home camera functional module. Because the use priority of the home camera for the camera is higher than that of the close-range watching reminding module, when a camera calling instruction of the home camera function module is received, the camera function module allows the home camera to open the camera.
Since the smart screen has allocated the camera to the close-range view reminder module before S406, the camera function module needs to release the camera from the close-range view reminder module before allocating the camera to the home camera function module in response to the camera call instruction of the home camera function module. In some embodiments, the camera functional module releases the camera from the close-range viewing reminding module, which may specifically include: the camera functional module sends a third control instruction to the close-range viewing reminding module, and the third control instruction is used for controlling the close-range viewing reminding module to release the camera. And then, the close-range viewing reminding 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-range viewing reminding module, and may also be implemented in other manners, which are not described in detail in the embodiments of the present application.
In some embodiments, in order to distinguish the camera call instruction sent by the close-range viewing alert module from the home camera function module, it may be named "first", "second", etc. For example, the camera call instruction sent by the home camera function module in S406 may be named as a third camera call instruction, the camera call instruction in S401 may be named as a fourth camera call instruction, and so on.
S407, controlling the camera by the home camera function module, and transmitting image data with the camera.
It can be appreciated that after the camera function module distributes the camera to the home camera function module, the home camera function module obtains the control right and the use right of the camera. At this time, the home camera function module may control the camera to perform operations such as photographing and video recording.
In some embodiments, the step S407 may specifically include the home camera function module acquiring a picture captured by the camera in real time, and displaying the picture on a display screen of the smart screen. Illustratively, after the user starts the home camera, the smart screen will enter the interface 21 shown in fig. 1E, where the screen displayed on the display screen of the smart screen 1 is the screen captured by the current camera in real time, and includes a portrait.
In other embodiments, the step S407 may further include controlling the camera to capture images, record video, and the like by the home camera function module. Illustratively, after the user activates the home camera, the smart screen will enter the interface 21 shown in FIG. 1E, where the user can take an image, i.e., a photograph, by selecting the function option "shoot" option 24 provided by the home camera; alternatively, the user may also record video by selecting the function option "record" option 25 provided by the home camera.
Further, after the user uses the home camera to shoot images or record videos through the camera, the images and videos shot by the camera can be stored in a preset appointed path. Thereafter, the user can view the captured image and recorded video through the "gallery" option in the interface shown in FIG. 1E.
It should be appreciated that in other embodiments, the home camera function module may be used for image data transfer with a video camera, as well as for other functions.
S408, responding to the exit operation of the home camera, and sending a camera release instruction to the camera functional module by the home camera functional module.
Illustratively, the user may exit the home camera by selecting an "exit" option from the interface 21 shown in fig. 1E. Typically the user chooses to exit the home camera, i.e. it means that the home camera will be out of use with the camera, at which point the home camera function module releases the camera. Therefore, in S408, upon detecting the exit operation of the user to the home camera, the home camera function module transmits a camera release instruction to the camera function module for instructing the home camera function module to release the camera.
The above-mentioned opening operation and exiting operation of the close-range viewing reminding module function and the home camera may be performed by a user. Alternatively, the above-mentioned opening operation and exiting operation may be automatically triggered by the intelligent screen based on other instructions (such as timing instructions, call instructions of other functional modules, etc.).
S409, responding to a camera release instruction, and releasing the camera from the home camera function module by the camera function module.
S410, the camera functional module sends a first notification message to the close-range viewing reminding module.
In this embodiment of the present application, since the user opens the close-range viewing reminding function before opening the home camera, after the home camera exits the use of the camera, the close-range viewing reminding module should be restored to use the camera to continue reminding the viewing distance of the user. Therefore, in order to enable the close-range viewing reminding module to sense the released message of the camera as soon as possible, in the embodiment of the application, after detecting the exit operation of the user on the home camera, the camera functional module actively sends a first notification message to the close-range viewing reminding module. The first notification message is used for notifying the close-range viewing reminding module that the current camera is released and returns to the idle state again, so that the close-range viewing reminding module is convenient to recall the camera again, and the close-range viewing reminding function is realized.
It is understood that S410 may also be represented as the close-range viewing alert module receiving the first notification message from the camera functional module.
In some embodiments, after executing S409 to release the camera, the camera function module may query whether the close-range viewing alert function is in an on state. Then, if it is found that the close range viewing reminding function is in the on state, the camera function module executes S410 again, that is, sends a first notification message to the close range viewing reminding module.
In some embodiments, the camera functional module may interact with the close-range viewing reminding module directly to obtain whether the close-range viewing reminding function is in an on state. The exemplary camera function module sends a query request to the close-range viewing reminding module after executing S409 to release the camera, then receives a response result returned by the close-range viewing reminding module, and determines whether the close-range viewing reminding function is in an on state according to the response result.
In other embodiments, the close range viewing alert function is in an off state, and the close range viewing alert module may not be able to receive or respond to the query request. Therefore, in this embodiment, after executing S409 to release the camera, the camera function module may send a query request to the close-range view reminding module, and determine whether the close-range view reminding function is in an on state according to whether a response message returned from the close-range view reminding module is received within a preset period of time. Further, if a response message returned by the close-range viewing reminding module is received within a preset time period, the close-range viewing reminding function is indicated to be in an on state. And if the response message returned by the close-range viewing reminding module is not received within the preset time period, the close-range viewing reminding module is in a closed state.
Besides the state of obtaining the close-range viewing reminding function through interaction with the close-range viewing reminding module, the intelligent screen can also be provided with a mark for representing whether the close-range viewing reminding function is started or not. For example, after the smart screen starts the close-range viewing alert function, the smart screen may set the flag to 1 to characterize that the close-range viewing alert function is in an on state; after the close-range viewing alert function is turned off, the smart screen may set the flag to 0 for characterizing the close-range viewing alert function in the off state. Further, after the camera function module executes S409 to release the camera, it may be determined whether the close-range viewing reminding function is in an on state by querying the value of this flag.
In the technical scheme provided by the embodiment of the application, after the camera is released, if the camera functional module detects that the close-range watching reminding function is in the on state, the camera functional module sends a first notification message to the close-range watching reminding module. So as to inform the close-range viewing reminding module that the camera is released, and the close-range viewing reminding module can recall the camera as soon as possible so as to recover the close-range viewing reminding function.
It can be understood that the close-range viewing reminding module can be replaced by other modules which use cameras to realize corresponding functions. That is, after executing S409 the home camera function module releases the camera, the camera function module queries whether there is a function that needs to be implemented using the camera in an on state, and if so, the camera function module responds to the camera release instruction and also sends a first notification message that the camera is released to the function module corresponding to the function.
In some embodiments, the camera function module in S410 sends the first notification message to the close-range view alert module, and specifically may trigger sending the first notification message to the close-range view alert module after the camera is released. Further, the triggering may be implemented by calling a camera release callback function after the camera is released, where the triggering sends the first notification message to the close-range viewing reminding module. The registration process of the camera release callback function and the specific implementation process of the camera function module for calling the camera release callback function after the camera is released may refer to the detailed description of the later embodiment, which is not repeated herein.
S411, the close-range viewing reminding module sends a camera calling instruction to the camera functional module based on the first notification message.
Because the first notification message indicates that the current camera is released, after the close-range viewing reminding module receives the first notification message, the camera can be recalled to realize the close-range viewing reminding function. In the embodiment of the application, the close-range viewing reminding module receives the first notification message from the camera functional module and sends the camera calling instruction to the camera functional module again. In some embodiments, in order to distinguish from other camera call instructions, the camera call instruction sent by the close-range view alert module in S411 may be named as a second camera call instruction.
S412, the camera functional module responds to a camera calling instruction, and the camera is distributed to the close-range watching reminding module.
As can be seen from the description of the above embodiments, in S409, the camera functional module releases the camera in response to the camera release instruction of the home camera functional module, so before the camera functional module allocates the camera to the close-range viewing reminding module again in S412, the camera needs to be restarted and then allocated to the close-range viewing reminding module again.
S413, controlling the camera by the close-range viewing reminding module, and transmitting image data with the camera.
So far, the close-range watching reminding module regains the control right and the use right of the camera. And then, the close-range watching reminding module can acquire images acquired by the camera through the camera functional module, analyze the images and determine whether a user needs to be reminded of the watching distance.
In the method for distributing cameras provided by the embodiment of the application, on the premise that the close-range watching reminding module uses the camera to carry out close-range watching reminding, if the camera is preempted to be used by the functional modules such as the home camera, when the functional modules such as the home camera are retreated from the camera to be used, the camera functional module sends a first notification message to the close-range watching reminding module. Therefore, the close-range watching reminding module can timely sense that the camera is released. And then, the close-range watching reminding module can timely recall the camera, and continuously monitor and remind the watching distance of the user. The problem that the home camera function module is used for exiting again and the close-range watching reminding cannot be recovered in time on the premise that the close-range watching reminding is started is avoided. Meanwhile, the problem that CPU resource is wasted due to the fact that the close-range watching reminding module continuously polls and tries to open the camera during the period that the camera is used by the family camera can be avoided, and the performance of the intelligent screen is improved.
As can be seen from the description of the above embodiment, S410 may be specifically implemented by calling a camera release callback function. The camera release callback function is generated by registering a close-range viewing reminding module. In some embodiments, the close-range view alert module may register the camera release callback function immediately after startup. Referring to fig. 5, after the smart screen detects the user' S opening operation of the close-range viewing reminding function, the method may further include S501:
s501, registering a camera release callback function by the close-range viewing reminding module.
The camera release callback function can be used for calling the camera release callback function after the camera is released, and is used for triggering a function module registered with the camera release callback function to send a first notification message that the camera is released.
In some embodiments, after the close-range view alert module registers the camera release callback function, the smart screen may add a registration record of the close-range view alert module to the camera release callback function. And after the camera is released by other functional modules, the camera service module can trigger the call of the camera release callback function and send a notification message to the functional module registered with the camera release callback function based on the registration record. That is, in the embodiment of the present application, after the close-range viewing reminding module registers the camera release callback function, if the camera is released by other functional modules, the camera functional module triggers to call the camera release callback function. According to the registration record, it can be determined that the close-range viewing reminding module registers the camera release callback function, so that calling the camera release callback function sends a notification message that the camera is released to the close-range viewing reminding module.
Further, in some embodiments, the close-range viewing reminding module registers a camera release callback function, which may specifically be that the close-range viewing reminding module registers the camera release callback function in the HAL layer.
Further, as shown in fig. 6, S501 may specifically include S501a and S501b:
s501a, sending a registration request for a camera release callback function to the HIDL camera interface service module by the close-range viewing reminding module.
The HIDL camera interface service module is a camera interface service module (HIDL service camera proxy, hereinafter abbreviated as HIDL camera interface service module) in the hardware abstraction layer interface definition language service. It can be understood that S501a may also be understood as that the HIDL camera interface service module receives a registration request sent by the close-range view reminding module for the camera release callback function.
S501b, responding to a registration request, and adding a registration record of the camera release callback function by the short-distance watching reminding module by the HIDL camera interface service module.
In the embodiment that the close-range viewing reminding module registers the camera release callback function, after the camera function module is released from the cameras of other function modules, the camera function module can send a first notification message to the close-range viewing reminding module by calling the camera release callback function.
It should be noted that S501 may be executed after S401 and S402, may be executed before S401 and S402, or S401 and S402 may be executed in synchronization with S501. In the embodiment of the present application, the execution sequence of S401, S402, and S501 is not limited.
In combination with the above S501 in the embodiment of the present application, after the close-range viewing reminding module is started, a camera release callback function is registered. Accordingly, after releasing the camera from the home camera function module at S409, the camera function module may send a first notification message to the close-range viewing alert module based on the registration record by calling the camera release callback function. With continued reference to fig. 5, the step S410 may specifically include step S410a:
s410a, triggering and calling a camera release callback function by the camera function module, and sending a first notification message to the close-range viewing reminding module based on the registration record.
In an embodiment in which the close-range viewing reminding module registers the camera release callback function in the HIDL camera interface service module, please continue to refer to fig. 6, the above S410a may specifically include S601 and S602:
s601, the camera functional module sends a second notification message to the HIDL camera interface service module.
The second notification message is used for notifying the HIDL camera interface service module that the camera is released. Therefore, after the HIDL camera interface service module receives the second notification message, the camera release callback function may be invoked to send the first notification message to the close-range viewing alert module based on the registration record.
In some embodiments, the S410a may specifically be that the camera HAL module in the camera function module sends the second notification message to the HIDL camera interface service module.
S602, the HIDL camera interface service module responds to the second notification message, calls a camera release callback function, and sends a first notification message to the close-range viewing reminding module based on the registration record.
As can be seen from the description of the above embodiment, the second notification message is used to notify the HIDL camera interface service module that the camera is released, so after the HIDL camera interface service module receives the second notification message, the camera release callback function may be invoked to trigger sending the first notification message to the close-range viewing reminding module.
In some embodiments, it may not be clear to the camera functional module whether or not any functional module registered the camera release callback function, or which functional modules registered the camera release callback function, before the camera was released. Therefore, before the camera functional module sends the second notification message to the HIDL camera interface service module, the camera functional module may query the registration record for which functional modules register the camera release callback function. After that, the camera function module may send a first notification message to the part of the function modules registered with the camera release callback function after the camera is released. In this embodiment, the close range viewing alert module registers the camera release callback function after being started, so in this embodiment, the camera function module may send a second notification message to the HIDL camera interface service module, so that the HIDL camera interface service module sends a first notification message to the close range viewing alert module.
Specifically, in some embodiments, after releasing the camera from the home camera function module, the camera function module may query the HIDL camera interface service module for which function modules have registered the camera release callback function.
In the embodiment of the application, after the close-range viewing reminding module is started, a camera release callback function is registered. And the camera functional module can call the camera release callback function after the camera is released. After the callback function is released by the camera, the camera can be triggered to send a first notification message to the close-range watching reminding module, so that the close-range watching reminding module timely senses the released message of the camera, and the close-range watching reminding module can timely recall the camera to restore the close-range watching reminding function.
As can be seen from the description of the above embodiment, if the camera is in an idle state when the close range view reminding function is started, the camera is allocated to the close range view reminding module, i.e. S403 and S404 shown in fig. 4C. After that, the home camera is started, and the control right and the use right of the camera are preempted, so that the short-distance watching reminding module is temporarily interrupted. Therefore, in some embodiments, the close-range viewing reminding module can register the camera release callback function again when the camera is preempted, so that when the home camera function module exits the camera, the camera release callback function can be called to inform the close-range viewing reminding module of the released message of the camera. Therefore, the close-range watching reminding module can timely recall the camera, and the close-range watching reminding function is recovered.
As can be seen from the description of the above embodiment, the process of preempting the control right and the use right of the camera by the home camera function module by the close-range viewing reminding module may specifically include releasing the camera from the close-range viewing reminding module and then distributing the camera to the home camera function module by the camera function module. As shown in fig. 7, S406 may specifically include S406a-S406c:
s406a, the camera functional module responds to the camera calling instruction and sends a third control instruction to the close-range watching reminding module.
S406b, responding to a third control instruction, and releasing the camera by the close-range viewing reminding module.
Meanwhile, after the camera of the close-range viewing function module releases the camera, the close-range viewing reminding module registers the camera release callback function, as shown in S701 in fig. 7:
s701, registering a camera release callback function by the close-range viewing reminding module.
Note that S701 may be performed before S406b, after S406b, or both S701 and S406b may be performed simultaneously. In the embodiment of the present application, the execution sequence of S701 and S406b is not limited.
S406c, the camera functional module distributes the cameras to the household camera functional module.
It can be appreciated that in the embodiment shown in fig. 7, when the home camera is out of use, the camera function module may send the first notification message to the close-range viewing alert module by triggering a manner of calling a camera release callback function.
In the technical scheme provided by the embodiment of the application, when the close-range viewing reminding module is started, if the camera is in an idle state, the control right and the use right of the camera can be immediately obtained. And then, the cameras are distributed to other functional modules such as home cameras, the cameras of the close-range watching reminding module are preempted, and the close-range watching reminding function is temporarily interrupted. At this time, when the close-range viewing reminding module releases the camera, the camera release callback function can be registered, so that after other functional modules withdraw from the camera, the camera release callback function can be called to inform the close-range viewing reminding module that the camera is released. Therefore, the camera can be timely recalled by the close-range watching reminding module, and the close-range watching reminding function can be timely restored.
In addition, in the embodiment in which the camera function module sends the first notification message to the close-range view reminding module by triggering the call of the camera release callback function, if the close-range view reminding function is started, the camera is already allocated to other function modules (such as a third function module) and the use priority of the close-range view reminding module for the camera is lower than the use priority of the third function module for the camera. In response to the opening operation of the close-range viewing reminding function, the close-range viewing reminding function can be started first, but the close-range viewing reminding function cannot be normally realized at this time because the camera is occupied by other functional modules.
In order to call the camera in time when the third functional module exits the camera, the close-range watching reminding module can timely call the camera to realize the close-range watching reminding function, and the close-range watching reminding module can register the camera to release the callback function. Therefore, when the third functional module exits the camera, the camera functional module can trigger and call the camera release callback function in time, and the first notification message is sent to the close-range watching reminding module based on the registration record. After receiving the first notification message, the close-range viewing reminding module can timely call the camera so as to realize a close-range viewing reminding function.
In some embodiments, the third functional module may be a video call related functional module. It will be appreciated that the third functional module may also be replaced by the home camera functional module described above.
In some embodiments, as shown in fig. 8, a schematic software architecture of the smart screen provided in the embodiments of the present application is shown, where functional modules related to the method for distributing cameras provided in the embodiments of the present application and data circulation among the functional modules are shown.
In the embodiment shown in fig. 8, the camera functional module may be specifically divided into: the camera service module is positioned at the application framework layer, and the camera hardware abstraction module is positioned at the hardware abstraction layer.
With reference to the functional modules shown in fig. 8, a complete flow of the method for allocating cameras provided in the embodiments of the present application is described below, with reference to fig. 9. In this embodiment, the close-range viewing alert module is a function of a child mode Application (APK), and the home camera function is a home camera application.
First, the user turns on the child mode of the smart screen. Then, the child mode judges whether or not the close-range viewing reminding function is turned on. After detecting that the child mode has turned on the close range view alert function, the child mode registers a camera release callback function in HIDL service camera proxy. And, the child mode starts the camera (camera HAL) through the camera server module. Then, the child mode acquires image data through the camera HAL, analyzes the image data, can monitor the watching distance of the user, and reminds the user when the watching distance is detected to be too close.
The user then turns on the home camera of the smart screen. After the home camera is started, the control right and the use right of the camera are preempted. At this time, the close-range viewing reminding function of the child mode is temporarily interrupted.
After that, the user turns off the home camera again. In the process of closing the home camera, the home camera can release the camera under control of the camera server. After the camera is released, the camera halos call the camera release callback function from HIDL service camera proxy, triggering the sending of a first notification message to the child mode to notify the child mode that the camera has been released.
After receiving the first notification message, the child mode can re-read the calling camera through the camera server module, and acquire images acquired by the camera for analysis. And then, monitoring and reminding the watching distance of the user according to the image analysis result.
Fig. 10 is a flowchart of a method for allocating cameras according to an embodiment of the present application. In this embodiment, the user first turns on the child mode, which will acquire whether the close-range viewing reminder function is turned on in the saved record. If the close-range viewing reminding module is not opened, the user can manually open the close-range viewing reminding function at the function setting interface of the child mode. After detecting that the close range view alert function is on, the close range view alert module may register a camera release callback function in HIDL service camera proxy.
Thereafter, it may be determined that camera release is available. If the camera is available when the child mode is turned on (or the close range view alert function is turned on), the camera may be directly assigned to the close range view alert module. And then, the close-range viewing reminding module can acquire images acquired by the camera, and analyze the images to determine the viewing distance of the user. And prompting the user when the image is analyzed to determine that the viewing distance of the user is too short.
If the camera is not available when the child mode is turned on (or the close range view alert function is turned on), then a notification message is waited HIDL service camera proxy to call the camera release callback function that the camera was released. After judging that the notification message that the camera is released is received, the close-range viewing reminding module can call the camera, and the intelligent screen can also distribute the camera to the close-range viewing reminding module. And then, the close-range watching reminding module can acquire the images acquired by the camera for analysis, and monitor and remind the watching distance of the user based on the image analysis result.
Wherein the camera HAL will send a notification message to HIDL service camera proxy after detecting that the camera is released. And HIDL service camera proxy, after receiving the notification message, calls the camera release callback function and sends the notification message that the camera is released to the close-range viewing reminding module registered with the camera release callback function.
Further, in the process that the close-range viewing reminding module acquires the image acquired by the camera and closely monitors and reminds the viewing distance of the user based on the result of image analysis, the use right of the camera may be preempted by other functional modules. When the close-range viewing reminding function is started, the close-range viewing reminding module registers the camera release callback function. Thus, after detecting that the camera is preempted, the close-range view alert module may detect whether a notification message sent by HIDL service camera proxy that the camera was released is received. And after receiving the released notification message of the camera, recalling the camera to acquire the image acquired by the camera and recovering the close-range watching reminding function.
Further embodiments of the present application provide a computer device, which may be the above-mentioned electronic device (e.g. the smart screen 1). The computer device may include: a 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 the computer instructions, the computer device may perform the various functions or steps performed by the intelligent screen 1 in the method embodiments described above. When the computer device is an electronic device, the structure thereof may refer to the structure of the electronic device 100 shown in fig. 2A.
Embodiments of the present application also provide 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 interface circuit 1102 may be interconnected by wires. For example, interface circuit 1102 may be used to receive signals from other devices (e.g., a memory of a computer apparatus). For another example, the interface circuit 1102 may be used to send signals to other devices (e.g., the processor 1101). The interface circuit 1102 may, for example, read instructions stored in a memory and send the instructions to the processor 1101. The instructions, when executed by the processor 1101, may cause a computer device to perform the various steps of the embodiments described above. Of course, the chip system may also include other discrete devices, which are not specifically limited in this embodiment of the present application.
The present application also provides a computer-readable storage medium, where the computer-readable storage medium includes computer instructions, where the computer instructions, when executed on an electronic device (e.g., the smart screen 1), cause the electronic device to perform the functions or steps performed by the smart screen 1 in the method embodiment.
The present embodiments also provide a computer program product, which when run on a computer, causes the computer to perform the functions or steps performed by the intelligent screen 1 in the above-described method embodiments. The computer may be an electronic device, such as a smart screen 1.
It will be apparent to those skilled in the art from this description that, for convenience and brevity of description, only the above-described division of the functional modules is illustrated, and in practical application, the above-described functional allocation may be performed by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules to perform all or part of the functions described above.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of modules or units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another apparatus, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and the parts shown as units may be one physical unit or a plurality of physical units, may be located in one place, or may be distributed in a plurality of different places. Some or all of the units may 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 may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a readable storage medium. Based on such understanding, the technical solution of the embodiments of the present application may be essentially or a part contributing to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, including several instructions to cause a device (may be a single-chip microcomputer, a chip or the like) or a processor (processor) to perform all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read Only Memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely a specific embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions within the technical scope of the present disclosure should be covered in the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. The method for distributing the cameras is characterized by being applied to electronic equipment, wherein the electronic equipment comprises the cameras, and a first functional module and a second functional module which support the cameras to realize corresponding functions; the first function corresponding to the first function module is in an on state, and the camera is currently distributed to the second function module; the method comprises the following steps:
acquiring a first operation for the second functional module;
and in response to the first operation, releasing the camera from the second functional module and distributing the camera to the first functional module.
2. The method of claim 1, wherein the electronic device further comprises a camera function module, the releasing the camera from the second function module and assigning the camera to the first function module in response to the first operation comprises:
The camera functional module responds to the first operation, releases the camera from the second functional module and triggers sending of a notification message that the camera is released to the first functional module;
the first functional module sends a first camera calling instruction to the camera functional module based on the notification message;
and responding to the first camera calling instruction, and distributing the camera to the first functional module by the camera functional module.
3. The method according to claim 1 or 2, characterized in that before the acquiring the first operation for the second functional module, the method further comprises:
acquiring a second operation for the second functional module;
and responding to the second operation, and distributing the camera to the second functional module.
4. A method according to claim 3, wherein prior to said obtaining a second operation for said second functional module, the method further comprises:
acquiring a third operation for the first functional module;
in response to the third operation, starting the first function and distributing the camera to the first function module;
Wherein the assigning the camera to the second functional module in response to the second operation includes:
and in response to the second operation, releasing the camera from the first functional module and distributing the camera to the second functional module.
5. The method of claim 4, wherein the electronic device further comprises a camera function module, and wherein after the acquiring the third operation for the first function module, the method further comprises:
the first functional module initiates a first registration request for registering a camera release callback function;
responding to the first registration request, and adding a registration record of the first functional module for the camera release callback function; the registration record is used for triggering and calling the camera release callback function after the camera is released from the second functional module by the camera functional module, and the notification message of the released camera is sent to the first functional module based on the registration record.
6. The method of claim 4, wherein the electronic device further comprises a camera functional module, the method further comprising, after the releasing the camera from the first functional module in response to the second operation:
The first functional module initiates a second registration request for registering a camera release callback function;
responding to the second registration request, and adding a registration record of the first functional module for the camera release callback function; the registration record is used for triggering and calling the camera release callback function after the camera is released from the second functional module by the camera functional module, and the notification message of the released camera is sent to the first functional module based on the registration record.
7. The method of claim 3, wherein the electronic device further comprises a camera function module, the method further comprising, after the assigning the camera to the second function module in response to the second operation:
acquiring a fourth operation for the first functional module;
in response to the fourth operation, initiating the first function;
the first functional module initiates a third registration request for registering a camera release callback function;
responding to the third registration request, and adding a registration record of the first functional module for the camera release callback function; the registration record is used for triggering and calling the camera release callback function after the camera is released from the second functional module by the camera functional module, and the notification message of the released camera is sent to the first functional module based on the registration record.
8. The method of any one of claims 1-7, wherein the first functional module comprises a close-range viewing reminder module; after said assigning the camera to the first functional module, the method further comprises:
the close-range watching reminding module acquires images acquired by the camera;
and the close-range viewing reminding module analyzes the image and reminds the viewing distance of the user according to a result obtained by analyzing the image.
9. An electronic device, the electronic device comprising: the device comprises a processor, a memory and a camera; the memory and the camera are respectively coupled with the processor;
the camera is used for collecting images; the memory has stored therein computer program code comprising computer instructions which, when executed by the processor, cause the electronic device to perform the method of any of claims 1-8.
10. A computer readable storage medium comprising computer instructions which, when run on an electronic device, cause the electronic device to perform the method of any of claims 1-8.
CN202310492723.7A 2023-05-04 2023-05-04 Camera distribution method and electronic equipment Pending CN117729425A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310492723.7A CN117729425A (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 CN117729425A (en) 2023-05-04 2023-05-04 Camera distribution method and electronic equipment

Publications (1)

Publication Number Publication Date
CN117729425A true CN117729425A (en) 2024-03-19

Family

ID=90200333

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310492723.7A Pending CN117729425A (en) 2023-05-04 2023-05-04 Camera distribution method and electronic equipment

Country Status (1)

Country Link
CN (1) CN117729425A (en)

Citations (4)

* Cited by examiner, † Cited by third party
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

Patent Citations (4)

* Cited by examiner, † Cited by third party
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

Similar Documents

Publication Publication Date Title
JP7463647B2 (en) Notification processing system, method and electronic device
CN114397979B (en) Application display method and electronic equipment
US11385857B2 (en) Method for displaying UI component and electronic device
US20230216990A1 (en) Device Interaction Method and Electronic Device
WO2022143883A1 (en) Photographing method and system, and electronic device
WO2022127632A1 (en) Resource management and control method, and device
CN113747374B (en) Message pushing method and device
US20240094972A1 (en) Page Display Method and Apparatus, Electronic Device, and Readable Storage Medium
CN113703849B (en) Screen-casting application opening method and device
EP4152756A1 (en) Device recommendation method and electronic device
CN117729425A (en) Camera distribution method and electronic equipment
CN116708647B (en) Notification message reply method and electronic equipment
CN117857646B (en) Data network sharing method, electronic equipment and storage medium
WO2023040848A9 (en) Device control method and apparatus
WO2023016347A1 (en) Voiceprint authentication response method and system, and electronic devices
WO2022089259A1 (en) Device communication method, system and apparatus
WO2023142935A1 (en) Application component management method and related device
CN116264600A (en) Incoming call reminding method, electronic device and computer readable storage medium
CN116541188A (en) Notification display method, terminal device and storage medium
CN118734349A (en) Privacy protection method and electronic equipment
CN116095230A (en) Application program recommendation method and related device
CN116668997A (en) Positioning method, user interface and electronic equipment
CN115268999A (en) Terminal for controlling health equipment and health equipment control method
CN117714760A (en) Synchronous playing method and 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