Control method of Near Field Communication (NFC) function and electronic equipment

文档序号:1908422 发布日期:2021-11-30 浏览:13次 中文

阅读说明:本技术 一种近场通信nfc功能的控制方法及电子设备 (Control method of Near Field Communication (NFC) function and electronic equipment ) 是由 尚志磊 武文斌 张东 于 2021-09-10 设计创作,主要内容包括:本申请提供一种近场通信NFC功能的控制方法及电子设备,涉及终端技术领域,可以解决电子设备中NFC功能和相机功能的冲突,同时还可以提高NFC功能和相机功能共用的可能性。其中,在电子设备启动第一摄像头的情况下,电子设备的NFC功能开启;在电子设备启动第二摄像头的情况下,NFC功能关闭。其中,第一摄像头和第二摄像头是电子设备的不同摄像头。该方案可以用于使用摄像头的场景中。(The application provides a control method of a Near Field Communication (NFC) function and electronic equipment, relates to the technical field of terminals, and can solve the conflict between the NFC function and a camera function in the electronic equipment and improve the possibility of sharing the NFC function and the camera function. The NFC function of the electronic equipment is started under the condition that the electronic equipment starts the first camera; and under the condition that the electronic equipment starts the second camera, the NFC function is closed. Wherein the first camera and the second camera are different cameras of the electronic device. The scheme can be used in scenes using cameras.)

1. A control method of Near Field Communication (NFC) function is applied to electronic equipment and comprises the following steps:

the NFC function of the electronic equipment is started under the condition that the electronic equipment starts a first camera;

under the condition that the electronic equipment starts a second camera, the NFC function is closed;

wherein the first camera and the second camera are different cameras of the electronic device.

2. The method of claim 1, wherein the second camera is a rear wide angle camera.

3. The method according to claim 1 or 2, characterized in that in case the electronic device starts the first camera, the NFC functionality of the electronic device is turned on; under the condition that the electronic equipment starts the second camera, the NFC function is closed, and the method comprises the following steps:

if the equipment identifier of the electronic equipment is a preset identifier, the NFC function of the electronic equipment is started under the condition that the electronic equipment starts a first camera, and the NFC function is closed under the condition that the electronic equipment starts a second camera;

the device identification is a device name, and the preset identification is a preset name; or, the device identifier is a device model, and the preset identifier is a preset model.

4. The method of claim 3, further comprising:

and if the equipment identifier of the electronic equipment is not the preset identifier, the NFC function is closed under the condition that the electronic equipment starts any camera in the electronic equipment.

5. The method according to any one of claims 1-4, wherein a preset configuration item is included in the electronic device;

the NFC function of the electronic equipment is started under the condition that the electronic equipment starts the first camera; under the condition that the electronic equipment starts the second camera, the NFC function is closed, and the method comprises the following steps:

if the preset configuration item is in an open state, the NFC function of the electronic equipment is opened under the condition that the electronic equipment starts the first camera, and the NFC function is closed under the condition that the electronic equipment starts the second camera; if the preset configuration item is in a closed state, the state of the NFC function is kept unchanged under the condition that the electronic equipment starts any camera in the electronic equipment.

6. The method according to any of claims 1-5, characterized in that in case the electronic device starts the first camera, the NFC functionality of the electronic device is turned on; in a case that the electronic device activates the second camera, before the NFC function is turned off, the method further includes:

the electronic device turns on the NFC function in response to initiating camera service.

7. The method according to any of claims 1-6, characterized in that in case the electronic device starts the first camera, the NFC functionality of the electronic device is turned on; in a case that the electronic device activates the second camera, after the NFC function is turned off, the method further includes:

the electronic equipment responds to a first operation of a user, closes all cameras in the electronic equipment, and starts the NFC function.

8. The method according to claim 6 or 7, wherein the opening the NFC function comprises:

and if the preset configuration item is in an opening state, opening the NFC function.

9. The method of any of claims 1-8, wherein the electronic device activating a second camera comprises:

and the electronic equipment responds to a second operation of the user, closes the first camera and starts the second camera.

10. The method of any of claims 1-8, wherein the electronic device activating the first camera comprises:

and the electronic equipment responds to a third operation of a user, closes the second camera and starts the first camera.

11. The method according to any one of claims 1-10, wherein the turning on of the NFC functionality of the electronic device in the case where the electronic device activates the first camera comprises:

and if the NFC function of the electronic equipment is not in a closed state in response to the operation of the user, the NFC function of the electronic equipment is started under the condition that the electronic equipment starts the first camera.

12. The method of claim 11, further comprising:

and if the NFC function of the electronic equipment is in a closed state in response to the operation of the user, the NFC function of the electronic equipment is closed under the condition that the electronic equipment starts the first camera.

13. The method according to any of claims 1-12, wherein the electronic device turns on the NFC functionality, comprising:

the camera service of the electronic device sends a first message to an NFC service of the electronic device; the NFC service responds to the first message and starts the NFC function; alternatively, the first and second electrodes may be,

the electronic device turns off the NFC function, including:

the camera service of the electronic device sends a second message to the NFC service of the electronic device; the NFC service turns off the NFC function in response to the second message.

14. The method according to claim 13, wherein the camera service records a message that the camera service last successfully sent to the NFC service; wherein the message is the first message or the second message;

wherein the camera service of the electronic device sending a first message to an NFC service of the electronic device comprises:

if the camera service successfully sends the second message to the NFC service last time, the camera service sends the first message to the NFC service; if the camera service successfully sends the first message to the NFC service last time, the camera service does not send the first message to the NFC service;

wherein the camera service of the electronic device sending a second message to the NFC service of the electronic device comprises:

if the camera service last successfully sends the first message to the NFC service, the camera service sends the second message to the NFC service; wherein if the camera service successfully sends the second message to the NFC service last time, the camera service does not send the second message to the NFC service.

15. The method according to any one of claims 1-14, wherein in case the electronic device activates the first camera, the NFC functionality of the electronic device is turned on, comprising:

after a camera in the electronic equipment is driven to start a camera, sending first preview frame data of an image collected by the camera and a camera identification of the camera to a camera hardware abstract layer in the electronic equipment;

the camera hardware abstraction layer adds the camera identification to the first preview frame data to obtain second preview frame data, and sends the second preview frame data to a camera service of the electronic equipment;

if the equipment identifier of the electronic equipment is a preset identifier, the camera service acquires the camera identifier from the second preview frame data;

the camera service sends a first message to the NFC service when the camera identification indicates that the camera is the first camera;

the NFC service responds to the first message and starts the NFC function.

16. The method according to any one of claims 1-14, wherein in case the electronic device activates the first camera, the NFC functionality of the electronic device is turned on, comprising:

after a camera in the electronic equipment is driven to start a camera, sending first preview frame data of an image collected by the camera and a camera identification of the camera to a camera hardware abstract layer in the electronic equipment;

the camera hardware abstraction layer adds the camera identification to the first preview frame data to obtain second preview frame data, and sends the second preview frame data to a camera service of the electronic equipment;

if the equipment identifier of the electronic equipment is a preset identifier, the camera service acquires the camera identifier from the second preview frame data;

the camera service sends a second message to the NFC service when the camera identification indicates that the camera is the second camera;

the NFC service turns off the NFC function in response to the second message.

17. An electronic device, wherein the electronic device supports near field communication, NFC, functionality and camera functionality, the electronic device comprising a display screen, a memory, and one or more processors; the display screen, the memory and the processor are coupled; the memory for storing computer program code comprising computer instructions that, when executed by the processor, cause the electronic device to perform the method of any of claims 1-16.

18. A computer-readable storage medium having instructions stored therein, which when run on an electronic device, cause the electronic device to perform the method of any of claims 1-16.

Technical Field

The present application relates to the field of terminal technologies, and in particular, to a method for controlling a near field communication NFC function and an electronic device.

Background

Currently, electronic devices such as mobile phones are generally provided with a camera function and a Near Field Communication (NFC) function at the same time. Wherein, camera function can be used to scene such as shooing, video recording, video conversation, and its sensor (sensor) module that needs the camera gathers light signal to convert light signal into the signal of telecommunication, thereby convenient processing and storage. And the NFC function may be used in a card reading, card swiping (such as a subway card) and other scenarios, which require the NFC chip to generate a radio frequency field to implement the card reading or card swiping.

However, in the process of implementing the embodiment of the present application, the inventor finds that, due to hardware reasons, signals simulated by the sensor module of some cameras may be coupled with a radio frequency field generated by the NFC chip, so that a conflict exists between the camera function and the NFC function. One of the obvious manifestations is: in a scenario where a camera function (e.g., video call) is used, if the NFC function is in an on state, a preview may be rippled.

Disclosure of Invention

The embodiment of the application provides a control method for a Near Field Communication (NFC) function and electronic equipment, which can solve the problem of conflict between the NFC function and a camera function and can improve the possibility of sharing the NFC function and the camera function.

In a first aspect, an embodiment of the present application provides a method for controlling a near field communication NFC function, which is applied to an electronic device capable of supporting an NFC function and a camera function. And when the electronic equipment starts the first camera, the NFC function of the electronic equipment is started. And under the condition that the electronic equipment starts the second camera, the NFC function is closed. The first camera and the second camera are different cameras of the electronic device, and the second camera is a camera of the electronic device that conflicts with a camera function. For example, if the camera in the electronic device that conflicts with the NFC function is a rear wide-angle camera, the second camera is a rear wide-angle camera.

In summary, by using the method of the embodiment of the present application, when the electronic device starts different cameras, the states of the NFC function are different. On the one hand, when the electronic device starts the conflicting camera, the NFC function is turned off. As such, the electronic device may avoid a collision of the NFC functionality and the camera functionality. On the other hand, when the electronic device starts other cameras (cameras other than the conflicting camera), the NFC function is turned on, and the electronic device can still keep the NFC function available in the process of using the other cameras. So that the possibility of sharing the NFC function and the camera function can be improved.

In another possible embodiment of the first aspect, the second camera is a rear wide-angle camera.

In another possible design manner of the first aspect, when the electronic device starts the first camera, the NFC function of the electronic device is turned on; under the condition that the electronic equipment starts the second camera, the NFC function is closed, including: if the equipment identification of the electronic equipment is the preset identification, the NFC function of the electronic equipment is started under the condition that the electronic equipment starts the first camera, and the NFC function is closed under the condition that the electronic equipment starts the second camera. The preset identification is used for indicating the electronic equipment of the clearly conflicting camera. The device identification is a device name, and the preset identification is a preset name; or the equipment identifier is an equipment model, and the preset identifier is a preset model. For example, in mobile phones in the market, it is known that a conflicting camera in a mobile phone of model a is a rear wide-angle camera, a conflicting camera in a mobile phone of model b is a rear telephoto camera, and the remaining mobile phones cannot definitely have conflicting cameras, and the preset identifier may be the model a and the model b. That is to say, if the device identifier of the electronic device is the preset identifier, it indicates that the camera in the electronic device that conflicts with the NFC function is clear.

Therefore, by adopting the method of the embodiment, the NFC function is turned on or off according to the currently started camera only when the camera in the electronic device having the conflict with the NFC function is clear. Thereby, the rationality of the control of the NFC function can be improved.

In another possible design manner of the first aspect, the method further includes: and if the equipment identifier of the electronic equipment is not the preset identifier, the NFC function is closed under the condition that the electronic equipment starts any camera in the electronic equipment. The device identification of the electronic device is not a preset identification, which indicates that a camera in the electronic device, which conflicts with the NFC function, is ambiguous.

Therefore, by adopting the method of the embodiment, under the condition that the cameras in conflict with the NFC function in the electronic device are not clear, the NFC function cannot be turned on or turned off according to the currently-started camera, but the NFC function is turned off uniformly when any camera is started. So that collisions can be avoided as much as possible.

In another possible design manner of the first aspect, a preset configuration item is included in the electronic device, and a state of the preset configuration item may be set according to performance requirements of the electronic device for the NFC function and the camera function. Different mobile phones have different requirements on performance. For example, some cell phones focus more on the effect of the shot, and generally do not allow for previewing the presence of water ripples. Thus, the conflict between the NFC function and the camera function needs to be resolved, and the preset configuration item may be set to the on state. Other handsets focus on the availability of NFC functionality and do not typically allow NFC functionality to be turned off. I.e. not allowing the NFC functionality to be switched off. Thus, the preset configuration item can be set to the off state without solving the conflict between the NFC function and the camera function. Correspondingly, the NFC function of the electronic equipment is started under the condition that the electronic equipment starts the first camera; under the condition that the electronic equipment starts the second camera, the NFC function is closed, including: if the preset configuration item is in an open state, the NFC function of the electronic equipment is opened under the condition that the electronic equipment starts the first camera, and the NFC function is closed under the condition that the electronic equipment starts the second camera. If the preset configuration item is in a closed state, the state of the NFC function is kept unchanged under the condition that the electronic equipment starts any camera in the electronic equipment.

