Abnormality detection method, electronic device and readable medium

By receiving the camera system interrupt signal and obtaining abnormal status codes, and performing module or system reset, the camera system abnormal detection and reset problems are solved, and the camera system is quickly and stable recovery and reliability of the camera system and shooting function are achieved.

CN117714665BActive Publication Date: 2024-12-24HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311043607.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-17
Publication Date
2024-12-24
Estimated Expiration
2043-08-17

AI Technical Summary

Technical Problem

The prior art is difficult to effectively detect and reset abnormalities in the camera system, resulting in failure or instability of the shooting function.

Method used

An exception detection method is provided to retrieve an exception status encoding by receiving an interrupt signal in the camera system, and perform module or system reset according to the encoding, including lightweight and heavyweight reset policies to repair exceptions in the camera system.

Benefits of technology

It realizes rapid detection and automatic reset of the camera system, ensuring the stability and reliability of the shooting function, and avoiding shooting interruptions and data losses caused by abnormalities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117714665B_ABST
    Figure CN117714665B_ABST
Patent Text Reader

Abstract

The present application provides an abnormality detection method, an electronic device and a readable medium. The electronic device is configured with a camera system, and the camera system includes a first module and a second module. The abnormality detection method includes: receiving an interrupt signal sent by the first module; based on the interrupt signal, obtaining the abnormal state code of the first module; based on the abnormal state code of the first module, resetting the first module, or resetting the camera system. The first module of the camera system can perform abnormality detection, and obtain an interrupt signal when an abnormality is detected. The electronic device can obtain the abnormal state code of the first module based on the interrupt signal, and the abnormal state code can indicate the abnormal type of the first module. The electronic device resets the first module based on the abnormal state code of the first module, or resets the camera system, thereby realizing abnormality detection and resetting of the camera system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of fault detection, and in particular to an abnormality detection method, an electronic device, a computer program product, and a computer-readable storage medium. Background Art

[0002] Electronic devices such as mobile phones are equipped with camera systems to realize the function of shooting images or videos. Therefore, it is necessary to provide a solution that can detect abnormalities and reset the camera system. Summary of the invention

[0003] The present application provides an abnormality detection method, an electronic device, a computer program product, and a computer-readable storage medium, which can realize abnormality detection and resetting of a camera system.

[0004] In order to achieve the above objectives, this application provides the following technical solutions:

[0005] In a first aspect, the present application provides an abnormality detection method applied to an electronic device, wherein the electronic device is configured with a camera system, the camera system includes a first module and a second module, the abnormality detection method is used to detect abnormalities in the camera system, and can also reset the module or the entire camera system based on the abnormality detection result. The abnormality detection method includes: receiving an interrupt signal sent by the first module; obtaining an abnormal state code of the first module based on the interrupt signal; resetting the first module or resetting the camera system based on the abnormal state code of the first module.

[0006] In some embodiments, the first module and the second module correspond to a function of the camera system respectively. For example, the first module is used to complete image capture, and the second module is used to complete the rotation control of the reflective prism during image capture. In some embodiments, the camera system may also include a third module, and the third module is used to complete anti-shake during image capture.

[0007] It can be seen from the above content that the first module of the camera system can perform abnormality detection and obtain an interrupt signal when an abnormality is detected. Based on the interrupt signal, the electronic device can obtain the abnormal status code of the first module, and the abnormal status code can indicate the abnormal type of the first module. Based on the abnormal status code of the first module, the electronic device resets the first module or resets the camera system, thereby realizing abnormality detection and resetting of the camera system.

[0008] In one possible implementation, based on the abnormal state code of the first module, resetting the first module or resetting the camera system includes: determining that the abnormal state code of the first module corresponds to a lightweight reset strategy and resetting the first module; determining that the abnormal state code of the first module corresponds to a heavyweight reset strategy and resetting the camera system.

[0009] In the above possible implementation manner, if it is determined that the abnormal state code of the first module corresponds to a lightweight reset strategy, it means that only the first module in the camera system has an abnormality, and the first module can be reset. If it is determined that the abnormal state code of the first module corresponds to a heavyweight reset strategy, it means that multiple modules of the camera system need to be reset to repair the abnormality, and therefore, the camera system is reset.

[0010] In a possible implementation, obtaining the abnormal status code of the first module based on the interrupt signal includes: based on the interrupt signal, calling the abnormal dump interface of the first module to obtain the abnormal status code of the first module.

[0011] In one possible implementation, resetting the first module based on the abnormal state code of the first module includes: based on the abnormal state code of the first module, calling the abnormal reset interface of the first module to reset the first module. In some embodiments, resetting the first module includes: initialization of the driver module, powering off, re-powering on, and initialization of the hardware IC and other hardware components, and initialization of the firmware corresponding to the driver module.

[0012] In a possible implementation, obtaining the abnormal status code of the first module based on the interrupt signal includes: requesting the abnormal status code from the first module and the second module based on the interrupt signal; and obtaining the abnormal status code of the first module.

[0013] In the above possible implementation, the first module sends an interrupt signal. However, since the abnormal component cannot be determined by using the interrupt signal, multiple modules may be triggered to execute the module abnormal diagnosis process to obtain the abnormal status code of the module.

[0014] In one possible implementation, the kernel layer of the operating system of the electronic device includes an abnormality detection module; the hardware abstraction layer of the operating system of the electronic device includes an image link; receiving an interrupt signal sent by the first module, and obtaining an abnormal state code of the first module based on the interrupt signal, including: the abnormality detection module receives the interrupt signal sent by the first module, and obtains the abnormal state code of the first module based on the interrupt signal; based on the abnormal state code of the first module, resetting the first module, or resetting the camera system, including: the abnormality detection module resets the first module based on the abnormal state code of the first module; or, the image link resets the camera system.

[0015] In some embodiments, resetting the camera system by the image link includes: reestablishing the image link, powering off all components, powering on again, and reinitializing.

[0016] In a possible implementation, before the image link resets the camera system, the method further includes: an abnormality detection module reporting an event to the image link.

