Data transmission method and related device

By creating a special information interface in electronic devices to separately transmit focal length information and Hall data, the problem of lag delay during anti-shake processing is solved and the user experience is improved.

CN120034592APending Publication Date: 2025-05-23HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411847684.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-23
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

When electronic devices undergo anti-shake processing, they may experience lag and delay, resulting in poor user experience.

Method used

When the camera is started, at least two information interfaces are created, one for transmitting focal length information and the other for transmitting Hall data, thereby transmitting separately, reducing the blockage of Hall data transmission by focal length information transmission.

Benefits of technology

By separately transmitting focal length information and Hall data, the transmission delay is reduced, the picture stuttering of electronic devices is reduced, and the user experience is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120034592A_ABST
    Figure CN120034592A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data transmission method and a related device, and is applied to the technical field of terminals. The method comprises the steps that when a camera is started, at least two information interfaces are created, one information interface is used for transmitting focal length information, and the other information interface is used for transmitting Hall data. Therefore, the focal length information and the Hall data are transmitted separately, so that the blocking of the transmission of the focal length information to the Hall data transmission can be reduced, the situation that a picture is relatively late due to waiting for the Hall data is reduced, and the picture lagging of the electronic equipment is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application. The application number of the original application is 202311583516.9, and the original application date is November 23, 2023. The entire contents of the original application are incorporated into this application by reference. Technical Field

[0002] The present application relates to the field of terminal technology, and in particular to a data transmission method and related devices. Background Art

[0003] Electronic devices such as mobile phones are usually equipped with one or more cameras to facilitate users to take photos, record, live broadcast, etc. When users use electronic devices to take photos, the images taken may be blurred due to hand shaking or camera shaking. Therefore, electronic devices need to perform anti-shake processing when taking photos to improve image quality.

[0004] However, when electronic devices are performing anti-shake processing, there may be freezes and delays, resulting in a poor user experience. Summary of the invention

[0005] The embodiment of the present application provides a data transmission method and related device, which are applied to the field of terminal technology. When the camera is started, at least two information interfaces are created, one for transmitting focal length information and the other for transmitting Hall data. In this way, the focal length information and Hall data are transmitted separately, which can reduce the blocking of Hall data transmission by focal length information transmission, thereby reducing the situation where the image is output late due to waiting for Hall data, and reducing the screen freeze of the electronic device.

[0006] In a first aspect, an embodiment of the present application provides a data transmission method. The method includes: in response to an operation of turning on a camera, creating a first information interface and a second information interface; transmitting first information through the first information interface, and transmitting second information through the second information interface, wherein the first information and the second information are different, and both the first information and the second information are used for image anti-shake processing.

[0007] The first information and the second information are transmitted through an information interface respectively, and the first information and the second information can be transmitted simultaneously, thereby reducing the situation where the first information blocks the second information and reducing the transmission delay caused by the blockage. In this way, the jamming phenomenon caused by slow anti-shake processing due to transmission delay can be reduced.

[0008] Optionally, transmitting the first information through the first information interface and transmitting the second information through the second information interface includes: when it is determined that the first information is target type information, transmitting the first information through the first information interface; and when it is determined that the second information is not target type information, transmitting the second information through the second information interface.

[0009] In this way, the information interface is selected according to the type of information, reducing the confusion of information interface transmission.

[0010] Optionally, information of the first information interface is stored in a member variable, and information of the second information interface is stored in an array; when the first information is judged to be information of the target type, the first information is transmitted through the first information interface, including: confirming the second information interface from the array according to the first message; when the first information is judged to be information of the target type, replacing the information interface used to transmit the first information from the second information interface to the first information interface; and transmitting the first information through the first information interface.

[0011] In this way, the selection of the first information interface is achieved by replacement, with minor changes to the existing architecture, and the method is simple and easy to implement.

[0012] Optional, the target type is SNS_OIS_MANAGER_MSGID_SNS_SET_AF_TARGET.

[0013] Optionally, the first information is used to perform optical image stabilization control on the camera; and the second information is used to perform electronic image stabilization processing on the image.

[0014] In this way, the first information and the second information may correspond to different anti-shake modes.

[0015] Optionally, the first information is information derived from a hardware abstraction layer, and the second information is information derived from hardware, and the hardware is hardware related to anti-shake processing.

[0016] Optionally, the first information includes focal length information, and the focal length information is used to indicate the focal length of the camera; the second information includes Hall data, and the Hall data is used to indicate the position of the lens in the camera.

[0017] The focal length of the camera may correspond to the target focal length below, and may also be referred to as an adjusted focal length, a focal length setting value, etc., which is not limited here.

[0018] In this way, focal length compensation can be performed based on focal length information, reducing the interference of focal length change on anti-shake and improving the anti-shake effect. Electronic anti-shake processing can be performed based on Hall data to facilitate the determination of image offset.

[0019] Optionally, creating a first information interface and a second information interface includes: creating the first information interface and the second information interface in a hardware abstraction layer; transmitting first information through the first information interface, and transmitting second information through the second information interface, including: the hardware abstraction layer transmits the first information to the sensor center layer through the first information interface; the sensor center layer transmits the second information to the hardware abstraction layer through the second information interface.

[0020] Optionally, the hardware abstraction layer includes: an optical image stabilization processing module and an electronic image stabilization processing module; the sensor center layer includes: an optical image stabilization driver; transmitting first information through a first information interface, and transmitting second information through a second information interface, including: the optical image stabilization processing module transmitting the first information to the optical image stabilization driver through the first information interface; the optical image stabilization driver transmitting the second information to the electronic image stabilization processing module through the second information interface.

[0021] In this way, the optical image stabilization driver can perform focal length compensation based on the focal length information, reduce the interference of focal length change on the image stabilization, and improve the image stabilization effect. The electronic image stabilization processing module can perform electronic image stabilization processing based on the Hall data to facilitate the determination of image offset.

[0022] Optionally, in response to an operation of turning off the camera, the first information interface and the second information interface are destroyed.

[0023] In this way, when the camera is turned off, the information interface is destroyed.

[0024] Optionally, the method further includes: performing optical image stabilization control according to the first information and the jitter information, wherein the jitter information is used to indicate the displacement of the lens in the camera caused by the jitter.

[0025] Optionally, performing optical image stabilization control according to the first information and the jitter information includes: obtaining a target position of the lens according to the focal length information and the jitter information in the first information; and controlling the movement of the lens according to the target position.