Therefore, by adopting the method of the embodiment, the electronic device can turn on or turn off the NFC function according to the turned-on camera only when the conflict needs to be solved, thereby avoiding the violation of the performance requirement of the electronic device. For example, if the electronic device needs to guarantee the NFC function, the NFC function cannot be turned off all the time.

In another possible design manner of the first aspect, when the electronic device starts the first camera, the NFC function of the electronic device is turned on; under the condition that the electronic equipment starts the second camera, before the NFC function is closed, the method further comprises the following steps: the electronic device turns on the NFC functionality in response to initiating the camera service. It will be appreciated that the use of a camera must then ensure that camera services are available. By adopting the scheme of the embodiment of the application, the NFC function can be closed when the second camera is started under normal conditions. In this case, if the camera service is abnormally interrupted, the NFC function may be in an off state and not turned on in time. Thereby affecting the use of subsequent NFC functionality. Therefore, after the camera service is started, the NFC function is forced to be turned on. Therefore, the problem that the NFC function is unavailable due to abnormal interruption of the camera service can be avoided.

Therefore, by adopting the method of the embodiment, the electronic device can ensure that the NFC function is available initially, and then the opening and closing of the NFC function are further controlled according to the camera on the basis.

In another possible design manner of the first aspect, when the electronic device starts the first camera, the NFC function of the electronic device is turned on; under the condition that the electronic equipment starts the second camera, after the NFC function is closed, the method further comprises the following steps: the electronic device responds to a first operation (for example, an operation of exiting a camera application, an operation of exiting a video call and the like) of a user, closes all cameras in the electronic device, and opens the NFC function.

Therefore, by adopting the method of the embodiment, the electronic equipment can start the NFC function after the camera is not used, so that the NFC function is enabled to be available.

In another possible design manner of the first aspect, the starting the NFC function includes: and if the preset configuration item is in the opening state, opening the NFC function. Similarly, the electronic device can turn on or off the NFC function according to the turned-on camera only when the conflict needs to be resolved, thereby avoiding violating the performance requirement of the electronic device

In another possible design manner of the first aspect, the starting of the second camera by the electronic device includes: and the electronic equipment responds to a second operation (such as an operation of adjusting the zoom bar to the corresponding magnification of the second camera) of the user, closes the first camera and starts the second camera. The above-mentioned electronic equipment starts first camera, includes: and the electronic equipment responds to a third operation (such as an operation of adjusting the zoom bar to the corresponding magnification of the first camera) of the user, closes the second camera and starts the first camera. That is, the first camera and the second camera can be switched with each other by the user's operation.

Therefore, by adopting the method of the embodiment, the electronic equipment can flexibly control the NFC function to be in different states along with the switching of the camera. So that the possibility of sharing the NFC function and the camera function can be further increased. For example, in the process of recording a video once, the NFC function is controlled to be in an on state in a time period when the first camera is used, and the NFC function is controlled to be in an off state in a time period when the second camera is used.

In another possible design manner of the first aspect, when the electronic device starts the first camera, the turning on of the NFC function of the electronic device includes: if the NFC function of the electronic device is not in an off state in response to the operation of the user, that is, the user does not manually turn off the NFC function, the NFC function of the electronic device is turned on when the electronic device starts the first camera.

Therefore, by adopting the method of the embodiment, if the user does not manually close the NFC function, the NFC function can be opened under the condition that the non-conflicting camera is started. Thereby avoiding violations of the user's wishes.

In another possible design manner of the first aspect, the method further includes: if the NFC function of the electronic equipment is in a closed state in response to the operation of the user, namely the NFC function is manually closed by the user, the NFC function of the electronic equipment is closed under the condition that the first camera is started by the electronic equipment.

Therefore, by adopting the method of the embodiment, if the user manually turns off the NFC function, even if the non-conflicting camera is started, the electronic device still keeps the NFC function off, and the NFC function is not turned on. Thereby avoiding violations of the user's wishes.

In another possible design manner of the first aspect, the starting, by the electronic device, an NFC function includes: the method comprises the steps that a camera service of the electronic equipment sends a first message to an NFC service of the electronic equipment; the NFC service starts the NFC function in response to the first message. Or, the electronic device turning off the NFC function includes: the camera service of the electronic device sends a second message to the NFC service of the electronic device; the NFC service turns off the NFC function in response to the second message.

Therefore, by adopting the method of the embodiment, the electronic device can send a message to the NFC service through the camera service to control the NFC function to be turned on or turned off.

In another possible design manner of the first aspect, a message that the camera service successfully sends to the NFC service last time is recorded in the camera service; wherein the message is a first message or a second message. The sending, by the camera service of the electronic device, the first message to the NFC service of the electronic device includes: if the camera service successfully sends the second message to the NFC service last time, the camera service sends the first message to the NFC service; and if the camera service successfully sends the first message to the NFC service last time, the camera service does not send the first message to the NFC service. The sending, by the camera service of the electronic device, the second message to the NFC service of the electronic device includes: if the camera service successfully sends the first message to the NFC service last time, the camera service sends a second message to the NFC service; and if the camera service successfully sends the second message to the NFC service last time, the camera service does not send the second message to the NFC service.

Therefore, with the method of this embodiment, before the camera service sends the message for turning off the NFC function or the message for turning on the NFC function to the NFC service, it is first queried whether the recorded message and the message to be sent are the same, and if the recorded message and the message to be sent are different, the camera service further sends the message for turning off the NFC function or the message for turning on the NFC function to the NFC service. And if the recorded message is the same as the message to be sent, the camera service does not send the message for closing the NFC function or the message for opening the NFC function to the NFC service. Therefore, the same message can be prevented from being continuously sent to the NFC service, cross-process communication between the camera service and the NFC service is reduced, and power consumption of the mobile phone is reduced.

In another possible design manner of the first aspect, when the electronic device starts the first camera, the turning on of the NFC function of the electronic device includes: after a camera in the electronic equipment is driven to start a camera, first preview frame data of an image collected by the camera and a camera identification of the camera are sent to a camera hardware abstract layer in the electronic equipment. And the camera hardware abstraction layer adds the camera identification to the first preview frame data to obtain second preview frame data, and sends the second preview frame data to the camera service of the electronic equipment. And if the equipment identifier of the electronic equipment is the preset identifier, the camera service acquires the camera identifier from the second preview frame data. The camera service sends a first message to the NFC service when the camera identification indicates that the camera is the first camera. The NFC service starts the NFC function in response to the first message.

Or, under the condition that the electronic device starts the first camera, the NFC function of the electronic device is turned on, including: after a camera in the electronic equipment is driven to start a camera, first preview frame data of an image collected by the camera and a camera identification of the camera are sent to a camera hardware abstract layer in the electronic equipment. And the camera hardware abstraction layer adds the camera identification to the first preview frame data to obtain second preview frame data, and sends the second preview frame data to the camera service of the electronic equipment. And if the equipment identifier of the electronic equipment is the preset identifier, the camera service acquires the camera identifier from the second preview frame data. The camera service sends a second message to the NFC service when the camera identification indicates that the camera is a second camera. The NFC service turns off the NFC function in response to the second message.

Therefore, by adopting the method of the embodiment, the camera hardware abstraction layer can add the camera identification of the currently started camera to the preview frame data and then report the preview frame data to the camera service. Therefore, the camera service can conveniently acquire the camera identification and determine whether the currently started camera is a conflicting camera. Moreover, the request for starting the camera is transmitted from the application program to the bottom layer, and only the function parameters are carried, and from the function parameters, the camera service can only determine the functions which need to be realized by the application program. And the specific started camera is determined by the bottom layer according to the functional parameters. Therefore, after the camera is started at the bottom layer, the camera identification reported by the bottom layer is added to the preview frame data and then reported to the camera service, so that the camera service can be ensured to acquire the accurate camera identification. Finally, the accuracy of the control of the NFC function can be improved.

In a second aspect, embodiments of the present application further provide an electronic device, which supports a camera function and an NFC function, and includes a display screen, a memory, and one or more processors. The display screen, the memory, and the processor are coupled. The memory for storing computer program code comprising computer instructions that, when executed by the processor, cause the electronic device to perform the steps of: and under the condition that the electronic equipment starts the first camera, starting the NFC function of the electronic equipment. And under the condition that the electronic equipment starts the second camera, the NFC function is closed. Wherein the first camera and the second camera are different cameras of the electronic device.

In another possible embodiment of the second aspect, the second camera is a rear wide-angle camera.

In another possible design of the second aspect, the computer instructions, when executed by the processor, cause the electronic device to further perform the steps of: if the equipment identification of the electronic equipment is a preset identification, the NFC function of the electronic equipment is started under the condition that the electronic equipment starts the first camera, and the NFC function is closed under the condition that the electronic equipment starts the second camera. The device identification is a device name, and the preset identification is a preset name; or, the device identifier is a device model, and the preset identifier is a preset model.

In another possible design of the second aspect, the computer instructions, when executed by the processor, cause the electronic device to further perform the steps of: and if the equipment identifier of the electronic equipment is not the preset identifier, the NFC function is closed under the condition that the electronic equipment starts any camera in the electronic equipment.

In another possible design manner of the second aspect, the electronic device includes a preset configuration item therein.

The computer instructions, when executed by the processor, cause the electronic device to further perform the steps of: if the preset configuration item is in an open state, the NFC function of the electronic equipment is opened under the condition that the electronic equipment starts the first camera, and the NFC function is closed under the condition that the electronic equipment starts the second camera; if the preset configuration item is in a closed state, the state of the NFC function is kept unchanged under the condition that the electronic equipment starts any camera in the electronic equipment.

In another possible design of the second aspect, the computer instructions, when executed by the processor, cause the electronic device to further perform the steps of: the electronic device turns on the NFC function in response to initiating camera service.

In another possible design of the second aspect, the computer instructions, when executed by the processor, cause the electronic device to further perform the steps of: the electronic equipment responds to a first operation of a user, closes all cameras in the electronic equipment, and starts the NFC function.

In another possible design of the second aspect, the computer instructions, when executed by the processor, cause the electronic device to further perform the steps of: and if the preset configuration item is in an opening state, opening the NFC function.

In another possible design of the second aspect, the computer instructions, when executed by the processor, cause the electronic device to further perform the steps of: and the electronic equipment responds to a second operation of the user, closes the first camera and starts the second camera.

In another possible design of the second aspect, the computer instructions, when executed by the processor, cause the electronic device to further perform the steps of: and the electronic equipment responds to a third operation of a user, closes the second camera and starts the first camera.

In another possible design of the second aspect, the computer instructions, when executed by the processor, cause the electronic device to further perform the steps of: and if the NFC function of the electronic equipment is not in a closed state in response to the operation of the user, the NFC function of the electronic equipment is started under the condition that the electronic equipment starts the first camera.

In another possible design of the second aspect, the computer instructions, when executed by the processor, cause the electronic device to further perform the steps of: and if the NFC function of the electronic equipment is in a closed state in response to the operation of the user, the NFC function of the electronic equipment is closed under the condition that the electronic equipment starts the first camera.

In another possible design of the second aspect, the computer instructions, when executed by the processor, cause the electronic device to further perform the steps of: the camera service of the electronic device sends a first message to an NFC service of the electronic device; the NFC service responds to the first message and starts the NFC function. Or the camera service of the electronic device sends a second message to the NFC service of the electronic device; the NFC service turns off the NFC function in response to the second message.

In another possible design manner of the second aspect, a message that the camera service has last successfully sent to the NFC service is recorded in the camera service; wherein the message is the first message or the second message.

The computer instructions, when executed by the processor, cause the electronic device to further perform the steps of: if the camera service successfully sends the second message to the NFC service last time, the camera service sends the first message to the NFC service; wherein if the camera service successfully sends the first message to the NFC service last time, the camera service does not send the first message to the NFC service. If the camera service last successfully sends the first message to the NFC service, the camera service sends the second message to the NFC service; wherein if the camera service successfully sends the second message to the NFC service last time, the camera service does not send the second message to the NFC service.

