Camera control method and electronic equipment

By setting camera conflict enable parameters in electronic devices and disconnecting the camera hardware, the abnormal problems caused by the simultaneously running of satellite communication applications and camera modules are solved, and more stable satellite communications and camera applications are achieved.

CN120238730APending Publication Date: 2025-07-01HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510088000.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-29
Publication Date
2025-07-01

AI Technical Summary

Technical Problem

In electronic devices that support satellite communications, when the satellite communication application and the camera module are running at the same time, it will cause abnormalities in the camera preview page, such as flower screen, black screen, frozen screen, and lag, which will also reduce the communication quality of satellite communications.

Method used

Provide a camera control method, which sets the camera conflict enable parameter to a specific value in response to user operations, disconnects the connection relationship with the camera hardware, prevents the application from calling the camera service, and prevents the camera hardware and the satellite communication module from running simultaneously.

Benefits of technology

It effectively avoids abnormal phenomena in the camera preview page, improves the communication quality of satellite communication, and ensures the smooth progress of satellite communication services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120238730A_ABST
    Figure CN120238730A_ABST
Patent Text Reader

Abstract

The invention provides a camera control method and electronic equipment. The method comprises the following steps: in response to a first operation performed on a first application by a user, setting a camera conflict enabling parameter as a fourth value; wherein the first application instruction is an application program with a satellite communication initiating function; the first operation instruction is an operation of starting a hardware module corresponding to the first application; when the camera service use information is obtained, the connection relation between the second application and the camera hardware is disconnected based on the camera service use information, the second application can be effectively prevented from calling the camera service, simultaneous operation of a hardware module corresponding to the first application and the camera hardware is avoided, and smooth operation of a service corresponding to the first application is ensured. The camera service use information is used for indicating a second application having a connection relationship with the camera hardware.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application. The application number of the original application is: 202311866250.9, the application date is: December 29, 2023, and the invention title is "Camera Control Method and Electronic Device". The entire content of the original application is incorporated herein by reference. Technical Field

[0002] This application relates to the terminal field, and in particular, to a camera control method and an electronic device. Background Art

[0003] In many current electronic devices supporting satellite communication, when the satellite communication application and the camera module operate simultaneously, the analog-to-digital conversion circuit in the camera module will be interfered by the radio frequency signals generated by satellite communication, resulting in abnormalities in the preview page of the camera application. For example, the preview page may show phenomena such as color distortion, black screen, frozen screen, and lag. Moreover, the radio frequency signals of satellite communication will also be affected by the electromagnetic interference of the camera module, resulting in a decline in the communication quality of satellite communication. Summary of the Invention

[0004] To solve the above technical problems, this application provides a camera control method and an electronic device, which can avoid the simultaneous operation of the satellite communication module and the camera hardware and ensure the smooth progress of satellite communication services.

[0005] In a first aspect, this application provides a camera control method, which includes: in response to a first operation performed by a user on a first application, setting a camera conflict enable parameter to a fourth value; where the first application is an application program with the function of initiating satellite communication; the first operation is an operation to turn on the hardware module corresponding to the first application; when obtaining camera service usage information, based on the camera service usage information, disconnecting the connection relationship between a 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.

[0006] In the embodiments of this application, there will be a conflict when the hardware module corresponding to the first application and the camera hardware operate simultaneously. When the hardware module corresponding to the first application is turned on, the electronic device determines the second application having 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 simultaneous operation of the hardware module corresponding to the first application and the camera hardware, and ensure the smooth progress of the service corresponding to the first application. For example, when the first application is a satellite communication application, the above camera control method can avoid the decline in satellite communication quality caused by the conflict between the satellite communication module and the camera module.

[0007] According to the first aspect, the camera control method further 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 is an operation indicating enabling the camera service; in the case where the camera conflict enabling parameter is a fourth value, returning a reminder that the camera service is unavailable to the third application.

[0008] In the embodiment of the present application, in the case where the camera conflict enabling parameter is a 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, it will cause a conflict between the satellite communication module and the camera module, 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.

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

[0010] In the embodiment of the present application, in the case where the camera conflict enabling parameter is a third value, it indicates that the hardware module that will conflict with the camera module is in an off state. Therefore, 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 programs using the camera service.

[0011] According to the first aspect, or any one of the above implementations of the first aspect, after setting the camera conflict enabling parameter to a fourth value in response to a first operation performed by the user on a first application, the method further includes: in the case where the user performs a first operation on the first application, the camera middle platform module obtains a status change response message corresponding to the first application; the target status value in the status change response message is indicated as a first value; the camera middle platform module sends scene information to the camera framework module based on the status change response message; the scene information includes the service scene identifier corresponding to the first application and the target status value; the camera framework module obtains the camera service usage information in the case where it determines that the service scene identifier is a preset identifier and the target status value is indicated as a first value.

[0012] In the 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, which is convenient for disconnecting the connection relationship between the second application and the camera hardware after obtaining the camera service usage information subsequently.

[0013] According to the first aspect, or any implementation of the above first aspect, 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.

[0014] In the embodiment of the present application, after the camera framework module obtains the service lock corresponding to the camera service, even if the second application has an established connection with the camera hardware currently, it cannot call the camera service and needs to wait for unlocking. This can prevent the second application from calling the camera service before disconnecting the connection between the second application and the camera hardware, and can avoid the simultaneous operation of the hardware module corresponding to the first application and the camera hardware, ensuring the smooth progress of the service corresponding to the first application.

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

[0016] In the embodiment of the present application, the camera middleware module registering a listener in the system server can monitor the status information corresponding to the first application in real time and timely avoid the conflict between the hardware module corresponding to the first application and the camera hardware.

[0017] According to the first aspect, or any implementation of the above first aspect, when the user performs a first operation on the first application, the camera middleware module obtains a status 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 status information corresponding to the first application; the listener sends a change response message to the camera middleware module in response to the change in the status information corresponding to the first application.