[0017] In one possible implementation, the first module includes: a first module of a hardware abstraction layer of an electronic device operating system, a first module of a kernel layer, and a first module of a firmware layer; an abnormality detection module receives an interrupt signal sent by the first module, and based on the interrupt signal, obtains an abnormal status code of the first module, including: the abnormality detection module receives an interrupt signal sent by the first module of the firmware layer, and based on the interrupt signal, obtains an abnormal status code of the first module sent by the first module of the kernel layer; the abnormality detection module resets the first module based on the abnormal status code of the first module, including: the abnormality detection module resets the first kernel layer module and the first module of the firmware layer based on the abnormal status code of the first module.

[0018] In one possible implementation, the second module includes: a second module of the hardware abstraction layer of the electronic device operating system, a second module of the kernel layer, and a second module of the firmware layer; the image link resets the camera system, including: the image link resets the first module of the kernel layer and the first module of the firmware layer through the first module of the hardware abstraction layer of the electronic device operating system, and resets the second module of the kernel layer and the second module of the firmware layer through the second module of the hardware abstraction layer of the electronic device operating system.

[0019] In a second aspect, the present application provides an electronic device comprising: one or more processors, a memory and a display screen; the memory and the display screen are coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes an anomaly detection method as described in any one of the first aspects.

[0020] In a third aspect, the present application provides a computer-readable storage medium for storing a computer program. When the computer program is executed, it is specifically used to implement any anomaly detection method as described in the first aspect.

[0021] In a fourth aspect, the present application provides a computer program product. When the computer program product runs on a computer or a processor, the computer or the processor executes the anomaly detection method as described in any one of the first aspects. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

[0024] Figure 3 A timing diagram of the operation of an abnormality detection and reset process of a component for tracking a moving object in a shooting scene provided by an embodiment of the present application;

[0025] Figure 4 A flowchart of registering two interfaces of the Scan driver, OIS driver and AF driver to the abnormality detection module provided in the embodiment of the present application;

[0026] Figure 5 A flowchart of abnormality detection and resetting of a component for tracking a moving object in a shooting scene provided in an embodiment of the present application. DETAILED DESCRIPTION

[0027] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. The terms used in the following embodiments are only for the purpose of describing specific embodiments and are not intended to be used as limitations on the present application. As used in the specification and the appended claims of the present application, the singular expressions "one", "a kind", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear contrary indication in the context. It should also be understood that in the embodiments of the present application, "one or more" refers to one, two or more; "and / or" describes the association relationship of the 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 objects associated before and after are in an "or" relationship.

[0028] References to "one embodiment" or "some embodiments" etc. described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application. Thus, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear at different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0029] The multiple involved in the embodiments of the present application means greater than or equal to two. It should be noted that in the description of the embodiments of the present application, the words "first", "second", etc. are only used for the purpose of distinguishing the description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order.

[0030] Figure 1 An example of the composition of an electronic device provided in an embodiment of the present application.

[0031] The electronic device can be a mobile phone, a tablet computer, a personal digital assistant (PDA), a desktop, a laptop, a notebook computer, an ultra-mobile personal computer (UMPC), a handheld computer, a netbook, a wearable device, etc.

[0032] like Figure 1 As shown, the electronic device 100 may include a processor 110, an internal memory 120, a camera 130, a display screen 140, a mobile communication module 150, a wireless communication module 160, an audio module 170, a sensor module 180, and a camera module 190, etc.

[0033] It is to be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 100. In other embodiments, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some 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.

[0034] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, a smart sensor hub and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0035] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

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

[0037] In some embodiments, the internal memory 120 stores instructions for abnormal detection and resetting of components that implement moving tracking objects in the shooting scene. Among them, implementing moving tracking objects in the shooting scene can refer to the camera's shooting mode, in response to the user's input zoom operation on the shooting object, controlling the camera module 190 to automatically zoom in or out the object with the object as the center, and can also be in the camera's video recording mode. Tracking objects can be implemented in response to the user's input tracking object operation on the shooting object, and the camera module 190 can automatically track and shoot the moving object selected by the user.

[0038] The electronic device can implement some shooting functions through the ISP, the camera 130, the video codec, the GPU, the display screen 140 and the application processor, etc. The shooting function can be understood as a conventional shooting function.

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

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

[0041] Digital signal processors are used to process digital signals. In addition to processing digital image signals, they can also process other digital signals. For example, when an electronic device selects a frequency point, a digital signal processor is used to perform Fourier transform on the frequency point energy.

[0042] Video codecs are used to compress or decompress digital videos. Electronic devices can support one or more video codecs. In this way, electronic devices can play or record videos in multiple coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

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

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

[0045] The display screen 140 is used to display images, video interfaces, etc. The display screen 140 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oled, a quantum dot light emitting diode (QLED), etc. In some embodiments, the electronic device may include 1 or N display screens 140, where N is a positive integer greater than 1.

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

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

[0048] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, etc. 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.

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

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

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

[0052] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device can listen to music or listen to a hands-free call through the speaker 170A.

[0053] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.

[0054] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The electronic device can be provided with at least one microphone 170C. In other embodiments, the electronic device can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device can also be provided with three, four or more microphones 170C to realize the collection of sound signals, noise reduction, identification of sound sources, and directional recording function, etc.

[0055] The earphone interface 170D is used to connect a wired earphone and can be a USB interface, or a 3.5 mm open mobile terminal platform (OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0056] In the sensor module 180, the pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 140. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. A capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device determines the intensity of the pressure based on the change in capacitance. When a touch operation acts on the display screen 140, the electronic device detects the intensity of the touch operation based on the pressure sensor 180A. The electronic device can also calculate the position of the touch based on the detection signal of the pressure sensor 180A.

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

[0058] The acceleration sensor 180C can detect the magnitude of the acceleration of the electronic device in various directions (generally three axes). When the electronic device is stationary, it can detect the magnitude and direction of gravity, and can also be used to identify the posture of the electronic device.