In another possible design of the second aspect, the computer instructions, when executed by the processor, cause the electronic device to further perform the steps of: after a camera in the electronic equipment is driven to start a camera, first preview frame data of an image collected by the camera and a camera identification of the camera are sent to a camera hardware abstraction layer in the electronic equipment. And the camera hardware abstraction layer adds the camera identification to the first preview frame data to obtain second preview frame data, and sends the second preview frame data to a camera service of the electronic equipment. And if the equipment identifier of the electronic equipment is a preset identifier, the camera service acquires the camera identifier from the second preview frame data. The camera service sends a first message to the NFC service when the camera identification indicates that the camera is the first camera. The NFC service responds to the first message and starts the NFC function.

In another possible design of the second aspect, the computer instructions, when executed by the processor, cause the electronic device to further perform the steps of: after a camera in the electronic equipment is driven to start a camera, first preview frame data of an image collected by the camera and a camera identification of the camera are sent to a camera hardware abstraction layer in the electronic equipment. And the camera hardware abstraction layer adds the camera identification to the first preview frame data to obtain second preview frame data, and sends the second preview frame data to a camera service of the electronic equipment. And if the equipment identifier of the electronic equipment is a preset identifier, the camera service acquires the camera identifier from the second preview frame data. The camera service sends a second message to the NFC service when the camera identification indicates that the camera is the second camera. The NFC service turns off the NFC function in response to the second message.

In a third aspect, an embodiment of the present application provides a chip system, where the chip system is applied to an electronic device including a display screen and a memory; the chip system includes one or more interface circuits and one or more processors; the interface circuit and the processor are interconnected through a line; the interface circuit is to receive a signal from a memory of the electronic device and to send the signal to the processor, the signal comprising computer instructions stored in the memory; when the processor executes the computer instructions, the electronic device performs the method as described in the first aspect and any one of its possible designs.

In a fourth aspect, the present application provides a computer storage medium comprising computer instructions which, when run on an electronic device, cause the electronic device to perform the method according to the first aspect and any one of its possible design forms.

In a fifth aspect, the present application provides a computer program product for causing a computer to perform the method according to the first aspect and any one of its possible designs when the computer program product runs on the computer.

It should be understood that beneficial effects that can be achieved by the electronic device according to the second aspect, the chip system according to the third aspect, the computer storage medium according to the fourth aspect, and the computer program product according to the fifth aspect provided above may refer to the beneficial effects of the first aspect and any possible design manner thereof, and are not repeated herein.

Drawings

Fig. 1A is a schematic view of a scene applicable to the embodiment of the present application;

fig. 1B is a schematic diagram of another scenario applicable to the embodiment of the present application;

fig. 2 is a schematic diagram of a hardware structure of a mobile phone according to an embodiment of the present disclosure;

fig. 3 is a block diagram of a software structure of a mobile phone according to an embodiment of the present disclosure;

fig. 4A is an interaction diagram of a method for controlling an NFC function according to an embodiment of the present application;

fig. 4B is a schematic diagram of an operation of opening a camera according to an embodiment of the present application;

fig. 4C is a schematic diagram illustrating an effect of the method for controlling an NFC function according to the embodiment of the present application;

FIG. 5 is a schematic diagram of another scenario in which embodiments of the present application are applicable;

fig. 6A is an interaction diagram of another NFC function control method according to an embodiment of the present application;

fig. 6B is a schematic diagram illustrating another effect of the method for controlling an NFC function according to the embodiment of the present application;

fig. 7A is an interaction diagram of another NFC function control method according to an embodiment of the present application;

fig. 7B is a schematic diagram illustrating another effect of the method for controlling an NFC function according to the embodiment of the present application;

fig. 8A is an interaction diagram of another NFC function control method according to an embodiment of the present application;

fig. 8B is an interaction diagram of another NFC function control method according to an embodiment of the present application;

fig. 9 is a flowchart of a method for controlling an NFC function according to an embodiment of the present application;

fig. 10 is a flowchart of another NFC function control method according to an embodiment of the present application;

fig. 11 is a structural diagram of a chip system according to an embodiment of the present application.

Detailed Description

The control method for the NFC function provided by the embodiment of the application can be suitable for various scenes using a camera (which can also be understood as using the camera function).

Fig. 1A is a schematic view of a scenario applicable to the embodiment of the present application. In this scenario, after the camera application of the mobile phone 100 is started, a preview image acquired by the camera is displayed in the photographing interface of the mobile phone 100. The control method of the NFC function in the embodiment of the application can be used in the scene shown in fig. 1A to avoid occurrence of water ripples in the preview image.

Fig. 1B is a schematic diagram of another scenario applicable to the embodiment of the present application. In this scenario, three-party applications, such as WeChat, are being launchedTMNail for nailTMAfter the video call in (1), a preview image collected by the camera is displayed in the call interface of the mobile phone 100. The NFC function control method according to the embodiment of the present application may be used in the scene shown in fig. 1B to avoid occurrence of water ripples in the preview image.

It should be understood that fig. 1A and fig. 1B are only examples of two scenarios to which the embodiment of the present application is applicable, and the control method for the NFC function provided in the embodiment of the present application may also be applicable to other scenarios "using a camera".

In addition, fig. 1A and fig. 1B mainly use a mobile phone as an example to illustrate a scenario in which the embodiment of the present application is applied, and in practical implementation, the method for controlling an NFC function provided in the embodiment of the present application may also be applied to other electronic devices that can support an NFC function and a camera function.

For example, the electronic device in the embodiment of the present application may be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a Personal Digital Assistant (PDA), an Augmented Reality (AR) \ Virtual Reality (VR) device, and other devices that support both a camera function and an NFC function, and the embodiment of the present application does not particularly limit the specific form of the device.

Before describing the method for controlling the NFC function provided in the embodiment of the present application in detail, the structure of the electronic device is first introduced here.

Fig. 2 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present disclosure. As shown in fig. 2, taking the electronic device as the mobile phone 100 as an example, the mobile phone 100 may include a processor 210, an external memory interface 220, an internal memory 221, a Universal Serial Bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, a sensor module 280, keys 290, a motor 291, an indicator 292, a camera 293, a display 294, a Subscriber Identity Module (SIM) card interface 295, and the like.

It is to be understood that the illustrated structure of the present embodiment does not specifically limit the mobile phone 100. In other embodiments, the handset 100 may include more or fewer components than shown, or combine certain components, or split certain components, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

Processor 210 may include one or more processing units, such as: the processor 210 may include an Application Processor (AP), a modem processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a memory, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a neural-Network Processing Unit (NPU), etc. The different processing units may be separate devices or may be integrated into one or more processors.

The controller may be the neural center and the command center of the handset 100. The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.

A memory may also be provided in processor 210 for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. The memory may hold instructions or data that have just been used or recycled by processor 210. If the processor 210 needs to use the instruction or data again, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 210, thereby increasing the efficiency of the system.

The charge management module 240 is configured to receive a charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 240 may receive charging input from a wired charger via the USB interface 230. In some wireless charging embodiments, the charging management module 240 may receive a wireless charging input through a wireless charging coil of the cell phone 100. The charging management module 240 can also supply power to the mobile phone through the power management module 241 while charging the battery 242.

The power management module 241 is used to connect the battery 242, the charging management module 240 and the processor 210. The power management module 241 receives input from the battery 242 and/or the charging management module 240, and provides power to the processor 210, the internal memory 221, the external memory, the display 294, the camera 293, and the wireless communication module 260. The power management module 241 may also be used to monitor parameters such as battery capacity, battery cycle number, battery state of health (leakage, impedance), etc. In some other embodiments, the power management module 241 may also be disposed in the processor 210. In other embodiments, the power management module 241 and the charging management module 240 may be disposed in the same device.

The wireless communication function of the mobile phone 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 250, the wireless communication module 260, the modem processor, the baseband processor, and the like.

The mobile phone 100 implements display functions through the GPU, the display screen 294, and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 294 and an application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 210 may include one or more GPUs that execute program instructions to generate or alter display information.

The display screen 294 is used to display images, video, and the like. The display screen 294 is the folding screen described above (e.g., a flexible folding screen or a multi-screen folding screen). The display screen 294 includes a display panel. The display panel may adopt a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-oeld, a quantum dot light-emitting diode (QLED), and the like.

The mobile phone 100 can implement a shooting function through the ISP, the camera 293, the video codec, the GPU, the display screen 294, the APP processor, and the like.

The external memory interface 220 may be used to connect an external memory card, such as a Micro SD card, to extend the storage capability of the mobile phone 100. The external memory card communicates with the processor 210 through the external memory interface 220 to implement a data storage function. For example, media files such as music, video, etc. are saved in an external memory card.

Internal memory 221 may be used to store computer-executable program code, including instructions. The processor 210 executes instructions stored in the internal memory 221, thereby performing various functions APP and data processing of the handset 100. The internal memory 221 may include a program storage area and a data storage area. The storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required by at least one function, and the like. The data storage area may store data (e.g., audio data, a phonebook, etc.) created during use of the handset 100, and the like. In addition, the internal memory 221 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 (UFS), and the like.

The handset 100 may implement audio functions through the audio module 270, the speaker 270A, the receiver 270B, the microphone 270C, the earphone interface 270D, and the application processor. Such as music playing, recording, etc.

The keys 290 include a power-on key, a volume key, etc. The keys 290 may be mechanical keys. Or may be touch keys. The cellular phone 100 may receive a key input, and generate a key signal input related to user setting and function control of the cellular phone 100.

The motor 291 may generate a vibration cue. The motor 291 can be used for both incoming call vibration prompting and touch vibration feedback. For example, touch operations applied to different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The motor 291 may also respond to different vibration feedback effects for touch operations on different areas of the display 294. Different application scenes (such as time reminding, receiving information, alarm clock, game and the like) can also correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization.

Indicator 292 may be an indicator light that may be used to indicate a state of charge, a change in charge, or may be used to indicate a message, missed call, notification, etc.

The SIM card interface 295 is used to connect a SIM card. The SIM card can be attached to and detached from the cellular phone 100 by being inserted into the SIM card interface 295 or being pulled out from the SIM card interface 295. The handset 100 may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 295 may support a Nano SIM card, a Micro SIM card, a SIM card, etc. Multiple cards can be inserted into the same SIM card interface 295 at the same time. The types of the plurality of cards may be the same or different. The SIM card interface 295 may also be compatible with different types of SIM cards. The SIM card interface 295 may also be compatible with external memory cards. The mobile phone 100 interacts with the network through the SIM card to implement functions such as communication and data communication. In some embodiments, the handset 100 employs esims, namely: an embedded SIM card. The eSIM card can be embedded in the mobile phone 100 and cannot be separated from the mobile phone 100.

Referring to fig. 3, a block diagram of a software structure of an electronic device according to an embodiment of the present application is provided. The software system of the electronic device may employ a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application exemplifies a software structure of the mobile phone 100 by taking an Android system with a layered architecture as an example.

As shown in FIG. 3, the layered architecture can divide the software into several layers, each layer having a clear role and division of labor. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, which are an application layer (abbreviated as application layer) 310, an application framework layer (abbreviated as framework layer) 320, a Hardware Abstraction Layer (HAL) 330, and a Kernel layer (Kernel, also called driver layer) 340 from top to bottom.

Among other things, the Application layer (Application)310 may include a series of Application packages. The plurality of application packages may be camera, gallery, calendar, phone, map, navigation, WLAN, bluetooth, music, video, short message, desktop Launcher (Launcher) and other applications.

In the embodiment of the present application, the application layer 310 may include a camera system application (also referred to as a camera application) 311. The camera application 311 may be run, for example, to take pictures, record videos, etc., using a camera.

In the embodiment of the present application, the application layer 310 may further include other applications (also referred to as three-party applications) 312 that need to use a camera. For example, WeChatTMVideo call function and beauty cameraTMThe function of taking a picture, panningTMThe function of taking pictures and recognizing pictures and the like all need to use a camera, thenThe other three-party application 312 may be WeChatTMCamera for beautifying faceTMTaobao medicineTMAnd the like.

As shown in fig. 3, the camera application 311 and the three-party application 312 may be used to display the preview image reported in the bottom layer in a viewing interface (e.g., the photographing interface in fig. 1A, the video interface in fig. 1B). Therein, the cell phone 100 may include a plurality of cameras, each of which may be used to capture a preview image. In addition, for convenience of explanation, a camera currently acquiring a preview image is referred to herein as a preview camera.

The application layer 310 may instruct the bottom layer (e.g., the kernel layer 340) to start the corresponding camera according to the user operation. For example, the user opens the camera application 311 and enters a photographing mode (assuming the photographing mode is the rear main camera by default), the application layer 310 may instruct the underlying layer (e.g., the kernel layer 340) to turn on the rear main camera. The application layer 310 may further instruct a bottom layer (e.g., the kernel layer 340) to close the corresponding camera according to the operation of the user. After the corresponding camera is turned off, the camera application 311 and the three-party application 312 do not display the viewfinder image of the camera.