[0026] Optionally, the target position of the lens is obtained according to the focal length information and jitter information in the first information, including: obtaining focal length compensation according to the focal length information and a preset correspondence, wherein the correspondence is the relationship between the focal length and the compensation value; obtaining jitter compensation according to the jitter information, wherein the jitter compensation is used to compensate for the displacement of the lens in the camera caused by jitter; and superimposing the focal length compensation, jitter compensation, and the position of the lens in the camera to obtain the target position.

[0027] Optionally, the method further includes: performing electronic anti-shake processing according to the Hall data in the second information.

[0028] Optionally, electronic anti-shake processing is performed according to the Hall data in the second information, including: determining the center position of the image according to the position of the lens corresponding to the Hall data; performing anti-shake (fusion, cropping, etc.) processing on the image according to the center position of the image to obtain a processed image.

[0029] In this way, the image can be electronically image-stabilized to improve image stability.

[0030] In a second aspect, an embodiment of the present application provides an electronic device, the electronic device comprising a terminal device, which may also be referred to as a terminal, user equipment (UE), mobile station (MS), mobile terminal (MT), etc.

[0031] The electronic device comprises: 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 method as in the first aspect.

[0032] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the method of the first aspect is implemented.

[0033] 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 executed, the computer executes the method of the first aspect.

[0034] In a fifth aspect, an embodiment of the present application provides a chip system, the chip system including a processor, the processor being used to call a computer program in a memory to execute the method described in the first aspect.

[0035] 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

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

[0037] Figure 2 A schematic diagram of the structure of hardware related to optical image stabilization in an electronic device provided in an embodiment of the present application;

[0038] Figure 3 A schematic diagram of lens position change provided in an embodiment of the present application;

[0039] Figure 4 A schematic diagram of the movement path of the front and rear lenses of the focal length compensation in the Z-axis direction provided in an embodiment of the present application;

[0040] Figure 5 A schematic diagram of the software structure of an electronic device provided in an embodiment of the present application;

[0041] Figure 6 A schematic diagram of a data transmission process provided in an embodiment of the present application;

[0042] Figure 7 A schematic diagram of the interaction of a software module provided in an embodiment of the present application;

[0043] Figure 8 A flowchart of a data transmission method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0044] In order to clearly describe the technical solutions of the embodiments of the present application, some terms and technologies involved in the embodiments of the present application are briefly introduced below:

[0045] 1. Optical image stabilization (OIS): refers to the process of correcting light rays back to the optical center by moving the lens or image sensor. Optical image stabilization can also be called optical image stabilization, optical image stabilization, etc., which is not limited here.

[0046] Specifically, OIS technology refers to detecting the shaking of the electronic device through a motion sensor (e.g., a gyroscope sensor, an accelerometer) during shooting, and the OIS controller confirms the target position based on the data detected by the motion sensor. The motor is controlled according to the target position to move the lens or image sensor (charge-coupled device, CCD). In this way, the position of the lens or image sensor is reversely adjusted according to the shaking of the electronic device, so that the optical path remains as stable as possible during the shooting process, and a clear exposed image is obtained.

[0047] In some embodiments, the electronic device controls a motor to move the lens according to the target position until the position of the lens detected by the Hall sensor is consistent with the target position.

[0048] 2. Electronic image stabilization (EIS): A software compensation algorithm that analyzes and collects images on the sensor and dynamically corrects the image based on the degree of jitter of the electronic device.

[0049] Specifically, the position change of the lens is confirmed by data from sensors such as Hall sensors, and the image is stretched or cropped using software algorithms to reduce the impact of jitter of the electronic device on the image.

[0050] 3. Auto focus (AF): Automatically focus the camera lens to make the image of the object accurate and clear.

[0051] 4. Information interface: interface used for communication between multi-processor processes.

[0052] In the embodiment of the present application, the information interface can enable the application processor to transmit data with the coprocessor (eg, sensor hub). Exemplarily, the information interface can be a Qualcomm message interface (QMI).

[0053] 5. Other terms

[0054] In the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with substantially the same functions and effects. For example, the first chip and the second chip are only used to distinguish different chips, and their order is not limited. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.

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

[0056] In the embodiments of the present application, "at least one" refers to one or more, and "more than one" 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: A exists alone, A and B exist at the same time, and B exists 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" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, a--c, bc, or abc, where a, b, c can be single or multiple.

[0057] In the embodiment of the present application, "at..." can be the instant when a certain situation occurs, or can be a period of time after a certain situation occurs, and the embodiment of the present application does not specifically limit this. In addition, the interface of the terminal device provided in the embodiment of the present application is only an example, and the interface can also include more or less content.

[0058] 6. Terminal equipment

[0059] The terminal device of the embodiment of the present application may also be any form of electronic device, for example, the electronic device may include a handheld device with a shooting function, a vehicle-mounted device, etc. For example, some electronic devices are: mobile phones, tablet computers, PDAs, laptop computers, mobile Internet devices (MID), wearable devices (for example, smart watches, smart glasses, smart bracelets or smart jewelry, etc.), 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), and wireless terminals in smart cities. assistant, PDA), handheld devices with wireless communication functions, computing devices or other processing devices connected to wireless modems, vehicle-mounted devices, wearable devices, terminal devices in 5G networks, or terminal devices in future public land mobile communication networks (PLMN), etc., which are not limited in the embodiments of the present application. In addition, in the embodiments of the present application, the electronic device can also be a terminal device in an Internet of Things (IoT) system, etc.

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

[0061] In an embodiment of the present application, the 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 a memory (also called main memory). The operating system can be any one or more computer operating systems that implement business processing through processes, such as Linux operating system, Unix operating system, Android operating system, iOS operating system, or Windows operating system. The application layer includes applications such as browsers, address books, word processing software, and instant messaging software.

[0062] For ease of understanding, the structure of the electronic device involved in the embodiment of the present application is described below. Figure 1 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 1 As shown, the electronic device includes: 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. Among them, 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.

[0063] It is to be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0064] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), an OIS controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). Among them, different processing units may be independent devices or integrated into one or more processors. A memory may also be provided in the processor 110 for storing instructions and data.

[0065] In the embodiment of the present application, the processor 110 may include: an application processor and an OIS controller. For example, the application processor may transmit focal length information to the OIS processor to implement optical image stabilization control. The OIS controller may transmit Hall data to the application processor to perform electronic image stabilization on the image. The specific process of optical image stabilization control can be referred to as follows Figure 2 The description is not repeated here.