[0059] The gyro sensor 180D may be used to determine the motion posture of the electronic device. In some embodiments, the angular velocity of the electronic device around three axes (ie, x, y, and z axes) may be determined by the gyro sensor 180D.

[0060] In some embodiments, the electronic device implements other shooting functions through the ISP, the camera module 190, the video codec, the GPU, the display screen 140, and the application processor. Other shooting functions may refer to: in the camera's photo mode, in response to the user's input operation on the shooting object, the object is automatically enlarged or reduced with the object as the center, and the moving object is continuously tracked in the camera's video recording mode, and the user's input operation on the shooting object is implemented, and the moving object selected by the user can be automatically tracked and shot.

[0061] In some embodiments, the camera module 190 includes: a lens photosensitive element Sensor, an OIS IC, and a Scan IC. The camera module 190 may also include an AF IC, which is not shown in the figure. From the perspective of hardware structure, abnormality detection and resetting of the components for realizing the moving tracking object in the shooting scene can be understood as: abnormality detection and resetting of the camera module 190.

[0062] In some embodiments, the camera module 190 is a telephoto module.

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

[0064] The lens of the camera module 190 includes a reflective prism, which is located in the incident light path of the sensor and is used to reflect light to the sensor. In some embodiments, the reflective prism supports rotational movement in the xz plane, and the range of rotational movement is +-24 degrees. It also supports rotational movement in the yz plane, and the range of rotational movement is +-7. The rotation of the reflective prism can also be understood as the rotation of the camera module lens. The rotation of the camera module lens can achieve that the subject is in the center of the picture during the zooming in or out process.

[0065] Scan IC can be understood as a controller that controls the rotation of the reflective prism. For example, Scan IC can be a chip with logic control capabilities. The Scan motor receives the control instructions of Scan IC and can drive the reflective prism to rotate. In some embodiments, the Scan motor includes two, one drives the reflective prism to rotate in the xz plane, and the other drives the reflective prism to rotate in the yz plane. The xz plane and the yz plane are two intersecting planes.

[0066] In some embodiments, the brake component can be used to lock and unlock the position of the camera module lens. Before the reflective prism rotates, the brake component can be unlocked, and after the reflective prism rotates, the brake component is locked, which can facilitate the camera module lens to quickly stabilize after reaching the position. In some embodiments, the brake component includes a brake IC and an actuator. The brake IC can receive control instructions from the Scan IC to control the actuator to lock or unlock. The brake IC can be understood as a controller, such as a chip with logic control capabilities.

[0067] In some embodiments, an OIS IC (Optical Image Stabilizer IC) is used for anti-shake. The OIS IC can control the OIS motor for anti-shake. In some embodiments, the OIS motor does not perform anti-shake when the Scan motor drives the reflection prism to rotate. Based on this, the Scan IC can control the OIS motor not to run during the operation of the Scan motor, and to run after the Scan motor finishes running. The OIS IC and the OIS motor can be collectively referred to as an anti-shake component.

[0068] In some embodiments, the AF motor is used for focusing, and the OIS IC can control the AF motor for focusing after performing algorithm calculation compensation. The AF IC and the AF motor can be referred to as a focusing component.

[0069] In some embodiments, the Scan IC and the OIS IC are configured with abnormal interrupt pins. The abnormal interrupt pins of the OIS IC and the Scan IC are connected to the AP. The abnormal interrupt pins of the OIS IC and the Scan IC can be connected to the AP in parallel or connected to the AP separately.

[0070] In some embodiments, the Scan IC, the OIS IC and the AP in the processor 110 communicate via an I2C bus. The AP can read the abnormal status codes of the Scan IC and the OIS IC via the I2C bus and can also control their reset.

[0071] In some embodiments, the brake IC is connected to the Scan IC via an I2C bus, and the AP can read the abnormal status code of the brake IC via the Scan IC and control its reset.

[0072] In some embodiments, the AF IC is connected to the OIS IC via an I2C bus, and the AP can read the abnormal status code of the AF IC through the OIS IC and control its reset.

[0073] Electronic equipment in Figure 1 The hardware components shown also have operating systems running on them. operating system, operating system, Operating system, etc. Applications such as camera applications can be installed and run on the operating system.

[0074] Figure 2 A schematic diagram of the software structure of an electronic device provided in an embodiment of the present application.

[0075] The layered architecture divides the operating system of the electronic device into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the operating system of the electronic device is the Android system. The Android system can be divided into five layers, from top to bottom, namely the application (APP) layer, the application framework layer (abbreviated as FWK), the system library, the hardware abstraction layer (HAL) and the kernel layer.

[0076] The application layer can include a series of application packages. Figure 2 As shown, the application package may include applications such as camera and call.

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

[0078] like Figure 2 As shown, the application framework layer may include window management services, content providers, phone managers, view systems, resource managers, and camera services, etc.

[0079] The window management service is used to manage window programs. The window management service can implement window addition, deletion, display and hiding control, etc. The content provider is used to store and obtain data and make the data accessible to applications. The data can include video, images, audio, dialed and received calls, browsing history and bookmarks, phone books, etc. The phone manager is used to provide communication functions for electronic devices. For example, the management of call status (including connected, hung up, etc.). The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. The resource manager provides various resources for applications, such as localized strings, icons, pictures, layout files, video files, etc.

[0080] In some embodiments, the camera service may also be referred to as a camera framework, which is used to receive recording requests, image capture requests, and other requests from camera applications, while maintaining the business logic of the internal circulation of recording requests, image capture requests, and other requests, and sending the final result of the request to the camera application.

[0081] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system. In some embodiments of the present application, the application cold start will run in the Android runtime, and the Android runtime will obtain the optimized file status parameters of the application. Then, the Android runtime can determine whether the optimized file is outdated due to system upgrades based on the optimized file status parameters, and return the judgment result to the application management module.

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

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

[0084] The system library may include multiple functional modules, such as a surface manager, a media library, a 3D graphics processing library (such as OpenGL ES), and a 2D graphics engine (such as SGL).

[0085] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of multiple common audio and video formats, as well as static image files. The media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis and layer processing. The 2D graphics engine is a drawing engine for 2D drawing.