Framework layer (Framework)320 provides an Application Programming Interface (API) and a programming Framework for the application layer. The framework layer 320 includes a number of predefined functions. As shown in fig. 3, the framework layer 320 may provide Camera APIs such as Camera API (API 1| API 2)321, Camera Service (Camera Service)322, and NFC Service 323.

Where Camera API (API 1| API 2)321 acts as an interface for the underlying layers (e.g., hardware abstraction layer 330) to interact with application layer 310. Specifically, Camera API (API 1| API 2)321 may receive a request to turn on a Camera or switch a Camera from an upper layer (e.g., application layer 310) and process the request through Camera service 322. Then, the core layer 340 is instructed to turn on the corresponding camera through the HAL layer 330, and a preview image acquired by the preview camera is obtained through the HAL layer 330.

In this embodiment, the camera service 322 may be configured to obtain a policy for handling the conflict between the NFC function and the camera function according to a request from the application layer 310 and/or according to preview frame data reported from a lower layer (e.g., the HAL layer 330). The camera service 322, after obtaining the processing policy, may also be configured to send a message to the NFC service 323 to control the NFC function to turn on or off. Thereby, the problem of the conflict between the NFC function and the camera function can be solved.

In this embodiment, the NFC service 323 may be configured to control the state of the NFC chip according to a message type from the camera service 322, such as a message type for turning off NFC or a message type for turning on NFC. So that the conflict of the NFC function and the camera function can be avoided.

HAL layer 330 is used to connect frame layer 320 and core layer 340. For example, HAL layer 330 may perform data transfers between framework layer 320 and kernel layer 340. Of course, HAL layer 330 may also process data from the underlying layer (i.e., kernel layer 340) and then transmit to framework layer 320.

As shown in fig. 3, the HAL layer 430 may include a HAL Interface Definition Language (HIDL) interface 331, a Camera hardware abstraction layer (Camera Provider)332, and a HAL interface. The camera hardware abstraction layer 332 maintains normal communication with upper layers, such as the camera service 322, by providing a standard HIDL interface to make calls to the upper layers. And the camera hardware abstraction layer 332 controls the kernel layer 340 downwards through a standard HAL interface, such as HAL3.0, and acquires preview frame data reported by the kernel layer 340.

In this embodiment, the camera hardware abstraction layer 332 may report the acquired preview frame data to an upper layer (e.g., the camera service 322). In some embodiments, the camera hardware abstraction layer 332 may also report the camera type of the preview camera to an upper layer (e.g., the camera service 322), thereby facilitating the upper layer (e.g., the camera service 322) to accurately detect and resolve conflicts.

The core layer 340 includes a Camera driver 341, an image signal processor ISP 342, and a Camera device 343. The Camera device 343 may include a plurality of cameras, each Camera including a Camera lens, an image sensor, and the like. The image signal processor ISP 342 may be provided separately from a Camera (e.g., Camera device 343). In other embodiments, the image signal processor ISP 342 may be disposed in a Camera (e.g., Camera device 343).

Among them, the image signal processor ISP 342 and Camera device 343 are main devices for taking video or pictures. The light signal reflected by the viewing environment is irradiated on the image sensor through the camera lens and converted into an electric signal, and the electric signal is processed by the image signal processor ISP 342 and can be transmitted to the upper layer as a raw parameter stream (i.e., a video stream) by the camera driver 341. Also, the Camera driver 341 may receive a notification (e.g., a notification indicating to turn on or turn off the Camera) from the upper layer, and send a function processing parameter stream to the Camera device 343 according to the notification to turn on or turn off the corresponding Camera.

The method for controlling the NFC function provided in the embodiment of the present application can be implemented in the mobile phone 100 having the above hardware structure and software structure.

Fig. 4A is a flowchart of a method for controlling an NFC function according to an embodiment of the present application. Referring to fig. 4A, a method for controlling an NFC function provided in an embodiment of the present application may include:

s401, the application program responds to the operation of opening the camera by the user and sends a request for starting the camera to the camera service.

Prior to S401, the application may receive an operation of the user to open the camera. The application program may be the camera application 311 or the three-party application 312, among others.

In some embodiments, the operation of opening the camera includes an operation of triggering the cell phone 100 to run the camera application 311 in the foreground. For example, the operation of opening the camera is a click operation by the user on an icon 402B in the main interface 401B shown in (a) in fig. 4B, and the icon 402a is an application icon of the camera application 311.

Alternatively, the operation of turning on the camera includes an operation of triggering the cell phone 100 to use the function of the camera in the foreground running three-party application 312. With three-party application 312 being WeChatTMFor example, the function of using a camera may be a function of video call. Accordingly, the operation of turning on the camera may be the user's confirmation of WeChatTMAnd clicking a button of the video call.

In still other embodiments, the operation of turning on the camera includes a switching operation of a photographing mode. In the function of using the camera in the camera application 311 or the three-party application 312, a plurality of shooting modes, such as a shooting mode, a recording mode, a portrait mode, a night view mode, a professional mode, and the like, may be provided. Accordingly, the operation of turning on the camera may be an operation of switching from one photographing mode to another photographing mode. Taking the camera application 311 as an example, after the camera application 311 is started, the mobile phone 100 may display the view interface 403B of the photographing mode shown in (B) in fig. 4B, and the operation of turning on the camera may be a user selection operation of any mode other than the photographing mode, such as a selection operation of a professional mode.

It should be understood that, during one shooting, the user may switch the shooting mode a plurality of times, and each switching operation of the shooting mode may be regarded as one operation of turning on the camera.

In other embodiments, the operation of turning on the camera includes a switching operation between preset cameras. For example, the switching operation between the preset cameras may be a switching operation between a front camera and a rear camera. Taking the camera application 311 as an example, after the camera application 311 is started, the mobile phone 100 may display a view interface 404B shown in (c) in fig. 4B, and the operation of opening the camera may be a click operation of switching the camera button 405B in the user view interface 404B.

It should be noted that the switching operation between the preset cameras does not generally include the switching operation between the plurality of rear cameras. For example, the sliding operation of the zoom bar 407B in the viewfinder interface 406B shown in (d) in fig. 4B by the user may switch between a plurality of rear cameras, and the operation of turning on the cameras does not include the sliding operation of the zoom bar 407B in the viewfinder interface 406B shown in (d) in fig. 4B by the user. That is to say, the user does not trigger the start of executing the scheme of the application to the sliding operation of the zoom bar in the view interface.

After the application receives the operation of opening the camera by the user, the application may call a camera interface (e.g., openCamera interface) to request to start the camera, that is, send a request to start the camera to the camera service. The request for starting the camera carries functional parameters for indicating the front-back type, the shooting mode and/or the zoom magnification. Therefore, the bottom layer can be explicitly instructed to start one or more cameras to meet the requirements of corresponding functions.

For example, assuming that the camera application 311 is opened to display the view interface 403B shown in (B) in fig. 4B by default, and a camera with a rear view and a zoom magnification of 1 times is used for view in the view interface 403B, and the shooting mode is the photographing mode, the function parameter may be {7,1x, 0 }. Wherein, 7 is used for instructing the rear camera, 1x is used for instructing the zoom magnification of 1 time, and 0 is used for instructing the photographing mode.

S402, the camera service responds to the received request for starting the camera and sends a message for closing the NFC function to the NFC service.

Prior to S402, the camera service may receive a request from an application to start a camera.

In this embodiment of the application, after receiving the request for starting the camera, the camera service sends a message for closing the NFC function, such as CLOSE _ NFC _ MSG, to the NFC service to instruct the NFC service to CLOSE the NFC function.

It should be appreciated that the first aspect requires the camera service to handle the conflict, i.e. to turn off the NFC functionality, after receiving a request to start the camera. In the second aspect, the request for starting the camera still needs to be continuously transmitted to the lower layer, the corresponding camera is started, and the preview in the viewing interface is finally realized. The specific implementation of the second aspect can be implemented according to the manner in the prior art, and is not described herein again.

And S403, the NFC service controls the NFC chip to enter an idle state in response to receiving the message of closing the NFC function.

Prior to S403, the NFC service may receive a message to turn off the NFC function from the camera service.

In the embodiment of the application, after receiving the message for closing the NFC function from the camera service, the NFC service may control the NFC chip to enter an IDLE state, that is, an IDLE state. After the NFC chip enters the IDLE state, a radio frequency field cannot be generated, and functions of card swiping, card reading and the like are closed. It should be understood that the NFC chip does not generate a radio frequency field, and thus does not interfere with a signal simulated by the sensor module of the camera. So that the conflict of the camera function and the NFC function can be avoided.

For example, the mobile phone 100 may receive a click operation of the icon 402C in the main interface 410C shown in (a) in fig. 4C by the user. The mobile phone 100 may display a viewfinder interface 403C shown in (b) of fig. 4C in response to a click operation of the icon 402C by the user. By adopting the scheme of the embodiment of the application, when the viewing interface 403c is displayed, the NFC function is closed, so that the camera view can not be interfered. It should be understood that the "NFC function is turned off" displayed in the viewfinder interface 403c is merely an illustration for indicating that the NFC function is turned off at this time. In actual practice, it will not usually be displayed.

S404, the application program responds to the operation of closing the camera by the user and sends a request for closing the camera to the camera service.

Prior to S404, the application may receive an operation (which may also be referred to as a first operation) of the user to turn off the camera. Wherein the operation of turning off the camera corresponds to the operation of turning on the camera. Turning off the camera may also be understood as turning off all cameras

In some embodiments, the operation of opening the camera includes an operation of triggering the cell phone 100 to run the camera application 311 in the foreground, and the operation of closing the camera may include an operation of triggering the cell phone 100 to exit from running the camera application in the foreground. For example, an operation of sliding up and retracting the main interface of the cellular phone 100. Alternatively, the operation of turning on the camera may include an operation of triggering the cell phone 100 to use the function of the camera in the foreground-running three-party application 312, and the operation of turning off the camera may include an operation of triggering the cell phone 100 to exit from using the function of the camera in the foreground-running three-party application 312.

In other embodiments, the operation of turning on the camera includes a switching operation of a photographing mode, and the operation of turning off the camera may also include a switching operation of a photographing mode. It should be understood that the switching operation of one shooting mode includes two layers: one layer is to turn off the current photographing mode, and the other layer is to turn on a new photographing mode. And closing the current shooting mode to correspondingly close the camera, and opening the new shooting mode to correspondingly open the camera. Therefore, the switching operation of the shooting mode is triggered to turn off the camera and turn on the camera in turn. That is, after the mobile phone 100 receives the switching operation of the photographing mode, it first sends a request for turning off the camera to the camera service in response to the operation of turning off the camera by the user. Then, a request for opening the camera is sent to the camera service in response to the request for opening the camera by the user.

In other embodiments, the operation of turning on the camera includes a switching operation between the preset cameras, and the operation of turning off the camera may also include a switching operation between the preset cameras. Similar to the switching operation of the shooting mode, the switching operation between the preset cameras includes two layers: one layer is to turn off the current camera and the other layer is to turn on a new camera. Accordingly, after the mobile phone 100 receives the switching operation between the preset cameras, it first sends a request for turning off the cameras to the camera service in response to the operation of turning off the cameras by the user. Then, a request for opening the camera is sent to the camera service in response to the request for opening the camera by the user.

After the application receives the operation of turning off the camera by the user, the application may call a camera interface (e.g., a closed camera interface) to request to turn off the camera, that is, send a request to turn off the camera to the camera service.

S405, the camera service responds to the received request for closing the camera, and sends a message for opening the NFC function to the NFC service.

Prior to S405, the camera service may receive a request from an application to turn off the camera.

In this embodiment of the application, after receiving the request for turning off the camera, the camera service sends a message for turning on the NFC function, such as OPEN _ NFC _ MSG, to the NFC service to instruct the NFC service to turn on the NFC function.

It should be appreciated that the first aspect requires the camera service to handle the conflict, i.e. to turn on the NFC functionality, after receiving a request to turn off the camera. In the second aspect, the request for closing the cameras still needs to be continuously transmitted to the lower layer, the corresponding cameras are closed, and the preview in the viewing interface is finally stopped. The specific implementation of the second aspect can be implemented according to the manner in the prior art, and is not described herein again.

S406, the NFC service responds to the received message for starting the NFC function and controls the NFC chip to exit the idle state.

Prior to S406, the NFC service may receive a message to turn on the NFC function from the camera service.