[0066] In the embodiment of the present application, the electronic device can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0067] The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted to the camera photosensitive element through the lens, and the light signal is converted into an electrical signal. The camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. In some embodiments, the ISP can be set in the camera 193.

[0068] 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. In some embodiments, the electronic device can include 1 or N cameras 193, where N is a positive integer greater than 1.

[0069] 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. 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 (such as audio data, a phone book, etc.), etc. The processor 110 executes various functional applications and data processing of the electronic device by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor.

[0070] The gyro sensor 180B can be used to determine the motion posture of the electronic device. In some embodiments, the angular velocity of the electronic device around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for optical image stabilization. Exemplarily, when the shutter is pressed, the gyro sensor 180B detects the angle of the electronic device's shake, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shake of the electronic device through reverse motion to achieve optical image stabilization.

[0071] The magnetic sensor 180D includes a Hall sensor. The electronic device can use the magnetic sensor 180D to detect the position of the lens in the camera.

[0072] The motor 191 can drive the lens or photosensitive element in the camera to move. Taking the motor 191 as a driving motor as an example, when the electronic device is shooting, according to the anti-shake parameters of the electronic device, the driving motor compensates in the X-axis and Y-axis directions to control the position and angle of the lens in the electronic device, thereby realizing the optical anti-shake processing of the electronic device.

[0073] Above Figure 1 The overall structure of the electronic device is described below. Figure 2 The optical image stabilization involved in the embodiment of the present application is described.

[0074] When users use electronic devices to take photos, the captured images may shake due to reasons such as the unstable placement of the electronic devices. Electronic devices usually process the captured images in combination with optical image stabilization on the basis of electronic image stabilization to reduce the shaking of the images.

[0075] However, when electronic devices use OIS and EIS for anti-shake processing, they may experience freezes and delays, resulting in a poor user experience.

[0076] Combine the following Figures 2 to 4The optical image stabilization process involved in the embodiment of the present application is described.

[0077] For example, Figure 2 The schematic diagram of the structure of the hardware related to optical image stabilization in an electronic device provided in an embodiment of the present application. Figure 2 As shown, the electronic device includes: a lens 201 , a motor 202 , a gyro sensor 203 , a Hall sensor 204 and an OIS controller 205 .

[0078] The motor 202 is used to drive the lens 201 to move the lens 201. Exemplarily, the motor 202 is driven by the OIS controller 205.

[0079] The gyro sensor 203 is used to measure the angular velocity of three axes (eg, X-axis, Y-axis or Z-axis) of the electronic device to obtain the shake of the electronic device and transmit the shake information to the OIS controller 205 .

[0080] The jitter information may be the angular velocity of the three axes (e.g., X-axis, Y-axis, or Z-axis) of the electronic device measured by the gyroscope sensor 203, or may be the displacement of the lens calculated according to the angular velocity of the three axes (e.g., X-axis, Y-axis, or Z-axis) of the electronic device. The specific form of the jitter information is not limited in the embodiment of the present application.

[0081] In some embodiments, the gyro sensor 203 may transmit the collected angular velocity of the electronic device in three axes to the OIS controller 205. The OIS controller 205 may determine the displacement of the lens according to the angular velocity of the electronic device in three axes, and further determine the shake compensation.

[0082] In other embodiments, the gyro sensor 203 can convert the collected angular velocity of the electronic device in three axes into the displacement of the lens, and transmit the displacement of the lens to the OIS controller 205. The OIS controller 205 determines the jitter compensation according to the displacement of the lens. This embodiment of the application is not limited to this.

[0083] The Hall sensor 204 is used to detect the position of the lens 201 according to the Hall effect, so as to determine whether the lens 201 has moved to the target position.

[0084] The OIS controller 205 is used to confirm the shake compensation of the lens 201 according to the shake information, and control the motor 202 to drive the lens 201 to move according to the shake compensation of the lens 201, so as to achieve optical image stabilization.

[0085] The Hall sensor 204 transmits Hall data to the OIS controller 205. The Hall data is used to indicate the position of the lens 201.

[0086] The implementation process of OIS anti-shake is as follows: the gyro sensor 203 transmits the angular velocity of the three axes of the electronic device to the OIS controller 205 at a preset frequency. The OIS controller 205 converts the angular velocity of the three axes into the displacement of the lens 201 on the X-axis and / or Y-axis, and obtains the jitter compensation; the OIS controller 205 controls the motor 202 to drive the lens 201 to move to the opposite position of the displacement (jitter) of the electronic device. The OIS controller 205 determines whether the lens 201 has moved to the target position based on the position of the lens 201 detected by the Hall sensor 204.

[0087] In some embodiments, the OIS anti-shake process further includes: when the position corresponding to the Hall data transmitted by the Hall sensor 204 is the same as the target position, the OIS controller 205 stops driving the motor 202 .

[0088] In the embodiment of the present application, the target position in the OIS anti-shake process is also related to focal length compensation. Specifically, when the electronic device adjusts the focal length, the OIS controller can also adjust the lens offset caused by magnetic field interference when the lens moves in the Z-axis direction (focal length changes).

[0089] It should be noted that when the electronic device adjusts the focal length of the lens and controls the lens to move in the Z-axis direction, the Hall sensor may make errors in detecting the lens position, causing the center position of the image captured by the electronic device to shift.

[0090] Combine the following Figure 3 and Figure 4 Focus compensation is explained.

[0091] For example, Figure 3 A schematic diagram of lens position change provided in an embodiment of the present application. Figure 3 As shown, when the motor drives the lens to move on the Z axis (i.e., adjust the focal length), the magnet in the motor will also move on the Z axis, and the magnet will be relatively displaced with the Hall sensor. The Hall sensor is disturbed by the change in the magnetic field, and the perception of the lens position on the X or Y axis is deviated. Since the Hall data obtained by the OIS controller from the Hall sensor is inaccurate, the lens position confirmed by the OIS controller on the X and Y axes is inaccurate, and the OIS controller deviates from the position adjustment of the lens, causing the center position of the captured image to change.

[0092] In an embodiment of the present application, the OIS controller can confirm focal length compensation (AF drift compensation) according to the movement of the lens in the Z-axis direction (for example, focal length, focal length change, etc.) to reduce the deviation of lens position adjustment caused by inaccurate Hall data.