[0018] In the embodiment of the present application, the system server maintains the status information corresponding to the first application. The listener can monitor the status information corresponding to the first application in real time and, when the status information changes, notify the camera middleware module in a timely manner, enabling the electronic device to timely avoid the conflict between the hardware module corresponding to the first application and the camera hardware.

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

[0020] In an embodiment of the present application, the system server maintains the status information corresponding to the first application, and when the hardware module corresponding to the first application is turned on, the status information corresponding to the first application is updated in real time, so that the camera middle platform module can timely learn that the status information corresponding to the first application has changed, thereby timely avoiding conflicts between the hardware module corresponding to the first application and the camera hardware.

[0021] According to the first aspect, or any implementation manner of the above first aspect, the method further includes: when the user performs a second operation on the first application, the camera middle platform module obtains a status change response message corresponding to the first application; the second operation instruction is an operation to turn off the hardware module corresponding to the first application; the target status value in the status change response message is indicated as a second value; the camera middle platform module sends scene information to the camera framework module based on the status change response message; the scene information includes the service scene identifier corresponding to the first application and the target status value; when the camera framework module determines that the service scene identifier is a preset identifier and the target status value is indicated as the second value, the camera conflict enabling parameter is set to a third value.

[0022] In an embodiment of the present application, when the hardware module corresponding to the first application is turned off, the camera middle platform module learns through the status 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 so that the camera framework module sets the camera conflict enabling parameter to a third value, facilitating other modules in the electronic device to determine through the third value that the hardware module conflicting with the camera module is in the off state, thereby ensuring that the camera service can be normally used when the hardware module corresponding to the first application is turned off.

[0023] In a second aspect, the present application provides an electronic device, which includes: one or more processors; a memory; and a computer program, where the computer program is stored in the memory, and when the computer program is executed by the one or more processors, it enables the electronic device to execute the instructions of the method in the first aspect or any possible implementation manner of the first aspect.

[0024] The second aspect and any implementation manner of the second aspect respectively correspond to the first aspect and any implementation manner of the first aspect. The technical effects corresponding to the second aspect and any implementation manner of the second aspect can be referred to the technical effects corresponding to the first aspect and any implementation manner of the first aspect, which will not be elaborated here.

[0025] In a third aspect, the present application provides a computer storage medium, including computer instructions, and when the computer instructions run on an electronic device, it enables the electronic device to execute the instructions of the method in the first aspect or any possible implementation manner of the first aspect.

[0026] The third aspect and any implementation manner of the third aspect respectively correspond to the first aspect and any implementation manner of the first aspect. For the technical effects corresponding to the third aspect and any implementation manner of the third aspect, reference may be made to the technical effects corresponding to the first aspect and any implementation manner of the first aspect above, which will not be elaborated herein. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 FIG. is a schematic diagram of an application scenario provided by an embodiment of the present application;

[0028] Figure 2 FIG. is a schematic diagram of an application scenario provided by an embodiment of the present application;

[0029] Figure 3 FIG. is a schematic structural diagram of an electronic device provided by an embodiment of the present application;

[0030] Figure 4 FIG. is a software structure block diagram of the electronic device provided by an embodiment of the present application;

[0031] Figure 5 FIG. is a flowchart of a camera control method provided by an embodiment of the present application Figure 1 ;

[0032] Figure 6 FIG. is a flowchart of a method for changing satellite status information provided by an embodiment of the present application;

[0033] Figure 7 FIG. is a flowchart of a camera control method provided by an embodiment of the present application Figure 2 ;

[0034] Figure 8 FIG. is a flowchart of a camera control method provided by an embodiment of the present application Figure 3 ;

[0035] Figure 9 FIG. is a flowchart of a camera control method provided by an embodiment of the present application Figure 4 ;

[0036] Figure 10 FIG. is another schematic diagram of an application scenario provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0037] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.

[0038] In this text, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.

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

[0040] In the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of words such as "exemplary" or "for example" is intended to present relevant concepts in a specific manner.

[0041] In the description of the embodiments of this application, unless otherwise specified, the meaning of "a plurality of" refers to two or more. For example, a plurality of processing units refers to two or more processing units; a plurality of systems refers to two or more systems.

[0042] Figure 1 and Figure 2 are both schematic diagrams of application scenarios provided by the embodiments of this application. Before introducing the embodiments of this application, first, based on Figure 1 and Figure 2 an exemplary description of the application scenario of the embodiments of this application is given.

[0043] Take a mobile phone as an example of an electronic device. Figure 1 In (1) of, the first display interface 101 of the electronic device is shown. The first display interface 101 includes a satellite connection identifier 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.

[0044] During the satellite call, the user performs a swiping up operation in the area near the lower edge of the screen. In response to the received swiping up operation in the area near the lower edge of the screen, as Figure 1 shown in (2) of, the second display interface 102 is displayed. The second display interface 102 indicates the desktop of the electronic device and includes an identifier indicating the device status and icons of multiple application programs. Among them, the identifier indicating the device status is, for example, the call holding identifier 1021, and the icon of the application program is, for example, the icon 1022 of the camera application program. In some scenarios, the user clicks on the icon 1022 of the camera application program in the second display interface 102.

[0045] In response to a click operation received on the icon 1022 of the camera application, as Figure 2 shown, a third display interface 103 is displayed. The third display interface 103 includes an image preview area 1031 ( Figure 2 shown by a white dotted line box in the figure). There is a black screen phenomenon in the image preview area 1031, and a normal preview image cannot be displayed. The reason is that in the electronic device, when the satellite communication application and the camera module run simultaneously, when the signal-to-noise ratio of the satellite communication module exceeds the baseline value of the channel isolation, the analog-to-digital 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. Moreover, the radio frequency signal of the satellite communication will also be affected by the electromagnetic interference of the camera module, resulting in a decrease in the communication quality of the satellite communication.

[0046] Therefore, an embodiment of the present application provides a camera control method. In this method, the electronic device sets the camera conflict enable parameter to a fourth value in response to a first operation performed by the user on a first application; wherein, the first application is indicated as an application program having a satellite communication function initiation; the first operation is indicated as an operation to turn on the hardware module corresponding to the first application; when 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 simultaneous operation of the hardware module corresponding to the first application and the camera hardware, and ensure the smooth progress of the service corresponding to the first application.