In the embodiment of the application, after receiving the message for starting the NFC function from the camera service, the NFC service may control the NFC chip to exit the IDLE state, that is, exit the IDLE state. After the NFC chip exits the IDLE state, the functions of card swiping, card reading and the like can be recovered. That is, after the camera is turned off, the NFC function may be turned on so that the NFC function is available. There is no conflict at this time.

It should be understood that after the phone 100 is powered on, the camera service is activated accordingly. In the embodiment of the present application, the NFC function may be turned off when the camera is turned on under normal conditions. In this case, if the camera service is abnormally interrupted, the NFC function may be in an off state and not turned on in time. Thereby affecting the use of subsequent NFC functionality.

Based on this, in some embodiments, after the camera service is started (including a normal start or an abnormal restart), the camera service may notify the NFC service to turn on the NFC function. So that the NFC service can be forcibly turned on after the camera service is started. Therefore, the problem that the NFC function is unavailable due to abnormal interruption of the camera service can be avoided.

In summary, with the method of this embodiment, the camera service may control to close the NFC function in the scene where the camera is turned on, and control to open the NFC function in the scene where the camera is turned off. Thus, the conflict between the NFC function and the camera function can be avoided, and the availability of the NFC function can be ensured in a scene without using a camera.

In the embodiment shown in fig. 4A, the camera service turns off the NFC function after receiving the request for starting the camera. The conflict between the NFC function and the camera function can be avoided to the greatest extent by the conflict resolution mode. At the same time, the NFC function may not be used at all in the process of using the camera function. Thereby making the NFC function and the camera function unusable in common.

For example, referring to fig. 5, in a scenario where a video call requires a camera, the NFC function may be turned off in the scenario of the video call, so that the NFC function is not available. If the user goes to the subway gate 500 while performing the video call, the user cannot use the mobile phone 100 to complete the card swiping for the subway station entering and exiting during the video call because the NFC function is turned off at this time.

Based on this, the embodiment of the present application further provides another NFC function control method, which can improve the possibility of common use of the camera function and the NFC function on the basis of the embodiment shown in fig. 4A.

Referring to fig. 6A, after S401, the method for controlling an NFC function provided in the embodiment of the present application may include:

s601, the camera service responds to the received request for starting the camera and sends the request for starting the camera to the camera hardware abstraction layer.

S602, the camera hardware abstraction layer sends a request for starting the camera to the kernel layer in response to receiving the request for starting the camera.

And S603, the kernel layer responds to the received request for starting the camera, starts the preview camera and collects a preview image.

Wherein, it can be the camera drive in the inner core layer to start the camera.

For example, the request for starting the camera includes a function parameter {7,1x, 0}, where 7 is used to indicate the rear camera, 1x is used to indicate a zoom magnification of 1, and 0 is used to indicate a photographing mode, the kernel layer may start the rear main camera.

And S604, the kernel layer reports preview frame data of the preview image and the camera type of the preview camera to the camera hardware abstract layer.

Here, the preview image may be referred to as a first image, and the preview frame data may be referred to as first preview frame data. In some embodiments, the cameras and camera types may correspond one-to-one. In this case, the meaning of the camera type is the same as the camera identification.

S601 to S604 may be processed according to a process of starting a camera and collecting and reporting a preview image in the prior art, which is not described herein again.

In different mobile phones, hardware such as a sensor module and an NFC chip of which the bottom layers adopt cameras are different. Accordingly, the types of cameras (i.e., conflicting cameras) coupled to the rf field generated by the NFC chip may also be different in different handsets. The camera type includes, but is not limited to, at least one of a rear wide angle type, a rear telephoto type, a rear monocular type, a rear infrared type, a rear color type, a rear depth type, a rear macro type, a rear main shooting type, and a front type.

In an example, in a mobile phone of model a, a radio frequency field generated by the NFC chip is coupled to a signal simulated by a sensor module of a rear wide-angle camera, and is not coupled to a signal simulated by a sensor module of another camera, so that the mobile phone of model a corresponds to the conflicting camera type (for example, a preset type) being the rear wide-angle type.

In the second example, in the mobile phone of model b, the radio frequency field generated by the NFC chip is coupled with the signal simulated by the sensor module of the rear infrared camera, and is not coupled with the signal simulated by the sensor module of another camera, so that the mobile phone of model b corresponds to the conflicting camera type (for example, the conflicting camera type is the rear infrared type).

Based on this, in the embodiment of the present application, after receiving the preview frame data and the camera type from the kernel layer, the camera hardware abstraction layer may control the NFC function to be turned on and off according to the camera type through the following S605-S608, so as to implement targeted control. Thereby improving the possibility of common use of the camera function and the NFC function. It should be noted that the preview image collection by the preview camera is continuous, and as the preview image collection by the preview camera is continuous, the report of the preview frame data and the camera type is continuous, and accordingly, S604 and the following steps thereof are continuous with the collection of the preview image.

And S605, the camera hardware abstraction layer adds the camera type to the preview frame data in response to the received preview frame data and the received camera type, so as to obtain updated preview frame data.

Here, the new preview frame data may also be referred to as second preview frame data.

In the embodiment of the application, after the camera starts to acquire the preview image and reports the preview frame data to the camera hardware abstraction layer through the kernel layer, the camera hardware abstraction layer adds the camera type to the preview frame data, for example, to the metadata (namely meta data) in the preview frame data, so as to detect whether a conflict exists in the subsequent process.

For example, the camera hardware abstraction layer may add camera types according to the correspondence shown in table 1 below.

TABLE 1

Serial number Camera type Type value
1 Rear wide angle type HWA_PHYSICAL_CAMERA_WIDE
2 Rear mounted tele type HWA_PHYSICAL_CAMERA_TELE
3 Rear monocular type HWA_PHYSICAL_CAMERA_MONO
4 Rear infrared type HWA_PHYSICAL_CAMERA_IR
5 Rear mounted colour type HWA_PHYSICAL_CAMERA_RGB
6 Type of rear depth HWA_PHYSICAL_CAMERA_TOF
7 Rear macro type HWA_PHYSICAL_CAMERA_MACRO
8 Rear main shooting type HWA_PHYSICAL_CAMERA_MAIN
9 Unknown type HWA_PHYSICAL_CAMERA_NONE
10 Type no HWA_PHYSICAL_CAMERA_MAX

For example, the CAMERA type received by the CAMERA hardware abstraction layer is the rear WIDE angle type, and the CAMERA hardware abstraction layer may add the CAMERA type with the type value HWA _ PHYSICAL _ CAMERA _ WIDE in the meta data.

For another example, the CAMERA type in the CAMERA parameters received by the CAMERA hardware abstraction layer is a post-MAIN shooting type, and the CAMERA hardware abstraction layer may add the type value of the CAMERA type to the meta data as HWA _ PHYSICAL _ CAMERA _ MAIN.

In some embodiments, as shown in table 1, the camera types further include an unknown camera, and if the camera type reported by the kernel layer is not the camera type listed in table 1, the camera type is an unknown camera. For example, the new type camera a is included in the cameras configured in the mobile phone 100, and the new type camera a is not recorded in table 1, so that when the camera reported by the kernel layer is the new type camera a, the new type camera a cannot be found from table 1 by the camera hardware abstraction layer. In this case, the CAMERA hardware abstraction layer may classify the new CAMERA a as an unknown CAMERA and assign a type value HWA _ PHYSICAL _ CAMERA _ NONE to be added to the preview frame data. As such, even if the camera type is not currently recorded in table 1, a corresponding type value may be assigned.

In some embodiments, the camera types also include null types, as shown in table 1. Generally, only the type (such as a preset type) of the conflicting camera is determined, and the conflicting can be handled accurately and specifically according to the type of the camera. Based on this, for the mobile phones with the types of CAMERAs which are not clearly conflicted, the CAMERA type can be added as a non-type, and a type value HWA _ PHYSICAL _ CAMERA _ MAX is given so as to distinguish the mobile phones with the types of CAMERAs which are clearly conflicted. Thereby facilitating subsequent collision detection.

It should be appreciated that the camera hardware abstraction layer, upon receiving the preview frame data, the first aspect requires that the camera type be added to the preview frame data for subsequent detection of conflicts. The second aspect needs to report the preview frame data continuously for the application to display the preview. For a specific implementation of the second aspect, reference may be made to the manner in the prior art, and details are not described here.

S606, the camera hardware abstraction layer sends the updated preview frame data to the camera service.

In the embodiment of the application, the camera hardware abstraction layer sends the updated preview frame data to the camera service, so that the camera service detects a conflict. Rather than simply transmitting the original preview frame data up for application display preview.

S607, the camera service acquires the camera type from the updated preview frame data in response to receiving the updated preview frame data.

Wherein, the camera service can parse out the camera type from meta data in the updated preview frame data.

It should be noted that, the request for starting the camera is transmitted from the application program to the underlying layer, and only the function parameters are carried, and from the function parameters, the camera service can generally only determine the functions that the application program needs to implement. And the specific started camera is determined by the bottom layer according to the functional parameters. Therefore, in the embodiment of the application, after the camera is started at the bottom layer, the camera type reported by the bottom layer is added to the preview frame data and then reported to the camera service, so that the camera service can be ensured to acquire the accurate camera type.

And S608, the camera service sends a message for closing the NFC function to the NFC service in response to the fact that the acquired camera type is a preset type.

The preset type of camera may be referred to as a second camera, and the message for turning off the NFC function may also be referred to as a second message.

The preset type is a type of a camera (i.e., a conflicting camera) coupled to the radio frequency field generated by the NFC chip in the mobile phone 100. As mentioned above, conflicting camera types may differ from handset to handset. For example, in glory magic3, the type of the conflicting camera is the rear wide angle type, i.e., the preset type is the rear wide angle type. In glowing magic4, the conflicting camera is a back depth camera, and the preset type is a back depth type.

After the camera service acquires the camera type, whether the camera type is a preset type is judged. If the camera type acquired by the camera service is a preset type, it indicates that the signal simulated by the sensor module of the preview camera is coupled with the radio frequency field generated by the NFC chip in the mobile phone 100. In this case, the camera service transmits a message to the NFC service to turn off the NFC function.

Taking the preset type as HWA _ PHYSICAL _ CAMERA _ WIDE as an example, if the CAMERA type acquired by the CAMERA service is HWA _ PHYSICAL _ CAMERA _ WIDE, the CAMERA service sends a message for closing the NFC function to the NFC service.

It should be noted that in a multi-lens video scene, at least two cameras are collecting preview images at the same time, and the types of the cameras may be various. Accordingly, the camera types obtained from the updated preview frame data may be various. For this situation, if the plurality of camera types include a preset type, the camera service sends a message for closing the NFC function to the NFC service. In this way, collisions can be strictly avoided.

Further, the type value reported by the CAMERA hardware abstraction layer may be HWA _ PHYSICAL _ CAMERA _ NONE, that is, an unknown type, and the type value obtained by the CAMERA service may also be HWA _ PHYSICAL _ CAMERA _ NONE. In some embodiments, the camera service does not send a message to the NFC service to turn off the NFC function or turn on the NFC function in response to the acquired camera type being the unknown type. That is, no processing is done for the case of unknown type. So that erroneous control can be avoided.

Further, the type value reported by the CAMERA hardware abstraction layer may be HWA _ PHYSICAL _ CAMERA _ MAX, that is, no type, and the type value obtained by the CAMERA service may also be HWA _ PHYSICAL _ CAMERA _ MAX. In some embodiments, the camera service does not send a message to the NFC service to turn off the NFC function or turn on the NFC function in response to the acquired camera type being the null type. That is, no processing is performed for the case of no type. So that erroneous control can be avoided.

And S609, the NFC service controls the NFC chip to enter an idle state in response to receiving the message of closing the NFC function.

For S609, see the description of S303 above.

In addition to this, the camera type acquired by the camera service may be other types than the preset type and the unknown type. In some embodiments, for other types of cases, after S607, further comprising:

s610, the camera service responds to the fact that the acquired camera type is other types, and sends a message for starting the NFC function to the NFC service.

The other type of camera may also be referred to as a first camera, and the message for turning on the NFC function may also be referred to as a first message.

Wherein the other type means a type other than the preset type. In some embodiments, the camera type further includes an unknown type, and the other types are types other than the preset type and the unknown type. In some embodiments, the camera type further includes a no type, and the other types are types other than the preset type and the no type. In some embodiments, the camera types include an unknown type and no type, and the other types are types other than the preset type, the unknown type, and no type. In the following embodiments, the other types are mainly described as types other than the preset type. In addition, for convenience of description, other types of cameras may also be referred to as the first camera.

