Camera control method and electronic device

By setting camera conflict enable parameters in electronic devices and disconnecting the camera hardware, the conflict problem between satellite communication applications and camera modules is solved while running at the same time, improving communication quality and business stability.

CN118474514BActive Publication Date: 2025-02-07HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311866250.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-29
Publication Date
2025-02-07
Estimated Expiration
2043-12-29

AI Technical Summary

Technical Problem

In electronic devices, when the satellite communication application and the camera module are running at the same time, the conversion circuit of the analog signal and digital signal of the camera module will be interfered with by the radio frequency signal generated by the satellite communication, causing abnormalities in the preview page of the camera application, and satellite communication The radio frequency signal will also be affected by electromagnetic interference from the camera module, causing the communication quality of satellite communication to decline.

Method used

Through a camera control method, in response to user operations, the camera conflict enable parameter is set to a specific value, disconnect the connection relationship with the camera hardware, avoiding the satellite communication module and the camera hardware running simultaneously, and ensuring the smooth progress of satellite communication services.

Benefits of technology

It effectively avoids conflicts between satellite communication modules and camera modules, prevents abnormalities in the camera preview page, improves the communication quality of satellite communications, and ensures the smooth progress of business.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118474514B_ABST
    Figure CN118474514B_ABST
Patent Text Reader

Abstract

The present application provides a camera control method and electronic device. The method includes: in response to a first operation performed by a user on a first application, setting a camera conflict enabling parameter to a fourth value; wherein the first application is indicated as an application program having a satellite communication initiation function; the first operation is indicated as an operation of starting a hardware module corresponding to the first application; when the camera service usage information is obtained, based on the camera service usage information, disconnecting the connection relationship between the second application and the camera hardware, which can effectively prevent the second application from calling the camera service, avoid the hardware module corresponding to the first application and the camera hardware from running at the same time, and ensure the smooth operation of the business corresponding to the first application, wherein the camera service usage information is used to indicate the second application that has a connection relationship with the camera hardware.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminals, and in particular to a camera control method and electronic equipment. Background Art

[0002] In many electronic devices that currently support satellite communications, when the satellite communication application and the camera module are running at the same time, the analog signal and digital signal conversion circuit in the camera module will be interfered by the radio frequency signal generated by the satellite communication, causing the preview page of the camera application to be abnormal, such as the preview page showing a distorted screen, a black screen, a frozen screen, or a stuck screen. In addition, the radio frequency signal of the satellite communication will also be subject to electromagnetic interference from the camera module, causing the communication quality of the satellite communication to deteriorate. Summary of the invention

[0003] In order to solve the above technical problems, the present application provides a camera control method and electronic device, which can avoid the simultaneous operation of the satellite communication module and the camera hardware, and ensure the smooth operation of the satellite communication service.

[0004] In a first aspect, the present application provides a camera control method, the method comprising: in response to a first operation performed by a user on a first application, setting a camera conflict enabling parameter to a fourth value; wherein the first application is indicated as an application having a satellite communication initiating function; the first operation is indicated as an operation to turn on a hardware module corresponding to the first application; when camera service usage information is obtained, based on the camera service usage information, disconnecting the connection between the second application and the camera hardware; the camera service usage information is used to indicate the second application having a connection relationship with the camera hardware.

[0005] In the embodiment of the present application, when the hardware module corresponding to the first application and the camera hardware are running at the same time, there will be a conflict. When the hardware module corresponding to the first application is turned on, the electronic device determines the second application that has a connection relationship with the camera hardware and disconnects the connection relationship between the second application and the camera hardware, which can effectively prevent the second application from calling the camera service, avoid the hardware module corresponding to the first application and the camera hardware from running at the same time, and ensure the smooth operation of the business corresponding to the first application. For example, when the first application is a satellite communication application, the above-mentioned camera control method can avoid the satellite communication quality degradation caused by the conflict between the satellite communication module and the camera module.

[0006] According to the first aspect, the camera control method also includes: in response to a third operation performed by the user on a third application, obtaining a camera conflict enabling parameter; wherein the third operation indication is an operation to enable the camera service; and when the camera conflict enabling parameter is a fourth value, returning a camera service unavailable reminder to the third application.

[0007] In the embodiment of the present application, when the camera conflict enabling parameter is the fourth value, it indicates that the satellite communication module that will conflict with the camera module is in an on state. Therefore, if the third application uses the camera service at this time, the satellite communication module and the camera module will conflict, resulting in a decrease in the communication quality of the satellite communication. Therefore, in order to avoid a conflict between the hardware module and the camera module, a reminder that the camera service is unavailable is returned to the third application.

[0008] According to the first aspect, or any implementation of the first aspect above, after obtaining the camera conflict enabling parameter in response to a third operation performed by the user on the third application, the above method also includes: when the camera conflict enabling parameter is a third value, storing camera service usage information corresponding to the third application; establishing a connection relationship between the third application and the camera hardware.

[0009] In the embodiment of the present application, when the camera conflict enabling parameter is the third value, it indicates that the hardware module that will conflict with the camera module is in a closed state, so the third application can use the camera service normally. Storing the camera service usage information corresponding to the third application can facilitate the management of the application program that uses the camera service.

[0010] According to the first aspect, or any implementation of the first aspect above, after setting the camera conflict enabling parameter to a fourth value in response to a first operation performed by a user on a first application, the method also includes: when the user performs a first operation on the first application, the camera middle station module obtains a state change response message corresponding to the first application; the target state value indicated in the state change response message is a first value; the camera middle station module sends scene information to the camera framework module based on the state change response message; the scene information includes a business scenario identifier and a target state value corresponding to the first application; when the camera framework module determines that the business scenario identifier is a preset identifier and the target state value indication is the first value, it obtains camera service usage information.

[0011] In an embodiment of the present application, when the hardware module corresponding to the first application is turned on, the camera middle platform module transmits scene information to the camera framework module, so that the camera framework module can obtain the camera service usage information in a timely manner, so as to facilitate the subsequent disconnection of the connection between the second application and the camera hardware after obtaining the camera service usage information.

[0012] According to the first aspect, or any implementation of the first aspect above, before disconnecting the connection between the second application and the camera hardware based on the camera service usage information, the method also includes: the camera framework module obtains a service lock corresponding to the camera service.

[0013] In the embodiment of the present application, after the camera framework module obtains the service lock corresponding to the camera service, the second application cannot call the camera service even if it has established a connection with the camera hardware and needs to wait for unlocking. Before the connection between the second application and the camera hardware is disconnected, the second application can be prevented from calling the camera service, which can prevent the hardware module corresponding to the first application from running at the same time as the camera hardware, thereby ensuring the smooth operation of the business corresponding to the first application.

[0014] According to the first aspect, or any implementation of the first aspect above, before setting the camera conflict enable parameter to a fourth value in response to a first operation performed by a user on a first application, the method also includes: the camera middle station module registers a listener in the system server; the listener is used to listen to the status information corresponding to the first application.