[0086] The hardware abstraction layer is a software located between the operating system kernel and the hardware circuit. It is usually used to abstract the hardware to realize the interaction between the operating system and the hardware circuit at the logical layer.

[0087] In some embodiments, the hardware abstraction layer includes a camera Hal, which includes an image link Pipeline and CamxHal3. The camera Hal is mainly responsible for the construction, linking, and interactive control of all modules in the image link. CamxHal3 is used to interact with the upper-level module to open or close the camera Hal, and to transmit data to the camera Hal.

[0088] In some embodiments, the image link Pipeline includes: a module control module, an ISP control module and an algorithm module; the module module is responsible for processing the camera module management, and the module module includes a sensor control module, a scan control module, an OIS control module, and a motor actuator control module.

[0089] In some embodiments, the sensor control module is used to connect to the image sensor, and the sensor control module can control the operation of the sensor through the sensor driver and the sensor firmware. The sensor control module is also called a sensor node.

[0090] In some embodiments, the Scan control module is used to connect to the Scan motor to realize the rotation of the reflective prism. The Scan control module can control the operation of the Scan motor through the Scan driver and Scan Firmware.

[0091] In some embodiments, the OIS control module is used to implement anti-shake processing during the rotation of the camera module, and the OIS control module can control the operation of the OIS motor through the OIS driver and OIS Firmware. In other embodiments, the Scan control module can control the operation of the OIS motor through the Scan driver, Scan Firmware and control OIS Firmware.

[0092] In some embodiments, the Actuator control module is used for AF focusing during the rotation of the camera module. The Actuator control module can control the operation of the AF motor through AF drive, OIS Firmware and AF Firmware.

[0093] It should be noted that the Sensor control module, Sensor driver, Sensor Firmware and Sensor are used to obtain image data. The Sensor control module, Sensor driver and Sensor Firmware can be collectively referred to as one module.

[0094] The Actuator control module, AF driver, AF Firmware and AF motor are used to perform focusing. The Actuator control module, AF driver and AF Firmware can also be collectively referred to as one module.

[0095] The OIS control module, OIS driver, OIS Firmware and OIS IC are used to perform anti-shake. The OIS control module, OIS driver and OIS Firmware can also be collectively referred to as one module.

[0096] The Scan control module, Scan driver, ScanFirmware and ScanIC are used to realize the rotation of the reflection prism. The Scan control module, Scan driver and ScanFirmware can also be collectively referred to as one module.

[0097] The ISP control module is used to receive image data sent by the sensor, process the image data, and then send it to the algorithm module. In some embodiments, the sensor refers to the sensor of the camera module 190.

[0098] The algorithm module is used to receive the image data sent by the ISP control module, analyze the image data, obtain the operation strategy of the lower module, and feed it back to the module in the module control module. In some embodiments, the algorithm module obtains the rotation strategy of the reflective prism and feeds it back to the Scan control module.

[0099] The kernel layer is the layer between hardware and software. The kernel layer receives commands from the control layer and supports the conversion of control commands into actual device operation instructions. Operation instructions include power-on and power-off control, device mode register instruction generation and issuance. The register control commands of the driver layer are passed to the firmware layer through the device bus. The kernel layer includes at least Sensor driver, Scan driver, OIS driver, and AF driver.

[0100] The firmware layer refers to the software system integrated into each component of the camera module, including Sensor Firmware, Scan Firmware, OIS Firmware, AF Firmware and Braking Firmware. In some embodiments, the firmware layer may not include Braking Firmware.

[0101] In some embodiments, Sensor Firmware is a software system running inside the Sensor, responsible for sensor exposure and image data output. Scan Firmware is a software system running inside the Scan IC, used to control the rotation of the camera module lens, and is responsible for converting the code sent down from the upper layer into a control signal, so as to drive the camera module lens to rotate and achieve the focus tracking and framing goals. Brake Firmware is a software system running inside the brake IC, used to lock the position of the camera module, so that the camera module can quickly stabilize after reaching the target position. OIS Firmware is a software system running inside the OIS IC, used for anti-shake. AF Firmware is a software system running inside the AF IC, used for focus tracking, responsible for converting the target position sent down from the upper layer into a motor current, and driving the AF motor to focus.

[0102] From the perspective of software structure, abnormality detection and resetting of components that realize mobile tracking objects in the shooting scene can be understood as: abnormality detection and resetting of image link Pipeline, Sensor driver, Scan driver, OIS driver, AF driver Sensor Firmware, Scan Firmware, OIS Firmware, AF Firmware and brake Firmware.

[0103] It should be noted that although the embodiments of the present application are based on The system is used as an example, but the basic principles are also applicable to Electronic devices with other operating systems.

[0104] Figure 3 The runtime timing of the anomaly detection and reset process for a component that tracks a moving object in a captured scene is shown.

[0105] like Figure 3 As shown, multiple drivers in the kernel layer, such as Scan driver, OIS driver, and AF driver, can register the following two interfaces with the anomaly detection module when the kernel driver is loaded:

[0106] The exception information parsing and dump interface, referred to as the exception dump interface, is used to call back each module to complete exception parsing when an exception occurs, and provide the module diagnosis results.

[0107] Exception reset interface, used to support exception processing and actions within the module.

[0108] Figure 4 The following figure shows the flow chart of Scan driver, OIS driver and AF driver registering two interfaces with the anomaly detection module. Figure 4 As shown, when the Scan driver, OIS driver and AF driver are loaded, the following steps S401 to S403 are executed; wherein:

[0109] S401. The Scan driver registers an exception dump interface and an exception reset interface with the exception detection module.

[0110] S402: The OIS driver registers an abnormal dump interface and an abnormal reset interface with the abnormal detection module.

[0111] S403: The AF driver registers an abnormal dump interface and an abnormal reset interface with the abnormal detection module.