Taking the preset type as HWA _ PHYSICAL _ CAMERA _ WIDE as an example, if the type value acquired by the CAMERA service is HWA _ PHYSICAL _ CAMERA _ TOF, that is, is not the preset type, the CAMERA service sends a message to the NFC service to open the NFC function.

And S611, the NFC service responds to the received message for starting the NFC function and controls the NFC chip to exit the idle state.

For S611, see the description of S306 above.

In the process from turning on the camera to turning off the camera, a user may trigger an application program to request the camera to be switched from the bottom layer through operations such as zoom adjustment. It should be noted that zoom adjustment is typically only switched between rear cameras, so that turning on the camera is not triggered. After the camera is switched at the bottom layer, the preview camera changes, so that the type value reported to the camera service changes accordingly. In a specific implementation manner, the S608-S611 are combined and then used in the above scenario of switching the camera, and the camera service may send different types of control messages to the NFC service according to the change of the camera type, so as to flexibly control the NFC function to be turned on and off. So that the possibility of sharing the NFC function and the camera function can be further increased.

Still taking the preset type HWA _ PHYSICAL _ CAMERA _ WIDE as an example, at time t1 when a video is recorded, the user makes the bottom layer switch the preview CAMERA from a rear WIDE-angle CAMERA to a rear telephoto CAMERA through zoom adjustment, then in preview frame data before time t1, the CAMERA service may acquire that the type value is HWA _ PHYSICAL _ CAMERA _ WIDE, which is the preset type, and at this time, a message for closing the NFC function is sent to the NFC service. In the preview frame data after the time t1, the CAMERA service may acquire that the type value is HWA _ PHYSICAL _ CAMERA _ TELE, that is, the type is neither a preset type nor an unknown type, and at this time, a message to start the NFC function is sent to the NFC service. That is, during one video recording, the NFC functionality may be turned off for one time and turned on for another time.

In summary, with the method of this embodiment, the camera service may not only solve the conflict between the NFC function and the camera function, but also control to close the NFC function only when the camera type in the reported preview frame data is the preset type. So that the possibility of sharing the NFC function and the camera function can be increased.

For example, referring to fig. 6B, after the method of this embodiment is adopted, in a video call scene, as long as a preview camera adopted by the video call is not a preset type of camera, a user may complete subway card swiping through an NFC function of a mobile phone in the video call process.

In the foregoing embodiment shown in fig. 6A, the camera service may acquire the camera type, and send a message to turn off the NFC function or a message to turn on the NFC function to the NFC service according to the camera type. It should be appreciated that the frame rate at which the preview camera acquires the preview image is typically 30 frames per second, 60 frames per second, etc. Taking 60 frames per second as an example, the bottom layer needs to report 60 times of preview frame data to the camera service every second, and the camera service needs to acquire 60 times of camera types from the preview frame data and send corresponding messages to the NFC service. That is, communication between the camera service and the NFC service needs to be as high as several tens of times per second or more. Meanwhile, the camera service and the NFC service belong to two different processes, and the power consumption of communication between the different processes is high, which may cause performance degradation of the mobile phone.

Based on this, the embodiment of the present application provides another NFC function control method, which can reduce the power consumption of a mobile phone based on the embodiment shown in fig. 6A.

As can be seen from the foregoing description, the camera service may send a message to the NFC service to turn on the NFC function when starting (e.g., restarting); the camera service may send a message to the NFC service to close the NFC function when acquiring that the camera type is the preset type from the preview frame data (e.g., S608); the camera service may send a message to the NFC service to start the NFC function when it acquires that the type of the camera is another type from the preview frame data (e.g., S609); the camera service may send a message to the NFC service to turn on the NFC function upon receiving a request to turn off the camera (as in S405).

In the embodiment of the application, the camera service records the message type of the message which is successfully sent to the NFC service last time. Wherein successful sending refers to a case where the camera service receives a notification that the NFC service feedback was successfully received. The message types include type 1 and type 2, where type 1 indicates a message to turn off the NFC function, and type 2 indicates a message to turn on the NFC function. It should be understood that the messages are only messages for turning off the NFC functionality and messages for turning on the NFC functionality, i.e. the messages and the message types are in a one-to-one correspondence. Thus, the type of message recorded that was last successfully sent to the NFC service, i.e., the last successfully sent message recorded to the NFC service.

In some embodiments, the initial value of the recorded message type is null, and after the camera service is started and a message for starting the NFC function is successfully sent to the NFC service, the camera service initializes that the message type is type 2.

Then, before the camera service sends the message for closing the NFC function or the message for opening the NFC function to the NFC service, it first queries whether the recorded message type is the same as the message type of the message to be sent, and if the recorded message type is different from the message type of the message to be sent, the camera service further sends the message for closing the NFC function or the message for opening the NFC function to the NFC service. And if the recorded message type is the same as the message type of the message to be sent, the camera service does not send a message for closing the NFC function or a message for opening the NFC function to the NFC service. Therefore, the same type of messages can be prevented from being continuously sent to the NFC service, cross-process communication between the camera service and the NFC service is reduced, and power consumption of the mobile phone is reduced.

As shown in fig. 7A, S608 may be replaced with S608a in the manner described above in which a message is sent when the message types are different:

s608a, the camera service sends a message to the NFC service to close the NFC function in response to the acquired camera type being the preset type and querying that the recorded message type is type 2.

And the camera service acquires that the type of the camera is a preset type, and the message to be sent is a message for closing the NFC function. In this case, if the queried message type is type 2, it indicates that the message type is different from the message type of the message to be sent, and at this time, the camera service may send a message for turning off the NFC function to the NFC service. On the contrary, if the inquired message type is type 1, it indicates that the message type is different from that of the message to be sent, and at this time, the camera service does not send the message for closing the NFC function to the NFC service.

As shown in fig. 7A, S610 may be replaced with S610a in the manner described above in which a message is sent when the message types are different:

s610a, the camera service responds that the acquired camera type is other type, and inquires that the recorded message type is type 1, and the camera service sends a message for starting the NFC function to the NFC service.

And the camera service acquires that the type of the camera is other types, and the message to be sent is a message for starting the NFC function. In this case, if the queried message type is type 1, it indicates that the message type is different from the message type of the message to be sent, and at this time, the camera service may send a message for starting the NFC function to the NFC service. On the contrary, if the inquired message type is type 2, it indicates that the message type is different from that of the message to be sent, and at this time, the camera service does not send the message for starting the NFC function to the NFC service.

That is, the camera service transmits a message to the NFC service to turn on the NFC function, including: if the camera service successfully sends the message for closing the NFC function (type 1) to the NFC service last time, the camera service sends the message for opening the NFC function to the NFC service. On the contrary, if the camera service successfully sends the message for starting the NFC function (type 2) to the NFC service last time, the camera service does not send the message for starting the NFC function to the NFC service.

The camera service sends a message for closing the NFC function to the NFC service, and the message comprises the following steps: if the camera service successfully sends the message for turning on the NFC function (type 2) to the NFC service last time, the camera service sends the message for turning off the NFC function to the NFC service. On the contrary, if the camera service successfully sends the message for closing the NFC function (type 1) to the NFC service last time, the camera service does not send the message for closing the NFC function to the NFC service.

Illustratively, the preset type is HWA _ PHYSICAL _ CAMERA _ WIDE (rear WIDE angle), and the message type before shooting is type 2.

In one scenario, referring to (a) in fig. 7B, a rear wide-angle camera is used in the whole shooting process, and messages to be sent in the whole shooting process are messages for turning off the NFC function. With the scheme shown in fig. 7A, the camera service may send a message to the NFC service to turn off the NFC function only at time t0 when the preview image starts to be captured, without sending a message to turn off the NFC function several tens of times per second.

In another scenario, referring to (B) in fig. 7B, in the whole shooting process, the camera is switched once at time t2, and the rear wide-angle camera is switched to the rear telephoto camera, so that messages to be sent are messages for turning off the NFC function before time t2 in the shooting process; at and after time t2 in the shooting process, the messages to be sent are all messages for starting the NFC function. With the scheme shown in fig. 7A, the camera service may send a message to the NFC service to turn off the NFC function only at time t1 when the preview image starts to be captured, send a message to the NFC service to turn on the NFC function at time t2 when the camera is switched, and otherwise need not communicate with the NFC service.

Therefore, by adopting the method of the embodiment, the number of times of communication between the camera service and the NFC service can be greatly reduced, and the power consumption of the mobile phone is reduced.

In the foregoing embodiment, the control of the NFC function by the camera service is mainly described in terms of solving the conflict. In actual implementation, there may be the following factors that affect the control of the NFC function by the camera service.

The requirement on the performance is different for different mobile phones with the factor one. For example, some cell phones focus more on the effect of the shot, and generally do not allow for previewing the presence of water ripples. Thus, the conflict between the NFC function and the camera function needs to be resolved. Other handsets focus on the availability of NFC functionality and do not typically allow NFC functionality to be turned off. I.e. not allowing the NFC functionality to be switched off. So that there is no need to resolve the conflict of the NFC function and the camera function.

Based on this, in some embodiments, a preset configuration item, such as a camera _ nfc _ switch, can be configured in the mobile phone 100 in advance, and the camera service only handles the conflict when the switch of the preset configuration item is turned on. For example, when the switch of the camera _ NFC _ switch is turned on, the camera service may transmit a message to turn off the NFC function or a message to turn on the NFC function to the NFC service. Otherwise, if the switch of the preset configuration item is not turned on, the camera service does not process the conflict. Therefore, the camera service can solve the conflict in a targeted manner, and the conflict with the performance requirement of the mobile phone is avoided.

And by the factor of two, different users or the same user have different use requirements on the NFC function at different times. For example, some users may swipe cards to get on and off a subway during work and need to use the NFC function, and expect that the NFC function is in an available state. While others have low demand for NFC functionality and will turn it off manually.

Based on this, in some embodiments, after the camera service sends the message for turning on the NFC function to the NFC service, the NFC service may query the user configuration, and if the switch of the NFC function in the user configuration is turned off, the NFC service may not control the NFC chip to exit the IDLE state; and if the switch of the NFC function in the user configuration is not closed, the NFC service controls the NFC chip to exit the IDLE state, so that the NFC function is started. Therefore, the NFC service can control the NFC function to be started on the basis that the user does not manually close the NFC function, and the situation that the NFC function is contrary to the intention of the user is avoided.

In practice, in some handsets, the conflicting camera types are unambiguous. For example, in model a handset, the conflicting camera types are rear wide angle types. While in other handsets, it is not clear whether there are conflicts or the type of camera that conflicts.

Based on this, the embodiment of the present application further provides a method for controlling an NFC function, and compared with the embodiment shown in fig. 4A and the embodiment shown in fig. 6A, the method can give consideration to various mobile phones and improve compatibility of a conflict solution.

On the one hand, referring to fig. 8A, the method for controlling the NFC function provided in this embodiment may be applied to a mobile phone with ambiguous collision. Specifically, as shown in fig. 8A, S402 further includes:

s801, the camera service responds to the request of starting the camera and obtains the equipment identification of the current mobile phone.

The device identifier is an identifier capable of distinguishing a mobile phone model. Illustratively, the device identification may be a device name, e.g., HONOR 50, HONOR magic 3. Alternatively, the device identification may be a device model number, e.g., NTH-AN 00.

It should be appreciated that after the camera service first obtains the device identification, the device identification may be recorded without obtaining it again.

S802, the camera service judges whether the equipment identifier is a preset identifier.

The preset identification is used for indicating the mobile phone with the definitely conflicting camera types. The preset identifier may be a preset name or a preset model corresponding to the device identifier.

For example, the preset identifier is a preset model. In the mobile phones in the market, it is known that the conflicting camera in the model a is a rear wide-angle camera, the conflicting camera in the model b is a rear telephoto camera, and the conflicting cameras cannot be clearly found in the other mobile phones, so that the preset model can be the model a and the model b.

In some embodiments, a preset identifier table is preconfigured in the mobile phone, and the preset identifier table records the device identifier of the mobile phone with the clearly conflicting camera. For example, the preset identification table is shown in table 2 below:

TABLE 2

Preset model number
Type a
Type b
……

The camera service matches the device identifier with each identifier in the preset identifier table, and if the device identifier is in the preset identifier table, the device identifier is the preset identifier. Otherwise, if the device identifier is not in the preset identifier table, the device identifier is not the preset identifier.

And S803, the camera service responds to the fact that the equipment identification is not the preset identification, and sends a message for closing the NFC function to the NFC service.

If the device identifier is not the preset identifier, it indicates that the device identifier is not a mobile phone with a camera definitely having a conflict, and in order to avoid the conflict, the camera service may send a message to the NFC service to close the NFC function. In this way, for a mobile phone with an unclear conflicting camera, the conflict can be avoided regardless of whether the conflicting camera exists or which camera is in conflict.