[0047] The data transmission method provided by the embodiment of the present application can be applied to an electronic device. The electronic device can be a wearable electronic device (such as a watch), a portable computer (such as a mobile phone), a tablet computer, a notebook computer, a personal computer (PC), an augmented reality (AR) / virtual reality (VR) device, an in-vehicle computer, etc. The following embodiments do not impose special restrictions on the specific form of the electronic device.

[0048] Before describing the technical solution of the embodiment of the present application, the electronic device of the embodiment of the present application will be described first in conjunction with the accompanying drawings. Figure 3 A schematic structural diagram of the electronic device 100 is shown. It should be understood that Figure 3 the electronic device 100 shown is only an 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 different component configurations. Figure 3The various components shown can be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application specific integrated circuits.

[0049] 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, a headphone 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, a barometric 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.

[0050] 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 processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.

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

[0052] A memory can also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The USB interface 130 is an interface compliant with the USB standard specification, and can specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used for data transmission between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio. This interface can also be used to connect other electronic devices, such as AR devices, etc.

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

[0054] 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 inputs 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, the wireless communication module 160, etc. 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 modulation and demodulation processor, and the baseband processor, etc.

[0055] The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example, the antenna 1 can be multiplexed 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.

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

[0057] The wireless communication module 160 may provide solutions for wireless communications such as 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. applied to the electronic device 100. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves through the antenna 2, performs frequency modulation and filtering on the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 may also receive the signals to be transmitted from the processor 110, perform frequency modulation and amplification on them, and convert them into electromagnetic waves through the antenna 2 for radiation.

[0058] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling electronic device 100 to communicate with the network and other devices via wireless communication technologies. The wireless communication technologies 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 technologies, etc. The GNSS may include Global Positioning System (GPS), Global Navigation Satellite System (GLONASS), BeiDou Navigation Satellite System (BDS), Quasi-Zenith Satellite System (QZSS), and / or Satellite Based Augmentation Systems (SBAS).

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

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

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

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

[0063] The camera 193 is used to capture static images or videos. An 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 light signal into an electrical signal and then transmits the electrical signal to the ISP to convert it 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 standard RGB, YUV, etc. formats. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.

[0064] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, etc.

[0065] The video codec is used to compress or decompress digital videos. The electronic device 100 can support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as: Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

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

[0067] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to implement the storage capacity expansion of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement the data storage function. For example, files such as music and videos are saved in the external memory card.

[0068] The internal memory 121 can be used to store computer-executable program codes, and the executable program codes 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 can include a program storage area and a data storage area. Among them, the program storage area can store the operating system, application programs required for at least one function (such as the sound playback function, the image playback function, etc.). The data storage area can store the data created during the use of the electronic device 100 (such as audio data, phone book, etc.). In addition, the internal memory 121 can include high-speed random access memory, and can also include non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0069] The electronic device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor, etc. Such as music playback, recording, etc.

[0070] The audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert analog audio input into a digital audio signal. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 can be disposed in the processor 110, or some functional modules of the audio module 170 can be disposed in the processor 110.

[0071] The pressure sensor 180A is used to sense pressure signals and can convert the pressure signals into electrical signals. In some embodiments, the pressure sensor 180A may be disposed 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 may include at least two parallel plates with 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 intensity of the touch operation according to the pressure sensor 180A. The electronic device 100 can also calculate the position of the touch 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 may 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, the 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, the instruction to create a new short message is executed.

[0072] The touch sensor 180K, also known as the "touch panel". The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also known as the "touch display screen". The touch sensor 180K is used to detect touch operations acting on it or nearby. The touch sensor can transmit 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 some other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, at a different position from where the display screen 194 is located.

[0073] The button 190 includes a power-on button, a volume button, etc. The button 190 can be a mechanical button. It can also be a touch button. The electronic device 100 can receive button inputs and generate key signal inputs related to the user settings and function controls of the electronic device 100.

[0074] The motor 191 can generate vibration prompts. The 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, playing audio, etc.) can correspond to different vibration feedback effects.

[0075] The indicator 192 can be an indicator light and can be used to indicate the charging state, the change in battery power, and can also be used to indicate messages, missed calls, notifications, etc.

[0076] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. In the embodiments of this application, taking the Android system with a layered architecture as an example, the software structure of the electronic device 100 will be exemplarily described.

[0077] Figure 4 This is the software structure block diagram of the electronic device 100 provided by the embodiments of this application.

[0078] The layered architecture of the electronic device 100 divides the software into several layers, and each layer has a clear role 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 and system libraries, the Hardware Abstraction Layer (HAL), and the kernel layer.

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

[0080] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications in the application layer. The application framework layer includes some predefined functions.

[0081] As Figure 4 shown, the application framework layer may include a content provider, a telephone manager, a notification manager, a SystemServer, a camera middle platform module, and a camera framework module, etc.

[0082] The content provider is used to store and obtain data, and make this data accessible to applications. The data may include videos, images, audio, dialed and answered calls, browsing history and bookmarks, phone books, etc.

[0083] The telephone manager is used to provide the communication function of the electronic device 100. For example, the management of call states (including connection, disconnection, etc.).

[0084] The notification manager enables an application to display notification information in the status bar. It can be used to convey informative messages, which can automatically disappear after a short stay without user interaction. For example, the notification manager is used to inform that a download is completed, a message is reminded, 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 the notification of a background running application, or a notification that appears in the form of a dialogue window on the screen. For example, it can prompt text information in the status bar, emit a prompt tone, vibrate the electronic device, blink the indicator light, etc.

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

[0086] The camera middle platform module includes an initialization module and a middle platform processing module. Among them, the initialization module is used to perform initialization operations on the middle platform processing module; the middle platform processing module is used to monitor the satellite status information maintained in the system server and transmit scene information to the camera framework module.