[0112] Scan Firmware, OIS Firmware, AF Firmware, and Brake Firmware may detect abnormalities during operation and perform abnormality checks. Figure 3 As shown, Scan Firmware executes 1-1 to perform abnormality check, OIS Firmware executes 1-2 to perform abnormality check, AF Firmware executes 1-3 to perform abnormality check, and Brake Firmware executes 1-4 to perform abnormality check.

[0113] If the brake firmware senses an abnormality, execute 2-1. Report an interrupt to the Scan Firmware, which can be reported to the AP's abnormality detection module through the Scan Firmware's interrupt pin. If the AF Firmware senses an abnormality, execute 2-2. Report an interrupt to the OIS Firmware, which can be reported to the AP's abnormality detection module through the OIS Firmware's interrupt pin. If the Scan Firmware or OIS Firmware senses an abnormality, execute 2-3. Use the interrupt pin to report an interrupt to the AP's abnormality detection module.

[0114] After the abnormality detection module receives an interrupt reported by Scan Firmware, OIS Firmware, AF Firmware and Brake Firmware, it can process the interrupt, call back the abnormality dump interface of each driver module, and obtain the abnormal status code of each driver module. Figure 3It shows that the abnormal detection model executes 3-1. Calls back the abnormal dump interface registered by the Scan driver to obtain the Scan abnormal status code; the abnormal detection model executes 3-2. Calls back the abnormal dump interface registered by the OIS driver to obtain the OIS abnormal status code; the abnormal detection model executes 3-1. Calls back the abnormal dump interface registered by the AF driver to obtain the AF abnormal status code. The specific implementation method can be found in the contents of steps S505 to S510 in the following embodiment, which will not be described here.

[0115] The abnormality detection module uses the abnormal state codes of each driver module to comprehensively obtain the state of each driver module and determine the reset strategy. The reset strategy may include a lightweight reset strategy and a heavyweight reset strategy; the lightweight reset strategy is given priority.

[0116] The exception detection module executes a lightweight reset strategy, which means calling back the exception reset interface of the driver module where the exception occurs to execute the reset process. The reset process usually includes the initialization of the driver module, powering off, re-powering on and initializing the hardware IC and other hardware components, and the initialization of the firmware corresponding to the driver module.

[0117] The anomaly detection module implements a heavyweight reset strategy including:

[0118] The abnormality detection module executes 4. Reports the event to the CRM to indicate an abnormal state. The CRM executes 5. Reports the event to the image link pipeline through V4L2 and CSL. The image link pipeline performs a full reset of the camera system. The full reset of the camera system includes: image link reconstruction, powering off all components, powering on again, and reinitializing. Among them, all components include at least: Figure 2 The displayed module control modules include the various control modules of the module, the driver modules corresponding to each control, the firmware driven by each driver module, and the hardware components controlled by the firmware.

[0119] It should be noted that Figure 2 The hardware abstraction layer shown includes an image link control module, which can be used to manage the image link. After CRM reports an event to the image link, the image link control module can obtain the event and rebuild the image link. Rebuilding the image link can be understood as: rebuilding the image link. Figure 2 The functional modules in the displayed image link are executed by the reconstructed image link as follows.

[0120] Image link Pipeline executes 7. Triggers SensorNode to perform reset.

[0121] In some embodiments, the image link PipelineSensorNode triggers the SensorNode to perform a reset including:

[0122] The SensorNode executes 8. Controls the Scan control module, the OIS control module and the Actuator control module to perform reset; and executes 9-1. Controls the Sensor to perform reset. The Scan control module executes 9-2. Performs reset. The OIS control module executes 9-3. Performs reset. The Actuator control module executes 9-4. Performs reset.

[0123] Among them, the specific implementation process of the above 9-1 to 9-4 can be found in the following embodiment content, which will not be elaborated here.

[0124] In some embodiments, the image link Pipeline further executes 6. sending an abnormal status to the algorithm module to inform it of the abnormal situation.

[0125] The following combination Figure 5 , taking the abnormality detected by Scan Firmware and OIS Firmware as an example, the process of resetting the abnormality is introduced. Of course, AF Firmware and Brake Firmware can also perform abnormality checks, and in the scenario where they detect abnormalities, they can also reset the abnormalities. The reset process can also refer to the content of the following embodiment.

[0126] like Figure 5 As shown, the abnormality check and reset process provided in the embodiment of the present application includes:

[0127] S501, Scan Firmware to perform abnormality check.

[0128] Scan Firmware is configured with an abnormality check process, and Scan Firmware executes the abnormality check process to check whether an abnormality occurs during its own operation.

[0129] In some embodiments, the check items for abnormality check performed by Scan Firmware may include:

[0130] 1. The hardware function of the basic components of Scan IC is abnormal, which may refer to the function abnormality caused by short circuit, open circuit, etc.

[0131] 2. Connection communication abnormality: The connection communication between AP and Scan IC is abnormal. In some embodiments, Scan IC reports abnormal data to AP through I2C bus, which can determine the connection communication abnormality between AP and Scan IC; the connection inside the module, such as SPI between Scan IC and OIS IC, and I2C between Scan IC and brake IC. In some embodiments, the abnormal connection inside the module leads to data transmission failure, and data retransmission can be allowed. After 3 data retransmission failures, an interruption can be reported.

[0132] 3. Data input abnormality check, including Gyro / Acc input, code check abnormality sent by AP to Scan IC, TMR data input abnormality, etc. Among them, code can be understood as: the target position of the reflective prism calculated by the algorithm module. The position information of the reflective prism can be the detection value of the TMR sensor, referred to as TMR data.

[0133] 4. Algorithm processing exception: Scan algorithm exception.

[0134] 5. Timing control abnormality: interrupt timing abnormality, firmware internal timing disorder or state machine abnormality.

[0135] 6. Data accuracy is abnormal: The difference between the code sent by the Scan IC and the code calculated by the algorithm module is greater than the threshold, the system accuracy is insufficient, or the difference between the TMR data and the code calculated by the algorithm module is greater than the threshold.

[0136] S502, if the Scan Firmware detects an abnormality, the abnormality is reported by reporting an interrupt to the abnormality detection module.