It should be noted that after receiving the request for starting the camera, the camera service needs to transmit the request for starting the camera to the bottom layer (e.g., the kernel layer) layer by layer, and after the bottom layer (e.g., the kernel layer) starts the corresponding camera and collects the preview image, the camera service reports the preview frame data layer by layer upwards (see S601-S606 in fig. 8B, except that in the cell phone with a camera that does not specifically conflict, the camera type may not be added to the preview frame data). The process (denoted as process 1) and the process of processing conflicts from S801 to S803 do not interfere with each other, and are two completely independent flows.

That is, the process 1 is performed independently of the result of the determination by the camera service as to whether the device identification is the preset identification. Based on this, after the process 1 is executed until the camera service receives preview frame data reported from the camera hardware abstraction layer, it needs to further determine whether the device identifier is a preset identifier (as in S804 below), so as to determine whether the current mobile phone is a mobile phone with a camera clearly having a conflict. Thereby determining whether the conflict needs to be resolved by retrieving the camera type from the preview frame data.

Obviously, for a mobile phone with a camera that does not definitely collide, the device identifier is not a preset identifier, and the camera service may determine that the device identifier is not a preset identifier after receiving preview frame data reported from the camera hardware abstraction layer, so that the step of acquiring the camera from the preview frame data and processing the collision does not need to be executed. That is, after receiving the preview frame data reported from the camera hardware abstraction layer, there is no need to perform collision processing.

On the other hand, referring to fig. 8B, the method for controlling the NFC function provided in this embodiment may be applied to a mobile phone with explicit conflict. Specifically, as shown in fig. 8B, after S401, the method further includes:

s801, the camera service responds to the request of starting the camera and obtains the equipment identification of the current mobile phone.

S802, the camera service judges whether the equipment identifier is a preset identifier.

If the equipment identifier is a preset identifier, the current mobile phone is the mobile phone with the definitely conflicting camera, at this time, no processing is performed, and the conflict is specifically processed by acquiring the camera type in the process of reporting the preview frame subsequently.

Similarly, after receiving the request for starting the camera, the camera service also needs to transmit the request for starting the camera to the bottom layer (e.g., the kernel layer) layer by layer, and after the bottom layer (e.g., the kernel layer) starts the corresponding camera and collects the preview image, the camera service reports the preview frame data upward layer by layer (e.g., S601-S606). The process (denoted as process 1) and the process of processing conflicts from S801 to S802 do not interfere with each other, and are two completely independent flows.

That is, the process 1 is performed independently of the result of the determination by the camera service as to whether the device identification is the preset identification. Based on this, S607 further includes:

s804, the camera service determines whether the device identifier is a preset identifier in response to receiving the preview frame data.

After the camera service receives preview frame data reported by a camera hardware abstract layer, whether the equipment identifier is a preset identifier is further judged so as to determine whether the current mobile phone is the mobile phone of the camera with definite conflict. Thereby determining whether the conflict needs to be resolved by retrieving the camera type from the preview frame data.

And S805, the camera service acquires the camera type from the preview frame data in response to the fact that the equipment identifier is the preset identifier.

Obviously, for a mobile phone with clear conflict, the device identifier is a preset identifier, and the camera service may determine that the device identifier is the preset identifier after receiving preview frame data reported from the camera hardware abstraction layer, so that the camera type needs to be acquired from the preview frame data. The conflict is then handled according to the camera type, i.e., S608-S611.

The method of the embodiment can be applied to various mobile phones, and in different mobile phones with preset identifiers, cameras with conflicts are different. Based on this, in some embodiments, a correspondence table of the preset identifier and the type value of the conflicting camera may be set in the mobile phone. Then, in S804, the camera service may determine whether the device identifier is a preset identifier through the table, and further query a type value corresponding to the device identifier from the table after determining that the device identifier is the preset identifier. Therefore, after the camera service acquires the camera type in S805, it is further determined whether the camera type is the preset type.

For example, a type value column may be added on the basis of table 2 to obtain a corresponding relationship table as shown in table 3 below:

TABLE 3

Preset model number Type value
Type a HWA_PHYSICAL_CAMERA_WIDE
Type b HWA_PHYSICAL_CAMERA_TELE
…… ……

For example, after the camera service queries that the device model of the current mobile phone is the model a in table 3, it may determine that the device identifier is the preset identifier. At this time, the CAMERA service may further acquire that the type value of the CAMERA currently conflicted by the cell phone is HWA _ PHYSICAL _ CAMERA _ WIDE, that is, the rear WIDE type.

In summary, with the method of this embodiment, after receiving a request for starting a camera, a camera service may determine for the first time whether an equipment identifier of a current mobile phone is a preset identifier, and if it is determined for the first time that the equipment identifier is the preset identifier, no conflict processing is performed at this time; and if the preset identifier is judged not to be the first time, sending a message for closing the NFC function to the NFC service, thereby finishing the conflict processing. That is, for a mobile phone with no clear conflict, the camera service can complete the conflict processing after the first determination. After the camera service receives the preview frame data, whether the equipment identifier of the current mobile phone is the preset identifier or not can be judged for the second time, if the equipment identifier is judged to be the preset identifier for the second time, the camera type is obtained from the preview frame data, and the conflict is processed according to the camera type; and if the preset identifier is judged not to be the preset identifier for the second time, no processing is performed. That is, for a cell phone with clear conflict, the camera service can complete the conflict processing after the first determination. Thus, for any mobile phone, the method of the present embodiment can complete conflict handling.

To this end, in order to facilitate understanding of the foregoing embodiments, the following describes the present application and its effects as a complete flow chart. Fig. 9 is a flowchart of a method for controlling an NFC function in a specific example of the present application.

Referring to fig. 9, a method for controlling an NFC function provided in an embodiment of the present application may include:

s901, starting camera service: when the mobile phone is started, the camera service is started, or after the camera service is started, the camera service is automatically restarted. In this embodiment of the application, after the camera service is started, the camera service may send a message for starting the NFC function to the NFC service, so as to start the NFC function. Therefore, the problem that the NFC function is not started in time after being closed due to abnormal interruption of the camera service can be avoided. The NFC functionality is guaranteed to be initially available after the camera service is started. After the camera service is started, a message for turning on the NFC function may be generated, and then the process proceeds to S910.

S902, turning on a camera: the camera application is opened, the function of using the camera in the three-party application is entered, the shooting mode is switched or the preset camera is switched, and the camera is triggered to be opened.

S903, connecting the camera, which may also be understood as requesting to start the camera: after receiving the operation of opening the camera by the user, the application program can request the camera service to start the camera.

S904, whether the mark is a preset mark: after receiving the request for connecting the camera, the camera service judges whether the equipment identifier of the current mobile phone is a preset identifier, namely determines whether the current mobile phone definitely has a conflicting camera. If the identification is preset, the current mobile phone is the mobile phone with the definitely conflicting camera, at this time, no processing is performed, and the conflict is processed by acquiring the camera type after the subsequent report of preview frame data. Otherwise, if the identifier is not the preset identifier, it indicates that the current mobile phone does not clearly have a conflicting camera, at this time, a message for closing the NFC function is generated, and then the process goes to S910.

It should be understood that for any handset, after S903, the camera service may transmit a request for starting a camera to the bottom layer, and after the bottom layer starts a corresponding camera, the bottom layer may report preview frame data to the camera hardware abstraction layer (the process is not shown in fig. 9).

S905, reporting a preview frame: and after receiving the preview frame data reported by the bottom layer, the camera hardware abstraction layer adds the camera type to the preview frame data, and then further reports the preview frame data to the camera service.

S906, whether the mark is a preset mark: since the process of starting the camera and reporting the preview frame data is completely independent from the step of S904 and the subsequent conflict processing, after receiving the preview frame data, the camera service needs to further determine whether the device identifier of the current mobile phone is the preset identifier, so as to determine whether the current mobile phone is the mobile phone with the clearly conflicting camera. Similarly, if the identifier is preset, it indicates that the current mobile phone is the mobile phone with the definitely conflicting camera, and at this time, S907 is entered to acquire the camera type and process the conflict. On the contrary, if the mobile phone is not the preset identifier, it indicates that the current mobile phone does not clearly have a conflicting camera, and for this situation, after determining that the mobile phone is not the preset identifier in S904, the conflict processing is already performed, and here, no further processing is needed.

It should be understood that the determination results in S904 and S906 should be consistent for the same handset. For the mobile phone with the clearly conflicting camera, if the determination results of S904 and S906 are both the preset identifiers, then the conflict does not need to be processed after S904, and the conflict needs to be processed after S906. For the mobile phone with the camera which is not clear of conflict, if the judgment results of S904 and S906 are both not the preset identifier, the conflict needs to be processed after S904, and the conflict does not need to be processed after S906.

For any mobile phone, after receiving the preview frame data, the camera service needs to report the preview frame data to the application program further, so that the application program layer presents a preview image (not shown in fig. 9).

S907, acquiring the camera type: if the camera type is unknown or the meta data does not include the camera type, no processing is performed, and error processing is avoided. If the camera type is the preset type, it indicates that the currently used camera is the camera with conflict in the current mobile phone, and at this time, the camera service may generate a message for turning off the NFC function, and then the process proceeds to S910. If the camera type is other than the unknown type or the preset type, it indicates that the currently used camera is not the camera with the conflict in the current mobile phone, and at this time, the camera service may generate a message for starting the NFC function, and then the process proceeds to S910.

In the embodiment of the application, it is first determined whether the identifier is a preset identifier through S907, and the camera type is then acquired through S907 if the identifier is determined to be the preset identifier. That is, for the mobile phone whose device identifier is not the preset identifier, the step of acquiring the camera type in S907 does not need to be performed. And acquiring the camera type from the preview frame data, wherein the camera service needs to analyze the preview frame data, then acquiring the camera type from an analysis result, and the process of analyzing and acquiring the camera type consumes long time. Therefore, for the mobile phone whose device identifier is not the preset identifier, S908 can be omitted, so that the efficiency of executing the scheme can be greatly improved.

S908, turning off the camera: the camera is triggered to be closed by exiting the foreground to run the camera application, using the function of the camera in the foreground to run the three-party application, switching the shooting mode or switching the preset camera.

S909, disconnecting, it can also be understood as requesting to close the camera: after receiving the operation of closing the camera by the user, the application program can request the camera service to close the camera. At this time, the camera service may generate a message to turn on the NFC function, and then proceeds to S910.

S910, and whether the recorded message type is the same: after the camera service generates a message for closing the NFC function, if S904 is not the preset identifier (i.e., "no"), or the camera acquired in S907 is of the preset type; or, after the camera service generates the message for starting the NFC function, for example, when the camera service is started in S901, the camera type acquired in S907 is another type, and the camera is requested to be turned off in S909, the camera service may detect whether the message type of the message generated this time (i.e., the message to be sent) is the same as the recorded message type. Wherein the recorded message type is the message type of the message that the camera service has successfully sent to the NFC service the last time.

If the message type of the message generated this time is the same as the recorded message type, the message does not need to be repeatedly sent to the NFC service, and the message may be discarded, that is, not processed. Therefore, repeated communication between the camera service and the NFC can be reduced, and the power consumption of the mobile phone is reduced.

If the message type of the message generated this time is not the same as the recorded message type, S911 is entered to continuously determine whether to send the message generated this time.

S911, whether the preset configuration item is started or not: and if the preset configuration item is configured in the mobile phone and the preset configuration item is started, the mobile phone has the conflict processing requirement. If the preset configuration item is not opened, the mobile phone does not have the requirement of processing conflict. The camera service detects whether a value of a preset configuration item (e.g., camera _ nfc _ switch) is true, and if the value of the preset configuration item is true, it detects that the preset configuration item is turned on. Thereby indicating that the handset needs to handle the collision, the message is further sent to the NFC service, i.e. S912 is entered to send the message. Otherwise, if the value of the preset configuration item is not true, it is detected that the preset configuration item is not opened. Thereby indicating that the handset does not need to process the conflict, the message is discarded, i.e., not processed. By adopting the S911, the conflict processing can be matched with the performance requirement of the mobile phone.

In the embodiment of the present application, it is first determined whether the message types are the same through S910, and if the message types are different, it is further detected whether the preset configuration item is opened through S911. In the process of one-time shooting, the frequency of switching the camera by the user is not very high, and even the camera cannot be switched. That is, in most cases, the judgment results obtained in S910 are all the same message type, and in this case, S911 does not need to be executed. Therefore, in the manner of S910 before S911, in most cases, S911 can be omitted, so that the efficiency of executing the scheme can be improved.