[0015] In an embodiment of the present application, the camera middle platform module registers a listener in the system server, and can monitor the status information corresponding to the first application in real time, thereby promptly avoiding conflicts between the hardware module corresponding to the first application and the camera hardware.

[0016] According to the first aspect, or any implementation method of the first aspect above, when the user performs a first operation on the first application, the camera middle station module obtains a status change response message corresponding to the first application, including: when the user performs the first operation on the first application, the system server changes the status information corresponding to the first application; the listener sends a change response message to the camera middle station module in response to the change in the status information corresponding to the first application.

[0017] In an embodiment of the present application, the system server maintains status information corresponding to the first application, and the listener can monitor the status information corresponding to the first application in real time, and promptly notify the camera middle platform module when the status information changes, so that the electronic device can promptly avoid conflicts between the hardware module corresponding to the first application and the camera hardware.

[0018] According to the first aspect, or any implementation method of the first aspect above, when a user performs a first operation on a first application, a system server changes status information corresponding to the first application, including: when the user performs a first operation on the first application, the first application sends start status information to the system server; the system server responds to the start status information and sets the target status value in the status information corresponding to the first application to a first value.

[0019] In an embodiment of the present application, the system server maintains status information corresponding to the first application, and updates the status information corresponding to the first application in real time when the hardware module corresponding to the first application is turned on, so that the camera middle platform module can promptly be informed of changes in the status information corresponding to the first application, thereby promptly avoiding conflicts between the hardware module corresponding to the first application and the camera hardware.

[0020] According to the first aspect, or any implementation of the first aspect above, the method also includes: when the user performs a second operation on the first application, the camera middle station module obtains a state change response message corresponding to the first application; the second operation indication is an operation to shut down the hardware module corresponding to the first application; the target state value indication in the state change response message is a second value; the camera middle station module sends scene information to the camera framework module based on the state change response message; the scene information includes a business scenario identifier and a target state value corresponding to the first application; when the camera framework module determines that the business scenario identifier is a preset identifier and the target state value indication is a second value, the camera conflict enabling parameter is set to a third value.

[0021] In an embodiment of the present application, when the hardware module corresponding to the first application is turned off, the camera middle platform module is informed through a state change response message that the hardware module corresponding to the first application is turned off. Therefore, the camera middle platform module sends scene information to the camera framework module to enable the camera framework module to set the camera conflict enable parameter to a third value, so that other modules in the electronic device can determine that the hardware module that conflicts with the camera module is in a closed state through the third value, thereby ensuring that the camera service can be used normally when the hardware module corresponding to the first application is turned off.

[0022] In a second aspect, the present application provides an electronic device, comprising: one or more processors; a memory; and a computer program, wherein the computer program is stored in the memory, and when the computer program is executed by one or more processors, the electronic device executes instructions of the method in the first aspect or any possible implementation of the first aspect.

[0023] The second aspect and any implementation of the second aspect correspond to the first aspect and any implementation of the first aspect respectively. The technical effects corresponding to the second aspect and any implementation of the second aspect can refer to the technical effects corresponding to the above-mentioned first aspect and any implementation of the first aspect, which will not be repeated here.

[0024] In a third aspect, the present application provides a computer storage medium comprising computer instructions, which, when executed on an electronic device, cause the electronic device to execute the instructions of the method in the first aspect or any possible implementation of the first aspect.

[0025] The third aspect and any implementation of the third aspect correspond to the first aspect and any implementation of the first aspect, respectively. The technical effects corresponding to the third aspect and any implementation of the third aspect can refer to the technical effects corresponding to the first aspect and any implementation of the first aspect, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;

[0027] Figure 2 A schematic diagram of an application scenario provided for an embodiment of the present application;

[0028] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0029] Figure 4 A software structure block diagram of an electronic device provided in an embodiment of the present application;

[0030] Figure 5 A schematic diagram of a camera control method provided in an embodiment of the present application Figure 1 ;

[0031] Figure 6 A schematic diagram of a flow chart of a satellite status information changing method provided in an embodiment of the present application;

[0032] Figure 7 A schematic diagram of a camera control method provided in an embodiment of the present application Figure 2 ;

[0033] Figure 8 A schematic diagram of a camera control method provided in an embodiment of the present application Figure 3 ;

[0034] Fig. 9 A schematic diagram of a camera control method provided in an embodiment of the present application Figure 4 ;

[0035] Fig.10 A schematic diagram of another application scenario provided for an embodiment of the present application. DETAILED DESCRIPTION

[0036] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0037] The term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

[0038] The terms "first" and "second" in the description and claims of the embodiments of the present application are used to distinguish different objects rather than to describe a specific order of objects. For example, a first target object and a second target object are used to distinguish different target objects rather than to describe a specific order of target objects.

[0039] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0040] In the description of the embodiments of the present application, unless otherwise specified, the meaning of "multiple" refers to two or more than two. For example, multiple processing units refer to two or more processing units; multiple systems refer to two or more systems.

[0041] Figure 1 and Figure 2 All of them are schematic diagrams of application scenarios provided by the embodiments of the present application. Figure 1 and Figure 2 The application scenarios of the embodiments of the present application are exemplified.

[0042] Take a mobile phone as an example of an electronic device. Figure 1 (1) shows a first display interface 101 of an electronic device, the first display interface 101 includes a satellite connection mark 1011, and the first display interface 101 indicates a satellite call page, indicating that the electronic device is currently in the process of a satellite call.

[0043] During the satellite call, the user swipes up in the area near the bottom edge of the screen. The electronic device responds to the received swipe up in the area near the bottom edge of the screen, such as Figure 1 As shown in (2) in FIG. 1 , a second display interface 102 is displayed. The second display interface 102 is indicated as a desktop of the electronic device, including an identifier indicating the device status and icons of multiple applications. The identifier indicating the device status is, for example, an identifier 1021 for holding a call, and the icon of an application is, for example, an icon 1022 of a camera application. In some scenarios, the user clicks the icon 1022 of the camera application in the second display interface 102.

[0044] The electronic device responds to the received click operation on the icon 1022 of the camera application, such as Figure 2 As shown, the third display interface 103 is displayed. The third display interface 103 includes an image preview area 1031 ( Figure 2 The image preview area 1031 is shown as a white dotted box in the figure), and a black screen appears in the image preview area 1031, and the normal preview image cannot be displayed. The reason is that in an electronic device, when the satellite communication application and the camera module are running at the same time, when the signal-to-noise ratio of the satellite communication module exceeds the baseline value of the channel isolation, the analog signal and digital signal conversion circuit in the camera module will be interfered by the radio frequency signal generated by the satellite communication module, resulting in an abnormal preview page of the camera application. In addition, the radio frequency signal of the satellite communication will also be subject to electromagnetic interference from the camera module, resulting in a decrease in the communication quality of the satellite communication.