[0093] For example, Figure 4A schematic diagram of the movement path of the front and rear lenses in the Z-axis direction for focal length compensation provided in an embodiment of the present application.

[0094] When the OIS controller does not perform focus compensation, if the lens moves along the Z-axis direction or moves in the opposite direction of the Z-axis, the lens may shift in the X-axis or Y-axis direction.

[0095] It is understandable that when the motor drives the lens to move on the Z axis (i.e., adjust the focal length), the magnet in the motor will also move on the Z axis, and the magnet will be relatively displaced with the Hall sensor. The Hall sensor is disturbed by the change in the magnetic field, and the perception of the lens position on the X-axis or Y-axis is deviated. Since the Hall data obtained by the OIS controller from the Hall sensor is inaccurate, the lens position confirmed by the OIS controller on the X-axis and Y-axis is inaccurate, and the OIS controller deviates from the position adjustment of the lens, causing the center position of the captured image to change.

[0096] like Figure 4 As shown in a, when the magnet in the motor and the Hall sensor are located in the same plane, the magnetic induction intensity felt by the Hall sensor is the largest. When the lens moves toward the Z axis or in the opposite direction of the Z axis relative to the plane, the lens shifts toward the side close to the Hall sensor.

[0097] like Figure 4 As shown in b, when the OIS controller performs focus compensation, if the lens moves along the Z-axis direction, or moves in the opposite direction of the Z-axis, the offset of the lens in the X-axis or Y-axis direction is reduced.

[0098] It is understandable that the electronic device adjusts the focal length, and the OIS anti-shake process is as follows: the OIS controller determines the jitter compensation based on the jitter information from the gyroscope sensor, and determines the focal length compensation based on the focal length information (e.g., focal length change, target focal length). The OIS controller determines the target position of the lens based on the jitter compensation and focal length compensation. The OIS controller drives the motor to adjust the position of the lens. When the position corresponding to the Hall data transmitted by the Hall sensor is the same as the target position, the OIS controller stops driving the motor.

[0099] In some embodiments, the OIS driver is pre-set with a corresponding relationship, and the focal length compensation is confirmed according to the focal length information and the corresponding relationship. The corresponding relationship is the relationship between the compensation parameter and the focal length. The relationship between the compensation parameter and the focal length can be pre-stored in the electronic device in the form of a compensation curve, table, formula, etc. The specific form of the corresponding relationship is not limited in the embodiments of the present application.

[0100] In an embodiment of the present application, when the electronic device supports focal length compensation, if the electronic device performs automatic focusing causing the position of the lens on the Z-axis (focal length) to change, the electronic device will transmit focal length information (e.g., target focal length, focal length change, etc.) to the OIS controller for focal length compensation.

[0101] However, when the electronic device transmits focal length information, it may block the OIS controller from transmitting Hall data to the EIS processing module in the electronic device. The EIS processing module acquires the Hall data later, and then processes the image later, resulting in a longer image output time, and then the electronic device experiences screen freezes.

[0102] In a possible design, when the camera is started, an information interface is created. Both focal length information and Hall data are transmitted through this information interface. During the process of automatic focusing of the electronic device, the focal length changes, and the electronic device transmits the focal length information to the OIS controller through the information interface. Since the focal length information and Hall data share an information interface, and the information interface is occupied by the focal length information, the transmission of the Hall data is delayed, and then the processing of the image by the application processor is delayed, and the screen display of the electronic device is stuck.

[0103] For example, in a video recording scenario, the electronic device displays 30 frames of images in 1 second. If the electronic device automatically focuses during recording, during the focus adjustment process, due to the blocking of the Hall data by the focus information, the number of images displayed by the electronic device in 1 second is reduced, for example, 28 frames of images are displayed in 1 second.

[0104] In view of this, the embodiment of the present application provides a data transmission method and related device, when the camera is started, at least two information interfaces are created, one information interface is used to transmit focal length information, and the other information interface is used to transmit Hall data. In this way, the focal length information and Hall data are transmitted separately, which can reduce the blocking of the focal length information transmission on the Hall data transmission, thereby reducing the situation where the image is output late due to waiting for Hall data, and reducing the screen freeze of the electronic device.

[0105] The following specific embodiments are used to describe in detail the technical solution of the present application and how the technical solution of the present application solves the above technical problems. The following specific embodiments can be implemented independently or in combination with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0106] For ease of understanding, the software system of the electronic device is described below. The software system of the electronic device can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a microservice architecture, or a cloud architecture, etc., which will not be repeated here. The embodiment of the present application takes the Android system of the layered architecture as an example to illustrate the software structure of the electronic device.

[0107] Figure 5 It is a software structure block diagram of the electronic device of the embodiment of the present application. The layered architecture divides the software into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system can be divided into five layers, from top to bottom, namely, the application layer, the application framework layer, the hardware abstraction layer (HAL), the sensor hub layer, and the hardware layer.

[0108] like Figure 5 As shown in FIG, the application layer may include a series of application packages. The application layer runs applications by calling the application programming interface (API) provided by the application framework layer. Figure 5 As shown, the application package may include applications such as camera application, third-party camera application and calendar. Among them, the third-party camera application may include: etc., not limited here.

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

[0110] like Figure 5 As shown, the application framework layer may include a camera service, etc. The camera service enables the application to manage the camera and access the camera device. For example, the camera service enables the application to control the camera to capture images, etc.

[0111] The purpose of the HAL layer is to abstract the hardware, and can provide a unified interface for querying hardware devices for upper-layer applications, or can also provide data storage services for upper-layer applications. Multiple modules in the HAL layer can follow the hardware abstraction layer interface description language (HAL interface definition language, HIDL) or AIDL.

[0112] like Figure 5 As shown, the HAL layer may include a camera hardware abstraction (camera HAL).

[0113] The camera hardware abstraction includes: OIS processing module (camxois), EIS processing module, and noncamera sensor (NCS) service module.

[0114] The OIS processing module is used to determine the change of focal length and transmit the focal length information to the sensor center layer. The focal length information may include the target focal length or the focal length change value, etc., which is not specifically limited here.

[0115] The OIS processing module may determine the target focal length after receiving the user's operation of adjusting the focal length (clicking to confirm the focus position), or may determine the target focal length according to the distance change of the object in the image. The OIS processing module may transmit the target focal length or the focal length change value to the sensor center layer.

