[go: up one dir, main page]

CN111163311A - Phase calibration method and electronic equipment - Google Patents

Phase calibration method and electronic equipment Download PDF

Info

Publication number
CN111163311A
CN111163311A CN202010091567.XA CN202010091567A CN111163311A CN 111163311 A CN111163311 A CN 111163311A CN 202010091567 A CN202010091567 A CN 202010091567A CN 111163311 A CN111163311 A CN 111163311A
Authority
CN
China
Prior art keywords
phase value
mipi
clock signal
abnormal
changed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010091567.XA
Other languages
Chinese (zh)
Other versions
CN111163311B (en
Inventor
吕宗安
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN202010091567.XA priority Critical patent/CN111163311B/en
Publication of CN111163311A publication Critical patent/CN111163311A/en
Application granted granted Critical
Publication of CN111163311B publication Critical patent/CN111163311B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N17/00Diagnosis, testing or measuring for television systems or their details
    • H04N17/002Diagnosis, testing or measuring for television systems or their details for television cameras

Landscapes

  • Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • General Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Testing, Inspecting, Measuring Of Stereoscopic Televisions And Televisions (AREA)
  • Studio Devices (AREA)
  • Gyroscopes (AREA)

Abstract

The embodiment of the invention provides a phase calibration method and electronic equipment. The method comprises the following steps: acquiring a clock signal phase value of a camera sensor of the electronic equipment; gradually adjusting the phase value of the clock signal according to a first direction by taking a first variable as a step length, and judging whether the working state of an MIPI (Mobile industry processor interface) of a camera sensor is changed after the phase value of the clock signal is adjusted every time; the method comprises the following steps that the working state of the MIPI is changed, wherein the connection state of the MIPI is changed from normal to abnormal or the connection state of the MIPI is changed from abnormal to normal; if the working state of the MIPI is changed, determining the phase value of the clock signal at the moment as a first phase value; determining a target phase value according to the first phase value; and determining the phase of the clock signal of the camera sensor as the target phase value. The embodiment of the invention can automatically optimize the phase value of the clock signal of the camera sensor.

Description

Phase calibration method and electronic equipment
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a phase calibration method and an electronic device.
Background
MIPI (Mobile Industry Processor Interface) DPHY is a standard universal Interface for Mobile Industry Processor interfaces. At present, an MIPI-DPHY interface is widely applied to an image sensor of a camera of a mobile phone and used for transmitting image DATA, the DPHY interface consists of a CLK lane (clock signal channel) and a DATAlane (DATA signal channel), both the CLK lane and the DATAlane are differential signals, namely the CLK lane consists of a positive edge clock signal CLKP and a negative edge clock signal CLKN, the DATAlane consists of a positive edge DATA signal DATAP and a negative edge DATA signal DATAN, the DATA is read by double-edge sampling, namely the rising edge and the falling edge of the CLK sample DATA, one CLK edge reads the level of one DATA, and one clock period samples the DATA twice.
However, in the prior art, when a signal receiving end of an MIPI-DPHY interface of a CPU (Central Processing Unit) of an electronic device samples DATA, a phase difference delay exists between CLK and DATA, and the phase difference delay causes a DATA sampling point position not to be at the center of a stable level of DATA, which results in a shortened DATA setup time and a lengthened DATA holding time, or a side length of the DATA setup time and a shortened DATA holding time, and even further worsens the phase difference delay in a process of mass production of the CPU, so that the read DATA level DATA is abnormal, and a camera is not opened or is not opened.
Disclosure of Invention
The embodiment of the invention provides a phase calibration method and electronic equipment, which are used for solving the problem of MIPI communication abnormal interruption caused by phase deviation of a clock signal CLK and a DATA signal DATA.
In order to solve the technical problem, the invention is realized as follows:
in a first aspect, an embodiment of the present invention further provides a phase calibration method applied to an electronic device, where the method includes:
acquiring a clock signal phase value of a camera sensor of the electronic equipment;
gradually adjusting the phase value of the clock signal according to a first direction by taking a first variable as a step length, and judging whether the working state of an MIPI (Mobile industry processor interface) of the camera sensor is changed after the phase value of the clock signal is adjusted every time; the change of the working state of the MIPI comprises the change of the connection state of the MIPI from normal to abnormal or the change of the connection state of the MIPI from abnormal to normal;
if the working state of the MIPI is changed, determining the phase value of the clock signal at the moment as a first phase value;
determining a target phase value according to the first phase value;
and determining the phase of the clock signal of the camera sensor as the target phase value.
In a second aspect, an embodiment of the present invention further provides a phase calibration apparatus, which is applied to an electronic device, and the apparatus includes:
the phase acquisition module is used for acquiring a clock signal phase value of a camera sensor of the electronic equipment;
the first adjustment judging module is used for adjusting the phase value of the clock signal gradually according to a first direction by taking a first change amount as a step length, and judging whether the working state of a Mobile Industry Processor Interface (MIPI) of the camera sensor changes or not after the phase value of the clock signal is adjusted every time; the change of the working state of the MIPI comprises the change of the connection state of the MIPI from normal to abnormal or the change of the connection state of the MIPI from abnormal to normal;
a first phase determining module, configured to determine, if the operating state of the MIPI changes, a phase value of the clock signal at this time as a first phase value;
a target phase determination module, configured to determine a target phase value according to the first phase value;
and the clock phase determining module is used for determining the phase of the clock signal of the camera sensor as the target phase value.
In a third aspect, an embodiment of the present invention further provides an electronic device, which includes a processor, a memory, and a computer program stored on the memory and executable on the processor, where the computer program, when executed by the processor, implements the steps of the phase calibration method described above.
In a fourth aspect, the embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the steps of the phase calibration method as described above.
According to the embodiment of the invention, the phase value of the clock signal of the camera sensor of the electronic device is obtained, the phase value of the clock signal is adjusted gradually according to the first direction by taking the first change amount as the step length until the working state of the MIPI of the camera sensor is changed, the phase value of the clock signal when the working state is changed is determined as the first phase value, and the target phase value is determined according to the first phase value. The change of the working state of the MIPI comprises the change of the connection state of the MIPI from normal to abnormal or the change of the connection state of the MIPI from abnormal to normal.
Therefore, in the embodiment of the invention, when the connection state of the MIPI is abnormal, the phase value of the clock signal can be automatically adjusted until the working state of the MIPI is changed, for example, the connection state of the MIPI is changed from abnormal to normal, so that abnormal interruption of MIPI communication caused by phase shift can be automatically eliminated, and a camera of the electronic device can be normally used.
In addition, under the condition that the connection state of the MIPI is normal, the embodiment of the present invention may further calibrate the phase value of the clock signal of the camera sensor, so as to obtain a more accurate target phase value, for example, so that the calibrated CLK sampling point may be located at the center position of the DATA level, that is, the DATA establishment time and the DATA retention time are the same, and further, the stability of the camera for acquiring DATA may be improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive labor.
Fig. 1 is a flowchart illustrating a phase calibration method according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a phase calibration method according to a second embodiment of the present invention;
fig. 3 is a flowchart illustrating a phase calibration method according to a third embodiment of the present invention;
FIG. 4 shows a timing diagram of a clock signal CLK and a DATA signal DATA received by a MIPI receiver during calibration of one embodiment;
FIG. 5 shows a timing diagram of a clock signal CLK and a DATA signal DATA received by a MIPI receiver after calibration according to one embodiment;
fig. 6 is a flowchart illustrating a phase calibration method according to a fourth embodiment of the present invention;
FIG. 7 shows a timing diagram of a clock signal CLK and a DATA signal DATA received by a MIPI receiver during calibration of one embodiment;
fig. 8 is a block diagram illustrating a phase calibration apparatus according to a fifth embodiment of the present invention;
fig. 9 is a schematic diagram of a hardware structure of an electronic device according to various embodiments of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present invention. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
In various embodiments of the present invention, it should be understood that the sequence numbers of the following processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
Example one
Referring to fig. 1, a flowchart of a phase calibration method provided in an embodiment of the present invention is shown, and applied to an electronic device, the method includes:
and 101, acquiring a clock signal phase value of a camera sensor of the electronic equipment.
The phase calibration method provided by the embodiment of the invention can be applied to electronic equipment, and a camera sensor of the electronic equipment uses an MIPI-DPHY interface. The electronic device specifically includes but is not limited to: smart phones, tablet computers, e-book readers, MP3 (Moving Picture Experts Group Audio Layer iii) players, MP4 (Moving Picture Experts Group Audio Layer IV) players, laptop portable computers, car-mounted computers, desktop computers, set-top boxes, smart televisions, wearable devices, and the like.
The embodiment of the invention can acquire the clock signal phase value of the camera sensor of the electronic equipment under the following two conditions: the first method is that when a camera has a functional fault and a CPU of electronic equipment receives MIPI communication abnormal interruption (or MIPI communication error prompt), a clock signal phase value of a camera sensor of the electronic equipment is acquired; and the second method is that the clock signal phase value of the camera sensor of the electronic equipment is obtained under the condition that the CPU of the electronic equipment does not receive MIPI communication abnormal interruption and the camera can be normally used.
In the first case, when the CPU of the electronic device detects that the MIPI communication interruption occurs in the camera sensor, the embodiment of the present invention may automatically adjust the phase value of the clock signal until the MIPI communication interruption is removed, so that the camera of the electronic device may be normally used.
In the second case, although the camera can be used normally, the MIPI-DPHY interface may still have a phase difference delay of CLK and DATA, which may cause the DATA sampling point position not to be at the center of the DATA level, resulting in a shortened DATA setup time and a lengthened DATA holding time, or a lengthened DATA setup time and a shortened DATA holding time, and further resulting in an unstable DATA acquisition of the camera. According to the embodiment of the invention, under the condition that MIPI communication abnormal interruption does not occur, the phase value of the clock signal of the camera sensor can be further calibrated to obtain a more accurate target phase value, for example, the target phase value obtained after further calibration can enable the CLK sampling point to be located at the center position of the DATA level, namely the DATA establishment time and the DATA retention time are the same, and the stability of DATA acquisition of the camera can be further improved.
Step 102, taking a first change amount as a step length, gradually adjusting the phase value of the clock signal according to a first direction, and after adjusting the phase value of the clock signal each time, judging whether the working state of a Mobile Industry Processor Interface (MIPI) of the camera sensor changes or not; the change of the working state of the MIPI comprises the change of the connection state of the MIPI from normal to abnormal or the change of the connection state of the MIPI from abnormal to normal.
It should be noted that the first direction may be a positive direction or a negative direction. Adjusting gradually according to the positive direction, namely increasing gradually the phase value of the clock signal; the clock signal phase values are successively decreased in a negative successive adjustment. The first variable may be any value such as 15 °, 45 °, 90 °, and the like, and the specific value of the first variable is not limited in the embodiment of the present invention, and a person skilled in the art may set the first variable according to an actual phase register of the camera sensor. For convenience of description, the first direction is taken as the positive direction, and the first variation is taken as 45 ° in the embodiment of the present invention.
In the first case, the determining whether the working state of the MIPI is changed may be determining whether the connection state of the MIPI is changed from abnormal to normal. In the second case, the determining whether the working state of the MIPI is changed may be determining whether the connection state of the MIPI is changed from normal to abnormal.
In practical application, when the connection state of the MIPI is normal, the MIPI receiver can sample image data normally; when the connection state of the MIPI is abnormal, the MIPI receiver cannot normally sample image data. Therefore, the embodiment of the invention can judge the connection state of the MIPI by detecting whether the MIPI receiver can normally sample the image data.
Taking the first case as an example, when the CPU of the electronic device receives MIPI communication abnormal interruption, the phase register of the camera sensor is read, and assuming that the currently read clock signal phase value is 90 °, the first direction is the forward direction, and the first change amount is 45 °, the clock signal phase value is gradually increased by 45 °. After the first 45 degrees is added, the phase value of the clock signal is changed from 90 degrees to 135 degrees, at this time, whether the image data can be normally sampled by the MIPI receiver is judged, if the image data can be normally sampled, the connection state of the MIPI is changed from abnormal to normal, therefore, the connection state of the MIPI can be judged to be changed from abnormal to normal, that is, the working state of the MIPI can be judged to be changed.
Taking the second case as an example, when the CPU of the electronic device does not receive the MIPI communication abnormal interrupt, the phase register of the camera sensor is read, and assuming that the currently read clock signal phase value is 60 °, the first direction is the forward direction, the first change amount is set to 45 °, the clock signal phase value is gradually increased by 45 °. After the first 45 degrees is added, the phase value of the clock signal is changed from 60 degrees to 105 degrees, at this time, whether the image data can be normally sampled by the MIPI receiver is judged, if the MIPI can still be normally sampled, the MIPI connection state is not changed, the clock signal is continuously added by 45 degrees, the phase value of the clock signal is changed from 105 degrees to 145 degrees, and if the MIPI receiver is detected to be incapable of normally sampling the image data at this time, the MIPI connection state can be judged to be abnormal from normal, that is, the MIPI working state can be judged to be changed.
Step 103, if the working state of the MIPI changes, determining the phase value of the clock signal at this time as a first phase value.
In a first case, the first phase value is a clock signal phase value obtained by gradually adjusting a clock signal phase value obtained under the condition that the MIPI connection state is abnormal, so that the MIPI connection state is changed from abnormal to normal. The first phase value can be used for eliminating MIPI communication abnormal interruption, so that the MIPI receiver can normally sample image data.
In the example of the first case described above, the clock signal phase value of 135 ° may be determined as the first phase value.
In a second case, the first phase value is a phase value of a clock signal that is obtained by successively adjusting a phase value of the clock signal obtained under a normal MIPI connection state, so that the MIPI connection state is changed from a normal state to an abnormal state. The phase value of the current clock signal can be further calibrated by utilizing the first phase value, so that the calibrated CLK sampling point can be positioned at the central position of the DATA level, and the stability of DATA acquisition of the camera is improved.
In the example of the second case described above, the clock signal phase value of 145 ° may be determined as the first phase value.
It should be noted that the condition that the MIPI connection state described in the second case is normal may be that the camera sensor has no MIPI communication abnormal interruption, the camera can be used normally, or that after the camera sensor has MIPI communication abnormal interruption, the MIPI connection state is changed from abnormal to normal after the MIPI communication abnormal interruption is removed by the phase calibration method of the embodiment of the present invention.
And 104, determining a target phase value according to the first phase value.
When the first phase value is determined, a target phase value may be determined based on the first phase value. For example, the first phase value may be determined as a target phase value; or, the first phase value may be further calibrated to obtain a more accurate target phase value, for example, the target phase value obtained after further calibration may enable the CLK sampling point to be located at the center of the DATA level, that is, the DATA establishment time and the DATA retention time are the same, so as to improve the stability of the DATA acquired by the camera.
And 105, determining the clock signal phase of the camera sensor as the target phase value.
For example, the determined target phase value may be stored in a phase register of a camera sensor, so as to calibrate the clock signal phase value of the camera sensor, so that the calibrated clock signal phase value may be directly called when the camera is started next time.
In an optional embodiment of the present invention, the determining whether the working state of the MIPI of the sensor may change includes the following steps:
step S11, controlling the camera sensor to output image data with preset frame number when the first change amount is adjusted for the phase value of the clock signal;
step S12, detecting the sampling state of the image data by the MIPI receiver of the electronic equipment;
step S13, if the sampling state is detected to be changed from normal to abnormal, judging that the connection state of the MIPI is changed from normal to abnormal; or if the sampling state is detected to be changed from abnormal to normal, judging that the connection state of the MIPI is changed from abnormal to normal.
In the embodiment of the present invention, each time the phase value of the clock signal is adjusted by the first change amount, the CPU of the electronic device controls the camera sensor to output image data of a preset number of frames (for example, 2 frames) through an I2C (Inter-Integrated Circuit), and at this time, a sampling state of the image data by the MIPI receiver of the electronic device may be detected. If it is detected that the sampling state is changed from normal to abnormal, for example, the MIPI receiver can originally receive 2 frames of image data normally, and after the phase value of the clock signal is adjusted by the first change amount, the MIPI receiver cannot receive 2 frames of image data normally, it is determined that the connection state of the MIPI is changed from normal to abnormal, that is, it is determined that the working state of the MIPI is changed from normal to abnormal. If it is detected that the sampling state is changed from abnormal to normal, for example, the MIPI receiver cannot normally receive 2 frames of image data originally, and after the phase value of the clock signal is adjusted by the first change amount, the MIPI receiver can normally receive 2 frames of image data, it is determined that the connection state of the MIPI is changed from abnormal to normal, that is, it is determined that the working state of the MIPI is changed from abnormal to normal.
It is to be understood that the preset frame number of 2 frames is only an application example of the embodiment of the present invention, and the embodiment of the present invention does not limit a specific value of the preset frame number. For example, the preset number of frames may be 1 frame, several frames or dozens of frames, and may also be several lines, several tens of lines, several hundreds of lines, several thousands of lines, etc.
In a specific application, the MIPI transmission code stream includes a hamming code and a Cyclic Redundancy Check (CRC) code, and optionally, the embodiment of the present invention may determine the sampling state of the MIPI receiver on the image data by using the hamming code or the CRC code.
In an example of the hamming code judgment, for transmitted 32-bit image data code stream information, the MIPI receiver can calculate the information of the rear 8 bits according to the information of the front 24 bits, compare the calculated information of the rear 8 bits with the received information of the rear 8 bits, and determine that data transmission is wrong if the error is more than 1 bit, that is, the sampling state is abnormal.
In an example of the determination using the CRC code, the MIPI receiver may perform inverse modulo two calculation on the image data code stream information and the CRC check, where the calculation result is an integer in the case that the image data transmission is normal, and if the image data transmission is abnormal, the calculation result is not an integer but has a remainder. Therefore, whether data transmission is normal, that is, whether the sampling state is normal can be judged according to the calculation result.
In an optional embodiment of the present invention, after the successively adjusting the phase values of the clock signal according to the first direction, the method further includes: and if the accumulated value of the gradually adjusted first variable reaches a first preset threshold value and the working state of the MIPI is not changed yet, stopping continuously adjusting the first variable and outputting prompt information.
The first preset threshold may be set according to an actual situation, optionally, the first preset threshold may be 180 °, and the first preset threshold is not specifically limited in the embodiment of the present invention.
If the accumulated value of the first variable which is adjusted gradually reaches a first preset threshold value and the working state of the MIPI is not changed yet, the current MIPI communication abnormal interruption is not caused by the phase deviation of the CLK signal and the DATA signal, at the moment, the operation of continuously adjusting the first variable can be stopped, and prompt information is output to inform a user that the clock signal phase problem is not detected.
Optionally, if the accumulated value of the first changing amount that is adjusted gradually reaches the first preset threshold, information of calibration failure may also be reported to the CPU.
In an optional embodiment of the present invention, before the step 102 uses the first change amount as a step size and successively adjusts the phase value of the clock signal according to the first direction, the method further includes:
gradually adjusting the phase value of the clock signal according to the reverse direction of the first direction by taking a fourth change amount as a step length until the working state of the MIPI is changed, and acquiring the phase value of the current clock signal;
the acquiring a clock signal phase value of a camera sensor of the electronic device includes: acquiring the phase value of the current clock signal;
the step-by-step adjustment of the phase value of the clock signal in a first direction using the first variable as a step length includes: gradually adjusting the phase value of the current clock signal according to a first direction by taking a first change amount as a step length until the working state of the MIPI is changed again, and determining the phase value of the clock signal at the moment as a first phase value; wherein the fourth amount of change is greater than the first amount of change.
At this time, a phase value of the approximate MIPI operating state change can be determined by using the fourth change amount with a longer step length, and then the accurate search is performed by using the shorter step length of the first change amount, thereby improving the search speed and accuracy. Optionally, the determination process of other phase values in this specification may also improve the search speed and accuracy through similar steps, which is not described again in this embodiment of the present invention.
In an example of the embodiment of the present invention, a first change amount (e.g., Δ α 1) may be adjusted in a forward direction for an acquired phase value of a clock signal of a camera sensor of the electronic device, and after a change in an operating state of the MIPI, a fourth change amount (e.g., Δ α 2) may be adjusted in a reverse direction for a current phase value of the clock signal, where Δ α 1> Δ α 2, and preferably, Δ α 2 is half of Δ α 1.
In another example of the embodiment of the present invention, the acquired phase value of the clock signal of the camera sensor of the electronic device may be first adjusted in a reverse direction by a fourth change amount (e.g., Δ α 2), and after the operating state of the MIPI is changed, the current phase value of the clock signal may be adjusted in a forward direction by a first change amount (e.g., Δ α 1), where Δ α 2> Δ α 1, and preferably, Δ α 1 is half of Δ α 2.
Therefore, on the premise of gradually adjusting to obtain the accurate phase adjustment amount delta α, the adjusting times can be reduced, the adjusting time can be further reduced, and the adjusting efficiency can be improved.
To sum up, in the embodiment of the present invention, by acquiring a phase value of a clock signal of a camera sensor of the electronic device, and taking a first change amount as a step length, the phase value of the clock signal is adjusted gradually according to a first direction until a working state of the MIPI of the camera sensor changes, the phase value of the clock signal when the working state changes is determined as a first phase value, and a target phase value is determined according to the first phase value. The change of the working state of the MIPI comprises the change of the connection state of the MIPI from normal to abnormal or the change of the connection state of the MIPI from abnormal to normal.
Therefore, in the embodiment of the invention, when the connection state of the MIPI is abnormal, the phase value of the clock signal can be automatically adjusted until the working state of the MIPI is changed, for example, the connection state of the MIPI is changed from abnormal to normal, so that abnormal interruption of MIPI communication caused by phase shift can be automatically eliminated, and a camera of the electronic device can be normally used.
In addition, under the condition that the connection state of the MIPI is normal, the embodiment of the present invention may further calibrate the phase value of the clock signal of the camera sensor, so as to obtain a more accurate target phase value, for example, so that the calibrated CLK sampling point may be located at the center position of the DATA level, that is, the DATA establishment time and the DATA retention time are the same, and further, the stability of the camera for acquiring DATA may be improved.
Example two
The present embodiment describes a specific process of calibrating a clock signal phase value of a camera sensor of an electronic device in detail for a first case.
In an optional embodiment of the present invention, the acquiring a clock signal phase value of a camera sensor of the electronic device in step 101 includes: acquiring a clock signal phase value of the camera sensor under the condition that the connection state of the MIPI is abnormal; the working state of the MIPI is changed, specifically, the connection state of the MIPI is changed from abnormal to normal.
For the first situation of the embodiment of the present invention, when a functional failure occurs in a camera and a CPU of an electronic device receives an MIPI communication abnormal interrupt (or an MIPI communication error prompt), that is, when a connection state of the MIPI is abnormal, a phase value of a clock signal of a camera sensor of the electronic device may be obtained.
In the first case, the working state of the MIPI is changed in step 102, specifically, the connection state of the MIPI is changed from abnormal to normal. Step 104 of determining a target phase value according to the first phase value includes: determining the first phase value as a target phase value.
Referring to fig. 2, a flowchart of a phase calibration method provided by a second embodiment of the present invention is shown, and applied to an electronic device, the method includes:
step 201, acquiring a clock signal phase value of a camera sensor of the electronic device under the condition that the connection state of the MIPI of the camera sensor is abnormal;
step 202, taking a first variable as a step length, gradually adjusting the phase value of the clock signal according to a first direction, and after adjusting the phase value of the clock signal each time, judging whether the connection state of the MIPI is changed from abnormal to normal;
step 203, if the connection state of the MIPI is determined to be changed from abnormal to normal, determining the phase value of the clock signal at the moment as a first phase value;
step 204, determining the first phase value as a target phase value;
and step 205, determining the clock signal phase of the camera sensor as the target phase value.
In an example of this embodiment, when a camera of the electronic device has a function failure and a CPU of the electronic device receives an MIPI communication abnormal interrupt (or MIPI communication error prompt), that is, when a connection state of the MIPI of the camera sensor is abnormal, an automatic calibration procedure of MIPI CLK and DATA phases is started, as follows.
Firstly, the CPU performs power-on initialization on the camera sensor, after the initialization is completed, the CPU reads a CLK-DATA phase register of the camera sensor through an I2C bus to acquire a clock signal phase value of the camera sensor, and the acquired clock signal phase value is assumed to be 90 degrees.
Then, the phase value of the clock signal is adjusted in a first direction (e.g. forward direction) by taking a first change amount (e.g. 45 °) as a step, and after each adjustment, it is determined whether the connection state of the MIPI is changed from abnormal to normal. For example, after the first adjustment of 45 °, the clock signal phase value becomes 135 °, at which time the CPU controls the camera sensor to output 2 frames of image DATA through I2C, the MIPI receiver of the CPU starts receiving the DATA, and if the MIPI receiver can receive 2 frames of image DATA, which indicates that the connection state of the MIPI is changed from abnormal to normal, that is, the malfunction of the camera due to the MIPI CLK-DATA phase offset is resolved, the clock signal phase value at this time of 135 ° is determined as the first phase value, and the first phase value of 135 ° is determined as the target phase value.
And finally, determining the phase of the clock signal of the camera sensor as a target phase value of 135 degrees, setting a camera sensor CLK-DATA phase register through an I2C bus, and setting the phase value of the register as 135 degrees, so that the electronic equipment can automatically adopt the register parameter of which the MIPI CLK-DATA phase value is 135 degrees when a camera of the electronic equipment is started next time.
In step 202, if the MIPI receiver of the CPU still does not receive 2 frames of image data after the first change amount is adjusted for the current clock signal phase value, which indicates that the connection state of the MIPI is still abnormal, the current clock signal phase value is continuously adjusted in a first direction until the MIPI receiver can receive 2 frames of image data, or the accumulated value of the first change amount reaches a first preset threshold.
If the accumulated value of the first variable which is adjusted gradually reaches a first preset threshold value and the working state of the MIPI is not changed yet, the current MIPI communication abnormal interruption is not caused by the phase deviation of the CLK signal and the DATA signal, at the moment, the operation of continuously adjusting the first variable can be stopped, and prompt information is output to inform a user that the clock signal phase problem is not detected. Optionally, information of calibration failure may also be reported to the CPU.
In summary, in this embodiment, when the phase offsets of the CLK and the DATA of the MIPI interface cause the functional failure of the camera, the phase value of the clock signal may be automatically adjusted to automatically remove the abnormal interruption of the MIPI communication caused by the phase offsets, so that the camera of the electronic device may be normally used.
EXAMPLE III
The present embodiment describes a specific process of calibrating a clock signal phase value of a camera sensor of an electronic device in detail for a second case.
In an optional embodiment of the present invention, the acquiring a clock signal phase value of a camera sensor of the electronic device in step 101 includes: acquiring a clock signal phase value of the camera sensor under the condition that the connection state of the MIPI is normal; the working state of the MIPI is changed, specifically, the connection state of the MIPI is changed from normal to abnormal.
For the second case of the embodiment of the present invention, the phase value of the clock signal of the camera sensor of the electronic device may be obtained when the CPU of the electronic device does not receive MIPI communication abnormal interruption (or MIPI communication error prompt), that is, when the connection state of the MIPI is normal.
In a second case, the working state of the MIPI is changed in step 102, specifically, the connection state of the MIPI is changed from normal to abnormal.
Optionally, after the determining the clock signal phase value at this time as the first phase value in step 103 and before the determining the target phase value according to the first phase value in step 104, the method further includes: gradually adjusting the phase value of the clock signal according to a second direction by taking a second change amount as a step length, and after adjusting the phase value of the clock signal every time, judging whether the connection state of the MIPI is changed from normal to abnormal; and if the connection state of the MIPI is changed from normal to abnormal, determining the phase value of the clock signal at the moment as a second phase value.
In the second case, although the MIPI receiver may normally sample image DATA, the CLK sampling point may not be in the center of the DATA level, and thus, the embodiment of the present invention further determines the second phase value after determining the first phase value.
Wherein the second direction may be a positive direction or a negative direction. Optionally, the second direction is a direction opposite to the first direction. The second change amount may be any value such as 15 °, 45 °, 90 °, and the specific value of the second change amount is not limited in the embodiment of the present invention. The second change amount may be the same as or different from the first change amount.
Optionally, the determining a target phase value according to the first phase value in step 104 includes: and determining a target phase value according to the first phase value and the second phase value.
For example, the first phase value and the second phase value may be summed and averaged, and the average may be used as the target phase value. It can be understood that the embodiment of the present invention does not limit the specific way of calculating the target phase value, and for example, different weights may be set for the first phase value and the second phase value, and then weighted summation and average value may be performed.
Referring to fig. 3, a flowchart of a phase calibration method provided by a third embodiment of the present invention is shown, and applied to an electronic device, the method includes:
step 301, acquiring a clock signal phase value of a camera sensor of the electronic device under the condition that the connection state of the MIPI of the camera sensor is normal;
step 302, taking a first change amount as a step length, gradually adjusting the phase value of the clock signal according to a first direction, and after adjusting the phase value of the clock signal each time, judging whether the connection state of the MIPI of the camera sensor changes from normal to abnormal;
step 303, if it is determined that the connection state of the MIPI changes from normal to abnormal, determining the phase value of the clock signal at this time as a first phase value;
step 304, taking a second change amount as a step length, successively adjusting the phase value of the clock signal according to a second direction, and after adjusting the phase value of the clock signal each time, judging whether the connection state of the MIPI is changed from normal to abnormal;
step 305, if the connection state of the MIPI is determined to be abnormal from normal, determining the phase value of the clock signal at the moment as a second phase value;
step 306, determining a target phase value according to the first phase value and the second phase value;
and 307, determining the clock signal phase of the camera sensor as the target phase value.
In an example of this embodiment, when the CPU of the electronic device does not receive the MIPI communication abnormal interrupt (or the MIPI communication error prompt), that is, when the connection state of the MIPI of the camera sensor is normal, the MIPICLK and DATA phase automatic calibration procedure is started, as follows.
Firstly, a CPU (central processing unit) performs power-on initialization on a camera sensor, after the initialization is completed, the CPU reads a CLK-DATA phase register of the camera sensor through an I2C bus, and obtains a clock signal phase value α of the camera sensor0At this timeAnd controlling the camera sensor to output 2 frames of image data, starting receiving the data by the MIPI receiver of the CPU, and determining that the connection state of the MIPI is normal if the MIPI receiver normally receives the 2 frames of image data.
Then, taking a first variable (such as delta α) as a step size, adjusting the phase value of the clock signal in a first direction (such as a forward direction) one by one, and after each adjustment, judging whether the connection state of the MIPI is changed from normal to abnormal or not, after each adjustment, a CPU controls a camera sensor to output 2 frames of image data through an I2C, an MIPI receiver of the CPU starts to receive the data until the MIPI receiver cannot normally receive the 2 frames of image data, which indicates that the connection state of the MIPI is changed from normal to abnormal, and then determining the phase value of the clock signal at the moment as a first phase value, namely α1For example, α1=α0+ n Δ α, where n is the number of adjustment steps for the first change amount.
Next, the phase value α of the clock signal is adjusted by a second change (e.g., Δ α)0After each adjustment, the CPU controls the camera sensor to output 2 frames of image data through I2C, and the MIPI receiver of the CPU starts receiving data until the MIPI receiver can not normally receive 2 frames of image data, which indicates that the connection state of the MIPI is changed from normal to abnormal, the phase value of the clock signal at the moment is determined as a second phase value, which is recorded as α2E.g. α2=α0-m Δ α, where m is the number of adjustment steps for the second amount of change.
Finally, a target phase value CAL is determined from the first phase value α 1 and the second phase value α 2, e.g., CAL ═ (α)12)/2. The CPU sets a CLK-DATA phase register of the camera sensor through an I2C bus, and sets a phase value of the register as CAL, so that the electronic equipment can automatically adopt the MIPI CLK-DATA phase value as the parameter of the CAL register when the camera of the electronic equipment is started next time.
In an optional embodiment of the present invention, after the successively adjusting the phase values of the clock signal according to the first direction, the method further includes: and if the accumulated value of the gradually adjusted first variable reaches a first preset threshold value and the working state of the MIPI is not changed yet, stopping continuously adjusting the first variable and outputting prompt information.
The first preset threshold may be set according to an actual situation, optionally, the first preset threshold may be 180 °, and the first preset threshold is not specifically limited in the embodiment of the present invention.
In an optional embodiment of the present invention, after the successively adjusting the phase value of the clock signal according to the second direction, the method further includes: and if the accumulated value of the second change amount which is adjusted successively reaches a second preset threshold value and the working state of the MIPI is not changed yet, stopping the operation of continuously adjusting the second change amount and outputting prompt information.
The second preset threshold may be set according to an actual situation, optionally, the second preset threshold may be 180 °, and the second preset threshold is not specifically limited in the embodiment of the present invention.
If the cumulative value of the second change amount adjusted one by one reaches a second preset threshold value and the working state of the MIPI is not changed yet, it indicates that the MIPI communication abnormal interruption occurred at present is not caused by the phase shift of the CLK signal and the DATA signal, at this time, the operation of continuously adjusting the second change amount may be stopped, and a prompt message is output to notify the user that the clock signal phase problem is not detected.
Optionally, if the accumulated value of the second change amount adjusted in sequence reaches a second preset threshold, information of calibration failure may also be reported to the CPU.
Referring to fig. 4, a timing diagram of a clock signal CLK and a DATA signal DATA received by the MIPI receiver during the calibration process of the present embodiment is shown, and referring to fig. 5, a timing diagram of a clock signal CLK and a DATA signal DATA received by the MIPI receiver after the calibration of the present embodiment is shown, as shown in fig. 5, a sampling point of the CLK after the calibration is located at a central position where DATA can be correctly sampled, so that the DATA setup time and the DATA hold time are the same.
In summary, in this embodiment, when the phase offsets of CLK and DATA of the MIPI interface cause that the CLK sampling point is not in the center position of the DATA level, but the connection state of the MIPI is still normal, the phase value of the clock signal of the camera sensor may be automatically calibrated to obtain a more accurate target phase value, so that the CLK sampling point is located in the center position of the DATA level, that is, the DATA establishment time and the DATA retention time are the same, and the stability of the camera in acquiring DATA may be further improved.
Example four
For the first situation, in the case of MIPI abnormal communication interruption, the present embodiment may first remove MIPI abnormal communication interruption, that is, first determine the first phase value, and then further calibrate the determined first phase value, so as to obtain a more accurate target phase value.
In an optional embodiment of the present invention, the acquiring a clock signal phase value of a camera sensor of the electronic device in step 101 includes: acquiring a clock signal phase value of the camera sensor under the condition that the connection state of the MIPI is abnormal; the working state of the MIPI is changed, specifically, the connection state of the MIPI is changed from abnormal to normal.
Optionally, after the determining the clock signal phase value at this time as the first phase value in step 103 and before the determining the target phase value according to the first phase value in step 104, the method further includes: gradually adjusting the first phase value according to the first direction by taking a third change amount as a step length, and after adjusting the clock signal phase value each time, judging whether the connection state of the MIPI is changed from normal to abnormal or not; and if the connection state of the MIPI is changed from normal to abnormal, determining the phase value of the clock signal at the moment as a third phase value.
Wherein the third direction may be positive or negative. Optionally, the third direction is the same direction as the first direction. The third change amount may be any value such as 15 °, 45 °, 90 °, and the specific value of the third change amount is not limited in the embodiment of the present invention. The third change amount may be the same as or different from the first change amount.
Optionally, the determining a target phase value according to the first phase value in step 104 includes: and determining a target phase value according to the first phase value and the third phase value.
For example, the first phase value and the third phase value may be summed and averaged, and the average may be used as the target phase value. It can be understood that the embodiment of the present invention does not limit the specific way of calculating the target phase value, and for example, different weights may be set for the first phase value and the third phase value, and then weighted summation and average value calculation may be performed.
Referring to fig. 6, a flowchart of a phase calibration method provided by a fourth embodiment of the present invention is shown, and applied to an electronic device, the method includes:
601, acquiring a clock signal phase value of a camera sensor of the electronic device under the condition that the MIPI connection state of the camera sensor is abnormal;
step 602, taking a first variable as a step length, successively adjusting the phase value of the clock signal according to a first direction, and after adjusting the phase value of the clock signal each time, judging whether the connection state of the MIPI is changed from abnormal to normal;
step 603, if the connection state of the MIPI is determined to be changed from abnormal to normal, determining the phase value of the clock signal at the moment as a first phase value;
step 604, taking a third change amount as a step size, successively adjusting the first phase value according to the first direction, and after adjusting the clock signal phase value each time, determining whether the connection state of the MIPI changes from normal to abnormal;
step 605, if it is determined that the connection state of the MIPI changes from normal to abnormal, determining the phase value of the clock signal at this time as a third phase value;
step 606, determining a target phase value according to the first phase value and the third phase value;
step 607, determining the clock signal phase of the camera sensor as the target phase value.
In an example of this embodiment, when a camera of the electronic device has a function failure and a CPU of the electronic device receives an MIPI communication abnormal interrupt (or MIPI communication error prompt), that is, when a connection state of the MIPI of the camera sensor is abnormal, an automatic calibration procedure of MIPI CLK and DATA phases is started, as follows.
Firstly, the CPU performs power-on initialization on the camera sensor, and after the initialization is completed, the CPU reads a CLK-DATA phase register of the camera sensor through an I2C bus to acquire a clock signal phase value of the camera sensor.
Then, taking a first variable (such as delta β) as a step size, adjusting the phase value of the clock signal in a first direction (such as a forward direction) successively, and after each adjustment, judging whether the connection state of the MIPI is changed from abnormal to normal or not, after each adjustment, a CPU controls a camera sensor to output 2 frames of image data through an I2C, a MIPI receiver of the CPU starts to receive the data until the MIPI receiver can normally receive the 2 frames of image data, which indicates that the connection state of the MIPI is changed from abnormal to normal, and then determining the phase value of the clock signal at the moment as a first phase value, and assuming that the clock signal is recorded as β1E.g. β1=α0+ n Δ β, where n is the number of adjustment steps for the first change amount.
Next, the first phase value β is adjusted by a third change (e.g., Δ β) as a step size1After each adjustment, the CPU controls the camera sensor to output 2 frames of image data through the I2C, the MIPI receiver of the CPU starts to receive the data until the MIPI receiver can not normally receive 2 frames of image data, and the connection state of the MIPI at the moment is changed from normal to abnormal, the phase value of the clock signal at the moment is determined as a third phase value, and the third phase value is assumed to be β2E.g. β2=β1+ m Δ β where m is the thThree changes of the number of adjustment steps.
Finally, the first phase value β is obtained1And the third phase value β2The target phase value CAL, e.g., CAL ═ is determined (β)12)/2. The CPU sets a CLK-DATA phase register of the camera sensor through an I2C bus, and sets a phase value of the register as CAL, so that the electronic equipment can automatically adopt the MIPI CLK-DATA phase value as the parameter of the CAL register when the camera of the electronic equipment is started next time.
In an optional embodiment of the present invention, after the successively adjusting the phase values of the clock signal according to the first direction, the method further includes: and if the accumulated value of the gradually adjusted first variable reaches a first preset threshold value and the working state of the MIPI is not changed yet, stopping continuously adjusting the first variable and outputting prompt information.
The first preset threshold may be set according to an actual situation, optionally, the first preset threshold may be 180 °, and the first preset threshold is not specifically limited in the present invention.
In an optional embodiment of the present invention, after the successively adjusting the first phase value according to the first direction, the method further includes: and if the sum of the accumulated values of the first change amount and the third change amount which are adjusted successively reaches a third preset threshold value and the working state of the MIPI is not changed yet, stopping the operation of continuously adjusting the third change amount and outputting prompt information.
The third preset threshold may be set according to an actual situation, optionally, the third preset threshold may be 360 °, and the third preset threshold is not specifically limited in the embodiment of the present invention.
If the sum of the accumulated values of the first change amount and the third change amount which are adjusted successively reaches a third preset threshold value and the working state of the MIPI is not changed yet, the current MIPI communication abnormal interruption is not caused by the phase deviation of the CLK signal and the DATA signal, at this moment, the operation of continuously adjusting the third change amount can be stopped, and prompt information is output to inform a user that the clock signal phase problem is not detected.
Optionally, if the sum of the accumulated values of the first change amount and the third change amount, which are adjusted successively, reaches a third preset threshold, information of calibration failure may also be reported to the CPU.
Referring to fig. 7, a timing diagram of a clock signal CLK and a DATA signal DATA received by the MIPI receiver during calibration of the present embodiment, and a timing diagram of a clock signal CLK and a DATA signal DATA received by the MIPI receiver after calibration are shown in fig. 5, where a sampling point of the CLK after calibration is located at a center position where DATA can be correctly sampled.
In summary, in this embodiment, when the phase offsets of the CLK and the DATA of the MIPI interface cause the functional failure of the camera, the phase value of the clock signal may be automatically adjusted to automatically remove the abnormal interruption of the MIPI communication caused by the phase offsets, so that the camera of the electronic device may be normally used. In addition, on the basis of removing MIPI communication abnormal interruption, the first phase value can be further calibrated to obtain a more accurate target phase value, so that a CLK sampling point is located at the central position of a DATA level, namely the DATA establishment time is the same as the DATA retention time, and the stability of DATA acquisition of the camera can be improved.
EXAMPLE five
Referring to fig. 8, a block diagram of a phase calibration apparatus according to a fifth embodiment of the present invention is shown, which is applied to an electronic device, and includes:
a phase obtaining module 801, configured to obtain a clock signal phase value of a camera sensor of the electronic device;
a first adjustment determining module 802, configured to gradually adjust the phase value of the clock signal according to a first direction with a first change amount as a step length, and after adjusting the phase value of the clock signal each time, determine whether a working state of a MIPI (mobile industry processor interface) of the camera sensor changes; the change of the working state of the MIPI comprises the change of the connection state of the MIPI from normal to abnormal or the change of the connection state of the MIPI from abnormal to normal;
a first phase determining module 803, configured to determine, if the operating state of the MIPI changes, the phase value of the clock signal at this time as a first phase value;
a target phase determination module 804, configured to determine a target phase value according to the first phase value;
a clock phase determining module 805, configured to determine a clock signal phase of the camera sensor as the target phase value.
Optionally, the phase obtaining module 801 includes:
the first acquisition submodule is used for acquiring a clock signal phase value of the camera sensor under the condition that the connection state of the MIPI is abnormal; the working state of the MIPI is changed, specifically, the connection state of the MIPI is changed from abnormal to normal;
the target phase determination module comprises:
a first determining sub-module for determining the first phase value as a target phase value.
Optionally, the phase obtaining module 801 includes:
the second acquisition submodule is used for acquiring a clock signal phase value of the camera sensor under the condition that the connection state of the MIPI is normal; the working state of the MIPI is changed, specifically, the connection state of the MIPI is changed from normal to abnormal;
the device further comprises:
a second adjustment judging module, configured to adjust the phase value of the clock signal successively according to a second direction by using a second change amount as a step length, and after adjusting the phase value of the clock signal each time, judge whether the connection state of the MIPI changes from normal to abnormal; if the connection state of the MIPI is changed from normal to abnormal, determining the phase value of the clock signal at the moment as a second phase value;
the target phase determination module comprises:
and the second determination submodule is used for determining a target phase value according to the first phase value and the second phase value.
Optionally, the phase obtaining module 801 includes:
a third obtaining submodule, configured to obtain a phase value of a clock signal of the camera sensor when the connection state of the MIPI is abnormal; the working state of the MIPI is changed, specifically, the connection state of the MIPI is changed from abnormal to normal;
the device further comprises:
a third adjustment and judgment module, configured to adjust the first phase value successively according to the first direction by using a third change amount as a step size, and after adjusting the clock signal phase value each time, judge whether the connection state of the MIPI changes from normal to abnormal; if the connection state of the MIPI is changed from normal to abnormal, determining the phase value of the clock signal at the moment as a third phase value;
the target phase determination module comprises:
and the third determining submodule is used for determining a target phase value according to the first phase value and the third phase value.
Optionally, the first adjustment determining module includes:
the control submodule is used for controlling the camera sensor to output image data with preset frame numbers when the first change quantity of the phase value of the clock signal is adjusted;
the detection submodule is used for detecting the sampling state of the MIPI receiver of the electronic equipment on the image data;
the judgment submodule is used for judging that the connection state of the MIPI is changed from normal to abnormal if the sampling state is detected to be changed from normal to abnormal; or if the sampling state is detected to be changed from abnormal to normal, judging that the connection state of the MIPI is changed from abnormal to normal.
Optionally, the apparatus further comprises:
and the accumulation judging module is used for stopping continuously adjusting the operation of the first variable and outputting prompt information if the accumulated value of the gradually adjusted first variable reaches a first preset threshold value and the working state of the MIPI is not changed.
The phase calibration device of the embodiment of the invention obtains the clock signal phase value of the camera sensor of the electronic equipment through the phase obtaining module; the method comprises the steps of sequentially adjusting a phase value of a clock signal according to a first direction by using a first change quantity as a step length through a first adjustment judging module, and judging whether the working state of a Mobile Industry Processor Interface (MIPI) of a camera sensor changes or not after the phase value of the clock signal is adjusted every time; the change of the working state of the MIPI comprises the change of the connection state of the MIPI from normal to abnormal or the change of the connection state of the MIPI from abnormal to normal; when the working state of the MIPI is judged to be changed, a first phase determining module determines the phase value of the clock signal at the moment as a first phase value; determining a target phase value according to the first phase value through a target phase determination module; and determining the phase of the clock signal of the camera sensor as the target phase value through a clock phase determination module.
Therefore, under the condition that the connection state of the MIPI is abnormal, the phase calibration device provided by the embodiment of the invention can automatically adjust the phase value of the clock signal until the working state of the MIPI is changed, for example, the connection state of the MIPI is changed from abnormal to normal, so that abnormal interruption of MIPI communication caused by phase deviation can be automatically eliminated, and a camera of the electronic equipment can be normally used.
In addition, under the condition that the connection state of the MIPI is normal, the phase calibration device of the embodiment of the present invention can further calibrate the phase value of the clock signal of the camera sensor, so as to obtain a more accurate target phase value, for example, so that the calibrated CLK sampling point can be located at the center position of the DATA level, that is, the DATA establishment time and the DATA retention time are the same, and further, the stability of the DATA acquired by the camera can be improved.
The phase calibration device provided by the embodiment of the present invention can implement each process implemented by the electronic device in the method embodiments of fig. 1, fig. 2, fig. 3, and fig. 6, and is not described herein again to avoid repetition.
FIG. 9 is a diagram illustrating a hardware configuration of an electronic device implementing various embodiments of the invention;
the electronic device 900 includes, but is not limited to: a radio frequency unit 901, a network module 902, an audio output unit 903, an input unit 904, a sensor 905, a display unit 906, a user input unit 907, an interface unit 908, a memory 909, a processor 910, and a power supply 911. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 9 does not constitute a limitation of the electronic device, and that the electronic device may include more or fewer components than shown, or some components may be combined, or a different arrangement of components. In the embodiment of the present invention, the electronic device includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted terminal, a wearable device, a pedometer, and the like.
The processor 910 is configured to obtain a clock signal phase value of a camera sensor of the electronic device; the phase value of the clock signal is adjusted gradually according to a first direction by taking a first change amount as a step length, and after the phase value of the clock signal is adjusted every time, whether the working state of a Mobile Industry Processor Interface (MIPI) of the camera sensor is changed or not is judged; if the working state of the MIPI is changed, determining the phase value of the clock signal at the moment as a first phase value; determining a target phase value according to the first phase value; and determining the phase of the clock signal of the camera sensor as the target phase value.
In the embodiment of the invention, under the condition that the camera sensor is abnormal, the phase value of the clock signal can be optimized through the adjustment, so that the problems that MIPI communication is abnormal and the probability of the camera cannot be opened due to the phase deviation of CLK and DATA are solved, and the camera is recovered to be normal. And under the condition that the camera sensor is abnormal or normal, a target phase value can be obtained through the adjustment, and the clock signal phase value is calibrated according to the target phase value, so that the sampling point is positioned at the central position of the stable level, and the stable use of the camera is ensured.
It should be understood that, in the embodiment of the present invention, the radio frequency unit 901 may be used for receiving and sending signals during a message transmission and reception process or a call process, and specifically, after receiving downlink data from a base station, the downlink data is processed by the processor 910; in addition, the uplink data is transmitted to the base station. Generally, the radio frequency unit 901 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 901 can also communicate with a network and other devices through a wireless communication system.
The electronic device provides wireless broadband internet access to the user via the network module 902, such as assisting the user in sending and receiving e-mails, browsing web pages, and accessing streaming media.
The audio output unit 903 may convert audio data received by the radio frequency unit 901 or the network module 902 or stored in the memory 909 into an audio signal and output as sound. Also, the audio output unit 903 may provide audio output related to a specific function performed by the electronic device 900 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 903 includes a speaker, a buzzer, a receiver, and the like.
The input unit 904 is used to receive audio or video signals. The input Unit 904 may include a Graphics Processing Unit (GPU) 9041 and a microphone 9042, and the Graphics processor 9041 processes image data of a still picture or video obtained by an image capturing device (such as a camera) in a video capture mode or an image capture mode. The processed image frames may be displayed on the display unit 906. The image frames processed by the graphic processor 9041 may be stored in the memory 909 (or other storage medium) or transmitted via the radio frequency unit 901 or the network module 902. The microphone 9042 can receive sounds and can process such sounds into audio data. The processed audio data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 901 in case of the phone call mode.
The electronic device 900 also includes at least one sensor 905, such as light sensors, motion sensors, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 9061 according to the brightness of ambient light, and the proximity sensor may turn off the display panel 9061 and/or the backlight when the electronic device 900 is moved to the ear. As one type of motion sensor, an accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of an electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), and vibration identification related functions (such as pedometer, tapping); the sensors 905 may also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which are not described in detail herein.
The display unit 906 is used to display information input by the user or information provided to the user. The Display unit 906 may include a Display panel 9061, and the Display panel 9061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 907 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic device. Specifically, the user input unit 907 includes a touch panel 9071 and other input devices 9072. The touch panel 9071, also referred to as a touch screen, may collect touch operations by a user on or near the touch panel 9071 (e.g., operations by a user on or near the touch panel 9071 using a finger, a stylus, or any other suitable object or accessory). The touch panel 9071 may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 910, receives a command from the processor 910, and executes the command. In addition, the touch panel 9071 may be implemented by using various types such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. The user input unit 907 may include other input devices 9072 in addition to the touch panel 9071. Specifically, the other input devices 9072 may include, but are not limited to, a physical keyboard, function keys (such as a volume control key, a switch key, and the like), a track ball, a mouse, and a joystick, which are not described herein again.
Further, the touch panel 9071 may be overlaid on the display panel 9061, and when the touch panel 9071 detects a touch operation on or near the touch panel 9071, the touch panel is transmitted to the processor 910 to determine the type of the touch event, and then the processor 910 provides a corresponding visual output on the display panel 9061 according to the type of the touch event. Although in fig. 9, the touch panel 9071 and the display panel 9061 are two independent components to implement the input and output functions of the electronic device, in some embodiments, the touch panel 9071 and the display panel 9061 may be integrated to implement the input and output functions of the electronic device, which is not limited herein.
The interface unit 908 is an interface for connecting an external device to the electronic apparatus 900. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 908 may be used to receive input from external devices (e.g., data information, power, etc.) and transmit the received input to one or more elements within the electronic device 900 or may be used to transmit data between the electronic device 900 and external devices.
The memory 909 may be used to store software programs as well as various data. The memory 909 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 909 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
The processor 910 is a control center of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device and processes data by running or executing software programs and/or modules stored in the memory 909 and calling data stored in the memory 909, thereby performing overall monitoring of the electronic device. Processor 910 may include one or more processing units; preferably, the processor 910 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It is to be appreciated that the modem processor described above may not be integrated into processor 910.
The electronic device 900 may further include a power supply 911 (e.g., a battery) for supplying power to various components, and preferably, the power supply 911 may be logically connected to the processor 910 through a power management system, so as to manage charging, discharging, and power consumption management functions through the power management system.
In addition, the electronic device 900 includes some functional modules that are not shown, and thus are not described in detail herein.
Preferably, an embodiment of the present invention further provides an electronic device, which includes a processor 910, a memory 909, and a computer program that is stored in the memory 909 and can be run on the processor 910, and when the computer program is executed by the processor 910, the processes of the control method embodiment of the application program are implemented, and the same technical effect can be achieved, and details are not described here again to avoid repetition.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the control method embodiment of the application program, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (14)