[0087] The camera framework module includes a camera service module, a scene judgment module, a conflict resolution module, and a camera disconnection module. Among them, 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 handling is required; the conflict resolution module is used to resolve camera conflicts; the camera disconnection module is used to disconnect the connection relationship between the application and the camera hardware.

[0088] Android Runtime includes a core library and a virtual machine. Android runtime is responsible for the scheduling and management of the Android system.

[0089] The core library consists of two parts: one part is the functional functions that need to be called by the Java language, and the other part is the core library of Android.

[0090] The application layer and the application framework layer run in the 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.

[0091] The system library can include multiple functional modules. For example: surface manager, Media Libraries, Service Manager, 2D graphics engine (such as: SGL), etc.

[0092] Among them, the service management module is used to manage system services and manage queries of Binder proxy objects corresponding to these system services, etc.

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

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

[0095] The protocol stack, also known as protocol stack-up, is a specific software implementation of a computer network protocol suite, which 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.

[0096] It can be understood that Figure 4 The layers in the shown software structure and the components included in each layer do not constitute a specific limitation on the electronic device 100. In some 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 are not limited in the present application.

[0097] Figure 5 It is a schematic flow chart of a camera control method provided by an embodiment of the present application Figure 1 . This camera control method is applied to an electronic device, which includes a service manager, a system server, an initialization module, a middle platform processing module, and a camera service module. Among them, 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 platform processing module belong to the camera middle platform module in the framework layer, and the camera service module belongs to the camera framework module in the framework layer. As Figure 5 shown, this camera control method includes: the following steps S501 - step S511.

[0098] Step S501: When the electronic device starts up, the system server sends a first startup instruction to the camera service module in the camera framework module.

[0099] Among them, the first startup instruction is used to instruct the camera service module to start.

[0100] 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.

[0101] Step S502: In response to the first startup instruction, the camera service module sends a camera service registration request to the system server.

[0102] Among them, the camera service registration request is used to request the registration of the camera service, and the camera service registration request includes the service name and service identifier of the camera service.

[0103] It should be noted that only after the camera service is successfully registered in the service manager, other application programs 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 thread manner.

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

[0105] Among them, the system server and the service manager are two independent processes, and the communication between them needs to be through the inter-process communication method, and this inter-process communication method can be a communication method based on the binder mechanism.

[0106] In a possible implementation manner, 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.

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

[0108] Among them, the camera service information includes the camera service proxy object.

[0109] It should be noted that the proxy object (Proxy) 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 limit access to the original object without changing the original object. In the embodiments of the present application, other application programs can use the camera service through the camera service proxy object.

[0110] In a possible implementation manner, the service manager maintains a service list, and the service list indicates the corresponding relationship list between the service and the proxy object. After receiving the camera service registration request, the service manager generates a camera service proxy object, and associates and stores the service identifier (and / or service name) of the camera service with the camera service proxy object in the service list, so as to facilitate subsequent access to the camera service for other application programs.

[0111] In a possible implementation, after the above 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.

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

[0113] Wherein, the second start instruction is used to instruct the initialization module in the camera middle platform module to start.

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

[0115] In the method provided in the embodiments of the present application, the described order of steps does not limit the execution order of the steps. For example, the above step S501 and the above 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. Specific limitations are not made in the embodiments of the present application.

[0116] Step S506: In response to the second start instruction, the initialization module performs an initialization operation on the middle platform processing module.

[0117] In a possible implementation, in response to the second start instruction, the initialization module performs an initialization operation on the middle platform processing module, including: in response to the second start instruction, the initialization module constructs the middle platform processing module and passes preset information into the middle platform processing module.

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

[0119] It should be noted that the middle platform processing module is a newly constructed module in the embodiments of the present application and is used to perform corresponding steps in subsequent embodiments.

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

[0121] Wherein, the camera service acquisition request includes at least one of the service identifier and service name of the camera service.

[0122] In the subsequent processing, the middleware processing module needs to interact with the camera framework module. Therefore, when the initialization of the middleware processing module is completed, it is necessary to obtain a way to interact with the camera framework module. Since the camera middleware module and the camera framework module are two independent processes, the middleware processing module belonging to the camera middleware module needs to first obtain a camera service proxy object in order to realize the interaction with the camera framework module through this camera service proxy object.

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

[0124] In a 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 a camera service acquisition request to the binder driver, so that the binder driver sends the camera service acquisition request to the service manager.

[0125] Step S509: The service manager sends service acquisition response information to the system server.

[0126] Among them, the service acquisition response information includes at least one of the service name and service identifier of the camera service, and the camera service proxy object.

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

[0128] Step S510: The system server forwards the service acquisition response information to the middleware processing module.

[0129] In a possible implementation, after receiving the acquisition response information, the middleware 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 this camera service proxy object in the subsequent process.

[0130] Step S511: When the initialization of the middleware processing module is completed, it monitors the satellite status information maintained in the system server.

[0131] Among them, the satellite status information is used to indicate the startup status of the satellite communication module, and the startup status includes the on state or the off state.

[0132] In a possible implementation, the satellite status information may exist in the form of fields. For example, when the field representing the satellite status information is the first value (e.g., true), it indicates that the satellite communication module is in the enabled state; when the field representing the satellite status information is the second value (e.g., false), it indicates that the satellite communication module is in the disabled state.

[0133] In a possible implementation, the middleware processing module monitors the satellite status information maintained in the system server, including: the middleware processing module registers a listener in the system server, where the listener is associated with the satellite status information. The listener can be a context listener for monitoring changes in the satellite status information. When the satellite communication status information changes, the listener is triggered to send a monitoring response message to the middleware processing module, and the monitoring response message includes the value of the satellite status information.

[0134] In the embodiments of the present application, after the electronic device is started, it executes the camera control method provided in the above steps S501 - S511 to implement the registration of the camera service and the construction of the middleware processing module. After the middleware processing module is constructed, the middleware processing module monitors whether the satellite communication module is enabled. Among them, the middleware processing module determines whether the satellite communication module is enabled 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.