[0116] The EIS processing module is used to perform electronic image stabilization processing on the image captured by the camera according to the Hall data to obtain a processed image. Exemplarily, the EIS processing module can determine the position of the camera lens according to the Hall data, thereby determining the center position of the image, determining the amount of image jitter, and realizing processing such as stretching or cropping the image. The embodiments of the present application do not limit the specific implementation process.

[0117] The NCS service module is used to realize the information transmission of non-camera sensors. Non-camera sensors include but are not limited to: gyroscope sensors, Hall sensors, etc.

[0118] Exemplarily, the OIS processing module may transmit focal length information to the OIS driver via the NCS service module; the OIS driver may transmit Hall data to the EIS processing module via the NCS service module.

[0119] The sensor control center layer is used to manage one or more sensors. Figure 5 As shown, the sensor control center layer includes an OIS driver. In an embodiment of the present application, during the shooting process of the electronic device, at least two information interfaces are provided between the NCS service module and the OIS driver, such as information interface a and information interface b. Exemplarily, information interface a is used to transmit focal length information, and information interface b is used to transmit Hall data.

[0120] In the embodiment of the present application, the OIS drive includes: an OIS algorithm, a gyroscope drive, a Hall drive, and a motor drive. The OIS algorithm is used to confirm the target position of the lens according to the focal length information and / or the jitter information transmitted by the gyroscope drive, and transmit the target position to the motor drive to adjust the position of the lens through the motor.

[0121] The gyroscope drive is used to detect the jitter information of the electronic device; the Hall drive is used to detect the position of the lens.

[0122] like Figure 5 As shown, the hardware layer may include: motors, Hall sensors, gyroscope sensors, etc. The Hall sensor is used to detect the position of the lens, and the gyroscope sensor is used to detect the shaking of the electronic device.

[0123] In some embodiments, the electronic device may include one or more processors. The processor of the electronic device may be divided into two types: application processor (AP) and coprocessor (CP). The application processor side may include: application layer, application framework layer, hardware abstraction layer (HAL), etc. from top to bottom. The coprocessor side may include: sensor control center layer (sensorhub), hardware layer, etc. from top to bottom.

[0124] In a possible implementation, the AP side may further include: a kernel layer and a hardware layer. The kernel layer of the AP side may include: a display driver, a camera driver, etc.; the hardware layer of the AP side may include: a display screen, a camera, etc. This embodiment of the application does not limit this.

[0125] It should be understood that in some embodiments, the layers implementing the same function may be called by other names, or the layers that can implement the functions of multiple layers may be regarded as one layer, or the layers that can implement the functions of multiple layers may be divided into multiple layers. The embodiments of the present application are not limited to this.

[0126] Combine the following Figure 6 The data transmission process involved in image stabilization processing of electronic devices is described. Taking the camera application as an example, in response to the operation of turning on the camera, the camera application sends a command to the camera hardware abstraction through the camera framework to instruct the camera to turn on. The camera hardware abstraction starts optical image stabilization processing and electronic image stabilization processing.

[0127] For example, Figure 6 A schematic diagram of a data transmission process provided by an embodiment of the present application. Figure 6 As shown, the optical image stabilization processing process includes: S601-S604.

[0128] S601, when the electronic device adjusts the focal length according to the user operation or the screen display, the OIS processing module transmits the focal length information to the OIS algorithm through the information interface a in the NCS service module;

[0129] Specifically, the OIS processing module may call the information interface a to transmit the focal length information to the OIS algorithm.

[0130] S602: The OIS algorithm module obtains jitter information from the gyroscope driver, and confirms the target position of the lens according to the focal length information and the jitter information.

[0131] The OIS algorithm module can actively obtain the jitter information from the gyroscope driver, or the gyroscope driver can report the jitter information to the OIS algorithm module at a preset frequency. The embodiment of the present application does not limit the method for obtaining the jitter information.

[0132] S603 , the OIS algorithm module transmits the target position to the motor driver.

[0133] S604: Motor driving controls the motor to drive the camera lens to move.

[0134] In some embodiments, when the difference between the position of the lens and the target position is less than a threshold, the motor driver stops driving the motor. Exemplarily, the OIS algorithm module can obtain Hall data from the Hall driver, and when the difference between the position corresponding to the Hall data and the target position is less than a threshold, the camera lens is adjusted. The Hall sensor transmits the Hall data to the OIS algorithm via the Hall driver; the OIS algorithm adjusts the control of the motor according to the Hall data to achieve optical image stabilization.

[0135] It is understandable that if the focal length is not adjusted: the electronic device may not execute S601. Adaptively, the OIS algorithm module can confirm the target position of the lens according to the jitter information. The subsequent process of adjusting the lens position of the camera according to the target position can refer to the above S603 and S604, which will not be described in detail here.

[0136] In this way, the electronic device can achieve the stabilization of the shooting optical path by the above method. Specifically, the lens is moved to the position opposite to the shaking, and the offset caused by the magnetic field interference is compensated, so that the center position of the image shot by the electronic device is stabilized.

[0137] like Figure 6 As shown, the process of electronic image stabilization includes: S605 and S606.

[0138] S605 . The Hall driver transmits the Hall data to the EIS processing module through the information interface b in the NCS service module.

[0139] Specifically, the Hall driver calls the information interface b to transmit the Hall data to the EIS processing module.

[0140] S606, the EIS processing module performs electronic image stabilization processing on the image collected by the camera according to the Hall data, and transmits the processed image to the camera framework. Adaptively, the camera framework transmits the processed image to the camera application display of the application layer.

[0141] Exemplarily, the EIS processing module can determine the center position of the image according to the position of the lens corresponding to the Hall data; and fuse and crop the image according to the center position of the image to obtain a processed image.

[0142] In this way, the electronic device can confirm the position of the lens based on the Hall data and perform electronic image stabilization on the image.

[0143] Combine the following Figure 7 The modules involved in data transmission during the shooting process of an electronic device and the interaction process between the modules are explained.

[0144] For example, Figure 7 A flowchart of a data transmission method provided by an embodiment of the present application. The electronic device comprises: an application, an OIS processing module, an NCS service module, an OIS driver and an EIS processing module.

[0145] like Figure 7 As shown, the method includes:

[0146] S701: In response to an operation of turning on a camera, the application transmits a message for instructing the OIS processing module to turn on the camera.

[0147] The application can be a camera application or a third-party camera application, and there is no limitation here.

[0148] In the embodiment of the present application, turning on the camera can be an operation of the user opening a camera application, or an operation of the user using the camera to make a video call, an operation of the user scanning a QR code, or other operations that require the use of the camera for shooting. The embodiment of the present application does not specifically limit the operation of turning on the camera.