1. A phase calibration method applied to an electronic device is characterized by comprising the following steps:
acquiring a clock signal phase value of a camera sensor of the electronic equipment;
gradually adjusting the phase value of the clock signal according to a first direction by taking a first variable as a step length, and judging whether the working state of an MIPI (Mobile industry processor interface) of the camera sensor is changed after the phase value of the clock signal is adjusted every time; the change of the working state of the MIPI comprises the change of the connection state of the MIPI from normal to abnormal or the change of the connection state of the MIPI from abnormal to normal;
if the working state of the MIPI is changed, determining the phase value of the clock signal at the moment as a first phase value;
determining a target phase value according to the first phase value;
and determining the phase of the clock signal of the camera sensor as the target phase value.
2. The method of claim 1, wherein obtaining a clock signal phase value of a camera sensor of the electronic device comprises:
acquiring a clock signal phase value of the camera sensor under the condition that the connection state of the MIPI is abnormal; the working state of the MIPI is changed, specifically, the connection state of the MIPI is changed from abnormal to normal;
the determining a target phase value from the first phase value comprises:
determining the first phase value as a target phase value.
3. The method of claim 1, wherein obtaining a clock signal phase value of a camera sensor of the electronic device comprises:
acquiring a clock signal phase value of the camera sensor under the condition that the connection state of the MIPI is normal; the working state of the MIPI is changed, specifically, the connection state of the MIPI is changed from normal to abnormal;
after the determining the clock signal phase value at this time as a first phase value and before the determining a target phase value according to the first phase value, the method further includes:
gradually adjusting the phase value of the clock signal according to a second direction by taking a second change amount as a step length, and after adjusting the phase value of the clock signal every time, judging whether the connection state of the MIPI is changed from normal to abnormal; if the connection state of the MIPI is changed from normal to abnormal, determining the phase value of the clock signal at the moment as a second phase value;
the determining a target phase value from the first phase value comprises:
and determining a target phase value according to the first phase value and the second phase value.
4. The method of claim 1, wherein obtaining a clock signal phase value of a camera sensor of the electronic device comprises:
acquiring a clock signal phase value of the camera sensor under the condition that the connection state of the MIPI is abnormal; the working state of the MIPI is changed, specifically, the connection state of the MIPI is changed from abnormal to normal;
after the determining the clock signal phase value at this time as a first phase value and before the determining a target phase value according to the first phase value, the method further includes:
gradually adjusting the first phase value according to the first direction by taking a third change amount as a step length, and after adjusting the clock signal phase value each time, judging whether the connection state of the MIPI is changed from normal to abnormal or not; if the connection state of the MIPI is changed from normal to abnormal, determining the phase value of the clock signal at the moment as a third phase value;
the determining a target phase value from the first phase value comprises:
and determining a target phase value according to the first phase value and the third phase value.
5. The method of claim 1, wherein the determining whether the operating state of the MIPI of the camera sensor has changed comprises:
controlling the camera sensor to output image data with preset frame numbers when the first change quantity of the phase value of the clock signal is adjusted;
detecting the sampling state of the image data by an MIPI receiver of the electronic equipment;
if the sampling state is detected to be changed from normal to abnormal, judging that the connection state of the MIPI is changed from normal to abnormal; or if the sampling state is detected to be changed from abnormal to normal, judging that the connection state of the MIPI is changed from abnormal to normal.
6. The method of claim 1, wherein after the successive adjustments of the clock signal phase values in the first direction, the method further comprises:
and if the accumulated value of the gradually adjusted first variable reaches a first preset threshold value and the working state of the MIPI is not changed yet, stopping continuously adjusting the first variable and outputting prompt information.
7. A phase calibration apparatus applied to an electronic device, the apparatus comprising:
the phase acquisition module is used for acquiring a clock signal phase value of a camera sensor of the electronic equipment;
the first adjustment judging module is used for adjusting the phase value of the clock signal gradually according to a first direction by taking a first change amount as a step length, and judging whether the working state of a Mobile Industry Processor Interface (MIPI) of the camera sensor changes or not after the phase value of the clock signal is adjusted every time; the change of the working state of the MIPI comprises the change of the connection state of the MIPI from normal to abnormal or the change of the connection state of the MIPI from abnormal to normal;
a first phase determining module, configured to determine, if the operating state of the MIPI changes, a phase value of the clock signal at this time as a first phase value;
a target phase determination module, configured to determine a target phase value according to the first phase value;
and the clock phase determining module is used for determining the phase of the clock signal of the camera sensor as the target phase value.
8. The apparatus of claim 7, wherein the phase acquisition module comprises:
the first acquisition submodule is used for acquiring a clock signal phase value of the camera sensor under the condition that the connection state of the MIPI is abnormal; the working state of the MIPI is changed, specifically, the connection state of the MIPI is changed from abnormal to normal;
the target phase determination module comprises:
a first determining sub-module for determining the first phase value as a target phase value.
9. The apparatus of claim 8, wherein the phase acquisition module comprises:
the second acquisition submodule is used for acquiring a clock signal phase value of the camera sensor under the condition that the connection state of the MIPI is normal; the working state of the MIPI is changed, specifically, the connection state of the MIPI is changed from normal to abnormal;
the device further comprises:
a second adjustment judging module, configured to adjust the phase value of the clock signal successively according to a second direction by using a second change amount as a step length, and after adjusting the phase value of the clock signal each time, judge whether the connection state of the MIPI changes from normal to abnormal; if the connection state of the MIPI is changed from normal to abnormal, determining the phase value of the clock signal at the moment as a second phase value;
the target phase determination module comprises:
and the second determination submodule is used for determining a target phase value according to the first phase value and the second phase value.
10. The apparatus of claim 7, wherein the phase acquisition module comprises:
a third obtaining submodule, configured to obtain a phase value of a clock signal of the camera sensor when the connection state of the MIPI is abnormal; the working state of the MIPI is changed, specifically, the connection state of the MIPI is changed from abnormal to normal;
the device further comprises:
a third adjustment and judgment module, configured to adjust the first phase value successively according to the first direction by using a third change amount as a step size, and after adjusting the clock signal phase value each time, judge whether the connection state of the MIPI changes from normal to abnormal; if the connection state of the MIPI is changed from normal to abnormal, determining the phase value of the clock signal at the moment as a third phase value;
the target phase determination module comprises:
and the third determining submodule is used for determining a target phase value according to the first phase value and the third phase value.
11. The apparatus of claim 7, wherein the first adjustment determining module comprises:
the control submodule is used for controlling the camera sensor to output image data with preset frame numbers when the first change quantity of the phase value of the clock signal is adjusted;
the detection submodule is used for detecting the sampling state of the MIPI receiver of the electronic equipment on the image data;
the judgment submodule is used for judging that the connection state of the MIPI is changed from normal to abnormal if the sampling state is detected to be changed from normal to abnormal; or if the sampling state is detected to be changed from abnormal to normal, judging that the connection state of the MIPI is changed from abnormal to normal.
12. The apparatus of claim 7, further comprising:
and the accumulation judging module is used for stopping continuously adjusting the operation of the first variable and outputting prompt information if the accumulated value of the gradually adjusted first variable reaches a first preset threshold value and the working state of the MIPI is not changed.
13. An electronic device, comprising a processor, a memory and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps of the phase calibration method according to any one of claims 1 to 6.
14. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the phase calibration method according to any one of claims 1 to 6.
CN202010091567.XA 2020-02-13 2020-02-13 Phase calibration method and electronic device Active CN111163311B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010091567.XA CN111163311B (en) 2020-02-13 2020-02-13 Phase calibration method and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010091567.XA CN111163311B (en) 2020-02-13 2020-02-13 Phase calibration method and electronic device