[0045] To this end, an embodiment of the present application provides a camera control method, in which the electronic device sets a camera conflict enabling parameter to a fourth value in response to a first operation performed by a user on a first application; wherein the first application indication is an application program having a satellite communication initiating function; the first operation indication is an operation to turn on a hardware module corresponding to the first application; when the camera service usage information is obtained, based on the camera service usage information, the connection relationship between the second application and the camera hardware is disconnected, which can effectively prevent the second application from calling the camera service, avoid the hardware module corresponding to the first application and the camera hardware from running at the same time, and ensure the smooth operation of the business corresponding to the first application.

[0046] The data transmission method provided in the embodiments of the present application can be applied to electronic devices, and the electronic devices may be wearable electronic devices (such as watches), portable computers (such as mobile phones), tablet computers, laptop computers, personal computers (personal computers, PCs), augmented reality (augment reality, AR) \ virtual reality (virtual reality, VR) devices, car computers and other devices. The following embodiments do not impose any special restrictions on the specific form of the electronic device.

[0047] Before describing the technical solution of the embodiment of the present application, the electronic device of the embodiment of the present application is first described with reference to the accompanying drawings. Figure 3 1 shows a schematic diagram of the structure of the electronic device 100. It should be understood that Figure 3 The illustrated electronic device 100 is merely one example of an electronic device, and the electronic device 100 may have more or fewer components than those shown in the figure, may combine two or more components, or may have a different configuration of components. Figure 3 The various components shown in the EMBODIMENTS 2000 may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application specific integrated circuits.

[0048] The electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0049] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (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. Different processing units may be independent devices or integrated into one or more processors.

[0050] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0051] A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a high-speed cache memory. The USB interface 130 is an interface that complies with USB standard specifications, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 may be used to connect a charger to charge the electronic device 100, or may be used to transfer data between the electronic device 100 and a peripheral device. It may also be used to connect headphones to play audio through the headphones. The interface may also be used to connect other electronic devices, such as AR devices, etc.

[0052] The charging management module 140 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. While the charging management module 140 charges the battery 142, it can also power the electronic device through the power management module 141.

[0053] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160. The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0054] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0055] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0056] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0057] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0058] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0059] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0060] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0061] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.

[0062] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0063] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0064] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0065] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0066] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0067] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0068] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0069] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.

[0070] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 can also calculate the touch position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.

[0071] The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.

[0072] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.

[0073] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects.

[0074] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.

[0075] The software system of the electronic device 100 may adopt 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 takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 100.

[0076] Figure 4 A software structure block diagram of the electronic device 100 provided in an embodiment of the present application.

[0077] The layered architecture of the electronic device 100 divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into five layers, from top to bottom, namely, the application layer, the application framework layer, the Android runtime (Android runtime) and the system library, the hardware abstraction layer (HAL) and the kernel layer.

[0078] The application layer may include a series of application packages. The application package may include applications such as camera, calendar, call, satellite communication, etc.

[0079] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0080] like Figure 4 As shown, the application framework layer may include a content provider, a phone manager, a notification manager, a system server (SystemServer), a camera middle platform module, and a camera framework module, etc.

[0081] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0082] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).

[0083] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.

[0084] The system server is responsible for starting many important system services, such as camera service, activity management, etc.

[0085] The camera mid-stage module includes an initialization module and a mid-stage processing module. The initialization module is used to perform initialization operations on the mid-stage processing module; the mid-stage processing module is used to monitor the satellite status information maintained in the system server and transmit scene information to the camera framework module.

[0086] The camera framework module includes a camera service module, a scene judgment module, a conflict resolution module, and a camera disconnection module. The camera service module is used to initiate a request to register the camera service, manage the application's call to the camera service, etc. The scene judgment module is used to determine whether camera conflict processing is required; the conflict resolution module is used to resolve camera conflicts; and the camera disconnection module is used to disconnect the connection between the application and the camera hardware.

[0087] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

[0088] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

[0089] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0090] The system library may include multiple functional modules, such as surface manager, media library, service manager, 2D graphics engine (such as SGL), etc.

[0091] The service management module is used to manage system services and manage queries on Binder proxy objects corresponding to these system services.

[0092] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, sensor driver, binder driver and protocol stack, etc.

[0093] Among them, the Binder driver is responsible for inter-process communication. It creates an inter-process communication framework through the kernel layer, allowing data and messages to be transmitted between processes.

[0094] A protocol stack is a specific software implementation of a computer network protocol suite that defines various specifications and methods required for network communication. It contains a collection of protocols organized in a specific order, and each protocol layer is responsible for a specific function.

[0095] Understandably, Figure 4 The layers in the software structure shown and the components included in each layer do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer layers than shown, and each layer may include more or fewer components, which is not limited in the present application.

[0096] Figure 5 A schematic diagram of a camera control method provided in an embodiment of the present application Figure 1 The camera control method is applied to an electronic device, which includes a service manager, a system server, an initialization module, a middle-stage processing module and a camera service module. The service manager belongs to the system library layer of the electronic device; the system server belongs to the framework layer of the electronic device; the initialization module and the middle-stage processing module belong to the camera middle-stage module in the framework layer; and the camera service module belongs to the camera framework module in the framework layer. Figure 5 As shown, the camera control method includes: the following steps S501-S511.

[0097] Step S501: When the electronic device is started, the system server sends a first start-up instruction to the camera service module in the camera framework module.

[0098] The first startup instruction is used to instruct the camera service module to start.

[0099] In some examples, when the electronic device is powered on or restarted, the system server sends a first startup instruction to the camera service module in the camera framework module.

[0100] Step S502: The camera service module sends a camera service registration request to the system server in response to the first start instruction.

[0101] The camera service registration request is used to request registration of the camera service, and the camera service registration request includes the service name and service identifier of the camera service.

[0102] It should be noted that only after the camera service is successfully registered in the service manager, other applications can use the camera service provided by the camera framework module by obtaining the proxy object of the camera service. The camera service will run in the system server in a threaded manner.

[0103] Step S503: The system server forwards the camera service registration request to the service manager.

[0104] The system server and the service manager are two independent processes, and the communication between the two needs to be done through inter-process communication, which may be a communication method based on a binder mechanism.

[0105] In one possible implementation, the system server forwards the camera service registration request to the service manager, including: the system server obtains the proxy object corresponding to the service manager, and based on the proxy object corresponding to the service manager, sends the camera service registration request to the binder driver, so that the binder driver sends the camera service registration request to the service manager.

[0106] Step S504: The service manager generates camera service information in response to the camera service registration request.

[0107] The camera service information includes the camera service proxy object.

[0108] It should be noted that a proxy object is a design pattern that allows the creation of a proxy object to control access to another object, that is, the proxy object can provide additional functions or restrict access to the original object without changing the original object. In the embodiment of the present application, other applications can use the camera service through the camera service proxy object.