[0149] Taking the camera application as an example, the camera application sends a command for instructing to turn on the camera to the OIS processing module in the camera hardware abstraction through the camera framework. In some embodiments, the camera application transmits the command by calling an opening function (eg, opencamera).

[0150] In some embodiments, the application may also send a command for instructing to turn on the camera to the OIS processing module via the camera framework and the sensor node in the camera hardware abstraction. This is not specifically limited here.

[0151] S702: The OIS processing module transmits a service registration message to the NCS service module. The service registration message is used to instruct the creation of an information transmission path between the camera hardware abstraction and the OIS driver.

[0152] Exemplarily, the OIS processing module sends a register service message to the NCS service module. The register service message includes: sensor type. The sensor type is used to indicate binding the information interface with the OIS driver (or hardware corresponding to the OIS driver).

[0153] S703. The NCS service module creates information interface a and information interface b.

[0154] The information interface a and the information interface b are used to realize data transmission between the camera hardware abstraction and the OIS driver. Exemplarily, the information interface a and the information interface b may be a Qualcomm message interface (QMI).

[0155] In some embodiments, information interface a and information interface b are stored in different locations. Exemplarily, information interface b is stored in an array, and information interface a is stored in a variable group.

[0156] For example, information interface b can be saved in m_sensorConnList in the form of pSSCConn=CAMX-NEW SSCConnection. Information interface a can be saved in m_soisCfgpara in the form of pAfDriftCConn=CAMX-NEW SSCConnection. In this way, the subsequent selection of information interface can be facilitated.

[0157] It is understandable that both the information interface a and the information interface b correspond to the OIS driver. Thus, the information interface a or the information interface b can be subsequently confirmed by the identifier of the OIS driver (eg, the name of the OIS driver).

[0158] In a possible implementation, the information interface a is stored in a member variable. In this way, the electronic device can use the information interface b to transmit messages multiple times. The information interface a will not be destroyed after being used once.

[0159] S704: The OIS processing module transmits an initialization message to the OIS driver.

[0160] Adaptively, the OIS driver performs initialization settings, including: parameter initialization settings in the OIS algorithm module or register initialization settings corresponding to the OIS driver.

[0161] In some embodiments, the OIS processing module may transmit an initialization message to the OIS driver via the information interface b.

[0162] S705: In response to the focus adjustment operation, the OIS processing module transmits focus information to the NCS service module. Adaptively, the OIS processing module confirms the information interface a according to the message type of the focus information.

[0163] The focus adjustment operation may be an operation in which a user selects a focus point, or may be an operation in which an electronic device automatically adjusts the focus according to a captured image, and this embodiment of the present application does not limit this.

[0164] S706 . When the NCS service module identifies the message type of the focal length information, it selects information interface a to transmit the focal length information to the OIS driver.

[0165] In the embodiment of the present application, the selection of the information interface is realized by the message type of the message. In the embodiment of the present application, the message types corresponding to the focal length information and the Hall data are different. Exemplarily, the message type of the Hall data can be: SNS_OIS_MANAGER_MSGID_SNS_OIS_MANAGER_EVENT. The message type of the focal length information can be: SNS_OIS_MANAGER_MSGID_SNS_SET_AF_TARGET.

[0166] In some embodiments, according to the different functions of the messages, the message types can be divided into the following types: OIS initialization message, focal length information, OIS related parameter setting message, production line control message, mutual OIS status message, Hall data return message, abnormal data return message, production line data return message, etc. In other embodiments, the message types are divided by the data structure corresponding to the message, etc., which is not limited here.

[0167] It should be noted that the message type is a type of identifier, and the message type can also be replaced by an identifier in the form of a flag bit, a name, etc. for distinction. For example, taking the flag bit as an example, the flag bit corresponding to the focal length information is 1, and the flag bit corresponding to the Hall data is 0; or the focal length information is added with a flag bit, and the Hall data does not have a corresponding flag bit. The embodiment of the present application does not limit the form of the identifier.

[0168] In possible implementation mode 1, when the message type is identified as focal length information, information interface a is selected; when the message type is not identified as focal length information, information interface b is selected. Exemplarily, the NCS service module may select information interface a from multiple information interfaces according to the message type of focal length information;

[0169] In possible implementation mode 2, the electronic device can select information interface b according to the message, and when recognizing that the message type is focal length information, replace the information interface for transmitting the message from information interface b to information interface a. In this way, the changes in information interface selection can be reduced, which is simple and easy to implement.

[0170] Exemplarily, the NCS service module can first select information interface b according to the sensor identifier and then replace information interface b with information interface a according to the message type of the focal length information; specifically, the focal length information includes: the sensor identifier (for example, the OIS driver identifier, the gyroscope sensor identifier, etc.), and the message type corresponding to the focal length information. After receiving the focal length information, the NCS service module selects information interface b from the array according to the sensor identifier; and replaces information interface b with information interface a according to the message type corresponding to the focal length information. The NCS service module transmits the focal length information to the OIS driver through information interface a.

[0171] In this way, the replacement method can reduce the changes to the information interface selection, and is simple and easy to implement.

[0172] S707: OIS driving performs optical image stabilization control according to the focal length information.

[0173] S707 can refer to the above Figure 6 The corresponding steps in the description will not be repeated here in detail.

[0174] In the embodiment of the present application, the OIS driver confirms the focal length compensation according to the focal length information.

[0175] Exemplarily, the OIS driver is pre-set with a corresponding relationship, and the focal length compensation is determined according to the focal length information and the corresponding relationship. The corresponding relationship is the relationship between the compensation parameter and the focal length.

[0176] The relationship between the compensation parameter and the focal length may be pre-stored in the electronic device in the form of a compensation curve, a table, a formula, etc. The embodiment of the present application does not limit the specific form of the corresponding relationship.

[0177] S708, the OIS driver transmits the Hall data to the EIS processing module through the information interface b of the NCS service module. Adaptively, the EIS processing module performs electronic image stabilization processing according to the Hall data. Exemplarily, the EIS processing module can determine the center position of the image according to the position of the lens corresponding to the Hall data; and fuse and crop the image according to the center position of the image to obtain a processed image.

[0178] In this way, the image can be electronically image-stabilized to improve image stability.