S912, sending a message to the NFC service: the camera service transmits the message generated this time to the NFC service.

S913, controlling the NFC chip to enter or exit an idle state: and after the NFC service receives the message of closing the NFC service, the NFC chip is controlled to enter an idle state, and the NFC function is closed at the moment. And when the NFC service receives the message for starting the NFC service, the NFC is controlled to exit the idle state, and at the moment, the NFC function is started.

It can be seen that the above-mentioned complete example shown in fig. 9 can be flexibly applied to all mobile phones by maintaining the preset identifier, the preset type and the preset configuration item. For example, the present invention can be applied to a mobile phone with clearly conflicting cameras, and can also be applied to a mobile phone with not clearly conflicting cameras. For another example, the method can be applied to mobile phones with different conflicting camera types. For another example, the method may be applied to a mobile phone that needs to process a conflict (i.e., the preset configuration item is turned on), or may be applied to a mobile phone that does not need to process a conflict (i.e., the preset configuration item is not turned on).

For example, after a new mobile phone product is developed, it is determined through a test that a signal simulated by a sensor module of a camera 1 of the new mobile phone is coupled with a radio frequency field generated by an NFC chip, an equipment identifier of the new mobile phone may be newly added as a preset identifier, the type of the camera 1 is determined as a preset type, and a value of a preset configuration item is added to the new mobile phone as true. Then, the scheme can only turn off the NFC function when the camera 1 is used for the mobile phone.

Since the software structure shown in fig. 3 may be included in the mobile phone 100, the mobile phone 100 may execute the NFC function control method according to the embodiment of the present application. In the following embodiments, the control method of the NFC function common to the embodiments of the present application is described with the execution subject being the mobile phone 100.

Referring to fig. 10, an NFC method provided in an embodiment of the present application may include:

s1001, the mobile phone 100 receives an operation of opening the camera by the user.

After the user inputs an operation of opening the camera, for example, after the user clicks an application icon of a camera application on the main interface, in a first aspect (i.e., S1002), the mobile phone 100 needs to determine whether the mobile phone 100 is a mobile phone with a clearly conflicting camera, and if so, no processing is required at this time; if not, the NFC function needs to be closed at this time. In the second aspect (i.e., S1003), the mobile phone 100 needs to activate the preview camera to capture and display the preview image. The two aspects are completely independent and do not influence each other.

S1002, the mobile phone 100 responds to an operation of opening the camera by the user, and determines whether the device identifier of the mobile phone 100 is a preset identifier. If yes, not processing; if not, go to step S1007.

If the device identifier of the mobile phone 100 is the preset identifier, it indicates that the mobile phone 100 is a mobile phone with a clearly conflicting camera, and at this time, no processing is required. But the conflict processing is subsequently performed by acquiring the camera type. On the contrary, if the device identifier of the mobile phone 100 is not the preset identifier, it indicates that the mobile phone 100 is not a camera mobile phone with a definite conflict, and in order to avoid the conflict as much as possible, the NFC function needs to be turned off at this time. That is, if the device identifier of the mobile phone 100 is not the preset identifier, the NFC function is turned off when the mobile phone 100 starts any camera.

S1003, the mobile phone 100 starts the preview camera in response to the user' S operation of opening the camera.

It should be noted that the preview camera may be switchable after the camera is turned on. For example, after the cell phone 100 responds to the user clicking on the application icon of the camera application, the cell phone 100 starts the rear main camera. Then, the user slides the zoom bar on the preview interface from 1x to 4x, and switching from 1x to 4x is switching between rear cameras, and generally does not re-trigger the mobile phone 100 to turn on the camera. But will trigger the handset 100 to switch cameras. Starting the preview camera in S1003 means starting the camera for the first time after turning on the camera, and does not include starting when switching the camera subsequently.

S1004, after the mobile phone 100 starts the preview camera, obtains preview frame data.

In the embodiment of the application, the preview frame data carries the camera type of the preview camera. And after the camera is switched, the preview camera is the switched camera.

It should be noted that the mobile phone 100 continuously acquires the preview frame data as the camera continuously acquires the preview image, so that S1004 and the subsequent steps thereof are continued as the camera continuously acquires the preview image.

S1005, the mobile phone 100 determines whether the device identifier is a preset identifier. If yes, go to S1005; if not, not processing.

Since S1003, S1004 and S1002 are completely independent, i.e., the execution of S1003 and S1004 does not depend on the determination result of S1002. Therefore, after S1004, the cellular phone 100 needs to determine again whether the device identifier is the preset identifier (i.e., S1004) in order to perform the collision processing in a targeted manner.

If the device identifier of the mobile phone 100 is the preset identifier, it indicates that the mobile phone 100 is a mobile phone with a clear conflicting camera, and at this time, S1006 is executed to perform conflict processing by acquiring a camera type. On the contrary, if the device identifier of the mobile phone 100 is not the preset identifier, it indicates that the mobile phone 100 is not the mobile phone with the clearly conflicting camera, and the conflict of the mobile phone 100 is already resolved, and at this time, no further processing is required.

S1006, the mobile phone 100 obtains the camera type of the preview camera from the preview frame data, and determines whether the camera type is a preset type. If yes, executing S1007; if not, go to S1008.

The preset type is a type of a camera in the mobile phone 100, where the camera is in conflict with the preset type. If the camera type carried in the preview frame data is the preset type, it indicates that the currently used preview camera is a conflicting camera, and at this time, S1007 is executed to close the NFC function. On the contrary, if the camera type carried in the preview frame data is not the preset type, it indicates that the currently adopted preview camera is not the conflicting camera, and at this time, S1008 may be executed to start the NFC function. It should be noted that the camera is not of the preset type, including: the camera type is unknown, or the camera is of another type. In some embodiments, the mobile phone 100 may further determine whether the camera type is an unknown type when the camera type is not the preset type, and if the camera type is the unknown type, the mobile phone 100 may not process the camera type, thereby avoiding causing an error. If the camera type is not unknown, that is, other types, the mobile phone 100 may execute S1008 to turn on the NFC function.

S1007, the mobile phone 100 turns off the NFC function.

In some embodiments, before S1007, the mobile phone 100 further needs to detect whether the NFC function is turned off. If the message which is successfully sent to the NFC service for the last time is a message for closing the NFC function, the NFC function is closed; and if the message which is successfully sent to the NFC service for the last time is the message for starting the NFC function, indicating that the NFC function is not closed. S1007 further includes: if the NFC function is not closed, the mobile phone 100 closes the NFC function. In addition, if the NFC function is already turned off, the mobile phone 100 does not perform any processing, so as to avoid repeatedly turning off the NFC function.

In some embodiments, the handset 100 includes preset configuration items. Before S1007, the mobile phone 100 further needs to detect whether the preset configuration item is turned on. S1007 further includes: if the preset configuration item is in the on state, the mobile phone 100 turns off the NFC function. In addition, if the preset configuration item is in the off state, the mobile phone 100 does not perform any processing, that is, the state of the NFC function remains unchanged.

S1008, the mobile phone 100 starts the NFC function.

In some embodiments, before S1008, the mobile phone 100 further needs to detect whether the NFC function is turned on. If the message which is successfully sent to the NFC service for the last time is the message for starting the NFC function, the NFC function is started; and if the message which is successfully sent to the NFC service for the last time is the message for closing the NFC function, indicating that the NFC function is not opened. S1008 further comprises: if the NFC function is not turned on, the mobile phone 100 turns on the NFC function. In addition, if the NFC function is already turned on, the mobile phone 100 does not perform any processing, thereby avoiding repeatedly turning on the NFC function.

In some embodiments, the handset 100 includes preset configuration items. Before S1008, the mobile phone 100 further needs to detect whether the preset configuration item is turned on. S1008 further comprises: if the preset configuration item is in the on state, the mobile phone 100 turns on the NFC function. In addition, if the preset configuration item is in the off state, the mobile phone 100 does not perform any processing, that is, the state of the NFC function is kept unchanged.

In some embodiments, before S1008, the handset 100 further needs to detect whether the user configuration includes a setting to turn off the NFC function. S1008 further comprises: if the user configuration does not include the setting for turning off the NFC function, the mobile phone 100 turns on the NFC function. In addition, if the user configuration includes a setting to turn off the NFC function, the mobile phone 100 does not perform any processing. That is, if the NFC function of the cellular phone 100 is not in the off state in response to the operation of the user, that is, the user does not manually turn off the NFC function, the cellular phone 100 turns on the NFC function. If the NFC function of the mobile phone 100 is in the off state in response to the operation of the user, that is, the user manually turns off the NFC function, the mobile phone 100 keeps the NFC function off without turning on the NFC function.

Based on the foregoing descriptions of S1006 to S1008, it can be seen that: in case that the mobile phone 100 starts a camera of a non-preset type (such as other types), the NFC function of the mobile phone 100 is turned on. In the case where the mobile phone 100 starts a preset type of camera, the NFC function is turned off.

In addition, in the process from turning on the camera to turning off the camera once, the non-preset type camera and the preset type camera can be switched with each other through the operation of a user. For example, the mobile phone 100 may receive the second operation of the user after the first camera is started. Wherein the second operation is used to trigger the mobile phone 100 to switch the camera to the second camera. The mobile phone 100 may turn off the first camera and turn on the second camera in response to the second operation of the user. For another example, the mobile phone 100 may receive a third operation of the user after the second camera is started. The third operation is used to trigger the mobile phone 100 to switch the camera to the first camera. The mobile phone 100 may turn off the second camera and turn on the first camera in response to a third operation by the user. By adopting the scheme, in the scene of switching the camera in the process of opening the camera to closing the camera once, the NFC service can be opened within a period of time, and the NFC service can be closed within another period of time, so that the possibility of sharing the NFC function and the camera function can be further increased.

S1009, the mobile phone 100 starts the NFC function in response to the operation of the user to turn off the camera.

The specific implementation of the NFC function in S1009 is the same as the specific implementation of the NFC function in S1008.

It should be understood that the mobile phone 100 in fig. 10 combines two cases of the device identifier being the preset identifier and not being the preset identifier into one scheme through two determinations. In practice, different mobile phones may directly use different methods to handle the conflict, and if the device identifier of the mobile phone 100 is the preset identifier, the mobile phone 100 may directly use the methods of S1001, S1008, and S1009 to handle the conflict. Or, if the device identifier of the mobile phone 100 is the preset identifier, the mobile phone 100 may directly handle the conflict in the manner of S1001 and S1003-S1009.

In summary, by using the method of the embodiment of the present application, the problem of the conflict between the NFC function and the camera function can be effectively solved by the mobile phone 100.

Other embodiments of the present application provide an electronic device, which may include: the display screen (e.g., a touch screen), memory, and one or more processors. The display screen, memory and processor are coupled. The memory is for storing computer program code comprising computer instructions. When the processor executes the computer instructions, the electronic device may perform various functions or steps performed by the mobile phone in the above-described method embodiments. The structure of the electronic device may refer to the structure of the cellular phone 100 shown in fig. 2.

The embodiment of the present application further provides a chip system, as shown in fig. 11, the chip system 1100 includes at least one processor 1101 and at least one interface circuit 1102. The processor 1101 and the interface circuit 1102 may be interconnected by wires. For example, the interface circuit 1102 may be used to receive signals from other devices (e.g., a memory of an electronic device). As another example, the interface circuit 1102 may be used to send signals to other devices (e.g., the processor 1101). Illustratively, the interface circuit 1102 may read instructions stored in the memory and send the instructions to the processor 1101. The instructions, when executed by the processor 1101, may cause the electronic device to perform the various steps in the embodiments described above. Of course, the chip system may further include other discrete devices, which is not specifically limited in this embodiment of the present application.

The embodiment of the present application further provides a computer storage medium, where the computer storage medium includes computer instructions, and when the computer instructions are run on the electronic device, the electronic device is enabled to execute each function or step executed by the mobile phone in the foregoing method embodiment.

The embodiment of the present application further provides a computer program product, which when running on a computer, causes the computer to execute each function or step executed by the mobile phone in the above method embodiments.

Through the description of the above embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions.

In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical functional division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another device, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.

The units described as separate parts may or may not be physically separate, and parts displayed as units may be one physical unit or a plurality of physical units, that is, may be located in one place, or may be distributed in a plurality of different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.

In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.

The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially or partially contributed to by the prior art, or all or part of the technical solutions may be embodied in the form of a software product, where the software product is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.

The above description is only an 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 by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

49页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种终端控制方法、终端、装置及其存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类