[0135] Figure 6 It is a schematic flowchart of a method for changing satellite status information provided by the embodiments 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. Among them, 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 For example, the change of satellite status information is described. Refer to Figure 6 , the method includes: steps S601 - S614.

[0136] Step S601, the satellite communication application enters the application page in response to a user instruction.

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

[0138] Step S602, the satellite communication application pulls up the protocol stack in response to a satellite communication start instruction.

[0139] Among them, the satellite communication startup instruction is used to indicate the establishment of satellite communication.

[0140] In a possible implementation, the user clicks on a control for initiating communication (such as making a call or sending a text message) (the first operation on the first application) on the application page of the satellite communication application, sending a satellite communication startup instruction to the satellite communication application to enable the satellite communication application to establish satellite communication.

[0141] In a possible implementation, the satellite communication application pulls up the protocol stack by sending a protocol stack startup instruction to the protocol stack.

[0142] Step S603: The protocol stack starts up and sends a power-on instruction to the satellite communication module.

[0143] Among them, the power-on instruction is used to indicate the power-on of the satellite communication module. The satellite communication module is a hardware module, such as a radio frequency module for satellite communication.

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

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

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

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

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

[0149] Step S605: The system server sets the field representing the satellite status information to the first value in response to this satellite communication on status information.

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

[0151] Among them, the network search instruction is used to indicate the protocol stack to search for network services providing satellite communication.

[0152] Step S607: The protocol stack controls the satellite communication module to perform network search and registration in response to this network search instruction.

[0153] In a possible implementation, the protocol stack searches for a network through the satellite communication module. After finding an available satellite network, it registers in the available satellite network. After registration, it can use the satellite communication service provided by the available satellite network to conduct the satellite communication service process.

[0154] Step S608: In response to the satellite communication end instruction, the satellite communication application sends a communication close request to the protocol stack.

[0155] Among them, the satellite communication end instruction is used to indicate that the user hangs up the satellite communication. The communication close request is used to request the protocol stack to end the satellite communication.

[0156] In a possible implementation, in the satellite communication page, the user clicks the control for hanging up the communication (the second operation on the first application) to send a satellite communication end instruction to the satellite communication application.

[0157] Step S609: In response to the communication close request, the protocol stack controls the satellite communication module to disconnect from the network.

[0158] Among them, disconnecting from the network refers to the operation of disconnecting the satellite communication module from the connected available satellite network.

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

[0160] Among them, the state machine stores the cached data generated during this satellite communication process.

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

[0162] Among them, the power-off instruction is used to indicate the power-off of the satellite communication module. The satellite communication module is a hardware module, such as a radio frequency module for satellite communication.

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

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

[0165] In a possible implementation, in response to the socket connection disconnection notification reported by the protocol stack, the satellite communication application sends satellite communication open status information to the system server. 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.

[0166] Step S614: In response to the satellite communication close status information, the system server sets the field representing the satellite status information to the second value.

[0167] In the embodiments 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 indicates that the satellite communication module is turned on; when the field representing the satellite status information is set to the second value, it indicates that the satellite communication module is turned off. The middle platform processing module can determine whether the satellite communication module is turned on by monitoring the satellite status information maintained in the system server.

[0168] 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 at the same time, the two may cause a hardware conflict, resulting in phenomena such as an abnormal camera preview page and a decrease in satellite communication quality. Therefore, the electronic device needs to control the use process of the camera service according to the usage status of the satellite communication module. For a detailed description, refer to the camera control method provided in the following embodiments.

[0169] Figure 7 Schematic flow of a camera control method provided by an embodiment of the present application Figure 2 。

[0170] Figure 8 Schematic flow of a camera control method provided by an embodiment of the present application Figure 3 。

[0171] Figure 7 and Figure 8 The camera control methods shown are both applied to an electronic device, which includes 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 program 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, and 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.

[0172] As Figure 7 shown, the camera control method includes the following steps S701 - step S706.

[0173] Step S701, the first application sends status change information to the system server.

[0174] Among them, the status change information is used to indicate that the usage status of the hardware module corresponding to the first application in the electronic device has changed. The status change information includes the current status information, and the current status information is, for example, the on state or the off state.

[0175] 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.

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

[0177] In a possible implementation, when the first application is indicated as a satellite communication application, the system server modifies the status information corresponding to the satellite communication application based on the status change information.

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

[0179] It should be noted that according to the detailed description of step S511 in the foregoing embodiments, the middleware 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 middleware processing module.

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

[0181] Among them, the status change response message is used to indicate that the status information corresponding to the first application has changed.

[0182] The status change response message includes a target status value, which is used to represent the changed status value. Taking the first application as a satellite communication application as an example, after the satellite status information changes, the middleware processing module receives the status change response message. In the status change response message, when the target status value is the first value, it indicates that the satellite communication module corresponding to the satellite communication application is on; when the target status value is the second value, it indicates that the satellite communication module corresponding to the satellite communication application is off.

[0183] Step S704: The middleware processing module sends scenario information to the scenario judgment module based on the status change response message.

[0184] Among them, the scenario information includes a scenario identifier and a target status value. The scenario identifier is used to indicate the scenario where the status information change occurs, and the scenario identifier is also the business scenario identifier corresponding to the first application. In the embodiments of the present application, the middleware processing module pre-stores the scenario identifiers corresponding to each application program, such as the satellite communication scenario identifier corresponding to the satellite communication application, the payment scenario identifier corresponding to the online banking application, the audio and video scenario identifier corresponding to the audio and video application, etc.

[0185] It should be noted that when some hardware modules in the electronic device (such as the satellite communication module in the foregoing embodiment) run simultaneously with the camera module, the two may interfere with each other. Therefore, after the middle platform processing module receives the status change response message, it is necessary to transmit corresponding parameters to the camera framework module for the camera framework module to determine whether there will be a conflict in the subsequent process.

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