[0109] In a possible implementation, the service manager maintains a service list, which indicates a list of correspondences between services and proxy objects. After receiving the camera service registration request, the service manager generates a camera service proxy object, and associates the service identifier (and / or service name) of the camera service with the camera service proxy object and stores it in the service list, so as to provide other applications with access to the camera service in the future.

[0110] In a possible implementation, after step S504, the service manager returns a registration success response message to the system server through the binder driver, so that the system server determines that the camera service is successfully registered. The registration success response message includes at least one of the service name and service identifier of the camera service.

[0111] Step S505: When the electronic device is started, the system server sends a second startup instruction to the initialization module in the camera middle platform module.

[0112] Among them, the second startup instruction is used to instruct the initialization module in the camera middle platform module to start.

[0113] In some examples, when the electronic device is turned on or restarted, the system server sends a second startup instruction to the initialization module in the camera middle platform module.

[0114] In the method provided in the embodiment of the present application, the order of description of the steps does not constitute a limitation on the order of execution of the steps. For example, the above-mentioned step S501 and the above-mentioned step S505 can be executed simultaneously; or step S501 can be executed first, and then step S505; or step S505 can be executed first, and then step S501. No specific limitation is made in the embodiment of the present application.

[0115] Step S506: The initialization module performs an initialization operation on the middle station processing module in response to the second startup instruction.

[0116] In one possible implementation, the initialization module responds to the second startup instruction to perform an initialization operation on the middle station processing module, including: the initialization module responds to the second startup instruction to build the middle station processing module and pass preset information into the middle station processing module.

[0117] The preset information is global information about the current system operating environment of the application, such as context information. The functions of the preset information include but are not limited to: indicating application resources that the module can access, such as strings, layout files, etc.; indicating components that the module can start, such as starting activities, starting services, etc.; indicating system services that the module can access, such as location services, cameras, etc.

[0118] It should be noted that the middle station processing module is a newly constructed module in the embodiment of the present application, which is used to execute corresponding steps in subsequent embodiments.

[0119] Step S507: After initialization is completed, the middle platform processing module sends a camera service acquisition request to the system server.

[0120] The camera service acquisition request includes at least one of a service identifier and a service name of the camera service.

[0121] In the subsequent processing process, the middle platform processing module needs to interact with the camera framework module. Therefore, when the middle platform processing module is initialized, it needs to obtain a way to interact with the camera framework module. Since the camera middle platform module and the camera framework module are two independent processes, the middle platform processing module belonging to the camera middle platform module needs to obtain the camera service proxy object first before it can interact with the camera framework module through the camera service proxy object.

[0122] Step S508: The system server forwards the camera service acquisition request to the service manager.

[0123] In one possible implementation, the system server forwards the camera service acquisition request to the service manager, including: the system server obtains the proxy object corresponding to the service manager, and based on the proxy object corresponding to the service manager, sends the camera service acquisition request to the binder driver, so that the binder driver sends the camera service acquisition request to the service manager.

[0124] Step S509: The service manager sends a service acquisition response message to the system server.

[0125] The service acquisition response information includes at least one of a service name and a service identifier of the camera service, and a camera service proxy object.

[0126] In a possible implementation manner, the service manager sends the service acquisition response information to the system server, including: the service manager sends the service acquisition response information to the system server through a binder driver.

[0127] Step S510: The system server forwards the service acquisition response information to the middle station processing module.

[0128] In one possible implementation, after receiving the acquisition response information, the middle station processing module extracts and stores the camera service proxy object from the acquisition response information, so as to interact with each sub-module in the camera framework module through the camera service proxy object in the subsequent process.

[0129] Step S511: After initialization is completed, the middle station processing module monitors the satellite status information maintained in the system server.

[0130] The satellite status information is used to indicate the startup status of the satellite communication module, which includes an on state or an off state.

[0131] In one possible implementation, the satellite status information may exist in the form of a field. For example, when the field representing the satellite status information is a first value (such as true), it indicates that the satellite communication module is in an on state; when the field representing the satellite status information is a second value (such as false), it indicates that the satellite communication module is in a off state.

[0132] In a possible implementation, the middle station processing module monitors the satellite status information maintained in the system server, including: the middle station processing module registers a listener in the system server, wherein the listener is associated with the satellite status information. The listener may be a context listener, which is used to monitor changes in satellite status information. When the satellite communication status information changes, the listener is triggered to send a monitoring response message to the middle station processing module, and the monitoring response message includes the value of the satellite status information.

[0133] In the embodiment of the present application, after the electronic device is started, it executes the camera control method provided by the above steps S501-S511 to realize the registration of the camera service and the construction of the middle platform processing module, and after the middle platform processing module is constructed, the middle platform processing module monitors whether the satellite communication module is enabled. Among them, the middle platform processing module determines whether the satellite communication module is turned on by monitoring the satellite status information maintained in the system server, because the satellite status information will change when the satellite communication module is turned on or off.

[0134] Figure 6 A flowchart of a satellite status information change method provided in an embodiment of the present application. The satellite status information is applied to an electronic device, which includes a system server, a satellite communication application, a protocol stack, and a satellite communication module. The satellite communication application belongs to the application layer, the system server belongs to the framework layer, the protocol stack belongs to the kernel layer, and the satellite communication module belongs to the hardware layer of the electronic device. Figure 6 Take the example to explain the change of satellite status information. Figure 6 The method includes: step S601-step S614.

[0135] Step S601: The satellite communication application enters the application page in response to a user instruction.

[0136] In a possible implementation, a user clicks on an application icon of a satellite communication application, and the electronic device enters an application page of the satellite communication application in response to the user's click operation on the application icon.

[0137] Step S602: The satellite communication application launches a protocol stack in response to a satellite communication start instruction.

[0138] Among them, the satellite communication start instruction is used to instruct the establishment of satellite communication.

[0139] In one possible implementation, a user clicks on a control (a first operation on a first application) to initiate communication (such as making a call or sending a text message) on an application page of the satellite communication application, thereby sending a satellite communication start instruction to the satellite communication application to enable the satellite communication application to establish satellite communication.

[0140] In a possible implementation, the satellite communication application starts the protocol stack by sending a protocol stack startup instruction to the protocol stack.

[0141] Step S603: The protocol stack is started and a power-on command is sent to the satellite communication module.

[0142] The power-on instruction is used to instruct the satellite communication module to power on. The satellite communication module is a hardware module, such as a radio frequency module used for satellite communication.

[0143] Step S603: The protocol stack establishes a socket connection with the satellite communication application.

[0144] Among them, the socket connection is used for data transmission during satellite communication.

[0145] Step S604: The satellite communication application sends satellite communication activation status information to the system server.

[0146] Among them, the satellite communication on state is used to indicate that the satellite communication module is currently in an enabled state.

[0147] In a possible implementation, the satellite communication application sends satellite communication start status information to the system server in response to the socket connection establishment notification reported by the protocol stack. The socket connection establishment notification is used to indicate that the socket connection between the protocol stack and the satellite communication application is established.

