Data recovery method and electronic equipment
By detecting and replacing the abnormal communication address and register information of the OIS device Driver IC, the problem of OIS device initialization failure was solved, and the normal startup of the camera application and the normal use of the camera function were achieved.
Patent Information
- Application Number
- CN202411162281.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2044-08-22
AI Technical Summary
During the initialization process of the OIS device of an electronic device, data anomalies cause initialization failure, which in turn causes the camera application to fail to start normally, resulting in a black screen or the inability to obtain a preview image.
By detecting whether the communication address and register information of the Driver IC in the OIS device are abnormal, and establishing a temporary communication connection when an abnormality occurs, the correct communication address and information are obtained from the EEPROM, and the abnormal data in the Driver IC are replaced to ensure the normal initialization of the OIS device.
Effectively ensure the successful initialization of the OIS device, avoid abnormal camera application startup, and ensure the normal use of the camera function.
Smart Images

Figure CN120743359A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminals, and in particular to a data recovery method and electronic equipment. Background Art
[0002] For electronic devices equipped with an Optical Image Stabilization (OIS) device, the OIS device must be successfully initialized before the camera application can be used. Otherwise, problems such as a black screen or inability to obtain a preview image will occur, preventing the camera application from launching successfully. In practice, OIS device initialization often fails due to abnormal OIS data. Recovering this data and ensuring successful OIS initialization is an urgent problem that needs to be solved. Summary of the Invention
[0003] The present application provides a data recovery method and electronic device. During the process of performing OIS initialization in an electronic device, it is detected whether the communication address of the Driver IC in the OIS device is abnormal. If it is abnormal, a temporary communication connection between the processor and the Driver IC is established using the abnormal communication address, and based on the temporary communication connection, the correct communication address obtained from the EEPROM of the OIS device is used to replace the abnormal communication address that has been tampered with in the Driver IC. In addition, the processor can also detect whether the information of the register in the Driver IC is abnormal. If it is abnormal, the correct information is also obtained from the EEPROM to replace the information of the register that has been tampered with in the Driver IC. In this way, the successful initialization of the OIS can be effectively guaranteed, and the normal use of the camera and OIS functions of the electronic device will not be affected.
[0004] In a first aspect, the present application provides a data recovery method, which is applied to an electronic device, which includes a first camera, the first camera including a driver integrated circuit Driver IC and a first memory, the method including: detecting whether the communication address of the Driver IC is a first communication address, the first communication address being obtained from the first memory; if the communication address of the Driver IC is not the first communication address, obtaining the current second communication address in the Driver IC; based on the second communication address, replacing the second communication address in the Driver IC with the first communication address; based on the first communication address, controlling the Driver IC to implement optical image stabilization OIS of the first camera.
[0005] After implementing the method described in the first aspect, when the communication address of the Driver IC is abnormal, it can be restored to the correct communication address in a timely manner, thereby ensuring the normal use of the OIS function.
[0006] In combination with the method described in the first aspect, before controlling the Driver IC to implement OIS, the method further includes: initializing the Driver IC based on the first communication address or the second communication address.
[0007] In this way, it can be effectively ensured that the correct communication address is used to complete the initialization of the Driver IC.
[0008] In combination with the method described in the first aspect, initializing the Driver IC specifically includes: loading the firmware in the first memory into the Driver IC; and successfully running the firmware through the Driver IC.
[0009] In this way, it can be effectively guaranteed that the correct communication address is used and the Driver IC firmware is loaded successfully.
[0010] In combination with the method described in the first aspect, before detecting whether the communication address of the Driver IC is the first communication address, the method further includes: receiving an operation for triggering power on of the electronic device.
[0011] In this way, the communication address of the Driver IC can be triggered and detected when the electronic device is turned on, and the abnormal communication address can be restored to a normal communication address to ensure that the subsequent use of the OIS function is not affected.
[0012] In combination with the method described in the first aspect, after replacing the second communication address in the Driver IC with the first communication address, the method further includes: receiving an operation for turning on the first camera in the electronic device, and displaying a preview interface of the first camera.
[0013] In this way, the abnormal communication address of the Driver IC is restored when the electronic device is turned on. In this way, when the first camera is used subsequently, the OIS of the first camera can be successfully initialized, and then the first camera can be successfully started and the preview interface of the first camera can be displayed.
[0014] In combination with the method described in the first aspect, before detecting whether the communication address of the Driver IC is the first communication address, the method further includes: receiving an operation for starting the first camera.
[0015] In this way, when the electronic device starts the first camera, the abnormal communication address can be triggered to be restored to the normal communication address, ensuring that the subsequent OIS is initialized normally and the camera is started normally.
[0016] In combination with the method described in the first aspect, the method also includes: after starting the operation of the first camera, displaying a black screen interface; after replacing the second communication address in the Driver IC with the first communication address, displaying a preview interface of the first camera.
[0017] In this way, although an abnormal black screen interface will be temporarily displayed after the camera operation is started and before the abnormal communication address of the Driver IC is restored, the electronic device will display the preview interface of the first camera after the abnormal communication address of the Driver IC is restored. Optionally, if restoring the abnormal communication address of the Driver IC takes an extremely long time, the normal preview interface may be displayed directly after the camera operation is started instead of the black screen.
[0018] In combination with the method described in the first aspect, obtaining the current second communication address in the Driver IC specifically includes: sequentially using one of a set of preset communication addresses to establish a communication connection with the Driver IC until a communication connection is successfully established, and then determining the communication address at which the communication connection is successfully established as the second communication address.
[0019] In this way, even if the communication address of the Driver IC is abnormal, the abnormal communication address can still be obtained, temporary communication can be performed based on the abnormal communication address, and abnormal data recovery can be achieved.
[0020] In combination with the method described in the first aspect, before controlling the Driver IC to implement optical image stabilization (OIS) of the first camera, the method further includes: the electronic device soft-starting the Driver IC.
[0021] In this way, it can be ensured that the normal data restored in the Driver IC is applied, and it is avoided that abnormal data is continued to be used, which may cause abnormal operation of the Driver IC.
[0022] In combination with the method described in the first aspect, the second communication address in the Driver IC is replaced with the first communication address, specifically including: replacing the second calibration data in the Driver IC with the first calibration data, the second calibration data includes the second communication address, the first calibration data includes the first communication address, and the first calibration data is obtained from the first memory.
[0023] This way, by replacing the entire block of trimming data containing the Driver IC's communication address, the abnormal communication address is restored, the difficulty of extracting the communication address from the trimming data is reduced, and the data reading and writing process is simplified. Furthermore, when the Driver IC's communication address is abnormal, other data is likely to be abnormal as well. Therefore, replacing the entire block of trimming data can quickly restore all abnormal data.
[0024] In combination with the method described in the first aspect, the Driver IC includes a register, and the method also includes: if the communication address of the Driver IC is the first communication address, the electronic device also detects whether the current second information of the register is abnormal; if the information of the register is abnormal, the second calibration data in the Driver IC is replaced with the first calibration data, the second calibration data includes the second information of the register, the first calibration data includes the first information of the register, and the first calibration data is obtained from the first memory.
[0025] In this way, when the communication address in the Driver IC is normal, it is necessary to further detect the register information of the Driver IC. The trimming data contains the register information. When the register information is abnormal, the entire trimming data is restored, which can effectively ensure the recovery of all abnormal data in the Driver IC.
[0026] In combination with the method described in the first aspect, the electronic device detects whether the current second information of the register is abnormal, specifically including: the electronic device also detects whether the number of bits of the register is greater than the preset number of bits. If it is greater than the preset number of bits, it is determined that the second information of the register is abnormal; if it is less than or equal to the preset number of bits, it is determined that the second information of the register is normal.
[0027] In combination with the method described in the first aspect, before controlling the Driver IC to implement OIS of the first camera, the method further includes: replacing the second OIS data in the Driver IC with the first OIS data by the processor, where the first OIS data is obtained from the first memory.
[0028] Currently, when abnormal data occurs in the Driver IC, there is a high possibility that the OIS data has been tampered with. Therefore, in order to reduce the power consumption caused by judging each type of data, the OIS data can be directly restored.
[0029] In combination with the method described in the first aspect, the electronic device also includes a processor, which replaces the second communication address in the Driver IC with the first communication address based on the second communication address, specifically including: based on the second communication address, establishing a second communication connection with the Driver IC through the processor, and controlling the second communication address in the Driver IC to be replaced with the first communication address based on the second communication connection.
[0030] In this way, a temporary communication connection can be established with the Driver IC based on the acquired abnormal communication address, and the abnormal communication address can be recovered based on the temporary communication connection.
[0031] In combination with the method described in the first aspect, based on the first communication address, controlling the Driver IC to implement optical image stabilization OIS of the first camera specifically includes: disconnecting the second communication connection, establishing a first communication connection with the Driver IC through the processor based on the first communication address, and controlling the Driver IC based on the first communication connection to implement optical image stabilization OIS of the first camera.
[0032] In this way, a communication connection can be established with the Driver IC based on the restored normal communication address, and the OIS function can be implemented based on the communication connection.
[0033] In combination with the method described in the first aspect, the electronic device includes a processor, and an OIS driver module runs in the kernel layer of the processor; the electronic device detects, through the OIS driver module, whether the communication address of the Driver IC is a first communication address, and the first communication address is obtained from the first memory; if the communication address of the Driver IC is not the first communication address, the current second communication address in the Driver IC is obtained through the OIS driver module; based on the second communication address, the second communication address in the Driver IC is replaced with the first communication address through the OIS driver module; based on the first communication address, the Driver IC is controlled by the OIS driver module to implement optical image stabilization OIS of the first camera.
[0034] In a second aspect, the present application provides an electronic device comprising a second memory, one or more processors, a first camera, and a computer program stored on the second memory, wherein the first camera comprises a driver integrated circuit Driver IC and a first memory, and the processor executes the computer program to implement the steps of any one of the methods described in the first aspect.
[0035] In a third aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any one of the methods described in the first aspect.
[0036] In a fourth aspect, the present application provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of any one of the methods described in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A schematic diagram of the structure of an OIS device provided in an embodiment of the present application;
[0038] Figure 2 A schematic diagram of a process flow for initialization failure of an OIS device provided in an embodiment of the present application;
[0039] Figure 3 A schematic diagram of a successful initialization process of an OIS device provided in an embodiment of the present application;
[0040] Figure 4 A schematic flow chart of a data recovery method for an OIS device provided in an embodiment of the present application;
[0041] Figure 5 A schematic diagram of the hardware architecture of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0042] The following is a clear and detailed description of the technical solutions in the embodiments of the present application, with reference to the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " represents the meaning of "or." For example, A / B can represent A or B. "and / or" in the text is merely a description of the association relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone.
[0043] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to imply or suggest relative importance or implicitly indicate the number of the technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of this application, unless otherwise specified, "plurality" means two or more.
[0044] References to "embodiments" in this application mean that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described in this application may be combined with other embodiments.
[0045] The term "user interface (UI)" in the following embodiments of this application refers to a medium interface for interaction and information exchange between an application or operating system and a user, which realizes the conversion between the internal form of information and the form that the user can receive. The user interface is a source code written in a specific computer language such as Java and extensible markup language (XML). The interface source code is parsed and rendered on an electronic device and finally presented as content that the user can recognize. The commonly used form of user interface is graphical user interface (GUI), which refers to a user interface related to computer operations that is displayed in a graphical manner. It can be a visual interface element such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc. displayed on the display screen of an electronic device.
[0046] Currently, for electronic devices equipped with Optical Image Stabilization (OIS) devices, if you want to use the camera application of the electronic device, you must successfully initialize the OIS device. Initializing the OIS device refers to the process of configuring and starting each component in the OIS device through the processor to ensure the correct execution of the image stabilization function. If the initialization fails, problems such as a black screen and inability to obtain a preview image will occur, and the camera application will not be able to be successfully started. In actual applications, the data of the OIS device is often abnormal, resulting in the failure of the OIS device initialization, which in turn causes the camera function to fail and the camera to start abnormally.
[0047] Next, the OIS device involved in this application and the process of OIS device initialization failure are introduced.
[0048] refer to Figure 1 , Figure 1 The structure of an OIS device is shown as an example.
[0049] The OIS device is part of a camera module (e.g., the main camera of an electronic device, also known as the first camera) of an electronic device. The camera module includes, but is not limited to, a lens, an image sensor, and an image signal processor (ISP). The OIS device includes, but is not limited to, motion sensors, a microprocessor (MCU), a driver integrated circuit (Driver IC), a motor, a non-volatile memory (also known as the first memory), and an inter-integrated circuit (I2C) bus. These components work together to offset camera module imaging blur caused by hand tremors or other reasons, thereby improving image quality.
[0050] Motion sensors include, for example, gyroscopes and Hall sensors. Gyroscopes collect vibration information from electronic devices and feed it back to the OIS river IC. Hall sensors collect lens position information and feed it back to the MCU.
[0051] Among them, the MCU (also known as the OIS controller) is used to receive and pre-process the vibration information collected by the gyroscope sensor and the lens position information collected by the Hall sensor, execute the control algorithm and calculate the required compensation displacement, generate the corresponding compensation instructions and send them to the driver integrated circuit.
[0052] The driver integrated circuit (hereinafter referred to as the Driver IC) receives compensation commands from the MCU, driving the motor to adjust the lens position according to the compensation commands to offset the blur caused by camera shake. The Driver IC contains registers that can be used to store OIS initialization and configuration parameters, transmit control commands (i.e., send them from a microcontroller or host processor to the Driver IC), read OIS status information, store sensor feedback, store firmware, and more.
[0053] Among them, the motor is used to drive the lens to move under the control of the Driver IC, thereby offsetting the impact of vibration (such as hand shaking) on image clarity.
[0054] The non-volatile memory may be specifically an electrically erasable programmable read-only memory (EEPROM). The EEPROM stores data such as calibration data and device configurations. These data are usually directly related to the functions of the driver IC.
[0055] The I2C bus can be used to connect the Driver IC to the electronic device's main processor (CPU) or coprocessor (Sensor Hub). This allows the electronic device to establish a connection with the Driver IC via the I2C bus during the initialization of the OIS device in a camera application scenario, sending control commands to the Driver IC and receiving status information, thereby controlling the Driver IC to power on, reset, and load firmware. Furthermore, the I2C bus is also used to connect the Driver IC to an EEPROM, allowing the Driver IC to read firmware data from the EEPROM and write it to the Driver IC when loading firmware.
[0056] Figure 1 The present invention only illustrates an illustrative example of a possible OIS device structure. Optionally, the OIS device structure may include more or fewer components. For example, the CPU of an electronic device or the ISP in a camera module may be used to replace the MCU to perform functions, and the embodiments of the present application do not impose any specific restrictions on this.
[0057] refer to Figure 2 , Figure 2 An example process of initialization failure of an OIS device is shown.
[0058] like Figure 2 As shown in the figure, when starting a camera application, the electronic device's software and hardware work together to initialize the OIS device. The electronic device's software includes but is not limited to the application layer, application framework layer, hardware abstraction layer (HAL), kernel layer, etc. The electronic device's hardware layer includes but is not limited to the driver IC, motor, gyroscope sensor, Hall sensor, image sensor, ISP, EEPROM, etc.
[0059] When starting a camera application, the initialization process of the OIS device includes the following steps:
[0060] (1) Starting the camera application: When the electronic device receives an operation for starting the camera application, it starts the camera application in the application layer.
[0061] (2) Starting the camera service: The electronic device starts the camera service in the application framework layer through the camera application, thereby providing services for the upper-layer camera application.
[0062] (3) Initializing the camera modules: The electronic device initializes the camera modules through the CameraProvider in the HAL, specifically including the OIS module. Initializing the OIS module involves calling the corresponding driver in the kernel layer to control the power-on, reset, and firmware loading of the OIS device.
[0063] (4) Power on, reset and load OIS firmware to complete the startup of Driver IC: The electronic device controls the power on of Driver IC through a specific driver in the kernel layer (such as OIS driver module) and performs a reset operation to put Driver IC in the initial state. The electronic device can also load OIS firmware for Driver IC through a specific driver in the kernel layer so that Driver IC can operate according to the predetermined logic. Optionally, initializing OIS is not only to control the power on, reset and firmware loading of Driver IC through a specific driver in the kernel layer to complete the startup of Driver IC, but also to configure and start other components in the OIS device, such as configuring the gyroscope sensor and calibrating the Hall sensor, etc.
[0064] Among them, the Driver IC loads the OIS firmware specifically including: a specific driver running on the electronic device CPU establishes a communication connection with the Driver IC in the OIS device through the I2C bus, and transmits control commands based on the communication connection, so that the Driver IC reads the firmware data from the EEPROM and writes it into the Driver IC.
[0065] However, in actual applications, the Driver IC will be affected by various factors, resulting in abnormalities in the data stored therein, such as abnormalities in one or more data such as calibration data (Trimming data), OISdata and Codedata. Since the Trimming data mainly contains the calibration data of the Driver IC at the factory, which includes information such as the I2C communication address of the Driver IC, the abnormal Trimming data will cause the I2C communication address in the Driver IC to be abnormal, so that the driver running on the CPU of the electronic device cannot address the Driver IC through the original correct I2C communication address, and thus cannot establish a communication connection with the Driver IC through the I2C bus, and cannot send control commands, which ultimately causes the Driver IC to fail to load the OIS firmware.
[0066] (5) Abnormal camera startup: Since the OIS device in the camera module fails to initialize successfully, the camera application cannot start normally, resulting in problems such as a black screen.
[0067] It can be seen that in adopting Figure 2 In the case of the initialization process of the OIS device shown, if the data of the Driver IC in the OIS device is abnormal, it will cause the camera to start abnormally. In order to solve the above problems, the present application provides a data recovery method and an electronic device. The method is applied to an electronic device including an OIS device, and the method includes: the electronic device performs OIS initialization through a processor, and in the process of performing OIS initialization, detects whether the communication address of the Driver IC in the OIS device is abnormal. If it is abnormal, a temporary communication connection between the processor and the Driver IC is established using the abnormal communication address, and based on the temporary communication connection, the correct communication address obtained from the EEPROM of the OIS device is replaced with the abnormal communication address that has been tampered with in the Driver IC. In addition, the processor can also detect whether the information of the register in the Driver IC is abnormal. If it is abnormal, the correct information is also obtained from the EEPROM to replace the information of the register that has been tampered with in the Driver IC. In this way, the successful initialization of the OIS can be effectively guaranteed, and the normal startup of the camera application of the electronic device will not be affected.
[0068] It is understandable that in addition to the data anomaly problem in the Driver IC component of the OIS device, there may also be data anomaly problems in other components. Similar data recovery methods can be used to address data anomaly problems in other components. This application will only use the recovery of abnormal data in the Driver IC component as an example to introduce.
[0069] refer to Figure 3 , Figure 3 An example of a successful initialization process of an OIS device is shown.
[0070] like Figure 3 As shown in the figure, when launching a camera application, the electronic device's software and hardware usually work together to initialize the OIS device. The electronic device's software includes but is not limited to: application layer, application framework layer, hardware abstraction layer (HAL), kernel layer, etc. The electronic device's hardware layer includes but is not limited to: driver IC, motor, gyroscope sensor, Hall sensor, image sensor, ISP, EEPROM, etc.
[0071] When starting a camera application, the initialization process of the OIS device includes the following steps:
[0072] (1) Starting the camera application: When the electronic device receives an operation for starting the camera application, it starts the camera application in the application layer.
[0073] (2) Starting the camera service: The electronic device starts the camera service in the application framework layer through the camera application, thereby providing services for the upper-layer camera application.
[0074] (3) Initializing the camera modules: The electronic device initializes the camera modules through the CameraProvider in the HAL. Specifically, this includes initializing the camera device and the OIS device. Initializing the OIS device includes initializing the EEPROM and initializing the DriverIC. During the DriverIC initialization process, the corresponding kernel layer driver is required to control the OIS device power-on, data recovery, and firmware loading.
[0075] (4) Power on, data recovery and firmware loading: The electronic device controls the power on of the Driver IC through the driver program (e.g., OIS driver module) in the kernel layer, and requests the upper layer module for initializing the EEPROM to obtain data, and recovers the data of the Driver IC based on the acquired data, that is, writes the acquired data into the Driver IC to replace the abnormal data in the Driver IC. After the Driver IC recovers the data, it also controls the Driver IC to load the OIS firmware so that the Driver IC can operate according to the predetermined logic. Among them, after the module for initializing the EEPROM in the HAL receives the data acquisition request sent by the driver program for controlling the Driver IC in the kernel layer, it reads the data in the EEPROM through the driver program for controlling the EEPROM in the kernel layer, and returns the read data to the driver program for controlling the Driver IC in the kernel layer.
[0076] In the embodiments of the present application, the EEPROM and Driver IC in the OIS device store corresponding data, and the addresses of these data in the EEPROM and the addresses in the Driver IC have a one-to-one correspondence. The data stored in the EEPROM and Driver IC include, but are not limited to, the following data: calibration data (Trimming data), operation data (OIS data), and firmware code data (Code data). The Driver IC's registers and flash memory also store data from the EEPROM.
[0077] Trimming data primarily includes driver IC factory information, including the driver IC's communication address, such as the I2C communication address, and configuration parameters for correcting and optimizing OIS system performance. This data can include temperature calibration parameters, timing adjustments, and voltage calibration to ensure the driver IC or other hardware devices function properly under different environmental conditions.
[0078] OISdata includes data related to the OIS function burned in by the manufacturer. This data typically includes sensor calibration information, OIS system configuration files, operating mode settings, firmware versions, production and testing information, etc. This information ensures that the camera can maintain a stable and clear image when moving or shaking.
[0079] Codedata primarily includes firmware, which is loaded into the Driver IC and serves as its "driver." This firmware enables the electronic device's operating system to operate according to standard device drivers. Optionally, the electronic device can determine whether the firmware is up to date and update the firmware version.
[0080] Optionally, Trimming data and OISdata belong to One Time Programmable (OTP) data in EEPROM. OTP data refers to data that can only be programmed once. It is usually written during the product manufacturing stage and cannot be changed after writing. Therefore, the Trimming data and OISdata in EEPROM will not have abnormal problems. However, the Trimming data and OISdata stored in the Driver IC are prone to abnormal problems, such as data abnormalities due to physical damage. Therefore, in the process of initializing the Driver IC, the abnormal data in the Driver IC is restored based on the backup data obtained from the EEPROM, which can ensure that the Driver IC is successfully initialized and the camera application of the electronic device can be successfully started.
[0081] Figure 3 Taking the scenario of starting the camera application as an example, the OIS initialization process is introduced. Figure 3Following the initialization process shown, after the camera application receives the user's input to start the operation and before the OIS is successfully initialized, the electronic device may first display a black screen interface. The camera application will not return to normal and display the preview interface until the OIS initialization process completes data recovery and successfully initializes. To completely avoid the problem of displaying a black screen when launching the camera application, it is also possible to trigger OIS initialization when the electronic device is turned on, and restore the data in the Driver IC during the initialization process. This will prevent the brief black screen problem when the user subsequently opens the camera application.
[0082] Next, combine Figure 4 The data recovery method provided by this application is introduced in detail. Figure 4 A flowchart of a data recovery method for an OIS device provided in an embodiment of the present application.
[0083] like Figure 4 As shown, the method flow includes the following steps:
[0084] Trigger condition 1 (S401-S402-1): When the electronic device starts the camera application, it triggers the initialization of the OIS and restores data.
[0085] S401: The electronic device starts a camera application.
[0086] Specifically, upon receiving an operation for starting the camera application, the electronic device starts to start the camera application. The operation for starting the camera application includes but is not limited to: an operation on the icon of the camera application, a voice command, etc.
[0087] Optionally, in addition to directly starting the camera application, the electronic device may also be triggered to initialize the OIS by performing an operation in other applications for calling the first camera of the electronic device. This embodiment of the present application does not limit this.
[0088] S402-1, the electronic device starts the camera service.
[0089] Specifically, the Camera Manager is a system service manager within an electronic device's operating system that detects and connects to camera devices. When a camera application requires access to the camera, it can request to open the camera by calling the openCamera() method of the Camera Manager within the Camera server. This method triggers a series of underlying operations, ultimately interacting with the hardware-layer camera module through the CameraProvider in the hardware abstraction layer and the kernel driver.
[0090] Among them, starting the camera can also be understood as turning on the camera, starting the camera, and enabling the camera, etc. The implementation of this application does not impose any specific restrictions on this name, and the corresponding implementation method has been recorded in the embodiments of this application.
[0091] Trigger condition 2 (S402-2): When the electronic device is powered on and the system is started, the OIS is initialized and data is restored.
[0092] S402-2, electronic equipment starts the system.
[0093] Specifically, upon receiving an operation for starting the electronic device, the electronic device starts to start the system. The operation for starting the electronic device includes, but is not limited to, a power-on operation on a physical key, a restart operation on a virtual key, etc., which is not limited in the present embodiment.
[0094] It is understandable that the data recovery method provided in the present application can adopt the aforementioned trigger condition 1 and trigger condition 2 at the same time, or only select any one of the trigger conditions, and the embodiments of the present application are not limited to this.
[0095] S403, the electronic device initializes the Driver IC.
[0096] Under the first trigger condition, enabling the camera application triggers a series of low-level operations, such as starting the CameraProvider in the hardware abstraction layer. Under the first trigger condition, when the electronic device's system is booted, the init process parses the init.rc file and starts corresponding services, including the CameraProvider service. The CameraProvider is used to start and manage the initialization of the Camera HAL. Specifically, the CameraProvider communicates with the CameraHAL through the Binder mechanism, controlling the initialization of specific Camera HAL modules. This initialization process involves not only configuring the camera module, but also initializing the OIS device.
[0097] S404: The electronic device detects whether the communication address of the Driver IC is abnormal.
[0098] Specifically, when the Camera HAL initializes the OIS, it relies on various services and interfaces provided by the kernel layer. The corresponding modules in the kernel layer (such as the OIS driver module) also need to detect whether the communication address of the Driver IC is abnormal, thereby ensuring that the corresponding services in the kernel layer running on the CPU can communicate normally with the Driver IC.
[0099] Detecting whether the driver IC's communication address is abnormal includes: the kernel layer running on the CPU uses a pre-configured communication address to establish a communication connection with the driver IC. If the connection is successful, it indicates that the driver IC's communication address is normal. If the connection is unsuccessful, it indicates that the pre-configured communication address of the driver IC has been tampered with and the driver IC's communication address is abnormal. The pre-configured communication address, also known as the first communication address, is set by the driver IC manufacturer before shipment and stored in EEPROM.
[0100] When the Camera HAL initializes OIS, it relies on various kernel-layer services and interfaces, including but not limited to device driver loading, parameter configuration, data transmission, interrupt handling, power supply control, user-space communication, and error handling. These low-level calls are essential for ensuring the correct startup and smooth operation of the OIS function.
[0101] S405-1: When it is detected that the communication address of the Driver IC is abnormal, temporary communication is established with the Driver IC based on the abnormal communication address, thereby controlling the Driver IC to recover to a normal communication address.
[0102] Specifically, after detecting that the communication address of the Driver IC is abnormal, the corresponding module in the kernel layer (such as the OIS driver module) needs to obtain the tampered abnormal communication address, use the abnormal communication address to establish a temporary communication connection (also called the first communication connection) with the Driver IC, and control the Driver IC to restore to the normal communication address through the temporary communication connection.
[0103] The method for obtaining the tampered abnormal communication address includes: the identification (e.g., I2C communication address) of the same model of Driver IC provided by the same manufacturer has a fixed rule. If a batch of electronic devices are all installed with the same model of Driver IC provided by the same manufacturer, then according to the fixed rule, each electronic device can sequentially use each possible I2C communication address to attempt to establish communication with the Driver IC. If the establishment is successful, it means that the currently used I2C communication address is the communication address of the tampered Driver IC. The tampered abnormal communication address is also called the second communication address.
[0104] Among them, the method of controlling the Driver IC to restore to a normal communication address through a temporary communication connection includes: the electronic device controls the Driver IC to power on through a driver program (such as an OIS driver module) in the kernel layer, and requests the upper layer to initialize the EEPROM module to obtain Trimming Data, the module that initializes the EEPROM reads the TrimmingData (also known as the first calibration information) from the EEPROM, the TrimmingData contains the communication address of the Driver IC, and writes the obtained data into the Driver IC to replace the abnormal data (also known as the second calibration data) in the Driver IC. Optionally, since all the data of the OTP are stored in the EEPROM, the OTP data contains the TrimmingData and OISData of the OIS, and the TrimmingData contains the communication address of the Driver IC. And the addresses of these data in the OTP and the addresses in the DriverIC have a one-to-one correspondence. Therefore, if necessary, the EEPROM can obtain the two parts of data based on the offset address of the TrimmingData and OIS data in the OTP, and then rewrite them into the DriverIC of the OIS.
[0105] S405-2: When it is detected that the communication address of the Driver IC is normal, check whether the information of the register in the Driver IC is abnormal.
[0106] Specifically, the information in the Driver IC includes not only the communication address but also the register information, which will affect the initialization of the Driver IC. Therefore, if the communication address of the Driver IC is normal, it is also necessary to check whether the register information is abnormal.
[0107] The method for detecting whether register information in the driver IC is abnormal specifically includes: reading the current second information of each register of one or more registers in the driver IC, and determining whether the second information is equal to the pre-designed first information. If the second information is not equal, the register information is abnormal. Optionally, for example, if the pre-designed maximum number of bits for a register is 0x80, but the actual maximum number of bits read is 0xFFFFFFF, the register information is abnormal.
[0108] S406: Based on the normal communication address, control the Driver IC to restore the Trimming data.
[0109] Since the Trimming data in the EEPROM contains the register information of the Driver IC, when the kernel layer detects an abnormality in the register information, the Trimming data can be read from the EEPROM, and a communication connection can be established with the Driver IC using a normal communication address, and the Trimming data can be rewritten into the Driver IC, thereby replacing the abnormal second information in the register with the first information in the Trimming data.
[0110] Regarding the method of restoring the trimming data, similarly, reference may be made to the description of S405-1 above, which will not be repeated here.
[0111] S407: After the data is restored or after the register information is detected to be normal, the OIS firmware is loaded.
[0112] Specifically, executing OIS firmware loading includes loading the firmware (Firmware) contained in the Codedata in the EEPROM into the Driver IC as the "driver" of the Driver IC. The Driver IC can successfully run the firmware, so that subsequent electronic devices can control the Driver IC based on the first communication address to achieve optical image stabilization OIS.
[0113] Optionally, the processor of the electronic device can continue to load the firmware contained in the Codedata in the EEPROM into the interior of the Driver IC based on the temporarily established second communication connection, or it can also disconnect the second communication connection and use the restored first communication address to establish a second communication connection with the Driver IC, and based on the first communication connection, load the firmware contained in the Codedata in the EEPROM into the interior of the Driver IC.
[0114] S408: Control the Driver IC to restore the OIS data.
[0115] Specifically, first load the Driver IC firmware, then restore the OIS data. This ensures the Driver IC's internal parameters and functions are correctly configured. The Driver IC is primarily responsible for guiding the lens to the correct target position based on the control algorithm. Only after the Driver IC firmware is correctly loaded can the OIS data be correctly applied to perform these basic functions.
[0116] Alternatively, in another possible implementation, before executing S408, the OIS data in the Driver IC can be checked for anomalies. If the OIS data in the Driver IC is abnormal, S408 can be executed. However, currently, if the data in the Driver IC is abnormal, there is a high probability that the OIS data has been tampered with. Therefore, to reduce the power consumption associated with determining each type of data, the OIS data can be directly restored.
[0117] Optionally, after executing the aforementioned recovery of the communication address, recovery of the Trimming data, and recovery of the OIS data, the electronic device can also restore the various logic modules in the Driver IC by soft-starting the Driver IC, thereby ensuring that the restored normal data can be applied during the subsequent operation of the Driver IC.
[0118] It can be seen that after implementing the data recovery method provided in this application, the normal initialization of the OIS device can be effectively guaranteed, and the first camera can be successfully enabled, thereby avoiding the problem of a black screen when starting the first camera or starting the camera application.
[0119] Next, the form and hardware architecture of the electronic device involved in this application are introduced.
[0120] Electronic equipment can be equipped or portable terminal devices with other operating systems, such as mobile phones, tablet computers, desktop computers, laptop computers, handheld computers, notebook computers, ultra-mobile personal computers (UMPCs), netbooks, as well as cellular phones, personal digital assistants (PDAs), augmented reality (AR) devices, virtual reality (VR) devices, artificial intelligence (AI) devices, wearable devices, in-vehicle devices, smart home devices and / or smart city devices, etc.
[0121] Figure 5 A schematic structural diagram of the electronic device 100 is shown.
[0122] 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, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, a sensor module 180, a button 190, a motor 191, a camera 193, a display screen 194, etc. The sensor module 180 may include a pressure sensor 180A, a touch sensor 180B, a gyroscope sensor 180C, a Hall sensor 180D, etc.
[0123] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer 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.
[0124] 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 microprocessor, a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units can be independent devices or integrated into one or more processors. Among them, the controller can be the nerve center and command center of the electronic device 100. The controller can generate an operation control signal based on the instruction opcode and the timing signal to complete the control of instruction fetching and execution.
[0125] 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 access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0126] In some embodiments, the processor 110 may include one or more interfaces, such as an inter-integrated circuit (I2C) interface and / or a universal serial bus (USB) interface.
[0127] 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 busses. The processor 110 can be coupled to the pressure sensor 180A, touch sensor 180B, gyroscope sensor 180C, Hall effect sensor 180D, driver IC, camera 193, etc. through different I2C bus interfaces. For example, the processor 110 can be coupled to the driver IC through the I2C interface, allowing the processor 110 and the driver IC to communicate through the I2C bus interface to implement the OIS function.
[0128] 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.
[0129] It is understood that the interface connection relationship between the modules illustrated in the embodiment of the present application 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.
[0130] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0131] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.
[0132] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0133] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, demodulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0134] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0135] 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.
[0136] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD). The display screen panel can also be made of an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a miniLED, a microLED, a micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.
[0137] In an embodiment of the present application, the electronic device 100 may display a user interface through the display screen 194 , such as a user interface provided by a camera application.
[0138] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194, application processor, OSI, etc. For the introduction of OSI, please refer to the previous Figure 1 The introduction of , I will not go into details here.
[0139] 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 converted into a visible image. The ISP can also perform algorithmic optimization on image noise and brightness. 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.
[0140] 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.
[0141] 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.
[0142] 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.
[0143] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).
[0144] Random access memory (RAM) may include static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM, for example, the fifth generation of DDR SDRAM is generally referred to as DDR5 SDRAM), etc. The RAM can be directly read and written by the processor 110 and can be used to store executable programs (e.g., machine instructions) of the operating system or other running programs, as well as user and application data.
[0145] Non-volatile memory can include disk storage devices and flash memory. Non-volatile memory can also store executable programs and user and application data, and can be pre-loaded into random access memory for direct reading and writing by processor 110. In the present application embodiment, the non-volatile memory includes an EEPROM in the OSI device. The EEPROM stores the OIS-related data described above, which will not be further described here.
[0146] The external memory interface 120 can be used to connect to an external non-volatile memory to expand the storage capacity of the electronic device 100. The external non-volatile memory communicates with the processor 110 via the external memory interface 120 to implement data storage. For example, files such as music and videos can be stored in the external non-volatile memory.
[0147] 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 acts on 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, a command 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, a command to create a new short message is executed.
[0148] Touch sensor 180B, also known as a "touch panel," can be disposed on display screen 194. The touch sensor 180B and display screen 194 form a touch screen, also known as a "touch screen." Touch sensor 180B is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to an application processor to determine the type of touch event. Visual output related to the touch operations can be provided via display screen 194. In other embodiments, touch sensor 180B can also be disposed on the surface of electronic device 100, at a location different from that of display screen 194.
[0149] In an embodiment of the present application, the electronic device 100 can detect user operations, such as operations for starting a camera application, through the pressure sensor 180A and the touch sensor 180B, and feed back the detected operation events to the processor 110.
[0150] The gyroscope sensor 180C 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 180C. The gyroscope sensor 180C can be used to implement the OIS function. Exemplarily, the gyroscope sensor 180C can transmit the collected angular velocity of the electronic device in the three axes to the OIS controller (i.e., the MCU mentioned above). The OIS controller can confirm the displacement of the lens based on the angular velocity of the electronic device in the three axes, and then confirm the shake compensation, so that the lens can offset the shake of the electronic device 100 through reverse motion to achieve anti-shake.
[0151] The Hall sensor 180D can be used to detect and measure changes in magnetic field strength and convert the magnetic field changes into voltage signal output. In an embodiment of the present application, when implementing the OIS function, the Hall sensor 180D is used to continuously detect the position information of the lens of the camera 193 and feed this information back to the driverIC of the OIS. The driverIC controls the motor to move the lens to the target position. It is necessary to ensure that the position of the lens detected by the Hall sensor is consistent with the target position.
[0152] Keys 190 include a power button, a volume button, and the like. Keys 190 can be mechanical physical keys or touch-sensitive physical keys. Electronic device 100 can receive key inputs and generate key signal inputs related to user settings and function control of electronic device 100, such as a power button signal input, thereby controlling the electronic device to power on.
[0153] The motor 191 may include 1-N. Different motors may have different functions, for example, including a motor set inside the OIS device and a motor for generating vibration prompts. For the specific function of the motor inside the OIS device, please refer to the previous Figure 1 The introduction of the motor for generating vibration prompts, for example, the touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. The motor 191 can also correspond to different vibration feedback effects for touch operations acting on different areas of the display screen 194. Different application scenarios (for example: time reminders, receiving information, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0154] It should be understood that each step in the above method embodiment can be completed by hardware integrated logic circuits in a processor or by software instructions. The method steps disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware processor, or by a combination of hardware and software modules in a processor.
[0155] The present application also provides an electronic device, which may include a memory, a processor, and a computer program stored in the memory, and the processor executes the computer program to implement the method performed by the electronic device in any of the above embodiments.
[0156] The present application also provides a chip system, including a processing circuit and an interface circuit, wherein the interface circuit is used to receive computer instructions and transmit them to the processing circuit, and the processing circuit is used to execute the computer instructions to implement a method executed by an electronic device as in any of the above embodiments.
[0157] The present application also provides a chip system, which includes at least one processor for implementing the method executed by the electronic device in any of the above embodiments. In one possible design, the chip system also includes a memory for storing program instructions and data, and the memory is located within or outside the processor.
[0158] A chip system can be composed of chips or include chips and other discrete devices.
[0159] Optionally, there may be one or more processors in the chip system. The processor may be implemented in hardware or software. When implemented in hardware, the processor may be a logic circuit, an integrated circuit, etc. When implemented in software, the processor may be a general-purpose processor implemented by reading software code stored in a memory.
[0160] Optionally, the memory in the chip system may be one or more. The memory may be integrated with the processor or may be provided separately from the processor, which is not limited in the embodiments of the present application. For example, the memory may be a non-transient processor, such as a read-only memory (ROM), which may be integrated with the processor on the same chip or provided on different chips. The embodiments of the present application do not specifically limit the type of memory or the configuration of the memory and the processor.
[0161] Exemplarily, the chip system can be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD) or other integrated chips.
[0162] The present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method executed by the electronic device in any one of the above embodiments is implemented.
[0163] The present application also provides a computer program product, including a computer program, which implements the method executed by the electronic device in any of the above embodiments when the computer program is executed by a processor.
[0164] The various implementation modes of this application can be combined arbitrarily to achieve different technical effects.
[0165] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described herein are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated therein. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).
[0166] Those skilled in the art will appreciate that all or part of the process steps in the above-described method embodiments can be implemented by a computer program instructing the relevant hardware. The program can be stored in a computer-readable storage medium, and when executed, the program can include the process steps in the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A data recovery method, characterized in that: The method is applied to an electronic device, the electronic device including a first camera, the first camera including a driver integrated circuit Driver IC and a first memory, and the method includes: detecting whether the communication address of the Driver IC is a first communication address, where the first communication address is obtained from the first memory; If the communication address of the Driver IC is not the first communication address, obtaining the current second communication address in the Driver IC; Based on the second communication address, replacing the second communication address in the Driver IC with the first communication address; Based on the first communication address, control the Driver IC to implement optical image stabilization (OIS) of the first camera.
2. The method according to claim 1, characterized in that Before controlling the Driver IC to implement OIS, the method further includes: The Driver IC is initialized based on the first communication address or the second communication address.
3. The method according to claim 2, characterized in that Initializing the Driver IC, specifically including: Loading the firmware in the first memory into the Driver IC; The firmware is successfully run through the Driver IC.
4. The method according to any one of claims 1 to 3, characterized in that Before detecting whether the communication address of the Driver IC is the first communication address, the method further includes: An operation for triggering powering on the electronic device is received.
5. The method according to claim 4, characterized in that After replacing the second communication address in the Driver IC with the first communication address, the method further includes: An operation for turning on a first camera in the electronic device is received, and a preview interface of the first camera is displayed.
6. The method according to any one of claims 1 to 3, characterized in that Before detecting whether the communication address of the Driver IC is the first communication address, the method further includes: An operation for starting the first camera is received.
7. The method according to claim 6, characterized in that The method further comprises: After starting the operation of the first camera, a black screen interface is displayed; After the second communication address in the Driver IC is replaced with the first communication address, a preview interface of the first camera is displayed.
8. The method according to any one of claims 1 to 7, characterized in that Obtaining the current second communication address in the Driver IC specifically includes: A communication connection is established with the Driver IC using one of a set of preset communication addresses in sequence until a communication connection is successfully established, and the communication address with which the communication connection is successfully established is determined as the second communication address.
9. The method according to any one of claims 1 to 8, characterized in that Before controlling the Driver IC to implement optical image stabilization (OIS) of the first camera, the method further includes: The electronic device soft-starts the Driver IC.
10. The method according to any one of claims 1 to 9, characterized in that Replacing the second communication address in the Driver IC with the first communication address specifically includes: The second calibration data in the Driver IC is replaced with the first calibration data, where the second calibration data includes the second communication address, the first calibration data includes the first communication address, and the first calibration data is obtained from the first memory.
11. The method according to any one of claims 1 to 8, characterized in that The Driver IC includes a register, and the method further includes: If the communication address of the Driver IC is the first communication address, the electronic device further detects whether the current second information of the register is abnormal; If the information of the register is abnormal, the second calibration data in the Driver IC is replaced with the first calibration data, where the second calibration data includes the second information of the register, the first calibration data includes the first information of the register, and the first calibration data is obtained from the first memory.
12. The method according to claim 11, characterized in that The electronic device detecting whether the current second information of the register is abnormal specifically includes: The electronic device further detects whether the number of bits of the register is greater than a preset number of bits. If so, it determines that the second information of the register is abnormal; if so, it determines that the second information of the register is normal.
13. The method according to any one of claims 1 to 12, characterized in that Before controlling the Driver IC to implement OIS of the first camera, the method further includes: The second OIS data in the Driver IC is replaced by the first OIS data, where the first OIS data is obtained from the first memory.
14. The method according to any one of claims 1 to 13, characterized in that The electronic device further includes a processor, which replaces the second communication address in the Driver IC with the first communication address based on the second communication address, specifically including: Based on the second communication address, a second communication connection is established with the Driver IC through the processor, and based on the second communication connection, the second communication address in the Driver IC is controlled to be replaced with the first communication address.
15. The method according to claim 14, characterized in that Based on the first communication address, controlling the Driver IC to implement optical image stabilization (OIS) of the first camera specifically includes: The second communication connection is disconnected, and based on the first communication address, a first communication connection is established with the Driver IC through the processor, and the Driver IC is controlled based on the first communication connection to implement optical image stabilization (OIS) of the first camera.
16. The method according to any one of claims 1 to 15, characterized in that The electronic device includes a processor, and an OIS driver module runs in the core layer of the processor; The electronic device detects, through the OIS driver module, whether the communication address of the Driver IC is a first communication address, where the first communication address is obtained from the first memory; If the communication address of the Driver IC is not the first communication address, obtaining the current second communication address in the Driver IC through the OIS driver module; Based on the second communication address, replacing the second communication address in the Driver IC with the first communication address through the OIS driver module; Based on the first communication address, the OIS driver module controls the Driver IC to implement optical image stabilization (OIS) of the first camera.
17. An electronic device, characterized in that: The system comprises a second memory, one or more processors, a first camera, and a computer program stored on the second memory, wherein the first camera comprises a driver integrated circuit (Driver IC) and a first memory, and the processor executes the computer program to implement the steps of the method according to any one of claims 1 to 16.
18. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 16 are implemented.
19. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 16 are implemented.
Citation Information
Patent Citations
Verification information generation method, verification method and device
CN114978742A
Equipment operation and maintenance method and device, equipment and storage medium
CN116684272A
Tamper-proof data processing method and device and electronic equipment
CN117240625A
Communication address detection apparatus, connector with built-in control circuit, and communication address detection method
JP2010245988A
Non-volatile semiconductor memory device
US20060034120A1