[0187] In a possible implementation, the middle platform processing module sends scenario information to the scenario judgment module based on the status change response message, including: the middle platform processing module sends scenario information to the scenario judgment module based on the status change response message and the pre-obtained camera service proxy object.

[0188] It should be noted that 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 in order to interact with the camera framework module through the camera service proxy object. The acquisition process of the camera service object refers to the foregoing steps S507 - S510 and will not be elaborated here.

[0189] In a possible implementation, before the middle platform processing module sends scenario information to the scenario judgment module based on the status change response message (the above step S704), the camera control method further includes: reading product configuration parameters; if the product configuration parameters cannot be read, performing the above step S704; if the product configuration parameters are read, ending the execution process of the camera control method.

[0190] Among them, the product configuration parameters are used to represent the parameters indicating that there will be no conflict when the satellite communication module and the camera module in the electronic device run simultaneously. The product configuration parameters are cloud push configuration parameters, which 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 there will be no conflict when the satellite communication module and the camera module in the electronic device run simultaneously. After the product configuration parameters are configured in the cloud, the electronic device can synchronize the product configuration parameters to local storage.

[0191] It should be noted that in some types of electronic devices, the isolation degree between the satellite communication module and the camera module is high. When the satellite communication module and the camera module operate simultaneously, the two may not conflict, that is, this type of electronic device may not need to perform conflict resolution processing. However, the cost of separately configuring a system program for this type of electronic device is relatively high. Therefore, in the embodiments of the present application, product configuration parameters are provided, so that even if the camera control method provided in the present application is configured in this type of electronic device, after reading the product configuration parameters, it will not transfer parameters to the camera framework module, and thus will not perform subsequent conflict resolution processing, saving system resources and expanding the application scope of the camera control method provided in the embodiments of the present application.

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

[0193] Among them, the scene information includes a scene identifier and a target status value.

[0194] In a possible implementation manner, the scene judgment module determines whether to perform camera conflict processing based on the scene information, including: when the scene identifier indicates a preset identifier (such as a satellite communication scene identifier) and the target status value indicates a first value, it is determined to perform camera conflict processing; when the scene identifier indicates a preset identifier (such as a satellite communication scene identifier) and the target status value indicates a second value, it is determined not to perform camera conflict processing. Alternatively, when the scene identifier indicates a non-preset identifier, it is determined 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.

[0195] Step S706: When the scene judgment module determines that camera conflict processing is not required, it sets the camera conflict enable parameter to a third value.

[0196] Among them, the camera conflict enable parameter is used to represent whether the hardware module conflicting with the camera module is running. This camera conflict enable parameter is a global parameter, and modules in the electronic device can all obtain the value of this camera conflict enable parameter. This camera conflict enable parameter indicates a third value or a fourth value. When this camera conflict enable parameter is the third value, it means that the hardware module that will conflict with the camera module is in the off state; when this camera conflict enable parameter is the fourth value, it means that the hardware module that will conflict with the camera module is in the on state.

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

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

[0199] In the case where the scene judgment module determines that camera conflict handling is required, the subsequent process can refer to Figure 8 the camera control method shown below, including: the following steps S707 - step S715.

[0200] Step S707: When the scene judgment module determines that camera conflict handling is required, it sends a conflict resolution instruction to the conflict resolution module.

[0201] Among them, the conflict resolution instruction is used to instruct the conflict handling module to perform conflict handling.

[0202] Step S708: In response to the conflict resolution instruction, the conflict resolution module sets the camera conflict enabling parameter to a fourth value.

[0203] Among them, when the camera conflict enabling parameter is the fourth value, it means that the hardware module that will conflict with the camera module is in an enabled state.

[0204] It should be noted that the camera conflict enabling parameter is a global parameter, and modules 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.

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

[0206] Among them, 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 successfully acquires the lock can access the camera service, and other modules need to wait until they are unlocked to access the camera service.

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

[0208] Among them, the service lock acquisition response is used to indicate that the conflict resolution module has successfully acquired the lock.

[0209] In the embodiments of the present application, after the conflict resolution module acquires the lock, other modules outside the conflict resolution module cannot access the camera service, which can effectively prevent the application programs that currently have a connection relationship with the camera module from continuing to access the camera service. Among them, the application programs that have a connection relationship with the camera module access the camera service, such as the lock screen application using face recognition.

[0210] In a possible implementation, after the conflict resolution module sends a service lock acquisition request to the camera service module, it calls a conditional lock function to set an acquisition duration; in the case where a service lock acquisition response is not received after exceeding this acquisition duration, a timeout response message is generated.

[0211] Among them, the acquisition duration is used to indicate the maximum waiting time for the conflict resolution module to acquire the service lock. For example, this acquisition duration can be set to 3 seconds or 4 seconds, and no specific limitation is made in the embodiments of this application. This timeout response message is used to indicate that the duration for acquiring the service lock has timed out.

[0212] It should be noted that if the acquisition duration is not set, the conflict resolution module will keep executing the acquisition program when it fails to acquire the service lock provided by the camera service module, that is, it will keep sending service lock acquisition requests to the camera service module, which may lead to a resource preemption deadlock situation in the electronic device, and further cause the electronic device to stop responding and the system program to crash. Therefore, in the above implementation, the acquisition duration is set, and in the case where a service lock acquisition response is not received after exceeding this acquisition duration, an exception response message is generated to prevent the conflict resolution module from continuously executing the acquisition program.

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

[0214] Among them, the camera service usage information is used to indicate information about the application program that has a connection relationship with the camera hardware. This camera service usage information includes, but is not limited to, the application program identifier and the application program access method of the application program.

[0215] In a possible implementation, this 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 in the camera service module that stores this camera service usage information, and in the case where this container class is not empty, obtains this camera service usage information from this container class, and this camera service usage information includes the application program identifier and the application program access method of the second application.

[0216] Step S712: The conflict resolution module sends an exception reminder message to the second application based on the camera service usage information.

[0217] Among them, the second application refers to the application program that has a connection relationship with the camera hardware. This second application is, for example, a camera application, an application with a video call function, an application with a face recognition function, etc. The exception reminder message is used to indicate that the camera service is currently unavailable.