[0179] In some embodiments, the information interface b is also used to transmit OIS initialization data, OIS related parameter settings, abnormal data, etc. The embodiments of the present application do not specifically limit the messages transmitted by the information interface b.

[0180] It is understandable that after the electronic device turns on electronic image stabilization, the EIS processing module will perform electronic image stabilization processing on each image. Therefore, the electronic device will execute S708 multiple times. In the embodiment of the present application, the order in which the electronic device executes S708 and S705 is not limited.

[0181] In this way, the focal length information and Hall data are transmitted using different information interfaces, and the focal length information will not block the transmission of the Hall data, thereby reducing the situation where the image is output late due to waiting for the Hall data and reducing the screen freeze of the electronic device.

[0182] S709: In response to the operation of turning off the camera, the application transmits a message for instructing the OIS processing module to turn off the camera.

[0183] In the embodiment of the present application, the operation of closing the camera can be an operation of the user closing the camera application, or an operation of the user ending a video call, an operation of the user scanning a QR code, etc. The embodiment of the present application does not specifically limit the operation of closing the camera.

[0184] Taking the camera application as an example, the camera application sends a command for instructing to close the camera to the OIS processing module in the camera hardware abstraction through the camera framework. In some embodiments, the camera application transmits the command by calling a close function (eg, closecamera).

[0185] In some embodiments, the application may also send a command for instructing to turn off the camera to the OIS processing module via the camera framework and the sensor node in the camera hardware abstraction. This is not specifically limited here.

[0186] S710. The OIS processing module transmits a message for instructing to destroy the service to the NCS service module.

[0187] S711. The NCS service module deletes information interface a and information interface b.

[0188] In this way, when the camera is turned off, the information interface a and the information interface b are destroyed, and the transmission of the focal length information and the Hall data is stopped.

[0189] For example, Figure 8 A flow chart of a data transmission method provided in an embodiment of the present application. Figure 8 As shown, the method includes:

[0190] S801. In response to an operation of turning on a camera, create a first information interface and a second information interface.

[0191] The operation of turning on the camera can refer to the above S701 and will not be repeated here.

[0192] S802: Transmit first information through a first information interface, and transmit second information through a second information interface, wherein the first information and the second information are different, and both the first information and the second information are used for image anti-shake processing.

[0193] The first information interface and the second information interface are used for data transmission between two modules or two processing units. Exemplarily, the first information interface and the second information interface are used to implement data transmission between the camera hardware abstraction and the OIS driver. For example, the first information interface and the second information interface can be a Qualcomm message interface (QMI).

[0194] In the embodiment of the present application, the first information and the second information may be transmitted simultaneously or may not be transmitted simultaneously, which is not limited here.

[0195] In this way, the first information and the second information are transmitted respectively via an information interface, and the first information and the second information can be transmitted simultaneously, thereby reducing the situation where the first information blocks the second information, reducing the transmission delay caused by the blockage, and further reducing the jamming phenomenon caused by the slow anti-shake processing due to the transmission delay.

[0196] Optionally, transmitting the first information through the first information interface and transmitting the second information through the second information interface includes: when it is determined that the first information is target type information, transmitting the first information through the first information interface; and when it is determined that the second information is not target type information, transmitting the second information through the second information interface.

[0197] The target type is a preset message type. The target type can be a message type corresponding to focal length information or a message type corresponding to Hall data, which is not specifically limited here.

[0198] In this way, the information interface used for transmission can be confirmed according to the target type, reducing the transmission confusion caused by not distinguishing the information interface.

[0199] In some other embodiments, the target type may also be replaced by other identifiers, such as a target flag, a target name, etc. Exemplarily, when it is determined that the flag carried by the first information is a target flag, the first information is transmitted through the first information interface; and when it is determined that the flag carried by the second information is not a target flag, or does not carry a flag, the second information is transmitted through the second information interface. In this way, the information interface used for transmission can be confirmed based on other identifiers, reducing the transmission confusion caused by not distinguishing the information interface.

[0200] Optionally, information of the first information interface is stored in a member variable, and information of the second information interface is stored in an array; when the first information is judged to be information of the target type, the first information is transmitted through the first information interface, including: confirming the second information interface from the array according to the first message; when the first information is judged to be information of the target type, replacing the information interface used to transmit the first information from the second information interface to the first information interface; and transmitting the first information through the first information interface.

[0201] Exemplarily, taking the case where information interface b is stored in an array, information interface a is stored in a member variable, and the first message is a focus message, the electronic device confirms information interface b from the array according to the focus message, and when it determines that the focus information is of the target type, replaces information interface b with information interface a. The focus information is transmitted through information interface a.

[0202] In this way, the selection of the first information interface is achieved by replacement, with minor changes to the existing architecture, and the method is simple and easy to implement.

[0203] Optional, the target type is SNS_OIS_MANAGER_MSGID_SNS_SET_AF_TARGET.

[0204] Optionally, the first information is used to perform optical image stabilization control on the camera; and the second information is used to perform electronic image stabilization processing on the image.

[0205] In the embodiment of the present application, the first information may be information such as focal length related to optical image stabilization, and the second information may be information such as Hall data related to electronic image stabilization.

[0206] In this way, the first information and the second information may correspond to different anti-shake modes.

[0207] Optionally, the first information is information derived from a hardware abstraction layer, and the second information is information derived from hardware, and the hardware is hardware related to anti-shake processing.

[0208] In the embodiment of the present application, the second information may be information uploaded from the hardware layer. The first information may be information sent from the application layer, the framework layer, or the hardware abstraction layer. The hardware related to the anti-shake processing may be a Hall sensor, or an OIS controller, etc., which is not specifically limited in the embodiment of the present application.

[0209] In this way, transmitting information of different levels using different information interfaces can reduce transmission congestion and reduce phenomena such as jamming caused by information transmission delays.

[0210] Optionally, the first information includes focal length information, and the focal length information is used to indicate the focal length of the camera; the second information includes Hall data, and the Hall data is used to indicate the position of the lens in the camera.

[0211] In this way, focal length compensation can be performed based on focal length information, reducing the interference of focal length change on anti-shake and improving the anti-shake effect. Electronic anti-shake processing can be performed based on Hall data to facilitate the determination of image offset.

[0212] Optionally, creating a first information interface and a second information interface includes: creating the first information interface and the second information interface in a hardware abstraction layer; transmitting first information through the first information interface, and transmitting second information through the second information interface, including: the hardware abstraction layer transmits the first information to the sensor center layer through the first information interface; the sensor center layer transmits the second information to the hardware abstraction layer through the second information interface.

[0213] Optionally, the hardware abstraction layer includes: an optical image stabilization processing module and an electronic image stabilization processing module; the sensor center layer includes: an optical image stabilization driver; transmitting first information through a first information interface, and transmitting second information through a second information interface, including: the optical image stabilization processing module transmitting the first information to the optical image stabilization driver through the first information interface; the optical image stabilization driver transmitting the second information to the electronic image stabilization processing module through the second information interface.

[0214] In this way, the optical image stabilization driver can perform focal length compensation based on the focal length information, reduce the interference of focal length change on the image stabilization, and improve the image stabilization effect. The electronic image stabilization processing module can perform electronic image stabilization processing based on the Hall data to facilitate the determination of image offset.

[0215] Optionally, in response to an operation of turning off the camera, the first information interface and the second information interface are destroyed.

[0216] In this way, when the camera is turned off, the information interface is destroyed.

[0217] Optionally, the method further includes: performing optical image stabilization control according to the first information and the jitter information, wherein the jitter information is used to indicate the displacement of the lens in the camera caused by the jitter.

[0218] In this way, the electronic device can confirm the target position according to the first information and the jitter information, realize optical image stabilization, and improve the stability of shooting.

[0219] Optionally, performing optical image stabilization control according to the first information and the jitter information includes: obtaining a target position of the lens according to the focal length information and the jitter information in the first information; and controlling the movement of the lens according to the target position.

[0220] In some embodiments, controlling the movement of the lens according to the target position includes: controlling the movement of the lens according to the target position until an error between the position of the lens and the target position is less than a threshold.

[0221] The threshold value may be 1 mm, 0.5 mm or any other value, which is not specifically limited here. In this way, the closed control of the optical image stabilization is achieved according to the movement of the target position.

[0222] Optionally, the target position of the lens is obtained according to the focal length information and jitter information in the first information, including: obtaining focal length compensation according to the focal length information and a preset correspondence, wherein the correspondence is the relationship between the focal length and the compensation value; obtaining jitter compensation according to the jitter information, wherein the jitter compensation is used to compensate for the displacement of the lens in the camera caused by jitter; and superimposing the focal length compensation, jitter compensation, and the position of the lens in the camera to obtain the target position.

[0223] In this way, the electronic device can confirm the target position based on the focal length information and jitter information to achieve optical image stabilization.

[0224] Optionally, the method further includes: performing electronic anti-shake processing according to the Hall data in the second information.

[0225] In this way, the position of the lens can be confirmed based on the Hall data, making it easier to perform electronic image stabilization processing later.

[0226] Optionally, electronic image stabilization is performed according to the Hall data in the second information, including: determining the center position of the image according to the position of the lens corresponding to the Hall data; and fusing and cropping the image according to the center position of the image to obtain a processed image.

[0227] In this way, the image can be electronically image-stabilized to improve image stability.

[0228] The method provided in the embodiment of the present application has been described above, and the device for executing the above method provided in the embodiment of the present application is described below. Those skilled in the art can understand that the method and the device can be combined and referenced with each other, and the relevant device provided in the embodiment of the present application can execute the steps in the above method.

[0229] The data transmission method provided in the embodiment of the present application can be applied to an electronic device with a shooting function. The electronic device includes a terminal device, and the specific device form of the terminal device can refer to the above related description, which will not be repeated here.

[0230] 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 executes the above method.

[0231] The embodiment of the present application provides a chip. The chip includes a processor, and the processor is used to call a computer program in a memory to execute the technical solution in the above embodiment. Its implementation principle and technical effect are similar to those of the above related embodiments, and will not be repeated here.

[0232] The embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium stores a computer program. The above method is implemented when the computer program is executed by the processor. The method described in the above embodiment can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. If implemented in software, the function 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.

[0233] In one possible implementation, a computer-readable medium may include RAM, ROM, compact disc read-only memory (CD-ROM) or other optical disk storage, disk storage or other magnetic storage devices, or any other medium that is intended to carry or store the required program code in the form of instructions or data structures and can be accessed 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 technology (such as infrared, radio and microwave) is used to transmit software from a website, server or other remote source, the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology such as infrared, radio and microwave are included in the definition of medium. Disks and optical disks as used herein include optical disks, laser disks, optical disks, digital versatile disks (DVD), floppy disks and Blu-ray disks, where disks usually reproduce data magnetically, while optical disks reproduce data optically using lasers. Combinations of the above should also be included in the scope of computer-readable media.

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

[0235] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable device to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0236] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0237] The above specific implementation methods further illustrate the purpose, 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 substitutions, 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 data transmission method, It is characterized in that Applied to an electronic device, the electronic device includes a camera application, and the method includes: Receiving a first user operation, the electronic device starts the camera application; After starting the camera application, the electronic device creates a first information interface and a second information interface; The electronic device transmits first information through the first information interface, and the electronic device transmits second information through the second information interface, wherein the first information and the second information are different.

2. The method according to claim 1, It is characterized in that The first information includes focal length information, and the second information includes Hall data.

3. The method according to claim 2, It is characterized in that The focal length information is used by the electronic device to perform optical image stabilization control, and the Hall data is used by the electronic device to perform electronic image stabilization processing.

4. The method according to any one of claims 1 to 3, It is characterized in that The electronic device transmits first information through the first information interface, including: The hardware abstraction layer of the electronic device transmits the first information to the sensor control center layer of the electronic device through the first information interface.

5. The method according to claim 4, It is characterized in that The electronic device transmits the second information through the second information interface, including: The sensor control center layer of the electronic device transmits the second information to the hardware abstraction layer of the electronic device through the second information interface.

6. The method according to claim 1, It is characterized in that The electronic device transmits first information through the first information interface, and the electronic device transmits second information through the second information interface, including: If the first information is information of the target type, transmitting the first information through the first information interface; If the second information is not information of the target type, the second information is transmitted through the second information interface.

7. The method according to claim 6, It is characterized in that The target type is SNS_OIS_MANAGER_MSGID_SNS_SET_AF_TARGET.

8. The method according to any one of claims 1 to 7, It is characterized in that The method further comprises: Receiving a second user operation, the electronic device closing the camera application; After closing the camera application, the electronic device destroys the first information interface and the second information interface.

9. An electronic device, It is 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 as described in any one of claims 1 to 8.

10. A computer-readable storage medium storing a computer program. It is characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.