[0137] As mentioned above, Scan IC is configured with an abnormal interrupt pin. Scan Firmware, as ScanIC firmware, can report an interrupt signal to the abnormal detection module of AP through the abnormal interrupt pin after detecting an abnormality, so as to report the abnormality detected by Scan Firmware to the abnormal detection module of AP.

[0138] S503, OIS Firmware performs abnormality check.

[0139] The OIS Firmware is also configured with an abnormality check process, and the OIS Firmware executes the abnormality check process to check whether an abnormality occurs during its own operation.

[0140] In some embodiments, the inspection items for abnormality inspection performed by OIS Firmware may include:

[0141] 1. The hardware function of the basic components of the OIS IC is abnormal, which may refer to the function abnormality caused by short circuit, open circuit, etc.

[0142] 2. Connection communication abnormality: The connection communication between AP and OIS IC is abnormal. In some embodiments, OIS IC reports data abnormality to AP through I2C bus, which can determine the connection communication abnormality between AP and OIS IC; the connection inside the module, such as SPI between Scan IC and OIS IC, and I2C between OIS IC and AF IC. In some embodiments, the connection abnormality inside the module leads to data transmission failure, and data retransmission can be allowed. After 3 data retransmission failures, an interruption can be reported.

[0143] 3. Data input abnormality check, including Gyro / Acc input, code check abnormality sent by AP to OIS IC, HALL data input abnormality, etc. Among them, code can be understood as: the operating parameters of the OIS motor calculated by the algorithm module. The anti-shake parameters of the OIS motor are the detection values ​​of the Hall Hall sensor, referred to as HALL data.

[0144] 4. Algorithm processing exception: OIS algorithm exception.

[0145] 5. Timing control abnormality: interrupt timing abnormality, firmware internal timing disorder or state machine abnormality.

[0146] 6. Data accuracy is abnormal: The difference between the code sent by the OIS IC and the code calculated by the algorithm module is greater than the threshold, the system accuracy is insufficient, or the difference between the HALL data and the code calculated by the algorithm module is greater than the threshold.

[0147] S504: If the OIS Firmware detects an abnormality, it reports the abnormality by reporting an interrupt to the abnormality detection module.

[0148] As mentioned above, the OIS IC is also configured with an abnormal interrupt pin. After detecting an abnormality, the OIS Firmware, as the OIS IC firmware, can report an interrupt signal to the AP's abnormal detection module through the abnormal interrupt pin to report the abnormality detected by the OIS Firmware to the AP's abnormal detection module.

[0149] S505, the abnormality detection module triggers the Scan driver execution module to diagnose the abnormal process.

[0150] After the abnormality detection module receives an interrupt signal reported by the firmware, it can trigger multiple driver modules to execute the module diagnosis abnormality process because the abnormal component cannot usually be determined using the interrupt signal. In some embodiments, the abnormality detection module calls back the abnormality dump interface of each driver module to obtain the abnormal status code of each driver module.

[0151] Exemplarily, the embodiment of the present application takes the triggering Scan driver and OIS driver execution module diagnosis abnormality process proposed in step S505 and step S508 as an example to illustrate.

[0152] S506: The Scan driver reads the Scan abnormal status code from the Scan Firmware.

[0153] As described in the aforementioned step S501, Scan Firmware performs an abnormality check, and after obtaining an abnormal phenomenon, the abnormal phenomenon may be encoded, and different abnormal phenomena may be encoded differently.

[0154] In some embodiments, step S501 proposes 6 inspection items, each of which may include inspection sub-items, and each inspection sub-item corresponds to an abnormal phenomenon (or fault) corresponding to a different code, which can uniquely indicate the fault.

[0155] S507. Scan Firmware returns the Scan abnormal status code to the abnormality detection module.

[0156] It should be noted that the brake IC is connected to the Scan IC. In addition to reading the Scan abnormal status code, the abnormality detection module can also read the brake IC firmware through the Scan IC, that is, the brake firmware performs abnormality inspection and obtains the brake abnormal status code.

[0157] S508 , the abnormality detection module triggers the OIS driver execution module to diagnose the abnormality process.

[0158] In some embodiments, the abnormality detection module triggers the OIS driver execution module to diagnose the abnormality process, which may refer to: the abnormality detection module calls back the abnormality dump interface of the OIS driver to obtain the OIS abnormal status code.

[0159] S509: The OIS driver reads the OIS abnormal status code from the OIS Firmware.

[0160] As described in the aforementioned step S503, the OIS Firmware performs an abnormality check, and after obtaining an abnormal phenomenon, the abnormal phenomenon may be encoded, and different abnormal phenomena may be encoded differently.

[0161] In some embodiments, step S503 proposes 6 inspection items, each of which may include inspection sub-items, and each inspection sub-item corresponds to an abnormal phenomenon (or fault) corresponding to a different code, which can uniquely indicate the fault.

[0162] S510. The OIS Firmware returns an OIS abnormal status code to the abnormality detection module.

[0163] It should be noted that the AF IC is connected to the OIS IC. In addition to reading the OIS abnormal status code, the abnormality detection module can also read the AF IC firmware through the OIS IC, that is, the AF Firmware for abnormality inspection to obtain the AF abnormal status code.

[0164] S511a, the abnormality detection module obtains a lightweight reset strategy based on the abnormal state encoding.

[0165] The abnormality checking module obtains the abnormal status codes reported by multiple firmwares, and can perform fault aggregation and reset strategy decision. In some embodiments, the reset strategy may include a lightweight reset strategy and a heavyweight reset strategy; the lightweight reset strategy is given priority.

[0166] The abnormality detection module is configured with: abnormal state codes of multiple driver modules corresponding to the lightweight reset strategy, and abnormal state codes of multiple driver modules corresponding to the heavyweight reset strategy. The abnormality detection module screens the abnormal state codes of multiple driver modules corresponding to the lightweight reset strategy and the abnormal state codes of multiple driver modules corresponding to the heavyweight reset strategy according to the abnormal state codes reported by multiple firmwares, and determines whether the abnormal state codes reported by multiple firmwares correspond to the lightweight reset strategy or the heavyweight reset strategy.

[0167] In some embodiments, if the exception detection module determines that the exception status codes reported by multiple firmwares all correspond to lightweight reset strategies, the exception detection module executes step S511a and uses the exception status codes to obtain the lightweight reset strategy; otherwise, the exception detection module executes S511b and uses the exception status codes to obtain the heavyweight reset strategy.

[0168] It should be noted that the lightweight reset strategy refers to the abnormality of individual modules in the entire camera system, so only the individual faulty modules need to be reset. The reset method is to call the abnormal reset interface of the faulty module to trigger the faulty module to perform a reset action. The reset action includes but is not limited to the initialization of the driver module, powering off, re-powering on and initializing the hardware IC and other hardware components, and the initialization of the firmware corresponding to the driver module.

[0169] The heavyweight reset strategy means that when multiple modules of the entire system are abnormal or the combined working sequence between multiple modules is abnormal, the entire camera system will be reset. The reset process requires the kernel driver layer to report the interrupt to the HAL layer. The HAL layer will perform an overall system reset, including image link pipeline reconstruction, power off, re-power on, and re-initialization of all components, etc., to ensure that the overall system returns to normal.

[0170] This embodiment is introduced by taking the Scan Firmware and OIS Firmware reporting interrupt as an example. Therefore, the abnormality detection module obtains a lightweight reset strategy based on the abnormal state encoding, and the Scan driver and OIS driver execution modules can be reset through the following S512a and S513a.

[0171] S512a, the abnormality detection module controls the Scan driver execution module to reset.

[0172] The abnormality detection module calls the abnormality reset interface registered by the Scan driver to control the Scan driver to execute the module reset. In some embodiments, the abnormality detection module calls the abnormality reset interface registered by the Scan driver to send a reset instruction to the Scan driver. The Scan driver responds to the reset instruction, triggers its own initialization, and can also send a reset instruction to the Scan Firmware through a bus such as I2C. The Scan Firmware responds to the reset instruction and performs a reset action.

[0173] In some embodiments, the Scan Firmware performing a reset action may refer to clearing the state through registers.

[0174] S513a, the abnormality detection module controls the OIS driving execution module to reset.

[0175] The abnormality detection module calls the abnormality reset interface registered by the OIS driver to control the OIS driver to reset the execution module. In some embodiments, the abnormality detection module calls the abnormality reset interface registered by the OIS driver to send a reset instruction to the OIS driver. The OIS driver responds to the reset instruction, triggers its own initialization, and can also send a reset instruction to the OIS Firmware through a bus such as I2C. The OIS Firmware responds to the reset instruction and performs a reset action.

[0176] In some embodiments, the OIS Firmware performing a reset action may refer to clearing a state through a register.

[0177] S512a and S513a can be executed in parallel without limitation Figure 5 The order in which the displays are executed.

[0178] S511b, the abnormality detection module uses the abnormal state encoding to obtain a heavyweight reset strategy.

[0179] For the specific implementation of this step, please refer to the content of the aforementioned step S511a, which will not be repeated here.

[0180] S512b: The anomaly detection module reports the event to the image link Pipeline.

[0181] In some embodiments, the abnormality detection module reports an event to the CRM (camera request manager), which indicates that the entire camera system needs to be reset. The CRM receives the event and reports the event to the image link Pipeline through the V4L2 and CSL buses.

[0182] CRM (camera request manager) is a module for managing camera application requests. The requirements issued by the hardware abstraction layer module can be first transmitted to CRM, which matches according to the sensor frame timing, and then sends the configuration to the corresponding module using the N+1 or N+2 mechanism. The data interruption of the sensor frame can also be reported to the hardware abstraction layer module through CRM.

[0183] In some embodiments, the anomaly detection module may report events to the image link Pipeline, or report events to the image link Pipeline through other modules.

[0184] S513b: The image link Pipeline controls the SensorNode to perform a reset.

[0185] In some embodiments, the image link Pipeline controlling the SensorNode to perform a reset may include:

[0186] The SensorNode executes the following steps S514b to S521b in response to the control of the image link Pipeline.

[0187] S514b, SensorNode controls the Sensor driver to perform reset.

[0188] In some embodiments, the SensorNode controlling the Sensor driver to perform a reset may include: the SensorNode controlling the Sensor driver to re-power on and initialize, and the Sensor driver controlling the Sensor Firmware to re-initialize.

[0189] S515b, SensorNode controls the Scan control module to perform reset.

[0190] In some embodiments, the SensorNode controls the Scan control module to perform a reset, and the Scan control module executes the following steps S516b and S517b in response to the control of the SensorNode.

[0191] S516b, the Scan control module controls the Scan driver to power on and initialize again.

[0192] In some embodiments, the Scan control module executes AcquireDevice to trigger the Scan driver to power off, power on again, and perform initialization.

[0193] S517b, Scan driver controls Scan Firmware to reinitialize.

[0194] After the Scan driver is powered on, the Scan driver can control the Scan IC to power off and then power on again. After the Scan IC is powered on, the link between the Scan driver and the Scan IC is connected, such as the I2C bus. The Scan driver can send an initialization command to the Scan IC through the link to control the Scan IC to perform an initialization operation, that is, control the Scan Firmware to reinitialize.

[0195] S518b, SensorNode controls the OIS control module to perform reset.

[0196] In some embodiments, the SensorNode controls the OIS control module to perform a reset, and the OIS control module executes the following steps S519b and S520b in response to the control of the SensorNode.

[0197] S519b: The OIS control module controls the OIS driver to power on and initialize again.

[0198] In some embodiments, the OIS control module executes AcquireDevice to trigger the OIS driver to power off, power on again, and perform initialization.

[0199] S520b: The OIS driver controls the OIS Firmware to reinitialize.

[0200] After the OIS driver is powered on, the OIS driver can control the OIS IC to power off and then power on again. After the OIS IC is powered on, the link between the OIS driver and the OIS IC is connected, such as the I2C bus. The OIS driver can send an initialization command to the OIS IC through the link to control the OIS IC to perform an initialization operation, that is, control the OIS Firmware to be reinitialized.

[0201] It should be noted that the OIS driver can also control the brake IC to power on again after powering off. After the brake IC is powered on, the link between the OIS driver and the brake IC is connected, such as the I2C bus. The OIS driver can send initialization instructions to the brake IC through the link to control the brake IC to perform initialization operations, that is, control the brake firmware to be reinitialized.

[0202] S521b, SensorNode controls the Actuator control module to perform reset.

[0203] In some embodiments, the Actuator control module performs a reset including: the Actuator control module AF driver powers off, powers on again, and performs initialization. After the AF driver is powered on, the AF driver can control the AF IC to power off and then power on again. After the AF IC is powered on, the link between the AF driver and the AF IC is connected, such as an I2C bus. The AF driver can send an initialization instruction to the AF IC through the link to control the AF IC to perform an initialization operation, that is, control the AF Firmware to reinitialize.

[0204] Another embodiment of the present application further provides a computer-readable storage medium, which stores instructions, and when the computer-readable storage medium is executed on a computer or a processor, the computer or the processor executes one or more steps in any of the above methods.

[0205] The computer-readable storage medium may be a non-temporary computer-readable storage medium, for example, the non-temporary computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0206] Another embodiment of the present application further provides a computer program product including instructions. When the computer program product is run on a computer or a processor, the computer or the processor executes one or more steps in any of the above methods.

Claims

1. An anomaly detection method, characterized in that: Applied to an electronic device, the electronic device is equipped with a camera system, the camera system includes a first module and a second module, and the abnormality detection method includes: Receiving an interrupt signal sent by the first module; Based on the interrupt signal, requesting an abnormal status code from the first module and the second module; When the abnormal state code of the first module is acquired, resetting the first module based on the abnormal state code of the first module, or resetting the camera system; When the abnormal status code of the first module and the abnormal status code of the second module are obtained, it is determined whether the abnormal status code of the first module and the abnormal status code of the second module both correspond to the lightweight reset strategy, if so, the first module is reset, and the second module is reset, if not, the camera system is reset based on the abnormal status code of the first module and the abnormal status code of the second module.

2. The anomaly detection method according to claim 1, characterized in that: The resetting the first module based on the abnormal state code of the first module, or resetting the camera system, includes: Determine that the abnormal state code of the first module corresponds to a lightweight reset strategy, and reset the first module; determine that the abnormal state code of the first module corresponds to a heavyweight reset strategy, and reset the camera system.

3. The abnormality detection method according to claim 1 or 2, characterized in that: The requesting the first module and the second module for the abnormal state code based on the interrupt signal includes: Based on the interrupt signal, the exception dump interface of the first module is called to request the exception status code from the first module, and the exception dump interface of the second module is called to request the exception status code from the second module.

4. The abnormality detection method according to claim 1 or 2, characterized in that: The resetting the first module based on the abnormal state code of the first module includes: Based on the abnormal state code of the first module, the abnormal reset interface of the first module is called to reset the first module.

5. The abnormality detection method according to claim 1 or 2, characterized in that: The kernel layer of the operating system of the electronic device includes an abnormality detection module; the hardware abstraction layer of the operating system of the electronic device includes an image link; Receiving an interrupt signal sent by the first module, and based on the interrupt signal, requesting the first module and the second module for the abnormal state code, comprising: the abnormality detection module receiving the interrupt signal sent by the first module, and based on the interrupt signal, requesting the first module and the second module for the abnormal state code; The resetting the first module or the camera system based on the abnormal state code of the first module includes: The abnormality detection module resets the first module based on the abnormal state code of the first module; or the image link resets the camera system; The determining whether the abnormal state code of the first module and the abnormal state code of the second module both correspond to the lightweight reset strategy, if so, resetting the first module and resetting the second module, and if not, resetting the camera system based on the abnormal state code of the first module and the abnormal state code of the second module, includes: If the abnormality detection module determines that the abnormal state code of the first module and the abnormal state code of the second module both correspond to the lightweight reset strategy, the first module is reset, and the second module is reset; if the abnormality detection module determines that the abnormal state code of the first module and the abnormal state code of the second module do not both correspond to the lightweight reset strategy, the image link resets the camera system based on the abnormal state code of the first module and the abnormal state code of the second module.

6. The anomaly detection method according to claim 5, characterized in that: Before the image link resets the camera system, the method further includes: The anomaly detection module reports events to the image link.

7. The abnormality detection method according to claim 5, characterized in that: The first module includes: a first module of the hardware abstraction layer of the electronic device operating system, a first module of the kernel layer, and a first module of the firmware layer; the second module includes: a second module of the hardware abstraction layer of the electronic device operating system, a second module of the kernel layer, and a second module of the firmware layer; The abnormality detection module receives an interrupt signal sent by the first module, and based on the interrupt signal, requests the first module and the second module for the abnormal state code, including: the abnormality detection module receives an interrupt signal sent by the first module of the firmware layer, and based on the interrupt signal, requests the first module of the kernel layer and the second module of the kernel layer for the abnormal state code; The abnormality detection module resets the first module based on the abnormal state code of the first module, including: the abnormality detection module resets the first module of the kernel layer and the first module of the firmware layer based on the abnormal state code of the first module; The abnormality detection module resets the second module, including: the abnormality detection module resets the second module of the kernel layer and the second module of the firmware layer.

8. The abnormality detection method according to claim 7, characterized in that: The image link resets the camera system, including: The image link resets the first module of the kernel layer and the first module of the firmware layer through the first module of the hardware abstraction layer of the electronic device operating system, and resets the second module of the kernel layer and the second module of the firmware layer through the second module of the hardware abstraction layer of the electronic device operating system.

9. An electronic device, characterized in that: include: one or more processors, memory, and display screens; The memory and the display screen are coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the anomaly detection method as described in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that: Used to store a computer program, which, when executed, is specifically used to implement the anomaly detection method as described in any one of claims 1 to 8.