[0218] In a possible implementation, the camera service usage information includes the application identification of the second application and the application access method, and the application access method may be a strong pointer pointing to the second application. Based on the camera service usage information, the conflict resolution module sends an exception reminder message to the second application, including: based on the application access method of the second application, the conflict resolution module calls an error notification function to send an exception reminder message to the second application. The error notification function is, for example, the NotifyError function, etc.

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

[0220] Among them, the camera service disconnection request includes the application identification of the second application. The camera service disconnection request is used to request the camera disconnection module to interact with the camera underlying module to disconnect the connection between the second application and the camera hardware.

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

[0222] Among them, the hardware disconnection instruction is used to instruct the camera HAL to disconnect the connection between the second application and the camera hardware.

[0223] In a possible implementation, when there are multiple second applications, the conflict resolution module can send a hardware disconnection instruction to the camera HAL once for each second application, and the hardware disconnection instruction includes the application identification of the second application.

[0224] Step S715: In response to the hardware disconnection instruction, the camera HAL disconnects the connection between the second application and the camera hardware.

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

[0226] In the camera control method provided by the embodiments of the present application, when satellite communication is enabled, the middle platform processing module transmits scene information to the scene judgment module. When the scene judgment module determines that conflict handling is required based on the scene information, the conflict handling module acquires the service lock of the camera service to prevent a second application (an application program having a connection relationship with the camera hardware) from calling the camera service. In addition, 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 satellite communication. Moreover, disconnecting the connection between the second application and the camera hardware can also reduce the device power consumption during satellite communication.

[0227] In the camera control method provided by the above embodiments of the present application, the second application is an application program that has established a connection relationship with the camera hardware before satellite communication is enabled. After satellite communication is enabled, 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. For a third application that requests to connect to the camera after satellite communication is enabled, the embodiments of the present application provide the following camera control method to avoid the situation where the satellite communication module and the camera module operate simultaneously.

[0228] Figure 9 It is a schematic flow of a camera control method provided by the embodiments of the present application Figure 4 . This camera control method is applied to an electronic device, and the electronic device includes a third application, a camera service module, and a camera HAL. Among them, the third application belongs to the application program layer of the electronic device; the camera service module belongs to the camera framework module in the framework layer; the camera HAL belongs to the hardware abstraction layer of the electronic device. As Figure 9 shown, this camera control method includes: step S901-step S907.

[0229] Step S901, the third application sends a camera startup request to the camera service module.

[0230] Among them, the camera startup request is used to request the use of the camera service. This camera service request includes the application program identifier of the third application.

[0231] In a possible implementation manner, in the application page of the third application, the user clicks the photographing component (the third operation on the third application), causing the third application to send a camera startup request to the camera service module.

[0232] In another possible implementation manner, in the application page of the third application, the user clicks the recognition component (the third operation on the third application), causing the third application to send a camera startup request to the camera service module. This recognition component can be used to initiate face recognition, or image recognition, or item recognition, etc.

[0233] In yet another possible implementation, the user can perform a specified action on the electronic device (a third operation on a third application), triggering the third application in the electronic device to send a camera startup request to the camera service module. Among them, the specified action is, for example, placing the hand above the electronic device or placing the face within the shooting range of the front camera of the electronic device, for unlocking the electronic device.

[0234] Step S902: In response to the camera startup request, the camera service module determines the parameter value of the camera conflict enabling parameter.

[0235] Among them, the camera conflict enabling parameter is used to characterize whether the hardware module in conflict with the camera module is running. For the scenario of changing the parameter value of this camera conflict enabling parameter, reference can be made to the detailed description corresponding to step S706 and the detailed description corresponding to step S708 in the foregoing embodiments, which will not be elaborated here.

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

[0237] Among them, when the camera conflict enabling parameter is the third value, it means that the hardware module that will conflict with the camera module is in the off state (refer to the detailed description corresponding to step S706 above). Therefore, 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 a container class, and the camera service usage information includes, but is not limited to, the application program identifier and the application program access method.

[0238] It should be noted that there is a container class in the camera service module for storing camera service usage information, and the camera service usage information is used to indicate the information of the application program that has a connection relationship with the camera hardware, facilitating the management of the application programs using the camera service.

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

[0240] Among them, the connection establishment instruction is used to indicate establishing a connection relationship between the third application and the camera hardware. The connection establishment instruction includes at least the application program identifier of the third application.

[0241] Step S905: In response to the connection establishment request, the camera hardware abstraction module establishes a connection relationship between the third application and the camera hardware.

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

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

[0244] Among them, when the camera conflict enabling parameter is the fourth value, it means that the hardware module that will conflict with the camera module is currently in the on state (see the detailed description in step S708). If the third application uses the camera service at this time, it will cause a conflict between the hardware module (such as the satellite communication module) and the camera module. Therefore, in order to avoid a 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.

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

[0246] In the camera control method provided in the embodiments of the present application, when the 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 a conflict between the hardware module and the camera module, thereby avoiding an abnormality in the service corresponding to the hardware module and an abnormality in the camera preview page, and ensuring the smooth progress of the service corresponding to the hardware module.

[0247] Figure 10 This is another schematic diagram of an application scenario provided by the embodiments of the present application. In a possible implementation, during the satellite communication process of the electronic device, the user opens the camera application. As Figure 10 shown, the electronic device displays a fourth display interface 104, and the fourth display interface 104 includes a reminder interface 1041 that the camera service is currently unavailable.

[0248] It should be noted that through Figure 5 、 Figure 7 、 Figure 8 and Figure 9 the camera control method provided, the embodiments of the present application can start from the software layer to solve hardware conflicts and reduce the hardware solution cost; can also flexibly configure products with or without hardware conflicts through cloud push configuration items; can also disconnect the foreground and background applications from the camera hardware, so that when the camera-less device is powered on, the interference to satellite communication is minimized, and at the same time, the device power consumption during satellite communication can be reduced. It should also be noted that in addition to being applied to the scenario where there is a conflict between the satellite communication module and the camera module, the embodiments of the present application can also be applied to other scenarios where there is a conflict between a hardware module and the camera module.

[0249] It can be understood that, in order to implement the above functions, the electronic device includes corresponding hardware and / or software modules for executing each function. Combining the algorithm steps of each example described in the embodiments disclosed in this article, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the form of hardware or computer software driving the 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 exceed the scope of the present application.

[0250] In the method provided by the above embodiments of the present application, the steps executed by the electronic device can also be executed by a chip system included in the electronic device. Among them, the chip system can include a processor and a Bluetooth chip. The chip system can be coupled to the memory, so that when the chip system runs, it calls the computer program stored in the memory to implement the steps executed by the above electronic device. Among them, the processor in the chip system can be an application processor or a processor other than an application processor.

[0251] This embodiment also provides a computer-readable medium, in which computer instructions are stored. When the computer instructions run on the electronic device, the electronic device is enabled to execute the above-related method steps to implement the method in the above embodiments.

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

[0253] In addition, the embodiments of the present application also provide a device, which can specifically be a chip, a component or a module. The device can include a processor and a memory connected to each other; among them, the memory is used to store computer execution instructions. When the device runs, the processor can execute the computer execution instructions stored in the memory, so that the chip executes the methods in the above method embodiments.

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

[0255] Through the description of the above embodiments, those skilled in the art can understand that, for the convenience and simplicity of description, only the above division of each functional module is used as an example. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.

[0256] In several embodiments provided by 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 merely illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of devices or units can be electrical, mechanical or other forms.

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

[0258] 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 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 embodiments of the present application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. The software product is stored in a storage medium and includes several instructions for causing a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods of each embodiment of the present application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read only memory (ROM), random access memory (RAM), magnetic disks or optical discs that can store program codes.

[0259] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and 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 various embodiments of the present application.

Claims

1. A camera control method, characterized in that, Applied to an electronic device, the method includes: When a second application requests to use the camera service, determine whether the electronic device is performing satellite communication; In the case of no satellite communication, establish a connection relationship between the second application and the camera hardware for the second application to call the camera service based on the connection relationship; In response to a first operation performed by the user on the first application, perform satellite communication; During the satellite communication process, when switching back to using the camera service in the second application, prompt that the camera service is currently unavailable in the display interface of the electronic device.

2. The method according to claim 1, characterized in that After determining whether the electronic device is performing satellite communication when the second application requests to use the camera service, the method further includes: In the case of performing satellite communication, prompt that the camera service is currently unavailable in the display interface of the electronic device.

3. The method according to claim 1, wherein After the step of performing satellite communication in response to a first operation performed by the user on the first application, the method further includes: In response to the enabling of the satellite communication function, obtain a service lock corresponding to the camera service.

4. The method according to claim 1, characterized in that, After establishing the connection relationship between the second application and the camera hardware, the method further includes: Record camera service usage information, where the camera service usage information includes the application identifier and application access method of the second application having a connection relationship with the camera hardware.

5. The method according to claim 4, wherein After the step of performing satellite communication in response to a first operation performed by the user on the first application, the method further includes: In response to the enabling of the satellite communication function, disconnect the connection relationship between the second application and the camera hardware.

6. The method according to claim 5, wherein The step of disconnecting the connection relationship between the second application and the camera hardware in response to the enabling of the satellite communication function includes: In response to the enabling of the satellite communication function, obtain the camera service usage information; Based on the camera service usage information, disconnect the connection relationship between the second application and the camera hardware.

7. The method according to claim 1, characterized in that, The step of determining whether the electronic device is performing satellite communication when the second application requests to use the camera service includes: When the second application requests to use the camera service and there will be a conflict if the camera hardware and the satellite communication module run simultaneously, determine whether the electronic device is performing satellite communication.

8. The method according to claim 7, characterized in that The step of determining whether the electronic device is performing satellite communication includes: Determine whether the hardware module corresponding to the first application is in an enabled state; the hardware module corresponding to the first application is the satellite communication module; In the case where the hardware module corresponding to the first application is in an enabled state, determine that the electronic device is performing satellite communication; In the case where the hardware module corresponding to the first application is in a disabled state, determine that the electronic device is not performing satellite communication.

9. The method according to claim 7, wherein The step of determining whether the electronic device is performing satellite communication includes: Determine whether the parameter value of the camera conflict enabling parameter is a preset value; the camera conflict enabling parameter is a parameter characterizing whether the satellite communication module is running; In the case where the parameter value of the camera conflict enabling parameter is the preset value, determine that the electronic device is performing satellite communication; In the case where the parameter value of the camera conflict enabling parameter is not the preset value, determine that the electronic device is not performing satellite communication.

10. The method according to claim 4, wherein During the process of satellite communication, before prompting that the camera service is currently unavailable in the display interface of the electronic device when switching back to the second application to use the camera service, the method further includes: In response to the enabling of the satellite communication function, based on the camera service usage information, sending an exception reminder message to the second application; During the process of satellite communication, when switching back to the second application to use the camera service, prompting that the camera service is currently unavailable in the display interface of the electronic device includes: During the process of satellite communication, when switching back to the second application to use the camera service, the second application, based on the exception reminder message, prompts in the display interface of the electronic device that the camera service is currently unavailable.

11. The method according to claim 7, characterized in that The situation where conflicts occur when the camera hardware and the satellite communication module run simultaneously includes: The situation where the product configuration parameters corresponding to the electronic device are not read; wherein the product configuration parameters are parameters used to characterize that no conflicts occur when the satellite communication module and the camera module in the electronic device run simultaneously.

12. An electronic device, characterized in that, The electronic device includes: One or more processors; A memory; And a computer program, wherein the computer program is stored on the memory, and when the computer program is executed by the one or more processors, the electronic device executes the method according to any one of claims 1-11.

13. A computer storage medium, characterized in that, Including computer instructions, when the computer instructions run on the electronic device, the electronic device executes the method according to any one of claims 1-11.