Publications (2)

Publication Number Publication Date
CN111163311A true CN111163311A (en) 2020-05-15
CN111163311B CN111163311B (en) 2022-05-24

Family

ID=70565865

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010091567.XA Active CN111163311B (en) 2020-02-13 2020-02-13 Phase calibration method and electronic device

Country Status (1)

Country Link
CN (1) CN111163311B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112558018A (en) * 2020-12-08 2021-03-26 深圳市虹远通信有限责任公司 Method, processor and system for aligning clock and pulse per second between multiple systems with high precision

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1337696A (en) * 2000-06-30 2002-02-27 惠普公司 Method and apparatus for calibration of time sequence of write-dowu processing onto storage medium
US20100182854A1 (en) * 2007-07-12 2010-07-22 Panasonic Corporation Operation guarantee system
CN102780552A (en) * 2011-05-13 2012-11-14 联咏科技股份有限公司 Signal correction method and related client circuit and transmission system
CN102789442A (en) * 2011-05-19 2012-11-21 联咏科技股份有限公司 Method of calibrating signal skews in MIPI and related transmission system
CN103475840A (en) * 2013-09-25 2013-12-25 武汉精立电子技术有限公司 Method for switching four-LINK LVDS video signals into MIPI video signals
CN104020820A (en) * 2013-02-28 2014-09-03 瑞萨Sp驱动器公司 Receiver and transmission and reception system
CN104765706A (en) * 2014-01-07 2015-07-08 全视技术有限公司 Digital calibration-based skew cancellation for long-reach mipi d-phy serial links
CN104952421A (en) * 2015-07-13 2015-09-30 武汉精测电子技术股份有限公司 Method and system for generating MIPI (mobile industry processor interface) signals for MIPI module detection
CN106998215A (en) * 2016-05-12 2017-08-01 思博半导体股份有限公司 data receiving device
CN109639380A (en) * 2018-11-29 2019-04-16 青岛海信电器股份有限公司 Processing method, device, equipment and the storage medium of MIPI signal

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1337696A (en) * 2000-06-30 2002-02-27 惠普公司 Method and apparatus for calibration of time sequence of write-dowu processing onto storage medium
US20100182854A1 (en) * 2007-07-12 2010-07-22 Panasonic Corporation Operation guarantee system
CN102780552A (en) * 2011-05-13 2012-11-14 联咏科技股份有限公司 Signal correction method and related client circuit and transmission system
CN102789442A (en) * 2011-05-19 2012-11-21 联咏科技股份有限公司 Method of calibrating signal skews in MIPI and related transmission system
CN104020820A (en) * 2013-02-28 2014-09-03 瑞萨Sp驱动器公司 Receiver and transmission and reception system
CN103475840A (en) * 2013-09-25 2013-12-25 武汉精立电子技术有限公司 Method for switching four-LINK LVDS video signals into MIPI video signals
CN104765706A (en) * 2014-01-07 2015-07-08 全视技术有限公司 Digital calibration-based skew cancellation for long-reach mipi d-phy serial links
US20150192949A1 (en) * 2014-01-07 2015-07-09 Omnivision Technologies, Inc. Digital Calibration-Based Skew Cancellation for Long-Reach MIPI D-PHY Serial Links
CN104952421A (en) * 2015-07-13 2015-09-30 武汉精测电子技术股份有限公司 Method and system for generating MIPI (mobile industry processor interface) signals for MIPI module detection
CN106998215A (en) * 2016-05-12 2017-08-01 思博半导体股份有限公司 data receiving device
CN109639380A (en) * 2018-11-29 2019-04-16 青岛海信电器股份有限公司 Processing method, device, equipment and the storage medium of MIPI signal

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112558018A (en) * 2020-12-08 2021-03-26 深圳市虹远通信有限责任公司 Method, processor and system for aligning clock and pulse per second between multiple systems with high precision