[0148] Step S605: The system server sets the field representing the satellite status information to a first value in response to the satellite communication start status information.

[0149] Step S606: The satellite communication application sends a network search instruction to the protocol stack.

[0150] Among them, the network search instruction is used to instruct the protocol stack to search for network services that provide satellite communications.

[0151] Step S607: The protocol stack responds to the network search instruction and controls the satellite communication module to search the network and register.

[0152] In one possible implementation, the protocol stack searches for a network through a satellite communication module, and after searching for an available satellite network, registers in the available satellite network. After registration, the satellite communication service provided by the available satellite network can be used to carry out satellite communication business processes.

[0153] Step S608: The satellite communication application sends a communication closing request to the protocol stack in response to the satellite communication end instruction.

[0154] The satellite communication end instruction is used to instruct the user to hang up the satellite communication. The communication close request is used to request the protocol stack to end the satellite communication.

[0155] In a possible implementation, the user sends a satellite communication end instruction to the satellite communication application by clicking a control for hanging up the communication (a second operation on the first application) on the satellite communication page.

[0156] Step S609: The protocol stack controls the satellite communication module to disconnect from the network in response to the communication closing request.

[0157] Among them, the network disconnection indication is the operation of the satellite communication module disconnecting from the connected available satellite network.

[0158] Step S610: The protocol stack clears the state machine.

[0159] The state machine stores cache data generated during this satellite communication process.

[0160] Step S611: The protocol stack sends a power-off instruction to the satellite communication module.

[0161] The power-off instruction is used to instruct the satellite communication module to power off. The satellite communication module is a hardware module, such as a radio frequency module used for satellite communication.

[0162] Step S612: The protocol stack disconnects the socket connection with the satellite communication application.

[0163] Step S613: The satellite communication application sends satellite communication shutdown status information to the system server.

[0164] In a possible implementation, the satellite communication application sends satellite communication start-up status information to the system server in response to the socket connection disconnection notification reported by the protocol stack. The socket connection disconnection notification is used to indicate that the socket connection between the protocol stack and the satellite communication application has been disconnected.

[0165] Step S614: The system server sets the field representing the satellite status information to a second value in response to the satellite communication shutdown status information.

[0166] In the embodiment of the present application, when the satellite communication module is started and shut down, the satellite status information in the system server will change. For example, when the field representing the satellite status information is set to the first value, it means that the satellite communication module is turned on; when the field representing the satellite status information is set to the second value, it means that the satellite communication module is turned off. The middle station processing module can monitor the satellite status information maintained in the system server to determine whether the satellite communication module is turned on.

[0167] It should be noted that when the satellite communication module in the electronic device is turned on, if the camera module is also running in the electronic device, the two may cause hardware conflicts, resulting in abnormal camera preview page and reduced satellite communication quality. Therefore, the electronic device needs to control the use process of the camera service according to the use status of the satellite communication module. For detailed description, please refer to the camera control method provided in the following embodiment.

[0168] Figure 7 A schematic diagram of a camera control method provided in an embodiment of the present application Figure 2 .

[0169] Figure 8 A schematic diagram of a camera control method provided in an embodiment of the present application Figure 3 .

[0170] Figure 7 and Figure 8 The camera control methods shown are all applied to electronic devices, which include a first application, a second application, a system server, a middle platform processing module, a camera service module, a scene judgment module, a conflict resolution module, a camera disconnection module, and a camera hardware abstraction module (camera HAL). Among them, the first application and the second application belong to the application layer of the electronic device; the system server belongs to the framework layer of the electronic device, the middle platform processing module belongs to the camera middle platform module in the framework layer, the camera service module, the scene judgment module, the conflict resolution module, and the camera disconnection module belong to the camera framework module in the framework layer; the camera HAL belongs to the hardware abstraction layer of the electronic device.

[0171] like Figure 7 The camera control method shown includes: the following steps S701-S706.

[0172] Step S701: The first application sends status change information to the system server.

[0173] The state change information is used to indicate that the usage state of the hardware module corresponding to the first application in the electronic device has changed. The state change information includes current state information, such as an on state or a off state.

[0174] In a possible implementation, the first application is indicated as a satellite communication application, and the hardware module corresponding to the first application is a satellite communication module.

[0175] Step S702: The system server modifies the state information corresponding to the first application based on the state change information.

[0176] In a possible implementation manner, when the first application indication is a satellite communication application, the system server modifies the state information corresponding to the satellite communication application based on the state change information.

[0177] For example, when the current state information included in the state change information indicates an on state, the system server modifies the field representing the satellite state information to a first value. When the current state information included in the state change information indicates an off state, the system server modifies the field representing the satellite state information to a second value.

[0178] It should be noted that, according to the detailed description of step S511 in the above embodiment, the middle station processing module will register a listener in the system server to monitor the satellite status information maintained by the system server. Therefore, when the satellite status information changes, the listener will return a response message to the middle station processing module.

[0179] Step S703: The middle platform processing module receives the status change response message returned by the listener in the system server.

[0180] The state change response message is used to indicate that the state information corresponding to the first application has changed.

[0181] The state change response message includes a target state value, which is used to represent the changed state value. Taking the first application as a satellite communication application as an example, after the satellite state information changes, the middle station processing module receives a state change response message. In the state change response message, if the target state value is a first value, it means that the satellite communication module corresponding to the satellite communication application is turned on; if the target state value is a second value, it means that the satellite communication module corresponding to the satellite communication application is turned off.

[0182] Step S704: The middle platform processing module sends scene information to the scene judgment module based on the state change response message.

[0183] The scenario information includes a scenario identifier and a target state value. The scenario identifier is used to indicate the scenario in which the state information change occurs. The scenario identifier is also the business scenario identifier corresponding to the first application. In the embodiment of the present application, the middle station processing module pre-stores scenario identifiers corresponding to each application program, such as a satellite communication scenario identifier corresponding to a satellite communication application, a payment scenario identifier corresponding to an online banking application, and an audio and video scenario identifier corresponding to an audio and video application.

[0184] It should be noted that when some hardware modules in the electronic device (such as the satellite communication module in the aforementioned embodiment) and the camera module are running at the same time, the two may interfere with each other. Therefore, after the middle station processing module receives the state change response message, it is necessary to pass the corresponding parameters to the camera framework module so that the camera framework module can determine whether there will be a conflict in the subsequent process.

[0185] In a possible implementation, the scenario identifier is a satellite communication scenario identifier. When the first application is a satellite communication application, after the satellite state information changes, the middle station processing module receives a state change response message, extracts a target state value from the state change response message, and sends the target state value and a satellite communication scenario identifier corresponding to the satellite communication application as scenario information to the scenario judgment module.

[0186] In one possible implementation, the middle station processing module sends scene information to the scene judgment module based on the state change response message, including: the middle station processing module sends scene information to the scene judgment module based on the state change response message and the pre-acquired camera service proxy object.

[0187] It should be noted that the camera mid-stage module and the camera framework module are two independent processes. The mid-stage processing module belonging to the camera mid-stage module needs to obtain the camera service proxy object first before it can interact with the camera framework module through the camera service proxy object. The acquisition process of the camera service object refers to the aforementioned steps S507-S510, which will not be repeated here.

[0188] In a possible implementation, before the middle station processing module sends the scene information to the scene judgment module based on the state change response message (the above step S704), the camera control method also includes: reading the product configuration parameters; if the product configuration parameters cannot be read, executing the above step S704; if the product configuration parameters are read, ending the execution process of the camera control method.

[0189] Among them, the product configuration parameters are used to characterize the parameters that will not cause conflicts when the satellite communication module and the camera module in the electronic device run at the same time. The product configuration parameters are cloud-pushed configuration parameters and are flexibly configured by the electronic device manufacturer. The product configuration parameters are not configured by default, but as long as they are configured, it means that the satellite communication module and the camera module in the electronic device will not cause conflicts when they run at the same time. After the product configuration parameters are configured in the cloud, the electronic device can synchronize the product configuration parameters to local storage.

[0190] It should be noted that in some types of electronic devices, the isolation between the satellite communication module and the camera module is high. When the satellite communication module and the camera module are running at the same time, there may be no conflict between the two, that is, this type of electronic device may not need to perform conflict resolution processing. However, the cost of configuring a system program separately for this type of electronic device is high. Therefore, the product configuration parameters are provided in the embodiment of the present application, so that even if the camera control method provided by the present application is configured in this type of electronic device, after reading the product configuration parameters, it will not pass the parameters to the camera framework module, and then will not perform subsequent conflict resolution processing, saving system resources, and improving the scope of application of the camera control method provided by the embodiment of the present application.

[0191] Step S705: The scene determination module determines whether to perform camera conflict processing based on the scene information.

[0192] The scene information includes a scene identifier and a target state value.

[0193] In one possible implementation, the scene judgment module determines whether to perform camera conflict processing based on scene information, including: when the scene identifier indicates a preset identifier (such as a satellite communication scene identifier) ​​and the target state value indicates a first value, determining to perform camera conflict processing; when the scene identifier indicates a preset identifier (such as a satellite communication scene identifier) ​​and the target state value indicates a first value, determining not to perform camera conflict processing. Alternatively, when the scene identifier indicates a non-preset identifier, determining not to perform camera conflict processing. It should be noted that in the scene corresponding to the non-preset identifier, the camera module will not conflict with the hardware module.

[0194] Step S706: When the scene determination module determines that camera conflict processing is not required, the camera conflict enabling parameter is set to a third value.

[0195] Among them, the camera conflict enable parameter is used to characterize whether the hardware module that conflicts with the camera module is running. The camera conflict enable parameter is a global parameter, and all modules in the electronic device can obtain the value of the camera conflict enable parameter, and the camera conflict enable parameter is indicated as a third value or a fourth value. When the camera conflict enable parameter is the third value, it means that the hardware module that will conflict with the camera module is in an off state; when the camera conflict enable parameter is the fourth value, it means that the hardware module that will conflict with the camera module is in an on state.

[0196] In one example, the third value may be 0, or false, or other values, which are not limited in the embodiments of the present application. Similarly, the fourth value may be 1, or true, or other values, which are not limited in the embodiments of the present application.

[0197] In a possible implementation, the camera conflict enabling parameter defaults to the third value. In the case where the camera conflict enabling parameter has not been changed, in the embodiment of the present application, the above step S706 may not be performed.

[0198] When the scene judgment module determines that camera conflict processing is required, the subsequent process can be seen in Figure 8 The camera control method shown includes: the following steps S707-S715.

[0199] Step S707: When the scene determination module determines that camera conflict processing is required, the scene determination module sends a conflict resolution instruction to the conflict resolution module.

[0200] The conflict resolution instruction is used to instruct the conflict processing module to perform conflict processing.

[0201] Step S708: The conflict resolution module sets the camera conflict enabling parameter to a fourth value in response to the conflict resolution instruction.

[0202] When the camera conflict enabling parameter is the fourth value, it indicates that the hardware module that may conflict with the camera module is in an enabled state.

[0203] It should be noted that the camera conflict enabling parameter is a global parameter, and any module in the electronic device can determine whether the hardware module that conflicts with the camera module is currently running by obtaining the value of the camera conflict enabling parameter.

[0204] Step S709: The conflict resolution module sends a service lock acquisition request to the camera service module.

[0205] The service lock acquisition request is used to instruct the camera service module to lock the conflict resolution module. It should be noted that only the module that has successfully locked can access the camera service, and other modules need to wait for unlocking before accessing the camera service.

[0206] Step S710: The camera service module returns a service lock acquisition response to the conflict resolution module.

[0207] The service lock acquisition response is used to indicate that the conflict resolution module has successfully locked the lock.

[0208] In the embodiment of the present application, after the conflict resolution module is locked, other modules outside the conflict resolution module cannot access the camera service, which can effectively prevent the application currently connected to the camera module from continuing to access the camera service. Among them, the application connected to the camera module accesses the camera service, such as the lock screen application using face recognition.

[0209] In a possible implementation, after the conflict resolution module sends a service lock acquisition request to the camera service module, the conditional lock function is called to set an acquisition duration; if no service lock acquisition response is received within the acquisition duration, a timeout response message is generated.

[0210] The acquisition time is used to indicate the maximum waiting time for the conflict resolution module to acquire the service lock. For example, the acquisition time can be set to 3 seconds or 4 seconds, which is not specifically limited in the embodiment of the present application. The timeout response information is used to indicate that the time for acquiring the service lock has timed out.

[0211] It should be noted that if the acquisition time is not set, the conflict resolution module will continue to execute the acquisition procedure if it fails to obtain the service lock provided by the camera service module, that is, it will continue to send a service lock acquisition request to the camera service module, which may cause a resource preemption deadlock in the electronic device, and then cause the electronic device to not respond and the system program to crash. Therefore, in the above implementation, the acquisition time is set, and if the service lock acquisition response is not received after the acquisition time, an abnormal response message is generated to prevent the conflict resolution module from continuing to execute the acquisition procedure.

[0212] Step S711: The conflict resolution module obtains camera service usage information from the camera service module.

[0213] The camera service usage information is used to indicate information about an application that has established a connection relationship with the camera hardware. The camera service usage information includes but is not limited to an application identifier and an application access method of the application.

[0214] In a possible implementation, the camera service usage information is stored in a container class of the camera service module. The conflict resolution module obtains the camera service usage information from the camera service module, including: the conflict resolution module traverses the container class storing the camera service usage information in the camera service module, and when the container class is not empty, obtains the camera service usage information from the container class, where the camera service usage information includes an application identifier and an application access method of the second application.

[0215] Step S712: The conflict resolution module sends abnormal reminder information to the second application based on the camera service usage information.

[0216] The second application indicates an application that has established a connection relationship with the camera hardware, such as a camera application, an application with a video call function, an application with a face recognition function, etc. The abnormal reminder information is used to indicate that the camera service is currently unavailable.

[0217] In a possible implementation, the camera service usage information includes an application identifier and an application access method of the second application, and the application access method may be a strong pointer to the second application. The conflict resolution module sends abnormal reminder information to the second application based on the camera service usage information, including: the conflict resolution module calls an error notification function based on the application access method of the second application, and sends abnormal reminder information to the second application. The error notification function may be a NotifyError function, etc.

[0218] Step S713: The conflict resolution module sends a camera service disconnection request to the camera disconnection module based on the camera service usage information.

[0219] The camera service disconnection request includes the application program identifier of the second application. The camera service disconnection request is used to request the camera disconnection module to interact with the camera bottom layer module to disconnect the connection between the second application and the camera hardware.

[0220] Step S714: The camera disconnection module sends a hardware disconnection instruction to the camera HAL based on the camera service disconnection request.

[0221] The hardware disconnection instruction is used to instruct the camera HAL to disconnect the connection between the second application and the camera hardware.

[0222] In a possible implementation, when there are multiple second applications, the conflict resolution module may send a hardware disconnect instruction to the camera HAL once for each second application, where the hardware disconnect instruction includes an application program identifier of the second application.

[0223] Step S715: The camera HAL disconnects the second application from the camera hardware in response to the hardware disconnect instruction.

[0224] In the embodiment of the present application, after the connection between the second application and the camera hardware is disconnected, the second application cannot directly call the camera service when using the camera service again, but needs to request to start the camera from the camera service module again, and can call the camera service only after re-establishing the connection with the camera hardware. When the second application requests to start the camera from the camera service module, if the satellite communication is still in progress, the second application can be denied to start the camera, thereby avoiding the conflict between the satellite communication module and the camera module.

[0225] In the camera control method provided by the embodiment of the present application, when satellite communication is turned on, the middle platform processing module will transmit scene information to the scene judgment module. When the scene judgment module determines that conflict processing is required based on the scene information, the conflict processing module obtains the service lock of the camera service to prevent the second application (an application that has a connection relationship with the camera hardware) from calling the camera service, and the camera disconnection module disconnects the connection relationship between the second application and the camera hardware, further preventing the second application from calling the camera service, which can effectively avoid conflicts between the satellite communication module and the camera module and ensure the communication quality of the satellite communication. In addition, disconnecting the connection between the second application and the camera hardware can also reduce the power consumption of the device during satellite communication.

[0226] In the camera control method provided in the above embodiment of the present application, the second application is an application that has established a connection relationship with the camera hardware before the satellite communication is turned on. After the satellite communication is turned on, the above method can effectively prevent the second application from calling the camera service, thereby avoiding conflicts between the satellite communication module and the camera module. As for the third application that requests to connect to the camera after the satellite communication is turned on, the embodiment of the present application provides the following camera control method to avoid the situation where the satellite communication module and the camera module are running at the same time.

[0227] Fig. 9 A schematic diagram of a camera control method provided in an embodiment of the present application Figure 4 The camera control method is applied to an electronic device, which includes a third application, a camera service module and a camera HAL. The third application belongs to the application layer of the electronic device; the camera service module belongs to the camera framework module in the framework layer; and the camera HAL belongs to the hardware abstraction layer of the electronic device. Fig. 9 As shown, the camera control method includes: step S901-step S907.

[0228] Step S901: The third application sends a camera start request to the camera service module.

[0229] The camera start request is used to request the use of the camera service. The camera service request includes an application program identifier of the third application.

[0230] In a possible implementation, the user clicks on a photo-taking component (a third operation on the third application) on an application page of the third application, causing the third application to send a camera start request to the camera service module.

[0231] In another possible implementation, the user clicks on the recognition component (a third operation on the third application) in the application page of the third application, so that the third application sends a camera start request to the camera service module. The recognition component can be used to initiate face recognition, image recognition, or object recognition, etc.

[0232] In another possible implementation, the user may perform a specified action (a third operation on a third application) on the electronic device to trigger the third application in the electronic device to send a camera start request to the camera service module. The instruction action is, for example, placing a hand above the electronic device or placing a face within the shooting range of the front camera of the electronic device to unlock the electronic device.

[0233] Step S902: The camera service module determines a parameter value of a camera conflict enabling parameter in response to a camera startup request.

[0234] The camera conflict enabling parameter is used to indicate whether the hardware module that conflicts with the camera module is running. The parameter value change scenario of the camera conflict enabling parameter can refer to the detailed description corresponding to step S706 and the detailed description corresponding to step S708 in the above embodiment, which will not be repeated here.

[0235] Step S903: When the camera conflict enabling parameter is a third value, the camera service module stores the camera service usage information corresponding to the third application.

[0236] Wherein, when the camera conflict enabling parameter is the third value, it indicates that the hardware module that will conflict with the camera module is in a closed state (see the detailed description corresponding to the aforementioned step S706), so the third application can use the camera service normally. The camera service module stores the camera service usage information corresponding to the third application in the container class, and the camera service usage information includes but is not limited to the application identifier and the application access method.

[0237] It should be noted that there is a container class in the camera service module for storing camera service usage information. The camera service usage information is used to indicate information of applications that have established a connection relationship with the camera hardware, so as to facilitate the management of applications that use the camera service.

[0238] Step S904: The camera service module sends a connection establishment instruction to the camera hardware abstraction module.

[0239] The connection establishment instruction is used to instruct to establish a connection relationship between the third application and the camera hardware. The connection establishment instruction at least includes an application program identifier of the third application.

[0240] Step S905: The camera hardware abstraction module establishes a connection relationship between the third application and the camera hardware in response to the connection establishment request.

[0241] Among them, after establishing a connection relationship with the camera hardware, the third application can call the camera service to perform corresponding operations, such as calling the camera service to make a video call, or calling the camera service to perform face recognition, etc.

[0242] Step S906: When the camera conflict enabling parameter is the fourth value, the camera service module returns a camera service unavailable reminder to the third application.

[0243] Wherein, when the camera conflict enabling parameter is the fourth value, it indicates that the hardware module that will conflict with the camera module is currently in the enabled state (see the detailed description of step S708). If the third application uses the camera service at this time, it will cause the hardware module (such as the satellite communication module) to conflict with the camera module. Therefore, in order to avoid the conflict between the hardware module and the camera module, the camera service module returns a reminder that the camera service is unavailable to the third application.

[0244] Step S907: The third application displays a reminder that the camera service is unavailable.

[0245] In the camera control method provided in the embodiment of the present application, when a third application requests to enable the camera, the camera service module determines whether the hardware module that conflicts with the camera module is running. If the hardware module is not running, the third application can use the camera service normally. If the hardware module is running, the third application cannot use the camera service temporarily to avoid conflicts between the hardware module and the camera module, thereby avoiding abnormalities in the business corresponding to the hardware module and avoiding abnormalities in the camera preview page, thereby ensuring that the business corresponding to the hardware module proceeds smoothly.

[0246] Fig.10 A schematic diagram of another application scenario provided by an embodiment of the present application. In a possible implementation, when an electronic device is performing satellite communication, a user opens a camera application, such as Fig.10 As shown, the electronic device displays the fourth display interface 104 , and the fourth display interface 104 includes a camera service currently unavailable reminder interface 1041 .

[0247] It should be noted that through Figure 5 , Figure 7 , Figure 8 and Fig. 9 The provided camera control method, the embodiment of the present application can solve hardware conflicts from the software layer and reduce the hardware solution cost; it can also flexibly configure products with hardware conflicts through cloud push configuration items; it can also disconnect the front and back applications from the camera hardware so that no camera device is powered on, ensuring that the interference to satellite communication is minimized, and at the same time, it can also reduce the power consumption of the device during satellite communication. It should also be noted that in addition to being applied to scenarios where there is a conflict between the satellite communication module and the camera module, the embodiment of the present application can also be applied to scenarios where there is a conflict between other hardware modules and the camera module.

[0248] It is understandable that, in order to realize the above functions, the electronic device includes hardware and / or software modules corresponding to the execution of each function. In combination with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to be beyond the scope of the present application.

[0249] The steps performed by the electronic device in the method provided in the above embodiment of the present application may also be performed by a chip system included in the electronic device, wherein the chip system may include a processor and a Bluetooth chip. The chip system may be coupled to a memory so that when the chip system is running, the computer program stored in the memory is called to implement the steps performed by the above electronic device. The processor in the chip system may be an application processor or a processor other than an application processor.

[0250] This embodiment further provides a computer-readable medium, in which computer instructions are stored. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the method in the above-mentioned embodiment.

[0251] This embodiment also provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the above-mentioned related steps to implement the method in the above-mentioned embodiment.

[0252] In addition, an embodiment of the present application also provides a device, which may specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor may execute the computer-executable instructions stored in the memory so that the chip executes the methods in the above-mentioned method embodiments.

[0253] Among them, the electronic device, computer-readable medium, computer program product or chip provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here.

[0254] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0255] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0256] The unit described as a separate component may or may not be physically separated, and the component displayed as a unit may be a physical unit or multiple physical units, that is, it may be located in one place, or it may be distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, each functional unit in each embodiment of the present application may be integrated in a processing unit, or each unit may exist physically separately, or two or more units may be integrated in one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0257] Any content of each embodiment of the present application, as well as any content of the same embodiment, can be freely combined. Any combination of the above contents is within the scope of the present application. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the methods of each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (read only memory, ROM), random access memory (random access memory, RAM), disk or optical disk and other media that can store program code.

[0258] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A camera control method, characterized in that: Applied to electronic equipment, the method comprises: In response to a first operation performed by a user on a first application, a camera conflict enabling parameter is set to a fourth value to indicate that a hardware module that will conflict with the camera hardware when running simultaneously is in an operation-on state; the first application indication is an application program having a satellite communication initiation function; the first operation indication is an operation of enabling the hardware module corresponding to the first application; the camera conflict enabling parameter is a parameter indicating whether the hardware module that will conflict with the camera hardware when running simultaneously is running; When the camera service usage information is obtained, the connection relationship between the second application and the camera hardware is disconnected based on the camera service usage information; the camera service usage information is used to indicate the second application that has a connection relationship with the camera hardware.

2. The method according to claim 1, characterized in that The method further comprises: In response to a third operation performed by the user on the third application, obtaining a camera conflict enabling parameter; the third operation indication is an operation of enabling a camera service; When the camera conflict enabling parameter is a fourth value, a camera service unavailable reminder is returned to the third application.

3. The method according to claim 2, characterized in that After obtaining the camera conflict enabling parameter in response to the third operation performed by the user on the third application, the method further includes: When the camera conflict enabling parameter is a third value, storing camera service usage information corresponding to the third application; A connection relationship between the third application and the camera hardware is established.

4. The method according to claim 1, characterized in that: After setting the camera conflict enabling parameter to a fourth value in response to a first operation performed by the user on the first application, the method further includes: When the user performs a first operation on the first application, the camera middle station module obtains a state change response message corresponding to the first application; the target state value in the state change response message indicates a first value; The camera middle platform module sends scene information to the camera framework module based on the state change response message; the scene information includes the business scene identifier corresponding to the first application and the target state value; The camera framework module obtains the camera service usage information when it is determined that the business scenario identifier is a preset identifier and the target state value indication is a first value.

5. The method according to claim 4, characterized in that Before disconnecting the connection between the second application and the camera hardware based on the camera service usage information, the method further includes: The camera framework module obtains a service lock corresponding to the camera service.

6. The method according to claim 4, characterized in that Before setting the camera conflict enabling parameter to a fourth value in response to the first operation performed by the user on the first application, the method further includes: The camera middle platform module registers a listener in the system server; the listener is used to monitor the status information corresponding to the first application.

7. The method according to claim 6, characterized in that When the user performs the first operation on the first application, the camera middle platform module obtains a state change response message corresponding to the first application, including: When the user performs a first operation on the first application, the system server changes the state information corresponding to the first application; In response to a change in the status information corresponding to the first application, the listener sends the change response information to the camera middle platform module.

8. The method according to claim 7, characterized in that When the user performs the first operation on the first application, the system server changes the state information corresponding to the first application, including: When the user performs a first operation on the first application, the first application sends opening status information to the system server; In response to the start status information, the system server sets the target status value in the status information corresponding to the first application to a first value.

9. The method according to claim 4, characterized in that The method further comprises: When the user performs a second operation on the first application, the camera middle platform module obtains a state change response message corresponding to the first application; the target state value in the state change response message indicates a second value; and the second operation indicates an operation of shutting down a hardware module corresponding to the first application; The camera middle platform module sends scene information to the camera framework module based on the state change response message; the scene information includes the business scene identifier corresponding to the first application and the target state value; The camera framework module sets the camera conflict enabling parameter to a third value when determining that the business scenario identifier is a preset identifier and the target state value indication is a second value.

10. An electronic device, characterized in that: The electronic device comprises: one or more processors; Memory; and a computer program, wherein the computer program is stored in the memory, and when the computer program is executed by the one or more processors, the electronic device executes the camera control method according to any one of claims 1 to 9.

11. A computer storage medium, characterized in that: The method comprises computer instructions, which, when executed on an electronic device, enable the electronic device to execute the camera control method as claimed in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Satellite communication method

    CN111049564A

  • Beidou anti-interference satellite navigation equipment detection system

    CN114543875A