Camera application configuration method, device and storage medium
By allocating camera parameter acquisition and sensor initialization through multi-threading, it solves the problem of long time displaying images on the camera application interface, achieves rapid image display, and improves user experience.
Patent Information
- Application Number
- PCT/CN2023/134117
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-02-27
- Filing Date
- 2023-11-24
- Publication Date
- 2024-10-24
AI Technical Summary
After the existing camera application is triggered, the interface takes a long time to display the image, resulting in the user being unable to capture the target scene image in time.
By allocating multiple threads for camera parameter acquisition, sensor initialization and data flow configuration respectively, sensor initialization is completed in advance, reducing resource competition and improving data flow configuration efficiency.
It significantly reduces the time from when the camera application is triggered to when the image is displayed on the interface, ensuring that users can capture target scene images in a timely manner and improving user experience.
Smart Images

Figure CN2023134117_24102024_PF_FP_ABST
Abstract
Description
Camera application configuration method, device and storage medium
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on February 27, 2023, with application number 202310227589.8 and application name “Camera application configuration method, device and storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of terminal technology, and in particular to a camera application configuration method, device, and storage medium. Background Art
[0003] With the development of terminal technology, terminal devices usually provide camera applications (applications, APPs), and camera applications support photo taking and video recording functions.
[0004] In a possible implementation, when a user wants to capture an image of a certain scene, the user triggers a camera application and takes a photo or video of the target scene. However, after the user triggers the camera application, the camera application user interface (UI) takes a long time to display the image, resulting in the user being unable to capture the target scene image.
[0005] Summary of the Invention
[0006] The embodiments of the present application provide a camera application configuration method, device, and storage medium, which are applied to the field of terminal technology and reduce the time taken from when a camera application is triggered to when an image is displayed on the camera application interface.
[0007] In a first aspect, an embodiment of the present application provides a camera application configuration method. The method includes:
[0008] At the first moment, the camera parameters are obtained through the first thread;
[0009] At the second moment, the sensor is initialized through the second thread; the sensor includes a sensor corresponding to the camera application; the sensor initialization is related to the camera parameters;
[0010] At the third moment, the camera application is configured with a data stream through a third thread. The data stream includes data streams corresponding to various functions of the camera application. The data stream configuration is related to the camera parameters and the parameters obtained during sensor initialization. The third moment is later than the second moment.
[0011] In this way, the sensor initialization start time of the sensor corresponding to the camera application is earlier than the start time of data stream configuration for the camera application, so that the sensor initialization of the sensor corresponding to the camera application is completed in advance, and the available memory of the electronic device and the available CPU resources of the electronic device before the third thread starts execution can be effectively utilized, so that the sensor initialization can be completed quickly, and the competition of the sensor initialization for the memory and CPU resources required by other processes corresponding to the third thread is reduced, so that the third thread corresponding to other processes can obtain sufficient memory and CPU resources during execution, reducing the time consumption of sensor initialization and the time consumption of data stream configuration of the camera application, and thus reducing the time consumption from the camera application being triggered to the image being displayed on the interface of the camera application.
[0012] In a possible implementation, before initializing the sensor through the second thread, the method further includes:
[0013] Detecting a logical identifier of a camera application, where the logical identifier includes an identifier of a first mode or an identifier of a second mode; the first mode corresponds to m sensors, and the second mode corresponds to one sensor, where m is an integer greater than 0;
[0014] If the logical identifier is an identifier of the first mode, a first channel corresponding to the camera application is created, and m second threads are created;
[0015] Initializing the sensor through the second thread includes: respectively initializing the m sensors through m second threads; wherein the first channel is used to manage interfaces between the camera application and the m sensors.
[0016] In this way, regardless of whether the camera application corresponds to one sensor or multiple sensors, each sensor can be initialized. If the camera application corresponds to multiple sensors, the total time consumed by initializing the m sensors corresponding to the camera application can be reduced by using m second threads to concurrently initialize the m sensors.
[0017] In a possible implementation, performing sensor initialization on m sensors respectively by m second threads includes:
[0018] For any second thread of the m second threads, the following operations are executed by the second thread: applying for a resource cache, obtaining a second channel of any sensor among the m sensors from the first channel, and writing first register data to any sensor; the second channel is used to power on any sensor.
[0019] In this way, through the applied cache resources, the first register data of each sensor sent by the camera application can be transmitted to the kernel driver layer, and each sensor can be powered on through the second channel of each sensor so that the kernel driver layer can write the first register data into each sensor to realize sensor initialization of each sensor.
[0020] In one possible implementation, the resource cache includes a package cache;
[0021] Write the first register data to any sensor, including:
[0022] Get the first register data from the camera application;
[0023] storing a first encapsulated packet obtained by encapsulating the first register data in a packet buffer;
[0024] Parsing a first encapsulated packet obtained from the packet buffer to obtain parsed first register data;
[0025] Write the parsed first register data to any sensor.
[0026] In this way, the first register data is transmitted from the application layer to the kernel driver layer, so that the first register data is written into each sensor through the kernel driver layer to implement sensor initialization of each sensor.
[0027] In a possible implementation, if the logic identifier is an identifier of the second mode, a second thread is created;
[0028] Initializing the sensor by using the second thread includes: initializing one sensor by using one second thread.
[0029] In this way, when a camera application corresponds to one sensor, there is no need to create the first channel corresponding to the camera application before creating the second thread. Instead, a second thread can be directly created and the sensor corresponding to the camera application can be initialized through the second thread. This can save the time spent on sensor initialization and facilitate the management of the sensor initialization thread.
[0030] In a possible implementation, initializing a sensor through a second thread includes:
[0031] The following steps are executed by a second thread: applying for a resource cache, creating a first channel, obtaining a second channel of a sensor from the first channel, and writing first register data to a sensor; the second channel is used to power on a sensor.
[0032] In this way, through the applied cache resources, the first register data of the sensor sent by the camera application can be transmitted to the kernel driver layer, and the sensor can be powered on through the second channel of this sensor so that the kernel driver layer can write the first register data to this sensor to realize the sensor initialization of this sensor. The process of creating the first channel is placed in the second thread, which saves the time of sensor initialization and facilitates the management of the sensor initialization thread.
[0033] In one possible implementation, the resource cache includes a package cache;
[0034] Write the first register data to a sensor, including:
[0035] Get the first register data from the camera application;
[0036] storing a first encapsulated packet obtained by encapsulating the first register data in a packet buffer;
[0037] Parsing a first encapsulated packet obtained from the packet buffer to obtain parsed first register data;
[0038] Write the parsed first register data to a sensor.
[0039] In this way, the first register data is transmitted from the application layer to the kernel driver layer, so that the first register data is written into the sensor through the kernel driver layer, thereby realizing sensor initialization of the sensor.
[0040] In a possible implementation, the second thread includes a corresponding synchronization lock; the synchronization lock is used to lock the execution object corresponding to the second thread.
[0041] In this way, multiple second threads executed in parallel will not simultaneously grab the same execution object, so that the execution result corresponding to each second thread is accurate and the execution result data obtained for each second thread is clean.
[0042] In one possible implementation, the method further includes:
[0043] Create a global variable maintenance interface for managing global variables of the camera application;
[0044] The process state machines corresponding to the first channel, the second thread, and the second channel and the second thread are maintained in global variables; the process state machine includes a directed graph consisting of the process state, process transition, and process action of the process, and the process state machine corresponding to the second thread includes a sensor power-on state machine and a first register data writing to the sensor completion state machine.
[0045] In this way, by calling the global variable maintenance interface, when configuring the data flow of the camera application, the process state machines corresponding to the first channel, the second thread, the second channel and the second thread can be called conveniently, accurately and efficiently.
[0046] In one possible implementation, configuring the data stream for the camera application through a third thread includes:
[0047] Initialize the first channel and create threads for each node corresponding to the camera application; the nodes include nodes for initializing the sensor;
[0048] If it is detected that the global variable contains a thread for initializing the sensor node, the first channel is obtained from the global variable;
[0049] If it is detected that the global variable contains the sensor power-on state machine and the first register data writing sensor completion state machine, the second channel of each sensor is obtained from the global variable;
[0050] The process of writing the first register data into the sensor is skipped, and the second register data is written into each sensor through the second channel of each sensor; the second register data includes the flow distribution register data selected according to the size of the data flow.
[0051] In this way, the time for writing the first register data to the sensor is saved. In addition, since there is no need to write the first register data to the sensor, if the execution of the threads of other nodes corresponding to the camera application is parallel to the process of writing the second register data, the execution of the threads of other nodes will obtain more abundant memory and CPU resources, which further enables the data flow configuration of the camera application to be completed quickly.
[0052] In a possible implementation, after writing the second register data into each sensor through the second channel of each sensor, the method further includes:
[0053] Unregister the second thread in the global variable.
[0054] This way, more memory can be freed up.
[0055] In a possible implementation, after configuring the data stream for the camera application through the third thread, the method further includes:
[0056] In response to an instruction to close the camera application, detecting a logical identifier of the camera application; the logical identifier includes an identifier of a first mode or an identifier of a second mode, the first mode corresponds to m sensors, the second mode corresponds to one sensor, and m is an integer greater than 0;
[0057] If the logical identifier is an identifier of the first mode, the first channel is released, the sensor power-on state machine is initialized, the second channel of the sensor is released, and the second thread is deregistered;
[0058] If the logical identifier is an identifier of the second mode, the sensor power-on state machine is initialized, the second channel of the sensor is released, and the second thread is deregistered.
[0059] In this way, the adaptability of the camera application to other applications can be improved, so that the second thread can be normally created and executed after other applications trigger the camera application, and further, after the camera application is triggered by other applications, the initialization of the camera application's corresponding sensor and the data stream configuration of the camera application can be quickly completed.
[0060] In a possible implementation, after configuring the data stream for the camera application through the third thread, the method further includes:
[0061] In response to an instruction to switch out of the camera application, the threads and the first channel of each node corresponding to the camera application are destroyed; and the second channel is destroyed.
[0062] In this way, if the first channel and the second channel are the first channel and the second channel of the CSL service, after the camera application exits, the first channel and the second channel of all CSL services will be released, so that after the camera application exits, the electronic device 100 has more available CPU resources and more available input / output (I / O) resources.
[0063] In a second aspect, an embodiment of the present application provides an electronic device, which includes: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the electronic device performs the method of the first aspect.
[0064] In a third aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method of the first aspect.
[0065] In a fourth aspect, an embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is run, it enables the computer to execute the method of the first aspect.
[0066] In a fifth aspect, an embodiment of the present application provides a chip, the chip including a processor, the processor being used to call a computer program in a memory to execute the method of the first aspect.
[0067] It should be understood that the second to fifth aspects of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] FIG1 is a schematic structural diagram of an electronic device 100 provided in an embodiment of the present application;
[0069] FIG2 is a schematic diagram of the software structure of the electronic device 100 provided in an embodiment of the present application;
[0070] FIG3 is a schematic diagram of a user triggering a camera application to take a photo in a possible implementation;
[0071] FIG4 is a schematic diagram of a process of displaying an image after a camera application is triggered in a possible implementation;
[0072] FIG5 is a schematic diagram of a user triggering a camera application to take a photo according to an embodiment of the present application;
[0073] FIG6 is a schematic diagram of a process of displaying an image after a camera application is triggered according to an embodiment of the present application;
[0074] FIG7 is a diagram illustrating an architecture corresponding to a camera application in which a sensor initialization node is advanced according to an embodiment of the present application;
[0075] FIG8 is a flowchart of a camera application configuration method according to an embodiment of the present application;
[0076] FIG9 is a second flowchart of a camera application configuration method according to an embodiment of the present application;
[0077] FIG10 is a schematic diagram of a multi-camera mode provided in an embodiment of the present application;
[0078] FIG11 is a schematic diagram of a single-camera mode provided in an embodiment of the present application;
[0079] FIG12 is a schematic diagram of the hardware structure of the chip provided in an embodiment of the present application. DETAILED DESCRIPTION
[0080] To facilitate a clear description of the technical solutions of the embodiments of the present application, some of the terms and technologies involved in the embodiments of the present application are briefly introduced below:
[0081] 1. Sensor: It can be called a photosensitive element, image sensor or sensor; it is used to convert light signals into electrical signals.
[0082] 2. configure_streams: This can be called data stream configuration or stream allocation; for example, the configuration of data streams corresponding to camera application-related functions.
[0083] 3. Session: can be called session control; used to display the control interface of the camera device.
[0084] 4. buffer: can be called buffer or cache.
[0085] 5. Package buffer: It can be called a packet buffer; it is used to store or transfer data to be transmitted during the data transmission process. The data to be transmitted needs to be encapsulated into a package and stored in the packet buffer.
[0086] 6. Camera ID: This can also be called a sensor ID. For example, one sensor corresponds to one sensor ID.
[0087] 7. User case: Also known as an instance; used to create configuration parameters for camera data stream processing nodes; user cases support the creation and algorithm configuration of various camera modes, such as single-camera mode and multi-camera mode.
[0088] 8. handle: It can be called a handle, which is used to create a camera device driver channel and also used to create or obtain a sensor driver channel.
[0089] 9. Session handle: It can be called session control handle or camera device control interface, which is used to create camera device driver channel.
[0090] 10. Devices handle: can be called sensor handle or sensor control interface, used to create or obtain sensor drive channels.
[0091] 11. open: can be called start.
[0092] 13. Pipeline: It can be called a pipeline, assembly line or multi-threading, which includes threads for each node corresponding to the camera application, such as sensor initialization threads, image algorithm threads, etc.
[0093] ION: An Android subsystem for memory management. ION stands for zero-copy memory. ION represents the memory used to transfer data between user and kernel space in a system such as Android. This memory can be directly accessed from both user and kernel space.
[0094] 15. Other terms
[0095] In the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described in this application as "exemplary" or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0096] In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0097] It should be noted that the "at..." in the embodiments of the present application can be the instant when a certain situation occurs, or it can be a period of time after the situation occurs, and the embodiments of the present application do not specifically limit this. In addition, the display interface provided in the embodiments of the present application is only an example, and the display interface can also include more or less content.
[0098] 16. Electronic devices
[0099] The electronic devices of the embodiments of the present application may include handheld devices, vehicle-mounted devices, etc. with image processing functions. For example, some electronic devices include: mobile phones, tablet computers, PDAs, laptop computers, mobile internet devices (MIDs), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control, wireless terminals in self-driving, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, cellular phones, cordless phones, session initiation protocol (SIP) phones, wireless local loop (WLL) stations, personal digital assistants (PDAs), handheld devices with wireless communication capabilities, computing devices or other processing devices connected to wireless modems, in-vehicle devices (such as car computers), wearable devices, terminal devices in 5G networks or future evolved public land mobile communication networks (PLMNs), and the like. The terminal equipment in the network (PLMN), etc., is not limited to this in the embodiments of the present application.
[0100] As an example and not a limitation, in the embodiments of the present application, the electronic device may also be a wearable device. Wearable devices may also be referred to as wearable smart devices, which are a general term for wearable devices that are intelligently designed and developed using wearable technology for daily wear, such as hearing aids, glasses, gloves, watches, clothing, and shoes. A wearable device is a portable device that is worn directly on the body or integrated into the user's clothes or accessories. Wearable devices are not only hardware devices, but also achieve powerful functions through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include those that are fully functional, large in size, and can achieve complete or partial functions without relying on smartphones, such as smart watches or smart glasses, as well as those that only focus on a certain type of application function and need to be used in conjunction with other devices such as smartphones, such as various smart bracelets and smart jewelry for vital sign monitoring.
[0101] In addition, in the embodiments of the present application, the electronic device can also be a terminal device in the Internet of Things (IoT) system. IoT is an important part of the future development of information technology. Its main technical feature is to connect objects to the network through communication technology, thereby realizing an intelligent network of human-machine interconnection and object-to-object interconnection.
[0102] The electronic devices in the embodiments of the present application may also be referred to as: terminal equipment, user equipment (UE), mobile station (MS), mobile terminal (MT), access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication equipment, user agent or user device, etc.
[0103] In an embodiment of the present application, an electronic device or each network device includes a hardware layer, an operating system layer running on the hardware layer, and an application layer running on the operating system layer. The hardware layer includes hardware such as a central processing unit (CPU), a memory management unit (MMU), and memory (also known as main memory). The operating system can be any one or more computer operating systems that implement business processing through processes, such as a Linux operating system, a Unix operating system, an Android operating system, an iOS operating system, or a Windows operating system. The application layer includes applications such as cameras, browsers, address books, word processing software, and instant messaging software.
[0104] In order to better understand the embodiments of the present application, the structure of the electronic device according to the embodiments of the present application is introduced below:
[0105] FIG1 shows a schematic structural diagram of an electronic device 100 .
[0106] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0107] It should be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0108] 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 video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0109] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0110] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly retrieve it from the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0111] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.
[0112] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C bus lines. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, and the like via different I2C bus interfaces. For example, the processor 110 may be coupled to the touch sensor 180K via the I2C interface, enabling communication between the processor 110 and the touch sensor 180K via the I2C bus interface, thereby implementing the touch function of the electronic device 100.
[0113] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface, enabling the function of answering calls through a Bluetooth headset.
[0114] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
[0115] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface, enabling the function of playing music through Bluetooth headphones.
[0116] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display 194 and the camera 193. MIPI interfaces include the camera serial interface (CSI) and the display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the camera function of the electronic device 100. The processor 110 and the display 194 communicate via the DSI interface to implement the display function of the electronic device 100.
[0117] The GPIO interface can be configured through software. The GPIO interface can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0118] The USB interface 130 is an interface that complies with USB standards and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100, or to transfer data 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 augmented reality devices.
[0119] It is understood that the interface connection relationship between the modules illustrated in the embodiment of the present invention is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.
[0120] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also provide power to the electronic device via the power management module 141.
[0121] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and provides power to the processor 110, the internal memory 121, the display 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0122] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects 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 that execute program instructions to generate or modify display information.
[0123] Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.
[0124] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
[0125] The ISP processes data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and transformed into a visible image. The ISP can also perform algorithmic optimization on image noise, brightness, and skin tone. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 193.
[0126] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0127] 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.
[0128] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. This allows electronic device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.
[0129] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 100, such as image recognition, face recognition, speech recognition, and text comprehension.
[0130] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.
[0131] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, image data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor.
[0132] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be located on display screen 194. There are many types of pressure sensors 180A, such as resistive, inductive, and capacitive. A capacitive pressure sensor can include at least two parallel plates made of conductive material. When force is applied to pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 100 determines the intensity of the pressure based on this change in capacitance. When a touch operation is applied to display screen 194, electronic device 100 detects the touch intensity based on pressure sensor 180A. Electronic device 100 can also calculate the touch location based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch location but with different touch intensities can correspond to different operation instructions. For example, when a touch operation with an intensity less than a first pressure threshold is applied to a short message application icon, an instruction to view short messages is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to a short message application icon, an instruction to create a new short message is executed.
[0133] The gyroscope sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyroscope sensor 180B can also be used for navigation and somatosensory game scenes.
[0134] Accelerometer 180E can detect the magnitude of acceleration of electronic device 100 in all directions (generally three axes). It can also detect the magnitude and direction of gravity when electronic device 100 is stationary. It can also be used to identify the electronic device's posture, enabling applications such as switching between landscape and portrait modes and pedometers.
[0135] The distance sensor 180F is used to measure distance. The electronic device 100 can measure distance using infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure distance to achieve fast focusing.
[0136] Ambient light sensor 180L is used to sense ambient light brightness. Electronic device 100 can adaptively adjust the brightness of display screen 194 based on the perceived ambient light. Ambient light sensor 180L can also be used to automatically adjust white balance when taking photos. Ambient light sensor 180L can also work with proximity light sensor 180G to detect whether electronic device 100 is in a pocket to prevent accidental touches.
[0137] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.
[0138] The touch sensor 180K is also called a "touch-sensitive device." 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 called a "touch screen." The touch sensor 180K is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, at a location different from that of the display screen 194.
[0139] The buttons 190 include a power button, a volume button, and the like. The buttons 190 may be mechanical buttons or touch buttons. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100.
[0140] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0141] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power level changes, messages, missed calls, notifications, etc.
[0142] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present invention, the Android system with a layered architecture is used as an example to illustrate the software structure of the electronic device 100.
[0143] FIG2 is a block diagram of the software structure of the electronic device 100 according to an embodiment of the present invention.
[0144] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into five layers: from top to bottom: the application layer, the application framework layer, the hardware abstraction layer (HAL), the kernel driver layer, and the hardware layer.
[0145] The application layer can include a series of application packages.
[0146] The application package may include applications such as camera, gallery, calendar, phone, map, navigation, WLAN, Bluetooth, music, video, and information as shown in FIG2 .
[0147] The application framework layer provides an application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0148] As shown in FIG. 2 , the application framework layer may include a camera access interface and a window manager.
[0149] The camera access interface establishes communication channels between the camera application and the camera manager and camera device, respectively. The camera access interface can include a Java Native Interface (JNI). By using the Java interface to write programs, the code can be easily ported across different platforms.
[0150] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.
[0151] The hardware abstraction layer (HAL) may include a camera hardware abstraction layer (HAL), a camera algorithm library (CAMLI), and a camera service layer (CSL). The HAL includes at least one camera device. The CAMLI contains image algorithms corresponding to the camera device in the HAL. Camera devices may include sensors, image signal processors (ISAs), digital signal processors (DSPs), and image processors. The CSL facilitates data exchange between the HAL and the kernel driver layer. The CSL provides an interface for interaction between the HAL and the kernel driver layer.
[0152] The kernel driver layer is the interface between hardware and software. It includes at least a camera device driver, a digital signal processor driver, and an image processor driver. The kernel driver layer can utilize the video device kernel driver framework (Video for Linux 2, V4L2) to facilitate reading and writing camera devices such as sensors.
[0153] The hardware layer includes at least one sensor, an image signal processor, a digital signal processor, and an image processor.
[0154] The following describes the software and hardware workflow of electronic device 100, using an example where a user triggers the camera application to take a photo. Figure 3 is a schematic diagram of a possible implementation where a user triggers the camera application to take a photo. Figure 4 is a schematic diagram of the image display process after the camera application is triggered, in a possible implementation. A user can trigger the camera application by touching and clicking the controls of the camera application on electronic device 100. The user can also trigger the camera application by switching the current application of electronic device 100 to the camera application.
[0155] In a possible implementation, when the touch sensor of electronic device 100, as shown in FIG3 , receives a user's single-touch operation, a corresponding hardware interrupt is sent to the kernel driver layer. The kernel driver layer processes the touch operation into a raw input event (including touch coordinates, touch operation timestamp, and other information). The raw input event is stored in the kernel driver layer. The application framework layer receives the raw input event from the kernel driver layer and identifies that the control corresponding to the input event is the control of the camera application icon. As shown in FIG4 , the camera application (APP) of electronic device 100 calls the camera access interface of the application framework layer, executes a first thread through the HAL layer, and obtains camera parameters and a first resource. The first resource includes a created HAL executor. The first thread is, for example, the camera application's startup thread (open thread). After obtaining the camera parameters, the camera application calls the HAL layer's stream allocation thread to configure the camera application's data flow. The stream allocation thread (also known as stream allocation) executes: creating a first channel (e.g., a session handle) corresponding to the camera application and creating various nodes of the camera application. The first channel is also known as the camera device driver channel. The first channel is used to manage the interface between the camera application and at least one camera device. Camera use cases include multi-camera mode or single-camera mode. Creating each node of the camera application includes creating a thread (pipeline) for each node. Nodes include, for example, a sensor initialization node, an image algorithm configuration node, and a sensor streaming start node. Sensor initialization includes powering on the sensor corresponding to the camera application by calling the kernel driver layer and writing initialization register data and calibration register data to the sensor. Sensor streaming start includes writing streaming register data to the sensor corresponding to the camera application by calling the kernel driver layer, starting the camera device driver, and capturing and outputting scene images through the sensor. After the camera application's data stream configuration is complete, the camera application of the electronic device 100 sends a preview request and a rotating buffer (rotating buffer) to the camera hardware abstraction layer. Sending a preview request and a rotating buffer (rotating buffer) is called repeating. The camera hardware abstraction layer of the electronic device 100 calls the image algorithm in the camera algorithm library, processes the scene image output by the sensor, and writes the processed image to the rotating buffer. The camera application displays a preview of the image in the rotating buffer on the camera application's user interface (UI). The user can then take a photo or record a video of the scene image. The photo or video recording operation is used to save the image displayed on the interface.
[0156] However, because the stream allocation thread corresponds to many processes, and the execution of each process requires a lot of I / O and CPU resources, if the electronic device has limited memory and / or the electronic device's CPU resources are heavily occupied by other background applications, the camera application's data stream configuration takes a long time. Therefore, when the user triggers the camera application, the camera application interface takes a long time to display the scene image, which may result in the user not being able to capture the target scene image.
[0157] In order to improve the versatility of camera applications on different electronic devices, some possible camera application system architectures adopt a serial execution method as shown in Figure 4, which is to execute the first thread - distribution - repeating - (preview) display image to realize the image display after the camera application is triggered. Once the time consumption of any of the multiple threads executed serially is prolonged, the time consumption of the image display after the camera application is triggered is prolonged. Since the node creation of sensor initialization is later than the start time of the distribution thread execution in the process corresponding to the distribution thread, and the data volume of the initialization register data and the calibration register data is large, the node creation of sensor initialization takes a long time, which in turn makes the execution of the distribution thread take a long time. In addition, there is a competition relationship between the node creation of sensor initialization and the creation of other nodes in the process corresponding to the distribution thread for memory and CPU resources. When the memory of the electronic device is small and / or the CPU resources of the electronic device are largely occupied by other background applications, the execution time of the distribution thread will be prolonged.
[0158] In view of this, an embodiment of the present application proposes a camera application configuration method, which is applied to an electronic device. By advancing the creation of the sensor initialization node, the start time of the sensor initialization node creation is made earlier than the start time of the distribution thread execution. On the one hand, the sensor initialization node creation is completed in advance, and on the other hand, the electronic device memory and the electronic device CPU resources before the distribution thread starts execution can be effectively utilized, so that the sensor initialization node creation can be completed quickly, and the competition of the sensor initialization node creation for the memory and CPU resources required by other nodes corresponding to the distribution thread is reduced, so that the distribution thread corresponding to other processes can obtain sufficient memory and CPU resources during the execution process, reducing the time consumption of the sensor initialization node creation and the distribution thread execution, so that after the camera application is triggered, the camera application interface quickly displays the image.
[0159] The camera application configuration method provided by this application is described below with reference to some embodiments.
[0160] Figure 5 is a schematic diagram of a user triggering a camera application to take a photo, according to an embodiment of the present application. Figure 6 is a schematic diagram of the image display process after the camera application is triggered, according to an embodiment of the present application. As shown in Figures 5 and 6, when the touch sensor of electronic device 100 receives a user's touch and single-click operation, a corresponding hardware interrupt is sent to the kernel driver layer. The kernel driver layer processes the touch operation into a raw input event (including touch coordinates, touch operation timestamp, and other information). The raw input event is stored in the kernel driver layer. The application framework layer obtains the raw input event from the kernel driver layer and identifies that the control corresponding to the input event is the control of the camera application icon. At a first moment, the camera application (APP) of electronic device 100 calls the camera access interface of the application framework layer and executes a first thread through the HAL layer to obtain camera parameters and a first resource. The first resource includes a created HAL executor. The first thread is, for example, the camera application's startup thread (open thread). At a second moment after the camera application obtains the camera parameters, the camera application of electronic device 100 performs sensor initialization on the sensor corresponding to the camera application through a second thread. Sensor initialization is related to the camera parameters. At a third moment after the first thread completes the corresponding process, the camera application configures the data flow for the camera application through a third thread. Data stream configuration is also called stream allocation. The camera application configures the data stream of the camera application through the third thread, including initializing the camera device driver channel (session handle), creating other nodes corresponding to the camera application such as the image algorithm configuration node, and starting the stream. The data stream includes data streams corresponding to each function of the camera application. The data stream configuration is related to the camera parameters and the parameters obtained during sensor initialization. The third moment is later than the second moment. The execution start time of the second thread is earlier than the execution start time of the third thread, so that the sensor initialization of the sensor corresponding to the camera application can be completed in advance. When the camera application configures the data stream through the third thread, time and resources for executing the sensor initialization process are saved, and the time spent on configuring the data stream of the camera application is reduced. After the data stream configuration of the camera application is completed, the camera application of the electronic device 100 sends a preview request and a rotating buffer (rotating buffer) to the camera hardware abstraction layer. Sending a preview request and a rotating buffer (rotating buffer) is also called repeating. The camera hardware abstraction layer of the electronic device 100 calls the image algorithm in the camera algorithm library, processes the scene image output by the sensor, and writes the processed image to the rotating buffer. The camera application of the electronic device 100 displays a preview of the image in the rotating buffer on the user interface (UI) of the camera application. The user can then take a photo or record a video of the scene image. The photo or video operation is used to save the image displayed on the interface.
[0161] For example, the time taken from when the camera application is triggered to when the scene image is displayed on the camera application interface is (T+730) milliseconds in the possible implementation shown in FIG3 , while the time taken for the camera application provided by the embodiment of the present application shown in FIG5 is (T+600) milliseconds. Assume that the scene image displayed on the camera application interface shown in FIG5 is the target scene image to be captured by the user. If the camera application on the user's electronic device 100 is the camera application shown in FIG3 , the user will not be able to capture the target scene image shown in FIG5 .
[0162] In an embodiment of the present application, after the user switches the current application of the electronic device 100 to the camera application, the interface of the camera application displays the implementation principle and technical effect of the scene image, which is similar to the implementation principle and technical effect of the camera application interface displaying the scene image after the user touches and clicks the camera application as shown in the embodiment of the present application. This embodiment will not be repeated here.
[0163] The camera application configuration method provided in the embodiments of the present application enables the sensor initialization of the corresponding sensor of the camera application to be completed in advance, accelerating the data flow configuration of the camera application, and reducing the time from when the camera application is triggered to when the scene image is displayed on the camera application interface. If the camera application on the user's electronic device adopts the camera application configuration method provided in the embodiments of the present application, after the user triggers the camera application, the camera application interface will promptly display the target scene image that the user wants to capture, allowing the user to complete the capture of the target scene image.
[0164] Figure 7 is a diagram of the corresponding architecture of the camera application for the sensor initialization node provided in advance in an embodiment of the present application. As shown in Figure 9, the architecture includes a camera application (APP), an application framework, and a kernel sensor driver layer. The application framework includes: a camera application API, a hardware environment area, a user end (sensor customer), and a sensor node. The camera application API can be used to trigger and shut down the camera application. The hardware environment area can initialize global parameters, initialize the thread manager, provide an entry for the sensor power-up process, provide a thread data synchronization delay mechanism, provide a configuration / acquisition entry for the global state machine of the sensor initialization process, provide process exit, clear data, and reclaim memory processes. The user end can create a second thread, create a second thread synchronization lock, create a first channel, acquire a second channel, configure parameters such as process switches and logical identifiers, and release asynchronous threads such as the second thread and CSL resources. The sensor node can use the first and second channels, skip the first register data write process, and release resources related to the first and second channels. The kernel driver layer can power on or off the sensor and write data to the second register.
[0165] The camera application configuration method provided by the present application is described in detail below with reference to Figures 8, 9, 10, and 11, and the architecture diagram shown in Figure 7 is described in detail. Figure 8 is a flowchart of the camera application configuration method provided in an embodiment of the present application. Figure 9 is a flowchart of the camera application configuration method provided in an embodiment of the present application. Figure 10 is a schematic diagram of the multi-camera mode provided in an embodiment of the present application. Figure 11 is a schematic diagram of the single-camera mode provided in an embodiment of the present application. The execution subject of the embodiment shown in Figure 8 can be the electronic device 100 in the embodiment shown in Figure 1. As shown in Figure 8, the method includes:
[0166] S101. At a first moment, obtain camera parameters through a first thread.
[0167] In an embodiment of the present application, in response to an instruction to trigger a camera application, electronic device 100 invokes a first thread at a first moment, obtains camera parameters, and creates a HAL executor through the first thread. The first thread is, for example, an open thread. The execution of the first thread is serviced by the HAL layer. The camera parameters include a sensor identifier.
[0168] S102: At a second moment, initialize the sensor via a second thread. The sensor includes a sensor corresponding to the camera application. Sensor initialization is related to camera parameters.
[0169] In the embodiment of the present application, at the second moment after acquiring the camera parameters, the electronic device 100 initializes the sensor corresponding to the camera application through the second thread.
[0170] Exemplarily, before the electronic device 100 performs sensor initialization on the sensor corresponding to the camera application through the second thread, the electronic device 100 detects the logical ID of the camera application. The logical ID includes an ID of the first mode or an ID of the second mode. The first mode corresponds to m sensors, and the second mode corresponds to one sensor, where m is an integer greater than 0. The first mode is, for example, the multi-camera mode shown in FIG10 . The second mode is, for example, the single-camera mode shown in FIG11 . The logical ID can be used to determine a user case of the camera application, such as a single-camera mode or a multi-camera mode.
[0171] Optionally, if the electronic device 100 detects that the logical identifier of the camera application is an identifier of the first mode, it creates a first channel corresponding to the camera application and creates m second threads. The first channel can be used to manage the interface between the camera application and the m sensors. The electronic device 100 initializes the m sensors respectively through the m second threads. For any second thread of the m second threads, any second thread executes: applying for resource cache, obtaining the second channel of any one of the m sensors from the first channel, and writing first register data to any one of the sensors. The second channel is used to power on any one of the sensors.
[0172] Exemplarily, the electronic device 100 uses the session control handle of the CSL service to create a first channel between the camera application and the camera device. For example, the electronic device 100 creates a session control handle of the driver node of the camera device including the sensor through the CSL open function to obtain the first channel, so as to obtain the second channel for driving the sensor through the first channel. The electronic device 100 implements communication between the camera application and the hardware abstraction layer through the first channel. Assuming m=2, the interface between the camera application and the m sensors can be devices handle 1 and devices handle 2 as shown in Figure 10. Optionally, the m second threads created can correspond to the sensor identifiers (camera ids) of the m sensors respectively.
[0173] Optionally, the electronic device 100 initializes m sensors respectively through m second threads, which may include: the electronic device 100 registers a callback function (such as a sensor advance power thread job callback function) to the second thread through a first function (such as a register job family function), configures the thread priority and parameter passing buffer, and starts the second thread through a startup function (such as a post job function).
[0174] Optionally, the electronic device 100 creates a corresponding synchronization lock when creating each second thread. The synchronization lock is used to lock the execution object corresponding to the second thread to obtain accurate execution results or clean execution result data. For example, assuming that the camera application corresponds to two sensors as shown in Figure 10, the electronic device 100 creates two second threads, namely second thread 1 and second thread 2. The electronic device 100 performs sensor initialization on sensor 1 and sensor 2 as shown in Figure 10 respectively through the second thread 1 and the second thread 2. If the second thread 1 and the second thread 2 execute their respective corresponding processes h, and the execution object is H, and the process h corresponding to the second thread 1 is prior to the process h corresponding to the second thread 2, then the electronic device 100 uses the synchronization lock of the second thread 1 to lock the object H when the second thread 1 corresponds to the process h. After the electronic device 100 executes the process h corresponding to the second thread 1, it unlocks the object H so that the electronic device 100 locks the object H when the second thread 2 corresponds to the process h. In this way, multiple second threads executed in parallel will not simultaneously grab the same execution object, so that the execution result corresponding to each second thread is accurate and the execution result data obtained for each second thread is clean.
[0175] The electronic device 100 executes to obtain the second channel of any one of the m sensors from the first channel. For example, the electronic device 100 uses the first channel (or session handle) to call the control interface (devices handle) of any one of the m sensors to obtain the second channel of any one of the m sensors. The control interface of any sensor is devices handle 1 or devices handle 2 as shown in Figure 10. The control interface (devices handle) of any one of the m sensors can be created or called by the electronic device 100 through an acquisition function (such as the CSL acquire device function).
[0176] Exemplarily, the resource cache includes a packet buffer. The electronic device 100 executes a request for a resource cache, including the electronic device 100 requesting a packet buffer from the kernel driver layer through the camera service layer (CSL). The packet buffer may be an ION buffer. The packet buffer is used for data transmission. The ION buffer can provide a common memory address for the hardware abstraction layer and the kernel driver layer. The kernel driver layer can directly use the data in the ION buffer to execute subsequent processes without copying data between the kernel driver layer and the hardware abstraction layer, thereby improving data transmission efficiency.
[0177] For example, the process of the electronic device 100 writing the first register data to any sensor may include the following steps S1021-S1024:
[0178] S1021: The electronic device 100 obtains first register data from a camera application.
[0179] Exemplarily, the first register data may include initialization register data corresponding to the sensor. The first register data may also include calibration register data corresponding to the sensor. The calibration registers may include PDC registers, SPC registers, and QSC registers.
[0180] S1022: The electronic device 100 stores the first encapsulated packet obtained by encapsulating the first register data in a packet buffer, thereby transmitting the first register data from the application layer to the kernel driver layer.
[0181] S1023: The electronic device 100 parses the first encapsulated packet obtained from the packet buffer to obtain the parsed first register data. For example, the electronic device 100 obtains the first encapsulated packet from the packet buffer of the kernel driver layer. The electronic device 100 parses the first encapsulated packet at the kernel driver layer to obtain the parsed first register data.
[0182] S1024: The electronic device 100 writes the parsed first register data into any sensor. For example, the electronic device 100 writes the parsed first register data into any sensor via an I2C bus (inter-integrated circuit).
[0183] Exemplarily, if the first register data includes initialization register data and calibration register data, the electronic device 100 can write the parsed initialization register data to the sensor by calling a second function (such as the load sensor init config cmd function), and write the parsed calibration register data to the sensor by calling a third function (such as the load sensor config cmds function).
[0184] Optionally, step S1021 may be performed before the electronic device 100 executes the resource cache application process, so that the electronic device 100 applies for a packet buffer that matches the data size of the first register, thereby achieving reasonable and effective utilization of the memory resources of the electronic device 100.
[0185] Optionally, if the electronic device 100 detects that the camera application's logical identifier is an identifier for the second mode, it creates a second thread. Since the camera application with the logical identifier for the second mode corresponds to a single sensor, the electronic device 100 initializes the single sensor via the second thread. Exemplarily, the electronic device 100 executes the following operations via the second thread: requesting a resource cache, creating a first channel, obtaining a second channel of a sensor from the first channel, and writing first register data to the single sensor. The second channel is used to power on the single sensor.
[0186] Exemplarily, the resource cache includes a packet buffer. The electronic device 100 executes a request for resource cache, including the electronic device 100 requesting a packet buffer corresponding to the sensor from the kernel driver layer. The packet buffer may be an ION buffer. The packet buffer is used for data transmission.
[0187] Exemplarily, the electronic device 100 creates a first channel (such as the first channel shown in FIG11 ) between the camera application and the camera device by creating a session control handle of the CSL service.
[0188] The electronic device 100 obtains the second channel of the sensor from the first channel. For example, the electronic device 100 calls the control interface of the sensor (devices handle 1 as shown in FIG11 ) through the first channel to obtain the second channel of the sensor.
[0189] For example, the process of the electronic device 100 writing the first register data to the sensor may include the following steps S1025-S1028:
[0190] S1025 : The electronic device 100 obtains first register data from the camera application.
[0191] Optionally, the first register data may include initialization register data corresponding to the sensor. The first register data may also include calibration register data corresponding to the sensor. Calibration registers include, for example, phase detection correction (PDC) registers, sensitivity phase correction (SPC) registers, and quad sensitivity correction (QSC) registers.
[0192] S1026 . The electronic device 100 stores the first encapsulated packet obtained by encapsulating the first register data in the packet buffer, thereby transmitting the first register data from the application layer to the kernel driver layer.
[0193] S1027: The electronic device 100 parses the first encapsulated packet obtained from the packet buffer to obtain the parsed first register data. For example, the electronic device 100 obtains the first encapsulated packet from the packet buffer of the kernel driver layer. The electronic device 100 parses the first encapsulated packet at the kernel driver layer to obtain the parsed first register data.
[0194] S1028: The electronic device 100 writes the parsed first register data into the sensor. For example, the electronic device 100 writes the parsed first register data into the sensor via an I2C bus (inter-integrated circuit).
[0195] Optionally, step S1025 can be performed before the electronic device 100 executes the resource cache application process, so that the electronic device 100 applies for a packet buffer that matches the first register data size corresponding to this sensor, thereby achieving reasonable and effective utilization of the memory resources of the electronic device 100.
[0196] Optionally, the electronic device 100 performs sensor initialization on the sensor via the second thread, further comprising: configuring global state machine parameters for the sensor power-up process and global state machine parameters for the first register data writing sensor state, so as to store the sensor power-up state machine and the first register data writing sensor completion state machine in global variables of the camera application. The state machine comprises a directed graph consisting of states, transitions, and actions.
[0197] Optionally, the electronic device 100 also creates a global variable maintenance interface for managing global variables of the camera application. The electronic device 100 maintains the process state machines corresponding to the first channel, second thread, second channel, and second thread in global variables, so that when the electronic device 100 configures the data flow of the camera application in step S103, it calls the process state machines corresponding to the first channel, second thread, second channel, and second thread, thereby reducing the time spent by the electronic device 100 in configuring the data flow of the camera application. The process state machine includes a directed graph consisting of process states, process transitions, and process actions of the process. The process state machine corresponding to the second thread includes a sensor power-on state machine and a first register data write to the sensor completion state machine.
[0198] Exemplarily, the global variable maintenance interface also provides an entry point for the sensor power-up process, a thread data synchronization delay mechanism, and an entry point for configuring / obtaining the global state machine for the sensor initialization process. Furthermore, it provides functions for exiting the process, clearing data, and reclaiming memory. By calling the global variable maintenance interface, the electronic device 100 can perform global class initialization on the hardware environment of the camera application. For example, the electronic device 100 can perform the following global parameter initialization: initializing all sensor power-up state machine parameters, creating sensor pointer addresses, creating and managing a sensor hardware information resource list, and creating an asynchronous thread manager using the thread manager class provided by the operating system of the electronic device 100. By calling a global variable maintenance interface, such as interface class 1, the sensor hardware information pointer address can be returned. By calling a global variable maintenance interface, such as interface class 2, a thread manager can be provided to create and manage asynchronous threads such as the second thread. Optionally, the maximum number of threads p that the thread manager can maintain can be statically or dynamically configured based on m, for example, statically or dynamically configuring p based on p ≥ m. By calling the global variable maintenance interface, the electronic device 100 can also maintain the asynchronous thread data execution state machine and the CSL handle. For example, calling interface class 3 to maintain the sensor power-on process parameter state machine; calling interface class 4 to maintain the sensor initialization process execution state machine; calling interface class 5 to maintain the CSL handles for single-camera mode and multi-camera mode, thereby maintaining the first channel and second channel of the CSL service in single-camera mode and multi-camera mode. In this way, when executing step S103, the electronic device 100 can conveniently, accurately, and efficiently call the process state machines corresponding to the first channel, second thread, second channel, and second thread.
[0199] S103, at a third moment, configuring data streams for the camera application through a third thread; the data streams include data streams corresponding to various functions of the camera application; the data stream configuration is related to camera parameters and parameters obtained during sensor initialization, and the third moment is later than the second moment.
[0200] In this embodiment of the present application, the electronic device 100 configures the data flow for the camera application through the third thread at a third time after the process corresponding to the first thread is completed. The third time is later than the second time, but earlier than the time when the second thread completes execution, so that the third thread can be executed in parallel with the second thread.
[0201] For example, the electronic device 100 may configure the data flow for the camera application through the third thread in the manner shown in S1031-S1034 below:
[0202] S1031. The electronic device 100 initializes the first channel and creates threads for each node corresponding to the camera application. The threads of each node are such as a realtime pipeline. The nodes include nodes for initializing the sensor corresponding to the camera application. The nodes also include nodes for each instance (usercase) of the camera application, such as nodes for the image algorithm associated with the instance. The threads of the image algorithm node are also related to the first channel. The instances may include instances such as night scenes, portraits, and dynamic photos as shown in Figure 5.
[0203] S1032: If the electronic device 100 detects that the global variable contains a thread for initializing a sensor node, it obtains a first channel from the global variable.
[0204] In the embodiment of the present application, the electronic device 100 needs to detect the threads of each node. If the electronic device 100 detects that the global variable contains a thread of the node used to initialize the sensor, such as the second thread, indicating that the global variable also contains the first channel, the electronic device 100 can obtain the first channel from the global variable.
[0205] Optionally, if the electronic device 100 does not detect that the global variable contains a thread for initializing the sensor node, the electronic device 100 will detect again at an interval of 10ms whether the global variable contains a thread for initializing the sensor node. The electronic device 100 starts timing from the first detection of whether the global variable contains a thread for initializing the sensor node. If the electronic device 100 still does not detect that the global variable contains a thread for initializing the sensor node after 3s, the electronic device 100 triggers the process protection mechanism of the camera application to terminate the process currently being executed by the camera application and the subsequent processes to be executed. 3s is a pre-set timeout period. In this way, the parameters of the first channel obtained can be not empty data, so that the second thread can be scheduled by the CPU in time, and the process synchronization of obtaining the first channel and obtaining the second channel can be achieved.
[0206] Optionally, the electronic device 100 may also directly detect whether the global variable contains the first channel. If the electronic device 100 detects that the global variable contains the first channel, the electronic device 100 obtains the first channel from the global variable.
[0207] After the electronic device 100 obtains the first channel from the global variable, it may execute the step shown in S1033 .
[0208] Optionally, if the electronic device 100 does not detect that the global variable contains the first channel, the electronic device 100 rechecks whether the global variable contains the first channel at an interval of 10ms. The electronic device 100 starts timing from the first detection of whether the global variable contains the first channel. If the electronic device 100 still does not detect that the global variable contains the first channel after 3 seconds, the electronic device 100 triggers the process protection mechanism of the camera application to terminate the currently executing process of the camera application and subsequent processes to be executed.
[0209] S1033: If the electronic device 100 detects that the global variable includes a sensor power-on state machine and a first register data writing to sensor completion state machine, it obtains the second channel of each sensor from the global variable.
[0210] In an embodiment of the present application, if the electronic device 100 detects that the global variable contains a sensor power-on state machine and a first register data writing sensor completion state machine, the electronic device 100 obtains the sensor power-on state machine and the first register data writing sensor completion state machine from the global variable. Upon obtaining the sensor power-on state machine and the first register data writing sensor completion state machine from the global variable, the electronic device 100 determines that the sensor corresponding to the camera application has completed powering on and sensor initialization. The electronic device 100 then obtains the second channel of each sensor from the global variable to directly execute subsequent steps, such as step S1034.
[0211] Optionally, if the electronic device 100 does not detect that the global variable contains the sensor power-on state machine and the first register data writing sensor completion state machine, the electronic device 100 will detect again at an interval of 10ms whether the global variable contains the sensor power-on state machine and the first register data writing sensor completion state machine.
[0212] Optionally, if the electronic device 100 begins timing after first detecting whether the global variables contain the sensor power-on state machine and the first register data writing sensor completion state machine, and after 5 seconds, still does not detect that the global variables contain the sensor power-on state machine and the first register data writing sensor completion state machine, the electronic device 100 triggers the camera application's process protection mechanism to terminate the camera application's currently executing process and subsequent pending processes. 5 seconds may be a preset maximum waiting time.
[0213] S1034: Electronic device 100 skips writing the first register data to the sensor and writes the second register data to each sensor corresponding to the camera application via the second channel of each sensor. The second register data includes stream register data selected based on the data stream size. For example, electronic device 100 writes the second register data to each sensor corresponding to the camera application by calling a third function (e.g., the load sensor config cmds function).
[0214] Optionally, in response to an instruction to switch the target sensor's kth data output mode to the vth data output mode, the electronic device 100 may flush the data of the data output pipeline corresponding to the kth data output mode of the target sensor and reconfigure the data of the data output pipeline corresponding to the vth data output mode. For example, the electronic device 100 may rewrite the second register data to the target sensor to implement the configuration of the data of the data output pipeline corresponding to the vth data output mode, without powering off the target sensor.
[0215] In an embodiment of the present application, if step S1034 detects that the global variable includes a sensor power-on state machine and a first register data writing sensor completion state machine, the electronic device 100 does not need to initialize each sensor. The electronic device 100 directly skips the process of writing the first register data to the sensor, and writes the second register data to each sensor corresponding to the camera application through the second channel of each sensor of the camera application, thereby starting the flow of each sensor.
[0216] In this way, the electronic device 100 saves the time of writing the first register data to the sensor when executing step S1034. In addition, step S1034 does not need to write the first register data to the sensor. If the execution of the threads of other nodes corresponding to the camera application created by step S1031 is parallel to step S1034, the execution of the threads of other nodes will obtain more abundant memory and CPU resources, which further enables step S103 to be completed quickly.
[0217] After each sensor starts streaming, it captures scene images and transmits them to the HAL layer of electronic device 100. In response to a preview request and carousel buffer sent by the camera application from the application layer to the HAL layer, electronic device 100 invokes the image algorithm in the HAL layer's camera algorithm library. The HAL layer processes the scene image output by the camera application's corresponding sensor and writes the processed image to the carousel buffer. The camera application displays a preview of the image in the carousel buffer on the camera application's interface.
[0218] Furthermore, after the electronic device 100 writes the second register data into each sensor corresponding to the camera application through the second channel of each sensor of the camera application, the electronic device 100 can call the global variable maintenance interface to cancel the second thread in the global variable to release more memory.
[0219] Optionally, if the electronic device 100 fails to create the second thread when executing step S102, the electronic device 100 terminates step S102 and may continue to execute the steps shown in S103 to initialize the sensor corresponding to the camera application and configure the data stream for the camera application. In this way, the camera application interface can still display the scene image captured and output by the sensor.
[0220] Optionally, the second thread also includes a thread switch. The electronic device 100 may also turn off the thread switch when the total amount of available memory and CPU resources of the electronic device 100 is greater than the resource threshold. As shown in Figure 9, if the electronic device 100 detects that the thread switch is on, step 102 may be executed. Correspondingly, if the electronic device 100 detects that the thread switch is off, the electronic device 100 may skip step S102 and execute step S103 after executing step S101. Exemplarily, if the electronic device 100 detects that the thread switch identifier is an on identifier, it indicates that the electronic device 100 detects that the thread switch is on; correspondingly, if the electronic device 100 detects that the thread switch identifier is a off identifier, it indicates that the electronic device 100 detects that the thread switch is off. The on identifier is such as identifier 1, and the off identifier is such as identifier 0.
[0221] Optionally, after the electronic device 100 configures the data flow for the camera application via the third thread, the electronic device 100 may also respond to an instruction to shut down the camera application by detecting the camera application's logical identifier and obtaining a sensor-related pointer. If the logical identifier is an identifier for the first mode, the electronic device 100, based on the obtained sensor-related pointer, releases the first channel, initializes the sensor power-on state machine, releases the sensor's second channel, and deregisters the second thread. If the logical identifier is an identifier for the second mode, the electronic device 100 initializes the sensor power-on state machine, releases the sensor's second channel, and deregisters the second thread. This improves the compatibility of the camera application with other applications, allowing the second thread to be created and executed normally after another application triggers the camera application. This allows the camera application to quickly complete initialization of the corresponding sensor and data flow configuration for the camera application after being triggered by another application.
[0222] Optionally, after the electronic device 100 configures the data flow for the camera application through the third thread, the electronic device 100 responds to the instruction to switch out of the camera application by destroying the thread and the first channel of each node corresponding to the camera application, and destroying the second channel. If the first channel and the second channel are the first channel and the second channel of the CSL service, then after the camera application exits, the first channel and the second channel of all CSL services will be released, so that after the camera application exits, the electronic device 100 has more available CPU resources and more available input / output (I / O) resources.
[0223] The camera application configuration method provided in the embodiment of the present application enables the sensor initialization of the sensor corresponding to the camera application to be completed in advance, accelerates the data stream configuration of the camera application, and can reduce the time from the camera application being triggered to the camera application interface displaying the scene image. If the camera application on the user's electronic device adopts the camera application configuration method provided in the embodiment of the present application, after the user triggers the camera application, the interface of the camera application will promptly display the target scene image that the user wants to capture, allowing the user to complete the capture of the target scene image, thereby improving the user's experience of using the camera application. In addition, if the electronic device adopts the camera application configuration method provided in the embodiment of the present application, after the camera application is triggered, even if the second thread cannot be created, the interface of the camera application can still preview and display the scene image output after the sensor capture.
[0224] An embodiment of the present application provides an electronic device, which terminal device includes: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the electronic device executes the above method.
[0225] The present application provides a chip. Figure 12 is a schematic diagram of the hardware structure of the chip provided in the present application. The chip includes one or more (including two) processors 81, a communication line 82, a communication interface 83, and a memory 84. The processor 81 is used to call the computer program in the memory to execute the technical solution in the above embodiment. Its implementation principle and technical effects are similar to those of the above-mentioned related embodiments and will not be repeated here.
[0226] The embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the above-mentioned method is implemented. The methods described in the above embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. If implemented in software, the functions can be stored as one or more instructions or codes on a computer-readable medium or transmitted on a computer-readable medium. Computer-readable media can include computer storage media and communication media, and can also include any medium that can transfer a computer program from one place to another. The storage medium can be any target medium that can be accessed by a computer.
[0227] In one possible implementation, computer-readable media may include RAM, ROM, compact disc read-only memory (CD-ROM) or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium designed to carry or store the desired program code in the form of instructions or data structures and accessible by a computer. Moreover, any connection is appropriately referred to as a computer-readable medium. For example, if a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) or wireless technologies such as infrared, radio and microwave are used to transmit software from a website, server or other remote source, the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technologies such as infrared, radio and microwave are included in the definition of medium. Disk and optical disk as used herein include optical disk, laser disk, optical disk, digital versatile disk (DVD), floppy disk and Blu-ray disk, where disks generally reproduce data magnetically, while optical disks reproduce data optically using lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0228] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed, the computer executes the above method.
[0229] The present application embodiment is described with reference to the flow chart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present application.It should be understood that each flow process and / or box in the flow chart and / or block diagram and the combination of the flow process and / or box in the flow chart and / or block diagram can be realized by computer program instructions.These computer program instructions can be provided to the processing unit of general-purpose computer, special-purpose computer, embedded processing machine or other programmable device to produce a machine, so that the instruction executed by the processing unit of computer or other programmable data processing device produces the device for realizing the function specified in one flow chart flow or multiple flows and / or one block or multiple blocks of block diagram.
[0230] The above specific implementation methods further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation methods of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solutions of the present invention should be included in the scope of protection of the present invention.
Claims
1. A camera application configuration method, characterized in that: Applied to electronic equipment, the method comprises: At the first moment, the camera parameters are obtained through the first thread; At the second moment, the sensor is initialized through the second thread; the sensor includes a sensor corresponding to the camera application; the sensor initialization is related to the camera parameter; At a third moment, data stream configuration is performed on the camera application through a third thread; the data stream includes data streams corresponding to various functions of the camera application; the data stream configuration is related to the camera parameters and the parameters obtained in the sensor initialization, and the third moment is later than the second moment.
2. The method according to claim 1, characterized in that Before the sensor is initialized by the second thread, the method further includes: Detecting a logical identifier of the camera application, where the logical identifier includes an identifier of a first mode or an identifier of a second mode; the first mode corresponds to m sensors, the second mode corresponds to one sensor, and m is an integer greater than 0; If the logical identifier is an identifier of the first mode, creating a first channel corresponding to the camera application, and creating m second threads; The performing sensor initialization on the sensor through the second thread includes: performing sensor initialization on the m sensors respectively through the m second threads; wherein the first channel is used to manage the interface between the camera application and the m sensors.
3. The method according to claim 2, characterized in that The performing sensor initialization on the m sensors respectively by the m second threads includes: For any one of the m second threads, the following steps are performed by the any one of the second threads: applying for a resource cache, obtaining a second channel of any one of the m sensors from the first channel, and writing first register data to the any one of the sensors; the second channel is used to power on the any one of the sensors.
4. The method according to claim 3, characterized in that The resource cache includes a package cache area; The step of writing first register data to any one of the sensors comprises: Acquire first register data from the camera application; storing a first encapsulation packet obtained by encapsulating the first register data in the packet buffer; Parsing a first encapsulation packet obtained from the packet buffer area to obtain parsed first register data; The parsed first register data is written into any one of the sensors.
5. The method according to claim 2, characterized in that: Also includes: If the logic identifier is an identifier of the second mode, creating a second thread; The initializing the sensor by using the second thread includes: initializing the sensor by using the second thread.
6. The method according to claim 5, characterized in that The step of initializing the sensor by using the second thread includes: The second thread executes: applying for resource cache, creating the first channel, obtaining the second channel of the sensor from the first channel, and writing first register data to the sensor; the second channel is used to power on the sensor.
7. The method according to claim 6, characterized in that The resource cache includes a package cache area; The step of writing first register data to the sensor comprises: Acquire first register data from the camera application; storing a first encapsulation packet obtained by encapsulating the first register data in the packet buffer; Parsing a first encapsulation packet obtained from the packet buffer area to obtain parsed first register data; The parsed first register data is written into the one sensor.
8. The method according to any one of claims 1 to 7, characterized in that: The second thread includes a corresponding synchronization lock; the synchronization lock is used to lock the execution object corresponding to the second thread.
9. The method according to claim 3, 4, 6 or 7, characterized in that: The method further comprises: Creating a global variable maintenance interface for managing global variables of the camera application; The first channel, the second thread, and the process state machine corresponding to the second channel and the second thread are maintained in the global variable; the process state machine includes a directed graph consisting of the process state, process transition, and process action of the process, and the process state machine corresponding to the second thread includes a sensor power-on state machine and a first register data writing completion state machine.
10. The method according to claim 9, characterized in that The configuring the data stream of the camera application through the third thread includes: Initialize the first channel and create threads of each node corresponding to the camera application; the nodes include a node for initializing the sensor; If it is detected that the global variable contains a thread for initializing the node of the sensor, obtaining the first channel from the global variable; If it is detected that the global variable contains the sensor power-on state machine and the first register data writing completion state machine, then obtaining the second channel of each of the sensors from the global variable; The process of writing the first register data into the sensor is skipped, and the second register data is written into each sensor through the second channel of each sensor; the second register data includes the flow register data selected according to the data flow size.
11. The method according to claim 10, characterized in that After writing the second register data into each of the sensors through the second channels of the sensors, the method further includes: The second thread in the global variable is cancelled.
12. The method according to claim 11, characterized in that After configuring the data stream of the camera application through the third thread, the method further includes: In response to an instruction to close the camera application, detecting a logical identifier of the camera application; the logical identifier includes an identifier of a first mode or an identifier of a second mode, the first mode corresponds to m sensors, the second mode corresponds to one sensor, and m is an integer greater than 0; If the logic identifier is an identifier of the first mode, releasing the first channel, initializing the sensor power-on state machine, releasing the second channel of the sensor and deregistering the second thread; If the logical identifier is an identifier of the second mode, the sensor power-on state machine is initialized, the second channel of the sensor is released, and the second thread is deregistered.
13. The method according to claim 11, characterized in that After configuring the data stream of the camera application through the third thread, the method further includes: In response to an instruction to switch out of the camera application, the threads of each node corresponding to the camera application and the first channel are destroyed; and the second channel is destroyed.
14. An electronic device, characterized in that: include: Processor and memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the electronic device performs the method according to any one of claims 1 to 13.
15. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 13 is implemented.
16. A computer program product, characterized in that The method comprises a computer program, which, when being executed, enables a computer to execute the method according to any one of claims 1 to 13.
17. A chip, comprising a processor, wherein the processor is used to call a computer program in a memory to execute the method according to any one of claims 1 to 13.