Also Published As

Publication number Publication date
CN111163311B (en) 2022-05-24

Similar Documents

Publication Publication Date Title
CN108182043B (en) Information display method and mobile terminal
CN108319390B (en) Control method of flexible screen and mobile terminal
CN108600546B (en) Environment light detection method and mobile terminal
CN108494030B (en) Wireless charging method, terminal and transmitting terminal equipment
CN108073343B (en) display interface adjusting method and mobile terminal
CN109831585B (en) Operation parameter adjusting method and mobile terminal
CN108900695B (en) Display processing method, terminal equipment and computer readable storage medium
CN111338533B (en) Application program starting method and electronic equipment
CN110943818A (en) Configuration method, receiving method, terminal and network side equipment
CN109558046B (en) Information display method and terminal equipment
CN108108113B (en) Webpage switching method and device
CN110730017A (en) Radio frequency device, control method thereof and terminal equipment
WO2021164760A1 (en) Parameter adjustment method and electronic device
CN111343710A (en) Power adjustment method and electronic equipment
CN108924319B (en) Proximity detection method and mobile terminal
CN109597546B (en) Icon processing method and terminal equipment
CN108521417B (en) Communication processing method and mobile terminal
CN108628534B (en) Character display method and mobile terminal
CN108829306B (en) Information processing method and mobile terminal
CN111163311B (en) Phase calibration method and electronic device
CN110912624B (en) Digital predistortion processing method and electronic device
JP7114747B2 (en) Random access resource selection method and terminal device
CN110456959B (en) Terminal control method and terminal
CN109067429B (en) Control method and terminal equipment
CN109886199B (en) Information processing method and device, vehicle and mobile terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant