Data processing method and electronic equipment

By reading and verifying calibration data from the first storage area when the electronic device is powered on and updating when it is unreliable, the data corruption problem caused by frequent power-on and reading is solved, and the accuracy and reliability of data reading are improved.

CN120201292APending Publication Date: 2025-06-24VIVO MOBILE COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510486119.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-17
Publication Date
2025-06-24

AI Technical Summary

Technical Problem

When the electronic device is powered on and read data on the storage unit of the camera module, resulting in damage to the storage unit and thus abnormal data reading.

Method used

When the electronic device is powered on, calibration data is read from the first storage area and verified. If the calibration data is unreliable, the calibration data in the first storage area is updated based on the calibration data burned in the storage unit of the camera module.

Benefits of technology

The power-up and down and data reading operations performed on the storage unit of the camera module are reduced, data corruption is avoided, and data reading accuracy and reliability are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120201292A_ABST
    Figure CN120201292A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method and electronic equipment, and belongs to the technical field of electronics. The data processing method comprises the steps that when the electronic equipment is started, first calibration data are read from a first storage area of the electronic equipment, the first storage area is an area where stored data are not released after power failure, and the first storage area is in a readable mode in the use stage of the electronic equipment; verifying the first calibration data to obtain a verification result which indicates the reliability of the first calibration data; under the condition that the verification result indicates that the first calibration data is unreliable, updating the first calibration data stored in the first storage area based on the second calibration data; the second calibration data is calibration data burnt in a storage unit of a camera module of the electronic equipment, the calibration data stored in the first storage area is used for calibrating camera parameters of the camera module of the electronic equipment, and the storage unit of the camera module is in a read-only mode in the use stage of the electronic equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of electronic technology, and particularly relates to a data processing method and an electronic device. Background Art

[0002] During the production process of electronic devices, in order to ensure the consistency of the imaging effects of camera modules in different electronic devices, the camera modules of each electronic device are usually differentially calibrated during the production stage of the electronic device to obtain calibration data (i.e., OTP data, One Time Programmable data) for each camera module, and then the obtained calibration data is burned into the storage unit of the camera module so that the electronic device can use this calibration data to calibrate the camera module to eliminate individual differences and achieve the best photographing effect.

[0003] However, since the electronic device needs to perform repeated power-on and data reading operations on the storage unit of the camera module every time it is powered on, and a large number of repeated power-on and data reading operations may damage the storage unit of the camera module, resulting in abnormal data reading from the storage unit, such as inability to read data or incorrect data reading. Summary of the Invention

[0004] The purpose of the embodiments of this application is to provide a data processing method and an electronic device, which can improve the accuracy and reliability of data reading.

[0005] In a first aspect, the embodiments of this application provide a data processing method, which includes: when the electronic device is powered on, reading first calibration data from a first storage area of the electronic device, where the first storage area is an area that does not release stored data after power-off, and the first storage area is in a readable mode during the use stage of the electronic device; verifying the first calibration data to obtain a verification result, where the verification result indicates the reliability of the first calibration data; in the case where the verification result indicates that the first calibration data is unreliable, updating the first calibration data stored in the first storage area based on second calibration data; where the second calibration data is calibration data burned into the storage unit of the camera module of the electronic device, and the calibration data stored in the first storage area is used for calibrating the camera parameters of the camera module of the electronic device, and the storage unit of the camera module is in a read-only mode during the use stage of the electronic device.

[0006] Second aspect, an embodiment of the present application provides an electronic device, which includes a first storage area, a camera module, and a processor. The camera module includes a storage unit, and the processor is connected to the first storage area and the camera module. The first storage area is used to store calibration data for calibrating the camera parameters of the camera module of the electronic device. The first storage area is an area that does not release the stored data after power-off, and the first storage area is in a readable mode during the use stage of the electronic device. The storage unit is used to store the burned second calibration data, and the storage unit is in a read-only mode during the use stage of the electronic device. The processor is used to, when the electronic device is powered on, read the first calibration data from the first storage area; and verify the first calibration data to obtain a verification result, where the verification result indicates the reliability of the first calibration data; and, when the verification result indicates that the first calibration data is unreliable, update the first calibration data stored in the first storage area based on the second calibration data.

[0007] In an embodiment of the present application, when the electronic device is powered on, the first calibration data is read from the first storage area of the electronic device. The first storage area is an area that does not release the stored data after power-off, and the first storage area is in a readable mode during the use stage of the electronic device. The first calibration data is verified to obtain a verification result, where the verification result indicates the reliability of the first calibration data. When the verification result indicates that the first calibration data is unreliable, the first calibration data stored in the first storage area is updated based on the second calibration data. Among them, the second calibration data is calibration data burned in the storage unit of the camera module of the electronic device. The calibration data stored in the first storage area is used to calibrate the camera parameters of the camera module of the electronic device. The storage unit of the camera module is in a read-only mode during the use stage of the electronic device. In this solution, by pre-storing the calibration data originally burned in the storage unit of the camera module in the first storage area, when using the camera of the electronic device each time, the calibration data can be read from the first storage area to calibrate the camera parameters of the camera module, without having to read from the storage unit of the camera module, reducing the power-on / off and data reading operations performed on the storage unit of the camera module, avoiding damage to the data stored in the storage unit of the camera module, and thus being able to avoid abnormal data reading and improve the accuracy of data reading. And, each time the electronic device is powered on, the reliability of the first calibration data read from the first storage area is verified, and when the first calibration data is unreliable, the first calibration data in the first storage area is updated based on the calibration data burned in the storage unit of the camera module to ensure that the calibration data stored in the first storage area of the electronic device is accurate, and further ensure that the calibration data used for calibrating the camera parameters of the camera module is reliable. Therefore, the solution of the present application can ensure the security of the calibration data, improve the accuracy and reliability of the calibration data, and further improve the accuracy and reliability of data reading. Description of the Drawings

[0008] Figure 1 is a schematic diagram of reading calibration data provided by the related art;

[0009] Figure 2 is one of the schematic flowcharts of the data processing method provided by the embodiments of the present application;

[0010] Figure 3 is a schematic flowchart of performing a security check on a camera module during the production stage of a mobile phone provided by the embodiments of the present application;

[0011] Figure 4 is a schematic flowchart of performing a security check on a camera module during the usage stage of a mobile phone provided by the embodiments of the present application;

[0012] Figure 5 is a schematic flowchart of burning calibration data into a storage unit of a camera module provided by the embodiments of the present application;

[0013] Figure 6 is a schematic flowchart of backing up calibration data in three storage areas of an electronic device provided by the embodiments of the present application;

[0014] Figure 7 is a schematic flowchart of obtaining calibration data to calibrate camera parameters of a camera module provided by the embodiments of the present application;

[0015] Figure 8 is another schematic flowchart of the data processing method provided by the embodiments of the present application;

[0016] Figure 9 is yet another schematic flowchart of the data processing method provided by the embodiments of the present application;

[0017] Figure 10 is one of the schematic structural diagrams of an electronic device provided by the embodiments of the present application;

[0018] Figure 11 is another schematic structural diagram of an electronic device provided by the embodiments of the present application. Detailed Description of the Embodiments

[0019] Next, the technical solutions in the embodiments of the present application will be clearly described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, rather than all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application belong to the scope of protection of the present application.

[0020] The terms "first", "second", etc. in the description and claims of this application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of this application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are usually of the same category, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the description and claims means at least one of the connected objects, and the character " / ", generally indicates that the associated objects before and after are in an "or" relationship.

[0021] The terms "at least one (item)", "at least one of", etc. in the description and claims of this application refer to any one, any two or more combinations of the objects it contains. For example, at least one (item) of a, b, and c can mean: "a", "b", "c", "a and b", "a and c", "b and c", and "a, b, and c", where a, b, and c can be single or multiple. Similarly, "at least two (items)" means two or more, and its meaning is similar to that of "at least one (item)".

[0022] The data processing method, device, electronic device, storage medium and program product provided by the embodiments of this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and their application scenarios.

[0023] The data processing method provided by the embodiments of this application can be applied to the scenario of calibrating the camera parameters of a camera in an electronic device.

[0024] Product consistency is an issue that the manufacturing industry has always had to face. The higher the product consistency, the more fully the software and hardware will be adapted, and the more advantages there will be in terms of quality, reliability, and cost. However, just as there are no two identical leaves in the world, no matter how strictly the production process is controlled, individual differences between products are still inevitable.

[0025] During the production process of electronic devices, product consistency issues often arise. Take mobile phones as an example. The chips, lenses, motors, and assembly processes in mobile phones all affect the consistency of the imaging effect of the cameras in mobile phones. To solve the consistency problem of the imaging effect of the cameras in mobile phones, the factory that produces the camera modules in mobile phones will burn calibration data into the storage unit of the camera module after differential calibration of each camera module. For example, an Electrically Erasable Programmable Read-Only Memory (EEPROM). Then, when the user uses the camera in the mobile phone, the mobile phone can call the calibration data burned in the storage unit of the camera module to calibrate the camera parameters of the camera module to eliminate individual differences and achieve the best photo-taking effect.

[0026] It should be noted that due to early camera modules, such as Camera Compact Modules (CCMs), not having EEPROMs and only having a small amount of burned data, which was burned into the OTP of the image sensor, the calibration data stored in the camera module can be called OTP data. Subsequently, with the evolution and development of camera modules, the data volume has increased, and the storage unit has also been changed to EEPROM, but the calibration data stored in the camera module can still be called OTP data.

[0027] In the traditional solution, the scheme for the mobile phone to call the calibration data burned in the EEPROM of the camera module to calibrate the camera parameters of the camera module is as Figure 1 shown.

[0028] In Figure 1 , each time the mobile phone is powered on, the EEPROM of the camera module is powered on, and the calibration data is read from the EEPROM. Then, the mobile phone converts the format of the calibration data into a format that can be used by the camera module according to the requirements and stores it in the Random Access Memory (RAM) of the mobile phone. Then, each time the mobile phone starts the camera, the mobile phone can read the calibration data from the RAM and use the calibration data to calibrate the camera parameters of the camera module. When the mobile phone is powered off, the calibration data stored in the RAM will be released, and when the mobile phone is powered on again, it is necessary to perform the power-on and data reading operations on the EEPROM again.

[0029] However, since each power-on and power-off of the mobile phone requires repeated power-on, power-off, and data reading operations on the EEPROM, a large number of repeated power-on, power-off, and data reading operations may cause damage to the EEPROM, and thus the calibration data stored in the EEPROM may be damaged, resulting in abnormal data reading when reading the calibration data from the EEPROM. Moreover, in order to enable the EEPROM to support a large number of repeated power-on, power-off, and data reading functions, the production cost of the EEPROM is relatively high.

[0030] To this end, the embodiments of the present application provide a data processing method. By pre-storing the calibration data originally burned in the storage unit of the camera module in the first storage area, when using the camera of the electronic device each time, the calibration data can be read from the first storage area to calibrate the camera parameters of the camera module, without having to read from the storage unit of the camera module, reducing the power-on, power-off, and data reading operations performed on the storage unit of the camera module, avoiding damage to the data stored in the storage unit of the camera module, thereby being able to avoid abnormal data reading and improving the accuracy of data reading. Moreover, when the electronic device is powered on each time, the reliability of the first calibration data read from the first storage area is verified, and in the case where the first calibration data is unreliable, the first calibration data in the first storage area is updated based on the calibration data burned in the storage unit of the camera module to ensure that the calibration data stored in the first storage area of the electronic device is accurate, and further ensure that the calibration data used for calibrating the camera parameters of the camera module is reliable. Therefore, the solution of the present application can ensure the security of the calibration data, improve the accuracy and reliability of the calibration data, and further improve the accuracy and reliability of data reading.

[0031] The execution subject of the data processing method provided by the embodiments of the present application may be a data processing device. Exemplarily, the data processing device may be an electronic device, or a functional component or functional entity in the electronic device. Hereinafter, taking the execution subject as an electronic device as an example, the data processing method provided by the embodiments of the present application will be exemplarily described.

[0032] Figure 2 is a schematic flowchart of the data processing method provided by the embodiments of the present application. As Figure 2 shown, the data processing method provided by the embodiments of the present application may include the following steps 101 to 103.

[0033] Step 101: When the electronic device is powered on, the electronic device reads the first calibration data from the first storage area of the electronic device.

[0034] In some embodiments of the present application, the above-mentioned first storage area may be an area that does not release the stored data after power-off, that is, the above-mentioned first storage area may be a storage area that can still store data after the electronic device is powered off.

[0035] In some embodiments of the present application, the above-mentioned first storage area may be all or part of the storage area of the first memory in the electronic device. Exemplarily, the first memory may be Universal Flash Storage (UFS), Flash Memory, or Embedded Multi-Chip Package (eMCP), etc. Among them, Flash Memory may be Nand-Flash or NOR-Flash.

[0036] In some embodiments of the present application, the above-mentioned first storage area is in a readable mode during the use stage of the electronic device.

[0037] In some embodiments of the present application, during the use stage of the electronic device, the above-mentioned first storage area is in a readable mode in the user mode. That is to say, in the user mode, the electronic device can read the data stored in the first storage area. Among them, the user mode is a running mode in which the execution permissions of the application programs running on the electronic device are relatively low. In the user mode, the application programs running on the electronic device cannot directly access the hardware devices and the kernel code area, can only execute non-privileged instructions, and the access permissions are restricted.

[0038] In some embodiments of the present application, the access permission of the above-mentioned first storage area is relatively low and can be easily accessed.

[0039] In some embodiments of the present application, the above-mentioned first storage area can be accessed each time the electronic device is powered on and each time the camera module of the electronic device is started. In other words, the data stored in the first storage area can be read each time the electronic device is powered on and each time the camera module of the electronic device is started.

[0040] It should be noted that the data stored in the above-mentioned first storage area will not be affected during the version upgrade and flashing process of the electronic device and will not be easily deleted. That is to say, the data stored in the above-mentioned first storage area is relatively safe.

[0041] In some embodiments of the present application, the above-mentioned first calibration data may be calibration data that is pre-stored in the first storage area and is used to calibrate the camera parameters of the camera module of the electronic device.

[0042] In some embodiments of the present application, the above-mentioned first calibration data may be unencrypted calibration data. Alternatively, the above-mentioned first calibration data may be unencrypted and pre-processed calibration data.

[0043] In some embodiments of the present application, the above-mentioned pre-processing may include, but is not limited to: removing invalid or redundant information, filling in missing values, handling outliers, converting the data format into a format that can be used by the camera module, and so on.

[0044] In some embodiments of the present application, when the electronic device is powered on, the electronic device may determine the address segment corresponding to the first storage area, such as the first address segment, from the recorded correspondence between the address segment and the storage area, and then read the data of the first address segment from the first storage area to obtain the first calibration data.

[0045] In some embodiments of the present application, the above-mentioned first address segment is the address information of the calibration data recorded in the first storage area when the electronic device pre-backups the calibration data for calibrating the camera parameters of the camera module in the first storage area.

[0046] In some embodiments of the present application, during the production stage of the electronic device, the electronic device may obtain the calibration data for calibrating the camera parameters of the camera module from the storage unit of the camera module, then write the obtained calibration data into the first storage area, determine the address segment used to store the calibration data in the first storage area to obtain the first address segment, and then record the correspondence between the first address segment and the first storage area. Then, during the usage stage of the electronic device, every time the electronic device is powered on, the electronic device may determine the address segment corresponding to the first storage area, such as the first address segment, from the recorded correspondence between the address segment and the storage area, and then read the data stored in the first address segment from the first storage area to obtain the first calibration data.

[0047] In some embodiments of the present application, the calibration data may be OTP data.

[0048] In some embodiments of the present application, the calibration data may include lens shading correction (LSC) parameters, auto white balance (AWB) parameters, auto focus (AF) parameters, phase detection auto focus (PDAF) parameters, and so on.

[0049] Step 102: The electronic device verifies the first calibration data to obtain a verification result.

[0050] In some embodiments of the present application, the above verification result can be used to indicate the reliability of the first calibration data.

[0051] That is to say, after the electronic device reads the first calibration data, it can first verify whether the first calibration data is reliable, that is, whether the first calibration data has been tampered with or damaged, so as to ensure that the calibration data used for subsequent calibration of the camera parameters of the camera module is accurate and reliable.

[0052] In one implementation manner of the embodiments of the present application, step 102 can be specifically implemented by the following steps 1021 and 1022.

[0053] Step 1021: The electronic device reads reference calibration data from the third storage area of the electronic device.

[0054] In some embodiments of the present application, the above third storage area can be an area that does not release stored data after power-off, that is, the above third storage area can be a storage area that can still store data after the electronic device is powered off.

[0055] In some embodiments of the present application, the above third storage area can be all or part of the storage area of the third memory in the electronic device. Exemplarily, the third memory can be UFS, flash memory, eMCP, etc.

[0056] It should be noted that the above third storage area and the first storage area can be different storage areas in the same memory, that is, the third memory and the first memory are the same memory. Or, the third storage area and the first storage area can be storage areas in different memories, that is, the third memory and the first memory are two different memories.

[0057] In some embodiments of the present application, the above third storage area is in a readable mode during the use stage of the electronic device.

[0058] In some embodiments of the present application, during the use stage of the electronic device, the above third storage area is in a readable mode in the user mode. That is to say, in the user mode, the electronic device can read the data stored in the third storage area.

[0059] In some embodiments of the present application, the access permission of the above third storage area is relatively high and it needs to go through an authentication application to be accessed. Moreover, the access permission and security of this third storage area are both higher than those of the first storage area.

[0060] In some embodiments of the present application, the above third storage area can be accessed each time the electronic device is powered on. In other words, the data stored in the third storage area can be read each time the electronic device is powered on.

[0061] It should be noted that the data stored in the above-mentioned third storage area will not be affected during the version upgrade or flashing process of the electronic device, and will not be easily deleted or called. That is to say, the data stored in the above-mentioned third storage area is relatively secure.

[0062] In some embodiments of the present application, the above-mentioned reference calibration data may be calibration data that is pre-stored in the third storage area and used as a reference to determine whether the first calibration data is accurate.

[0063] In some embodiments of the present application, the above-mentioned reference calibration data may be unencrypted calibration data. Alternatively, the above-mentioned reference calibration data may be unencrypted and pre-processed calibration data.

[0064] It should be noted that since the reference calibration data is used as a reference for the first calibration data, therefore, when the first calibration data is unencrypted calibration data, the reference calibration data is also unencrypted calibration data; when the first calibration data is unencrypted and pre-processed calibration data, the reference calibration data is also unencrypted and pre-processed calibration data.

[0065] In some embodiments of the present application, when the electronic device is powered on, the electronic device can determine the address segment corresponding to the third storage area, such as the second address segment, from the recorded correspondence between the address segment and the storage area, and then read the data of the second address segment from the third storage area to obtain the reference calibration data.

[0066] In some embodiments of the present application, the above-mentioned second address segment is the address information of the calibration data in the third storage area recorded when the electronic device pre-backups the calibration data for calibrating the camera parameters of the camera module in the third storage area.

[0067] In some embodiments of the present application, during the production stage of the electronic device, the electronic device can obtain the calibration data for calibrating the camera parameters of the camera module from the storage unit of the camera module, then write the obtained calibration data into the third storage area, determine the address segment used to store the calibration data in the third storage area to obtain the second address segment, and then record the correspondence between the second address segment and the third storage area. Then, during the use stage of the electronic device, every time the electronic device is powered on, the electronic device can determine the address segment corresponding to the third storage area, such as the second address segment, from the recorded correspondence between the address segment and the storage area, and then read the data stored in the second address segment from the third storage area to obtain the reference calibration data.

[0068] Step 1022: The electronic device compares the first calibration data with the reference calibration data to obtain a verification result.

[0069] In some embodiments of the present application, after the electronic device reads the first calibration data and the reference calibration data, the first calibration data and the reference calibration data can be temporarily stored in the cache of the electronic device or the RAM of the electronic device.

[0070] Exemplarily, the RAM of the above-mentioned electronic device can be a Dynamic Random Access Memory (DRAM), a Synchronous Dynamic Random Access Memory (SDRAM), and so on.

[0071] In some embodiments of the present application, the electronic device can compare the first calibration data with the reference calibration data. If the two are the same, the verification result indicates that the first calibration data is reliable. If the two are different, the verification result indicates that the first calibration data is unreliable.

[0072] Exemplarily, the electronic device can use 1 and 0 to represent the verification result. If the first calibration data is different from the reference calibration data, the verification result is 1, indicating that the first calibration data is reliable. If the first calibration data is the same as the reference calibration data, the verification result is 0, indicating that the first calibration data is unreliable.

[0073] In some embodiments of the present application, the above step 1022 can be specifically implemented through the following step 10221.

[0074] Step 10221: When the first calibration data is different from the reference calibration data, the electronic device determines that the verification result indicates that the first calibration data is unreliable.

[0075] In some embodiments of the present application, if the first calibration data is different from the reference calibration data, at least one of the first calibration data and the reference calibration data is tampered with or damaged. However, since the reference calibration data is accessed less frequently, it is highly probable that the first calibration data is tampered with or damaged. Therefore, the electronic device can determine that the first calibration data is unreliable.

[0076] In this way, by comparing the first calibration data stored in the first storage area with the reference calibration data stored in the third storage area to determine whether the first calibration data is reliable, and further determining whether to update the first calibration data stored in the first storage area, the accuracy and reliability of the calibration data for calibrating the camera parameters of the camera module can be improved.

[0077] In another implementation manner of the embodiments of the present application, in some embodiments of the present application, the first calibration data can be encrypted calibration data. The above step 102 can be specifically implemented through the following step 1023.

[0078] Step 1023: The electronic device reads the first key and the first check code of the first calibration data from the third storage area of the electronic device.

[0079] In some embodiments of the present application, the above-mentioned third storage area may be an area where the stored data is not released after power-off.

[0080] It should be noted that the explanation of the third storage area can be referred to the relevant description in step 1021 above. To avoid repetition, it will not be elaborated here.

[0081] In some embodiments of the present application, the above-mentioned first key may be the key used for encrypting the calibration data burned in the storage unit of the camera module, and the above-mentioned check code may be the message authentication code (Message Authentication Code, MAC) obtained by using the first key for the calibration data burned in the storage unit of the camera module by means of a message authentication algorithm.

[0082] Exemplarily, the above-mentioned message authentication algorithm may include a hash-based message authentication code (HMAC) algorithm, a cipher-based message authentication code (CMAC), and the like.

[0083] In some embodiments of the present application, the electronic device may determine the address segments corresponding to the third storage area, such as the fourth address segment and the fifth address segment, from the recorded correspondence between the address segments and the storage areas, and then read the first key from the fourth address segment of the third storage area and read the first check code of the first calibration data from the fifth address segment.

[0084] In some embodiments of the present application, the above-mentioned fourth address segment is the address information of the first key in the third storage area recorded when the electronic device pre-stores the first key in the third storage area. The above-mentioned fifth address segment is the address information of the first check code in the third storage area recorded when the electronic device pre-stores the first check code in the third storage area.

[0085] Step 1024: The electronic device generates a second check code based on the first key and the first calibration data.

[0086] In some embodiments of the present application, the electronic device may first decrypt the first calibration data using the first key to obtain the decrypted first calibration data, and then the electronic device may use the first key to perform the above-mentioned message authentication algorithm on the decrypted first calibration data to obtain the second check code.

[0087] Step 1025: The electronic device compares the first check code with the second check code to obtain a verification result.

[0088] In some embodiments of the present application, the electronic device may compare the first verification code with the second verification code. If the two are the same, the verification result indicates that the first calibration data is reliable. If the two are different, the verification result indicates that the first calibration data is unreliable.

[0089] Exemplarily, the electronic device may use 1 and 0 to represent the verification result. If the first verification code is different from the second verification code, the verification result is 1, indicating that the first calibration data is reliable. If the first calibration data is the same as the reference calibration data, the verification result is 0, indicating that the first calibration data is unreliable.

[0090] In some embodiments of the present application, step 1025 above may be specifically implemented through the following step 10251.

[0091] Step 10251: When the first verification code is different from the second verification code, the electronic device determines that the verification result indicates that the first calibration data is unreliable.

[0092] In some embodiments of the present application, if the first verification code is different from the second verification code, since the second verification code is calculated based on the first key and the decrypted first calibration data, at least one of the first verification code, the first calibration data, and the first key is tampered with or damaged. However, since the number of times the first key and the first verification code are accessed is small, it is highly probable that the first calibration data is tampered with or damaged. Therefore, the electronic device may determine that the first calibration data is unreliable.

[0093] In this way, by regenerating the second verification code and comparing the first verification code and the second verification code to determine whether the first calibration data is reliable, and then determining whether to update the first calibration data stored in the first storage area, the accuracy and reliability of the calibration data for calibrating the camera parameters of the camera module can be improved.

[0094] Step 103: When the verification result indicates that the first calibration data is unreliable, the electronic device updates the first calibration data stored in the first storage area based on the second calibration data.

[0095] In some embodiments of the present application, the above second calibration data may be calibration data burned in the storage unit of the camera module of the electronic device.

[0096] In some embodiments of the present application, the storage unit of the above camera module is in a read-only mode during the use stage of the electronic device. That is to say, during the use stage of the electronic device, the user can read data from the storage unit of the camera module, but cannot write data to the storage unit of the camera module.

[0097] Exemplarily, the storage unit of the above camera module can be a component in the camera module for storing OTP data. For example, the storage unit of the camera module can be an OTP storage component, an EEPROM, or a lower-cost data storage component.

[0098] In some embodiments of the present application, the above second calibration data can be burned into the storage unit of the camera module during the production stage of the camera module. Alternatively, the above second calibration data can be burned into the storage unit of the camera module during the production stage of the electronic device.

[0099] In some embodiments of the present application, the above second calibration data can be encrypted calibration data or unencrypted calibration data. Among them, the unencrypted calibration data can be calibration data generated after differential calibration of the camera module. In other words, the calibration data burned into the storage unit of the camera module can be calibration data generated after differential calibration of the camera module, or calibration data that is the encrypted version of the calibration data generated after differential calibration of the camera module.

[0100] Next, taking the case where the second calibration data is burned into the storage unit of the camera module during the production stage of the camera module as an example, the processes of burning unencrypted calibration data and encrypted calibration data into the storage unit of the camera module are respectively described through Example 1 and Example 2.

[0101] Example 1, during the production stage of the camera module, the calibration device on the production line performs differential calibration on the camera module to generate calibration data of the camera module, and then sends the generated calibration data of the camera module to the local server on the production line. After receiving the calibration data, the local server on the production line burns the received calibration data into the storage unit of the camera module. In this case, the calibration data burned into the storage unit of the camera module is unencrypted calibration data, that is, the above second calibration data is unencrypted calibration data.

[0102] Example 2, during the production stage of the camera module, the calibration device on the production line performs differential calibration on the camera module to generate calibration data of the camera module, and then sends the calibration data of the camera module to the local server on the production line. After receiving the calibration data, the local server on the production line encrypts the calibration data using an encryption algorithm to obtain encrypted calibration data, and then burns the encrypted calibration data into the storage unit of the camera module. In this case, the calibration data burned into the storage unit of the camera module is encrypted calibration data, that is, the above second calibration data is encrypted calibration data.

[0103] Exemplarily, the production line local server may encrypt the calibration data using an encryption algorithm such as a key encryption algorithm or a one-way hashing algorithm. For example, the above key encryption algorithm may include Data Encryption Standard (DES), Triple DES (3DES), International Data Encryption Algorithm (IDEA), Advanced Encryption Standard (AES), and so on. The above one-way hashing algorithm may include Secure Hash Algorithm (SHA), MAC algorithm, Cyclic Redundancy Check (CRC), and so on.

[0104] In this way, after encrypting the calibration data and then burning it into the storage unit of the camera module, even if the data is read from the storage unit without the decryption key (key), it cannot be used, improving the security of the calibration data.

[0105] In some embodiments of the present application, when the first calibration data is different from the reference calibration data, the electronic device may obtain the second calibration data from the storage unit of the camera module. Alternatively, when the first calibration data is different from the reference calibration data, the electronic device may obtain the second calibration data from the second storage area. Wherein, the second calibration data burned in the storage unit of the camera module of the electronic device is stored in the second storage area.

[0106] In some embodiments of the present application, the specific implementation of the electronic device updating the first calibration data stored in the first storage area based on the second calibration data may include: when the second calibration data is unencrypted calibration data, the electronic device may update the first calibration data in the first storage area to the second calibration data; when the second calibration data is encrypted calibration data, the electronic device may decrypt the second calibration data and update the first calibration data in the first storage area to the calibration data obtained after decrypting the second calibration data. In this way, it is ensured that the calibration data stored in the first storage area is unencrypted calibration data. Then, when the electronic device reads the calibration data from the first storage area, it can be used directly without decryption, which can improve the calibration efficiency.

[0107] In some embodiments of the present application, the calibration data stored in the above first storage area may be used to calibrate the camera parameters of the camera module of the electronic device. In other words, each time the camera is started, the electronic device may read the calibration data from the first storage area to calibrate the camera parameters of the camera module.

[0108] In this way, in the case where the calibration data in the first storage area may be tampered with, updating the calibration data stored in the first storage area based on the calibration data burned in the storage unit of the camera module can ensure the accuracy and reliability of the calibration data used to calibrate the camera parameters of the camera module subsequently read from the first storage area, and improve the security of the calibration data.

[0109] In some embodiments of the present application, when the verification result indicates that the first calibration data is reliable, it means that the first calibration data has not been tampered with or damaged, and the electronic device can release the first calibration data in the cache or RAM.

[0110] In the embodiments of the present application, by pre-storing the calibration data originally burned in the storage unit of the camera module in the first storage area, when using the camera of the electronic device each time, the calibration data can be read from the first storage area to calibrate the camera parameters of the camera module, without having to read from the storage unit of the camera module, reducing the power-on / off and data reading operations performed on the storage unit of the camera module, avoiding damage to the data stored in the storage unit of the camera module, thereby being able to avoid abnormal data reading and improving the accuracy of data reading. Moreover, each time the electronic device is powered on, the reliability of the first calibration data read from the first storage area is verified, and in the case where the first calibration data is unreliable, the first calibration data in the first storage area is updated based on the calibration data burned in the storage unit of the camera module to ensure that the calibration data stored in the first storage area of the electronic device is accurate, and further ensure that the calibration data used for calibrating the camera parameters of the camera module is reliable. Therefore, the solution of the present application can ensure the security of the calibration data, improve the accuracy and reliability of the calibration data, and further improve the accuracy and reliability of data reading.

[0111] In some embodiments of the present application, before the above step 103, the data processing method provided by the embodiments of the present application may further include the following step 100.

[0112] Step 100: The electronic device reads second calibration data from the second storage area.

[0113] In some embodiments of the present application, the above second storage area may be an area that does not release the stored data after power-off, that is, the above second storage area may be a storage area that can still store data after the electronic device is powered off.

[0114] In some embodiments of the present application, the above-mentioned second storage area may be all or part of the storage area of the second memory in the electronic device. Exemplarily, the second memory may be UFS, Flash memory, eMCP, or Programmable Read-Only Memory (PROM), etc.

[0115] In some embodiments of the present application, the above-mentioned second storage area, third storage area, and first storage area may be different storage areas in the same memory, that is, the second memory, third memory, and first memory are the same memory. Or, the above-mentioned second storage area, third storage area, and first storage area may be storage areas in three different memories respectively, that is, the second memory, third memory, and first memory are three different memories. Or, the above-mentioned second storage area and third storage area may be different storage areas in the same memory, that is, the second memory and third memory are the same memory. Or, the above-mentioned second storage area and first storage area may be different storage areas in the same memory, that is, the second memory and first memory are the same memory.

[0116] In some embodiments of the present application, the address segment in the above-mentioned second storage area may be a system idle address segment.

[0117] In some embodiments of the present application, the above-mentioned second storage area is in a read-only mode during the use stage of the electronic device.

[0118] In some embodiments of the present application, during the use stage of the electronic device, the above-mentioned second storage area can write data in the production mode and only has the function of reading data in the user mode and cannot write data. Among them, the production mode is a running mode in which the execution permissions of the application programs running on the electronic device are relatively high. In the production mode, the application programs running on the electronic device have higher execution permissions and can execute instructions at any level and access any area of the memory.

[0119] In some embodiments of the present application, the access permission of the above-mentioned second storage area is relatively high and it can only be accessed after an authentication application.

[0120] In some embodiments of the present application, both the access permission and security of the above-mentioned second storage area are higher than those of the first storage area and the third storage area, and the second storage area is the security bottom line for data storage. Or, the access permission and security of the above-mentioned second storage area are the same as those of the first storage area and the third storage area. The embodiments of the present application do not make any limitations in this regard.

[0121] It should be noted that the data stored in the above-mentioned second storage area will not be affected during the electronic device version upgrade and the flashing process.

[0122] In some embodiments of the present application, the second calibration data burned in the storage unit of the camera module is stored in the above-mentioned second storage area. The second calibration data can be encrypted calibration data or unencrypted calibration data.

[0123] In some embodiments of the present application, the electronic device can determine the address segment corresponding to the second storage area, such as the third address segment, from the recorded correspondence between the address segment and the storage area, and then read the data of the third address segment from the second storage area to obtain the second calibration data.

[0124] In some embodiments of the present application, the above-mentioned third address segment is the address information of the calibration data in the second storage area recorded when the electronic device pre-backups the calibration data for calibrating the camera parameters of the camera module in the second storage area.

[0125] In some embodiments of the present application, during the production stage of the electronic device, when writing the second calibration data into the second storage area, the electronic device can also determine the address segment in the second storage area used to store the second calibration data, obtain the third address segment, and then record the correspondence between the third address segment and the second storage area. Then, during the usage stage of the electronic device, when the first calibration data is unreliable, the electronic device can determine the address segment corresponding to the second storage area, such as the third address segment, from the recorded correspondence between the address segment and the storage area, and then read the data stored in the third address segment from the second storage area to obtain the second calibration data.

[0126] In some embodiments of the present application, before the above step 100, the data processing method provided by the embodiments of the present application may further include the following steps 11 and 12.

[0127] Step 11: The electronic device reads the second calibration data from the storage unit of the camera module.

[0128] In some embodiments of the present application, during the production stage of the camera module, the second calibration data is burned in the storage unit of the camera module of the electronic device.

[0129] It should be noted that the specific implementation of burning the second calibration data into the storage unit of the camera module of the electronic device can refer to the relevant description in the above step 103. To avoid repetition, it will not be elaborated here.

[0130] Step 12: The electronic device writes the second calibration data into the second storage area.

[0131] In some embodiments of the present application, during the production stage of the electronic device, after the electronic device is powered on, the storage unit of the camera module of the electronic device is powered on. The electronic device can read the second calibration data from the storage unit of the camera module, and then write the read second calibration data into the second storage area. That is to say, the second storage area stores a backup of the calibration data burned in the storage unit of the camera module.

[0132] In this way, during the production stage of the electronic device, a backup of the calibration data burned in the storage unit of the camera module is made in the second storage area of the electronic device. So that during the subsequent use stage of the electronic device, when the calibration data stored in the first storage area of the electronic device is unreliable, the correct calibration data can be obtained from the second storage area, instead of reading the calibration data from the storage unit of the camera module, which can not only ensure the accuracy and security of the calibration data, but also reduce the access to the storage unit of the camera module and reduce the damage to the storage unit.

[0133] It should be noted that the above steps 11 and 12 can be steps executed during the production stage of the electronic device, and the above steps 11 and 12 can be executed before the above step 101.

[0134] In an implementation manner of the embodiments of the present application, the "the electronic device updates the first calibration data stored in the first storage area based on the second calibration data" in the above step 103 can be specifically implemented through the following step 1031 or step 1032.

[0135] Step 1031: When the reference calibration data is the same as the second calibration data, the electronic device updates the first calibration data stored in the first storage area to the second calibration data.

[0136] In some embodiments of the present application, when the second calibration data is unencrypted calibration data, if the reference calibration data is the same as the second calibration data, it means that the reference calibration data has not been tampered with or damaged, that is, the reference calibration data is reliable, then the electronic device updates the first calibration data stored in the first storage area to the second calibration data.

[0137] In some embodiments of the present application, when the second calibration data is encrypted calibration data, if the reference calibration data is the same as the second calibration data, it means that the reference calibration data has not been tampered with or damaged, that is, the reference calibration data is reliable, then the electronic device decrypts the second calibration data to obtain the decrypted second calibration data, and updates the first calibration data stored in the first storage area to the decrypted second calibration data.

[0138] In some embodiments of the present application, the electronic device may temporarily store the read second calibration data in the cache or RAM of the electronic device. Then, the electronic device reads the second calibration data from the cache or RAM and decrypts it to obtain the decrypted second calibration data.

[0139] In some embodiments of the present application, the electronic device may use a decryption algorithm corresponding to the encryption algorithm in the above step 103 to decrypt the second calibration data to obtain the decrypted second calibration data.

[0140] It should be noted that the process of the electronic device decrypting the second calibration data and the process of the electronic device encrypting the calibration data in the above step 103 are reciprocal processes. To avoid repetition, it will not be elaborated here.

[0141] In this way, since the security of the second storage area is relatively high and the probability of being accessed is relatively small, the data stored in the second storage area is not easily tampered with and has relatively high security. Then, when the first calibration data is unreliable, the electronic device reads the second calibration data from the second storage area and updates the first calibration data stored in the first storage area with the second calibration data, which can ensure that the calibration data stored in the first storage area is accurate and improve the accuracy and reliability of the calibration data.

[0142] Step 1032: When the reference calibration data is different from the second calibration data, the electronic device updates the first calibration data stored in the first storage area and the reference calibration data stored in the third storage area to the second calibration data.

[0143] In some embodiments of the present application, when the second calibration data is unencrypted calibration data, if the reference calibration data is different from the second calibration data, it means that the reference calibration data has been tampered with or damaged, that is, the reference calibration data is unreliable. Then, the electronic device updates the first calibration data stored in the first storage area and the reference calibration data stored in the third storage area to the second calibration data.

[0144] In some embodiments of the present application, when the second calibration data is encrypted calibration data, if the reference calibration data is different from the second calibration data, it means that the reference calibration data has been tampered with or damaged, that is, the reference calibration data is unreliable. Then, the electronic device decrypts the second calibration data to obtain the decrypted second calibration data, and updates the first calibration data stored in the first storage area and the reference calibration data stored in the third storage area to the decrypted second calibration data.

[0145] It should be noted that the process of the electronic device decrypting the second calibration data and the process of the electronic device encrypting the calibration data in the above step 103 are reciprocal processes. To avoid repetition, it will not be elaborated here.

[0146] Thus, since the second storage area has a high level of security and a low probability of being accessed, the data stored in the second storage area is not easily tampered with and has a relatively high level of security. Then, when the first calibration data is unreliable, the electronic device reads the second calibration data from the second storage area and updates the first calibration data stored in the first storage area and the second calibration data stored in the third storage area with the second calibration data. This can not only ensure that the calibration data stored in the first storage area is accurate, improving the accuracy and reliability of the calibration data, so that accurate and reliable calibration data can be used to calibrate the camera parameters when the camera is started later, but also ensure the accuracy of the reference calibration data, improving the accuracy of the verification result when verifying the reliability of the first calibration data during the next power-on.

[0147] In another implementation manner of the present application, the second calibration data is encrypted calibration data. The step of "the electronic device updates the first calibration data stored in the first storage area based on the second calibration data" in step 103 can be specifically implemented through the following step 1031.

[0148] Step 1031: The electronic device calculates a third check code based on the first key and the second calibration data.

[0149] In some embodiments of the present application, the electronic device can decrypt the second calibration data to obtain the decrypted second calibration data, and then use the first key to obtain the third check code for the decrypted second calibration data using a message authentication algorithm.

[0150] It should be noted that the explanation of the message authentication algorithm can be referred to the relevant description in step 1023 above. To avoid repetition, it will not be elaborated here.

[0151] Step 1032: The electronic device updates the first calibration data stored in the first storage area to the second calibration data, and updates the first check code stored in the third storage area to the third check code.

[0152] Thus, since the second storage area has a high level of security and a low probability of being accessed, the data stored in the second storage area is not easily tampered with and has a relatively high level of security. Then, when the first calibration data is unreliable, the electronic device reads the second calibration data from the second storage area and updates the first calibration data stored in the first storage area and the second calibration data stored in the third storage area with the second calibration data. This can not only ensure that the calibration data stored in the first storage area is accurate, improving the accuracy and reliability of the calibration data, but also ensure the accuracy of the check code stored in the third storage area, improving the accuracy of the verification result during subsequent use.

[0153] In some embodiments of the present application, the data processing method provided by the embodiments of the present application may further include the following step 104.

[0154] Step 104: In response to the startup instruction of the camera module, the electronic device retrieves the calibration data stored in the first storage area and calibrates the camera parameters of the camera module.

[0155] In some embodiments of the present application, when the camera module of the electronic device starts up, in response to the startup instruction of the camera module, the electronic device determines the address segment corresponding to the first storage area from the recorded correspondence between the address segment and the storage area, for example, updates the address segment, then reads the calibration data of the updated address segment from the first storage area, and calibrates the camera parameters of the camera module based on the read calibration data.

[0156] In some embodiments of the present application, the above-mentioned updated address segment is the address information of the updated calibration data in the first storage area when the electronic device updates the calibration data in the first storage area.

[0157] In some embodiments of the present application, when the electronic device updates the first calibration data stored in the first storage area based on the second calibration data, it may also record the address segment used to store the updated calibration data in the first storage area to obtain the updated address segment, and then update the previously recorded address segment corresponding to the first storage area, for example, the first address segment, to obtain a new correspondence, that is, the correspondence between the updated address segment and the first storage area. Then, when the camera module of the electronic device starts up, in response to the startup instruction of the camera module, the electronic device determines the address segment corresponding to the first storage area from the recorded correspondence between the address segment and the storage area, for example, the updated address segment, and then reads the calibration data stored in the updated address segment from the first storage area, and calibrates the camera parameters of the camera module based on the read calibration data.

[0158] In some embodiments of the present application, the specific implementation of the electronic device retrieving the calibration data stored in the first storage area and calibrating the camera parameters of the camera module may include: the electronic device uses the LSC parameter to correct the lens shadow; or, the electronic device uses the AWB parameter to adjust the white balance parameter of the camera module; or, the electronic device uses the AF parameter to adjust the focusing mode and focusing area of the camera module; or, the electronic device uses the PDAF parameter to adjust the focusing speed and focusing accuracy of the camera module.

[0159] Exemplarily, taking the electronic device as a mobile phone and the camera module of the electronic device as the mobile phone camera, when the user opens the mobile phone camera, the electronic device can calibrate the camera parameters of the mobile phone camera based on the calibration data read from the first storage area. Then, when the user triggers the capture button, the mobile phone camera takes pictures according to the calibrated camera parameters.

[0160] In some embodiments of the present application, when the calibration data stored in the first storage area is unencrypted and preprocessed calibration data, after the electronic device retrieves the calibration data stored in the first storage area, it can directly calibrate the camera parameters based on the read calibration data. Alternatively, when the calibration data stored in the first storage area is unencrypted calibration data, after the electronic device retrieves the calibration data stored in the first storage area, it can preprocess the calibration data and then calibrate the camera parameters based on the preprocessed calibration data. Alternatively, when the calibration data stored in the first storage area is encrypted calibration data, after the electronic device retrieves the calibration data stored in the first storage area, it can decrypt the calibration data to obtain the decrypted calibration data, then preprocess the decrypted calibration data, and then calibrate the camera parameters based on the preprocessed calibration data.

[0161] It should be noted that the specific implementation of preprocessing the calibration data can refer to the relevant description in step 101 above. To avoid repetition, it will not be elaborated here.

[0162] In this way, when the electronic device is powered on, by verifying the reliability of the first calibration data stored in the first storage area, it is determined whether to update the first calibration data stored in the first storage area to ensure the accuracy of the calibration data stored in the first storage area. Then, when the user uses the camera of the electronic device, the electronic device directly reads the calibration data from the first storage area to calibrate the camera parameters, improving the accuracy and reliability of the calibration data reading, and further improving the accuracy of the camera parameter calibration, and a better photographing effect can be achieved.

[0163] It should be noted that the above step 104 can be executed after the above step 103.

[0164] In some embodiments of the present application, before the above step 101, the data processing method provided by the embodiments of the present application may further include the following steps 13 to 15.

[0165] Step 13: The electronic device reads second calibration data from the storage unit of the camera module.

[0166] In some embodiments of the present application, during the production stage of the camera module, second calibration data is burned into the storage unit of the camera module of the electronic device, and the second calibration data can be encrypted calibration data or unencrypted calibration data.

[0167] It should be noted that the specific implementation of burning the second calibration data into the storage unit of the camera module of the electronic device can refer to the relevant description in step 103 above. To avoid repetition, it will not be elaborated here.

[0168] In some embodiments of the present application, during the production stage of the electronic device, after the electronic device is powered on, the storage unit of the camera module of the electronic device is powered on, and the electronic device can read the second calibration data from the storage unit.

[0169] Step 14: When the second calibration data is encrypted calibration data, the electronic device decrypts the second calibration data to obtain the decrypted second calibration data, and writes the decrypted second calibration data into the first storage area.

[0170] In some embodiments of the present application, when the second calibration data is encrypted calibration data, the electronic device can use the decryption algorithm corresponding to the encryption algorithm in the above step 103 to decrypt the second calibration data to obtain the decrypted second calibration data. Then, the electronic device writes the decrypted second calibration data into the first storage area, that is, backs up the decrypted calibration data in the first storage area. In this way, when calibrating the camera parameters subsequently, the calibration data obtained from the first storage area can be directly used without decrypting again, shortening the time for calibrating the camera parameters and improving the calibration efficiency.

[0171] Step 15: When the second calibration data is unencrypted calibration data, the electronic device writes the second calibration data into the first storage area.

[0172] In some embodiments of the present application, when the second calibration data is unencrypted calibration data, the electronic device can back up the second calibration data in the first storage area. In this way, when calibrating the camera parameters subsequently, the calibration data can be directly obtained from the first storage area for use without accessing the components of the camera module multiple times.

[0173] In this way, during the production stage of the electronic device, the electronic device can pre-back up the unencrypted calibration data in the first storage area. Then, during the use stage of the electronic device, each time it is powered on, the calibration data stored in the first storage area is verified to ensure the reliability of the calibration data stored in the first storage area. Then, when the camera is started, the electronic device can read the reliable calibration data from the first storage area to calibrate the camera parameters, improving the accuracy and reliability of the calibration data.

[0174] It should be noted that the above step 14 and step 15 can be executed after the above step 12.

[0175] In some embodiments of the present application, before the above step 101, the embodiments of the present application can be executed in the order of step 11 - step 12 - step 14 and step 15 to pre-back up the second calibration data burned in the storage unit of the camera module in the second storage area and back up the unencrypted calibration data in the first storage area.

[0176] In some embodiments of the present application, the above step 14 can be specifically implemented through the following steps 141 to 143.

[0177] Step 141: When the second calibration data is encrypted calibration data, the electronic device decrypts the second calibration data to obtain the decrypted second calibration data.

[0178] Step 142: The electronic device calibrates the camera parameters of the camera module based on the decrypted second calibration data, and acquires an image through the calibrated camera module.

[0179] In some embodiments of the present application, the above decrypted second calibration data may include LSC parameters, AWB parameters, AF parameters, PDAF parameters, and so on.

[0180] In some embodiments of the present application, the specific implementation of the electronic device calibrating the camera parameters of the camera module based on the decrypted second calibration data may include: the electronic device uses the LSC parameters to correct the lens shadow; or, the electronic device uses the AWB parameters to adjust the white balance parameters of the camera module; or, the electronic device uses the AF parameters to adjust the focusing mode and focusing area of the camera module; or, the electronic device uses the PDAF parameters to adjust the focusing speed and focusing accuracy of the camera module. Then, the electronic device can start the camera and take a picture according to the calibrated camera parameters through the camera.

[0181] In some embodiments of the present application, the electronic device may temporarily store the decrypted second calibration data in the cache or RAM of the electronic device. Then, the electronic device reads the decrypted second calibration data from the cache or RAM for preprocessing, and then calibrates the camera parameters of the camera module based on the preprocessed decrypted second calibration data.

[0182] It should be noted that the specific implementation of the above preprocessing of the decrypted second calibration data can refer to the relevant description in the above step 101, and the specific implementation of the above calibration of the camera parameters of the camera module based on the preprocessed decrypted second calibration data can refer to the above relevant description. To avoid repetition, it will not be elaborated here.

[0183] Step 143: When the image quality of the acquired image meets the preset conditions, the electronic device writes the decrypted calibration data into the first storage area.

[0184] In some embodiments of the present application, the above preset conditions may be that all the image quality parameters used to evaluate the image quality reach the corresponding preset thresholds. Exemplarily, the above image quality parameters used to evaluate the image quality may include resolution, clarity, contrast, brightness, user rating, and so on. The above preset conditions may include that the resolution reaches the preset resolution threshold, the clarity reaches the preset clarity threshold, the contrast is within the preset contrast range, the brightness is within the preset brightness range, and the user rating is greater than the rating threshold.

[0185] It should be noted that the above preset resolution threshold, preset clarity threshold, preset contrast range, preset brightness range, and preset rating can all be set and adjusted according to actual needs, and the embodiments of the present application do not limit this.

[0186] In some embodiments of the present application, after the electronic device acquires an image through the calibrated camera module, the electronic device can obtain the image quality parameters of the acquired image, such as resolution, clarity, contrast, and brightness, and determine whether these image quality parameters reach the corresponding preset thresholds. Moreover, the electronic device can display the acquired image and display a rating option for the user to rate, and determine whether the user rating is greater than the rating threshold. In the case where the image quality parameters such as resolution, clarity, contrast, and brightness all reach the corresponding preset thresholds and the user rating is greater than the rating threshold, it can be determined that the image quality of the acquired image meets the preset conditions, that is, it is determined that the imaging effect of the camera module after calibrating the camera parameters reaches the expected effect.

[0187] In this way, it can be ensured that the calibration data written into the first storage area can make the imaging effect of the camera module reach the expected effect. Then, after calibrating the camera parameters of the camera module with the calibration data stored in the first storage area subsequently, the photographing effect of the electronic device can also reach the user's expectation, improving the user's photographing experience.

[0188] Furthermore, in the case where the second calibration data is encrypted calibration data, after the electronic device decrypts the second calibration data to obtain the decrypted second calibration data, it can also perform a security check on the decrypted second calibration data to obtain a check result. In the case where the check result indicates that the decrypted second calibration data is secure, the decrypted second calibration data is written into the first storage area. Or, in the case where the check result indicates that the decrypted second calibration data is secure, the above steps 142 and 143 are executed.

[0189] Exemplarily, the electronic device can use any one of a hash algorithm, a digital signature algorithm, a parity check algorithm, a check code, or a message authentication code to perform a security check on the decrypted second calibration data.

[0190] It should be noted that the security of the second calibration data after decryption mentioned above means that the second calibration data after decryption is complete and has not been tampered with.

[0191] Further, when the second calibration data is unencrypted calibration data, after the electronic device reads the second calibration data, it can perform a security check on the second calibration data to obtain a check result. When the check result indicates that the second calibration data is secure, the second calibration data is written into the first storage area. Alternatively, when the check result indicates that the second calibration data is secure, the electronic device calibrates the camera parameters of the camera module based on the second calibration data, and captures an image through the calibrated camera module. When the image quality of the captured image meets a preset condition, the electronic device writes the second calibration data into the first storage area.

[0192] In this way, by performing a security check on the calibration data to be written into the first storage area, the security and reliability of the calibration data written into the first storage area can be improved.

[0193] In an implementation manner of the embodiment of the present application, after the above step 13, when the second calibration data is unencrypted calibration data, the electronic device can write the second calibration data into the third storage area, that is, back up the second calibration data in the third storage area.

[0194] In another implementation manner of the embodiment of the present application, after the above step 13, when the second calibration data is encrypted calibration data, the electronic device uses the first key to decrypt the second calibration data to obtain the decrypted second calibration data, writes the decrypted second calibration data into the first storage area, and adopts a message authentication algorithm for the decrypted second calibration data based on the first key to obtain a first check code. Then the electronic device writes the first key and the first check code into the third storage area of the electronic device, that is, backs up the first key and the first verification code in the third storage area.

[0195] In some embodiments of the present application, during the production stage of the electronic device, when burning the encrypted calibration data into the storage unit of the camera module of the electronic device, the camera module identifier and the production batch information of the camera module, etc. of the camera module can also be encrypted and burned into the storage unit. In this case, before the electronic device writes the decrypted second calibration data into the first storage area in the above step 14, the electronic device can read the encrypted camera module identifier of the camera module from the storage unit of the camera module, then decrypt the encrypted camera module identifier to obtain the decrypted camera module identifier, and then perform a security check on the camera module based on the decrypted camera module identifier and the decrypted second calibration data. If the check result is secure, continue to write the decrypted second calibration data into the first storage area. If the check result is insecure, report an error.

[0196] Exemplarily, when the decrypted camera module identifier and the decrypted second calibration data conform to the preset naming rule, it is determined that the verification result is safe, that is, the camera module is the original camera module of the electronic device. When the decrypted camera module identifier and the decrypted second calibration data do not conform to the preset naming rule, it is determined that the verification result is unsafe, that is, the camera module is not the original camera module of the electronic device.

[0197] Next, taking the example of burning the encrypted calibration data and the encrypted camera module identifier into the EEPROM of the camera module of the mobile phone, the process of performing a security verification on the camera module during the production stage of the mobile phone is described. As Figure 3 shown, during the production stage of the mobile phone, the process of performing a security verification on the camera module may include step a1 to step a4.

[0198] Step a1: During the production stage of the mobile phone, after the mobile phone is powered on, the EEPROM of the camera module is powered on.

[0199] Step a2: The mobile phone reads the encrypted calibration data and the encrypted camera module identifier from the EEPROM.

[0200] Step a3: The mobile phone decrypts the encrypted calibration data and the encrypted camera module identifier respectively to obtain the decrypted calibration data and the decrypted camera module identifier.

[0201] Step a4: The mobile phone performs a security verification on the camera module based on the decrypted camera module identifier and the decrypted calibration data to determine whether the camera module is the original camera module of the electronic device.

[0202] In some embodiments of the present application, a camera module identifier is stored in the storage unit of the above camera module, and the camera module identifier is used to indicate a camera module. Before the above step 101, the data processing method provided by the embodiments of the present application may further include the following steps 16 and 17. Moreover, the "the electronic device reads the first calibration data from the first storage area of the electronic device" in the above step 101 may be specifically implemented by the following step 1011.

[0203] Step 16: The electronic device reads the camera module identifier from the storage unit of the camera module.

[0204] In some embodiments of the present application, the above camera module identifier may be an unencrypted camera module identifier or an encrypted camera module identifier.

[0205] In some embodiments of the present application, when the electronic device is powered on, the electronic device can obtain the address information of the camera module identifier from the recorded address information, such as a specific address segment, and then read the data of the specific address segment from the storage unit of the camera module to obtain the camera module identifier.

[0206] In some embodiments of the present application, the above specific address segment is the address information of the camera module identifier in the storage unit of the camera module recorded when the camera module identifier of the camera module is stored in the storage unit of the camera module in advance.

[0207] In some embodiments of the present application, taking the above camera module identifier as an unencrypted camera module identifier as an example, in the production stage of the camera module, the calibration device on the production line performs differential calibration on the camera module to generate calibration data of the camera module, and then sends the calibration data of the camera module and the camera module identifier of the camera module to the local server on the production line. The local server on the production line burns the received calibration data and camera module identifier into the storage unit of the camera module. And, the electronic device can determine the address segment in the storage unit of the camera module used to store the camera module identifier, such as a specific address segment, and record the specific address segment. Then, when the electronic device is powered on, the electronic device can obtain the specific address segment of the camera module identifier from the stored address information, and then read the data of the specific address segment from the storage unit of the camera module to obtain the unencrypted camera module identifier.

[0208] In some embodiments of the present application, taking the above camera module identifier as an encrypted camera module identifier as an example, in the production stage of the camera module, the calibration device on the production line performs differential calibration on the camera module to generate calibration data of the camera module, and then sends the calibration data of the camera module and the camera module identifier of the camera module to the local server on the production line. The local server on the production line encrypts the received calibration data and camera module identifier to obtain the encrypted calibration data and the encrypted camera module identifier, and then burns the encrypted calibration data and the encrypted camera module identifier into the storage unit of the camera module. And, the electronic device can determine the address segment in the storage unit of the camera module used to store the encrypted camera module identifier, such as a specific address segment, and record the specific address segment. Then, when the electronic device is powered on, the electronic device can obtain the specific address segment of the camera module identifier from the stored address information, and then read the data of the specific address segment from the storage unit of the camera module to obtain the encrypted camera module identifier.

[0209] It should be noted that the above method for encrypting the calibration data and the camera module identifier can refer to the relevant description in step 103 above. To avoid repetition, it will not be elaborated here.

[0210] Step 17: The electronic device performs a security check on the camera module identifier to obtain a check result, which is used to indicate whether the camera module indicated by the camera module identifier is the original camera module of the electronic device.

[0211] In some embodiments of the present application, when the camera module identifier read by the electronic device from the storage unit of the camera module is an encrypted camera module identifier, the electronic device may decrypt the encrypted camera module identifier using a decryption method corresponding to the encryption method to obtain the decrypted camera module identifier, and then the electronic device performs a security check on the decrypted camera module identifier.

[0212] In some embodiments of the present application, the specific implementation of the electronic device performing a security check on the decrypted camera module identifier may include: the electronic device compares the decrypted camera module identifier with the camera module identifier of the original camera module stored in the electronic device. If the two are the same, it is determined that the check result is secure, indicating that the camera module indicated by the decrypted camera module identifier is the original camera module of the electronic device; if the two are different, it is determined that the check result is insecure, indicating that the camera module indicated by the decrypted camera module identifier is not the original camera module of the electronic device, and the electronic device may report an error.

[0213] In some embodiments of the present application, the specific implementation of the electronic device performing a security check on the decrypted camera module identifier may include: the electronic device determines whether the decrypted camera module identifier conforms to a preset naming rule. If so, the check result is secure, indicating that the camera module indicated by the decrypted camera module identifier is the original camera module of the electronic device; if not, the check result is insecure, indicating that the camera module indicated by the decrypted camera module identifier is not the original camera module of the electronic device, and the electronic device may report an error.

[0214] It should be noted that in actual use, a method combining the above two methods may also be adopted to determine whether the camera module indicated by the decrypted camera module identifier is the original camera module of the electronic device.

[0215] In some embodiments of the present application, when the camera module identifier read by the electronic device from the storage unit of the camera module is an unencrypted camera module identifier, the electronic device may perform a security check on the read camera module identifier.

[0216] It should be noted that the specific implementation of the electronic device performing a security check on the read camera module identifier may refer to the relevant description of the electronic device performing a security check on the decrypted camera module identifier above. To avoid repetition, it will not be elaborated here.

[0217] Step 1011: When the verification result indicates that the camera module identified by the camera module identifier is the original camera module of the electronic device, the electronic device reads the first calibration data from the first storage area.

[0218] That is to say, when the electronic device is powered on, the electronic device first determines whether the currently installed camera module is the original camera module. And when the currently installed camera module is the original camera module, the subsequent calibration data reading process is then executed.

[0219] Next, taking the example of burning the encrypted camera module identifier into the EEPROM of the camera module of the mobile phone, the process of performing security verification on the camera module during the usage stage of the mobile phone will be described. As Figure 4 shown, during the usage stage of the mobile phone, the process of performing security verification on the camera module may include Step b1 to Step b4.

[0220] Step b1: During the usage stage of the mobile phone, after the mobile phone is powered on, the EEPROM of the camera module is powered on.

[0221] Step b2: The mobile phone reads the encrypted camera module identifier from the EEPROM.

[0222] Step b3: The mobile phone decrypts the encrypted camera module identifier data to obtain the decrypted camera module identifier.

[0223] Step b4: The mobile phone performs security verification on the decrypted camera module identifier to determine whether the camera module is the original camera module of the electronic device.

[0224] In this way, every time the electronic device is powered on, it is not necessary to read all the data stored in the storage unit of the camera module of the electronic device, such as calibration data and camera module identifier. Instead, only the camera module identifier in a smaller address segment needs to be read, which has a fast reading speed and low power consumption. And by judging whether the camera module of the electronic device is the original camera module through the camera module identifier, and when the camera module of the electronic device is the original camera module, then performing the subsequent steps, it can prevent the use of illegal camera modules or substandard camera modules, ensure the best photo-taking experience for users, reduce disputes between users and electronic device manufacturers due to poor photo-taking effects, and thus reduce the impact on the reputation of electronic device manufacturers.

[0225] Next, taking the example of the electronic device comparing the first calibration data with the reference calibration data to determine whether the first calibration data is reliable, combined with Figures 5 to 8 the data processing method provided by the embodiments of the present application will be described. Exemplarily, combining the above embodiments, it can be known that the data processing method provided by the embodiments of the present application may include three processes, namely Process One, Process Two, and Process Three. Among them:

[0226] Process 1 is the process of burning calibration data in the storage unit of the camera module. Process 1 is executed during the production stage of the camera module.

[0227] Exemplarily, the above Process 1 will be described below by taking the example of burning encrypted OTP data in the OTP storage component of the camera module. As Figure 5 shown, this Process 1 may include the following steps c1 to step c4.

[0228] Step c1: During the production stage of the camera module, the calibration device on the production line performs differential calibration on the camera module to generate the OTP data of the camera module.

[0229] Step c2: The calibration device on the production line sends the OTP data to the local server on the production line.

[0230] Step c3: The local server on the production line encrypts the OTP data using an encryption algorithm to obtain the encrypted OTP data.

[0231] Step c4: The local server on the production line burns the encrypted OTP data in the OTP storage component of the camera module.

[0232] Process 2 is the process of backing up calibration data in three storage areas of the electronic device. Process 2 is executed during the production stage of the electronic device.

[0233] Exemplarily, the above Process 2 will be described below by taking the example of backing up the encrypted OTP data burned in the OTP storage component of the camera module of the mobile phone in three storage areas of the mobile phone. As Figure 6 shown, this Process 2 may include the following steps d1 to step d12.

[0234] Step d1: The mobile phone is powered on.

[0235] Step d2: The OTP storage component of the camera module of the mobile phone is powered on.

[0236] Step d3: The mobile phone reads the encrypted OTP data from the OTP storage component.

[0237] Step d4: The mobile phone writes the encrypted OTP data into the high-level ROM-A of the mobile phone.

[0238] It should be noted that the above ROM-A is the above second storage area.

[0239] Step d5: The mobile phone decrypts the encrypted OTP data to obtain the decrypted OTP data, and performs a security check on the decrypted OTP data.

[0240] Step d6: In the case where the verification result indicates that the decrypted OTP data is not secure, the mobile phone reports an error.

[0241] Step d7: When the verification result indicates that the decrypted OTP data is secure, the mobile phone preprocesses the decrypted OTP data.

[0242] Step d8: The mobile phone temporarily stores the preprocessed decrypted OTP data in the DRAM of the mobile phone.

[0243] Step d9: The mobile phone uses the preprocessed decrypted OTP data to confirm the imaging effect of the camera module after calibrating the camera parameters.

[0244] Step d10: The mobile phone determines whether the imaging effect reaches the expected effect.

[0245] Step d11: If the imaging effect does not reach the expected effect, the mobile phone reports an error.

[0246] Step d12: If the imaging effect reaches the expected effect, the mobile phone writes the preprocessed decrypted OTP data into the high-level ROM-B and the ordinary ROM-C of the mobile phone respectively.

[0247] It should be noted that the above ROM-B is the above-mentioned third storage area, and the above ROM-C is the above-mentioned first storage area.

[0248] Process three is: the process of obtaining calibration data to calibrate the camera parameters of the camera module. Process three is executed during the use stage of the electronic device.

[0249] Exemplarily, the following will take the electronic device as a mobile phone, the storage unit of the camera module as an OTP storage component, and the calibration data burned in the storage unit of the camera module as encrypted OTP data as an example to illustrate the above process three. As Figure 7 shown, this process three may include the following steps e1 to step e13.

[0250] Step e1: The mobile phone is powered on.

[0251] Step e2: The OTP storage component of the camera module of the mobile phone is powered on.

[0252] Step e3: The mobile phone reads the camera module identifier of the camera module from a specific address segment of the OTP storage component.

[0253] Step e4: The mobile phone performs a security verification on the camera module identifier to determine the legitimacy of the camera module.

[0254] Step e5: If the verification result is insecure, the mobile phone reports an error.

[0255] Step e6: If the verification result is secure, the mobile phone compares whether the first calibration data read from ROM-C and the reference calibration data read from ROM-B are consistent.

[0256] It should be noted that the above ROM-B is the above-mentioned third storage area, and the above ROM-C is the above-mentioned first storage area.

[0257] Step e7: If not, the mobile phone authenticates and reads the second calibration data in ROM-A, and temporarily stores the second calibration data in the DRAM.

[0258] It should be noted that the above ROM-A is the above-mentioned second storage area.

[0259] Step e8: The mobile phone decrypts the second calibration data to obtain the decrypted calibration data.

[0260] Step e9: The mobile phone compares whether the decrypted calibration data is consistent with the reference calibration data.

[0261] Step e10: If so, the mobile phone updates the first calibration data stored in ROM-C to the decrypted calibration data.

[0262] Step e11: If not, the mobile phone updates both the first calibration data stored in ROM-C and the reference calibration data stored in ROM-B to the decrypted calibration data.

[0263] Step e12: When the mobile phone camera is started, the mobile phone reads the calibration data from ROM-C to calibrate the camera parameters of the camera module, and then uses the camera module with calibrated camera parameters to take pictures.

[0264] Step e13: The mobile phone camera is turned off.

[0265] Exemplarily, when the user turns on the camera again, the mobile phone returns to execute the above step e12. Then, after the mobile phone is powered on again, the mobile phone returns to execute the above step e3.

[0266] It should be noted that the specific implementation of each step in the above Process 1, Process 2, and Process 3 can refer to the relevant descriptions of the above embodiments. To avoid repetition, it will not be elaborated here.

[0267] Next, taking the electronic device as a mobile phone, the storage unit of the camera module as an EEPROM, and the encrypted calibration data and the encrypted camera module identifier stored in the storage unit of the camera module as an example, the data processing method provided by the embodiments of the present application will be described. As Figure 8 shown, the data processing method may include the following steps 201 to step 218.

[0268] Step 201: In the production stage of the mobile phone, after the mobile phone is powered on, the EEPROM is powered on, and the mobile phone reads the encrypted calibration data from the EEPROM.

[0269] Step 202: The mobile phone writes the encrypted calibration data into the ROM-A of the mobile phone.

[0270] It should be noted that the above ROM-A is the second storage area in the above embodiment.

[0271] Step 203: The mobile phone decrypts the encrypted calibration data to obtain the decrypted calibration data.

[0272] Step 204: The mobile phone performs a security check on the decrypted calibration data to obtain a first check result.

[0273] Step 205: When the first check result indicates that the decrypted calibration data is secure, the mobile phone uses the decrypted calibration data to calibrate the camera parameters of the camera and uses the camera with calibrated camera parameters to capture images.

[0274] Step 206: When the mobile phone determines that the image quality of the captured image meets the expectation, it writes the decrypted calibration data into the ROM-B and ROM-C of the mobile phone.

[0275] It should be noted that the above ROM-B is the third storage area in the above embodiment, and the above ROM-C is the first storage area in the above embodiment.

[0276] Step 207: During the usage stage of the mobile phone, after the mobile phone is powered on, it reads the encrypted camera module identifier from the EEPROM of the camera module.

[0277] Step 208: The mobile phone decrypts the encrypted camera module identifier to obtain the decrypted camera module identifier, and performs a security check on the decrypted camera module identifier to obtain a second check result.

[0278] Step 209: When the second check result indicates that the camera module is an original camera module, the mobile phone reads the first calibration data from the ROM-C and reads the reference calibration data from the ROM-B.

[0279] Step 210: The mobile phone determines whether the first calibration data is the same as the reference calibration data. If not, it executes step 211; if so, it executes step 216.

[0280] Step 211: The mobile phone reads the encrypted calibration data from the ROM-A.

[0281] Step 212: The mobile phone decrypts the encrypted calibration data to obtain the decrypted calibration data.

[0282] Step 213: The mobile phone determines whether the reference calibration data is the same as the decrypted calibration data. If so, it executes step 214; if not, it executes step 215.

[0283] Step 214: The mobile phone updates the first calibration data in ROM-C to the decrypted calibration data.

[0284] Step 215: The mobile phone updates both the reference calibration data in ROM-B and the first calibration data in ROM-C to the decrypted calibration data.

[0285] Step 216: When the camera in the mobile phone is started, the mobile phone reads the calibration data from ROM-C and calibrates the camera parameters of the camera using the read calibration data.

[0286] Step 217: After the camera of the mobile phone is turned off and then turned on again, return to execute the above Step 216.

[0287] Step 218: After the mobile phone is turned off and then turned on again, return to execute the above Step 207.

[0288] It should be noted that the specific implementation processes of the above Steps 201 to 218 can refer to the relevant descriptions of the above embodiments. To avoid repetition, they will not be elaborated herein.

[0289] The data processing method provided in the embodiments of the present application is different from the solution in the related art that lacks security verification and powers on the EEPROM and reads calibration data every time the device is powered on. In this solution, the encrypted calibration data is stored in the EEPROM of the camera module and cannot be easily decrypted, which improves the security of the calibration data to a certain extent. Moreover, during the production stage of the electronic device, the electronic device reads the calibration data from the EEPROM of the camera module, preprocesses and makes three backups of the read calibration data. Then, during each power-on process, instead of reading a large amount of data from the EEPROM of the camera module and performing processing, it reads the encrypted identification data in a smaller address segment, with a fast reading speed and reduced power consumption during startup. Also, by confirming the legitimacy of the camera module through the read identification data, the use of illegal camera modules is eliminated, ensuring the best experience for users. Additionally, since the above solution only reads the identification data from the EEPROM of the camera module once during each power-on, there is no need to perform repeated power-on and power-off and read operations on the EEPROM of the camera module, avoiding damage to the EEPROM and thus avoiding abnormal photographing situations caused by component damage. And since the EEPROM is essentially an "OTP transfer tool" from the camera module to the entire machine, this solution only requires a one-time read instead of the traditional requirement of more than ten thousand reads and writes, so components with lower performance and lower cost can be selected to store the calibration data, reducing the production cost.

[0290] Next, taking the example of the electronic device comparing the first verification code and the second verification code to determine whether the first calibration data is reliable, in combination with Figure 9A description is given of the data processing method provided in the embodiments of the present application. As Figure 9 shown, the data processing method may include the following steps 301 to step 318.

[0291] Step 301, during the production stage of the mobile phone, after the mobile phone is powered on, the EEPROM is powered on, and the mobile phone reads the encrypted calibration data from the EEPROM.

[0292] Step 302, the mobile phone writes the encrypted calibration data into the ROM-A of the mobile phone.

[0293] It should be noted that the above ROM-A is the second storage area in the above embodiments.

[0294] Step 303, the mobile phone decrypts the encrypted calibration data to obtain the decrypted calibration data.

[0295] Step 304, the mobile phone performs a security check on the decrypted calibration data to obtain a first check result.

[0296] Step 305, when the first check result indicates that the decrypted calibration data is reliable, the mobile phone uses the decrypted calibration data to calibrate the camera parameters of the camera, and uses the camera with calibrated camera parameters to capture images.

[0297] Step 306, when the mobile phone determines that the image quality of the captured image meets the expectation, the mobile phone writes the decrypted calibration data into the ROM-C of the mobile phone, and uses the message authentication algorithm for the decrypted calibration data based on the first key to obtain a first check code, and writes the first key and the first check code into the ROM-B.

[0298] It should be noted that the above ROM-B is the third storage area in the above embodiments, and the above ROM-C is the first storage area in the above embodiments.

[0299] Step 307, during the use stage of the mobile phone, after the mobile phone is powered on, it reads the encrypted camera module identifier from the EEPROM of the camera module.

[0300] Step 308, the mobile phone decrypts the encrypted camera module identifier to obtain the decrypted camera module identifier, and performs a security check on the decrypted camera module identifier to obtain a second check result.

[0301] Step 309, when the second check result indicates that the camera module is an original camera module, the mobile phone reads the first calibration data from the ROM-C, and reads the first key and the first check code from the ROM-B.

[0302] Step 310, the mobile phone uses the message authentication algorithm for the first calibration data based on the first key to obtain a second check code.

[0303] Step 311: The mobile phone determines whether the first verification code is the same as the second verification code. If not, step 312 is executed; if so, step 317 is executed.

[0304] Step 312: The mobile phone reads the encrypted calibration data from ROM-A.

[0305] Step 313: The mobile phone decrypts the encrypted calibration data to obtain the decrypted calibration data.

[0306] Step 314: The mobile phone uses a message authentication algorithm on the decrypted calibration data based on the first key to obtain a third verification code.

[0307] Step 315: The mobile phone updates the first verification code in ROM-B to the third verification code and updates the first calibration data in ROM-C to the decrypted calibration data.

[0308] Step 316: When the camera in the mobile phone is started, the mobile phone reads the calibration data from ROM-C and calibrates the camera parameters of the camera using the read calibration data.

[0309] Step 317: After the camera of the mobile phone is turned off and then turned on again, return to execute step 316 above.

[0310] Step 318: After the mobile phone is turned off and then turned on again, return to execute step 307 above.

[0311] It should be noted that the specific implementation processes of the above steps 301 to 318 can refer to the relevant descriptions of the above embodiments. To avoid repetition, they are not elaborated herein in this embodiment.

[0312] The data processing method provided by the embodiment of the present application pre-stores the calibration data originally burned in the storage unit of the camera module in the first storage area, so that when the camera of the electronic device is used each time, the calibration data can be read from the first storage area to calibrate the camera parameters of the camera module, without having to read from the storage unit of the camera module, reducing the power-on / off and data reading operations performed on the storage unit of the camera module, avoiding damage to the data stored in the storage unit of the camera module, and thus being able to avoid abnormal data reading and improve the accuracy of data reading. Moreover, each time the electronic device is powered on, the reliability of the first calibration data read from the first storage area is verified, and in the case where the first calibration data is unreliable, the calibration data burned in the storage unit of the camera module is used to update the first calibration data in the first storage area to ensure that the calibration data stored in the first storage area of the electronic device is accurate, and further ensure that the calibration data used for calibrating the camera parameters of the camera module is reliable. Therefore, the solution of the present application can ensure the security of the calibration data, improve the accuracy and reliability of the calibration data, and further improve the accuracy and reliability of data reading.

[0313] It should be noted that each of the above method embodiments, or various possible implementation manners in each method embodiment, can be executed independently, or any two or more of them can be combined with each other, which can be specifically determined according to actual usage requirements, and the embodiments of the present application do not limit this.

[0314] The data processing method provided by the embodiment of the present application may be executed by a data processing device, and the data processing device may be an electronic device. In the embodiment of the present application, taking the electronic device executing the data processing method as an example, the electronic device provided by the embodiment of the present application is described.

[0315] Figure 10 FIG. is a schematic structural diagram of the electronic device provided by the embodiment of the present application. The electronic device may include a first storage area 401, a camera module 402, and a processor 403. The camera module 402 may include a storage unit 4021. The processor 403 is connected to the first storage area 401 and the camera module 402.

[0316] The above-mentioned first storage area 401 is used to store the calibration data for calibrating the camera parameters of the camera module 402 of the electronic device. The first storage area 401 is an area that does not release the stored data after power-off, and the first storage area 401 is in a readable mode during the use stage of the electronic device.

[0317] The above-mentioned processor 403 is configured to, when the electronic device is powered on, read first calibration data from the first storage area 401; and verify the first calibration data to obtain a verification result, where the verification result indicates the reliability of the first calibration data; and, in the case where the verification result indicates that the first calibration data is unreliable, update the first calibration data stored in the first storage area 401 based on the second calibration data.

[0318] The above-mentioned storage unit 4021 is configured to store the burned second calibration data, and this storage unit 4021 is in a read-only mode during the use stage of the electronic device.

[0319] In some embodiments of the present application, in combination with Figure 10 , such as Figure 11 shown, the above-mentioned electronic device may further include a second storage area 404, and this second storage area 404 is connected to the above-mentioned processor 403.

[0320] The above-mentioned second storage area 404 is configured to store the second calibration data burned in the storage unit 4021 of the above-mentioned camera module 402. This second storage area 404 is an area that does not release the stored data after power-off, and this second storage area 404 is in a read-only mode during the use stage of the electronic device.

[0321] The above-mentioned processor 403 is further configured to read the second calibration data from the second storage area 404 before updating the first calibration data stored in the first storage area 401 based on the second calibration data.

[0322] In some embodiments of the present application, such as Figure 11 shown, the above-mentioned electronic device may further include a third storage area 405, and this third storage area 405 is connected to the above-mentioned processor 403.

[0323] The above-mentioned third storage area 405 is configured to store reference calibration data. This third storage area 405 is an area that does not release the stored data after power-off, and this third storage area 405 is in a readable mode during the use stage of the electronic device.

[0324] The above-mentioned processor 403 is specifically configured to read reference calibration data from the third storage area 405 of the electronic device; and compare the first calibration data with the reference calibration data to obtain a verification result.

[0325] In some embodiments of the present application, the processor 403 is specifically configured to determine that the verification result indicates that the first calibration data is unreliable in the case where the first calibration data is different from the reference calibration data.

[0326] In some embodiments of the present application, the above-mentioned processor 403 is specifically configured to update the first calibration data stored in the first storage area 401 to the second calibration data when the reference calibration data is the same as the second calibration data; or, when the reference calibration data is different from the second calibration data, update the first calibration data stored in the first storage area 401 and the reference calibration data stored in the third storage area 405 to the second calibration data.

[0327] In some embodiments of the present application, the above-mentioned processor 403 is specifically configured to read the first key and the first check code of the first calibration data from the third storage area 405 of the electronic device, where the third storage area 405 is an area that does not release stored data after power-off; and, generate a second check code based on the first key and the first calibration data; and, compare the first check code with the second check code to obtain a verification result.

[0328] In some embodiments of the present application, the above-mentioned processor 403 is specifically configured to determine that the verification result indicates that the first calibration data is unreliable when the first check code is different from the second check code.

[0329] In some embodiments of the present application, the second calibration data is encrypted calibration data. The above-mentioned processor 403 is specifically configured to calculate a third check code based on the first key and the second calibration data; and, update the first calibration data stored in the first storage area 401 to the second calibration data, and update the first check code stored in the third storage area 405 to the third check code.

[0330] In some embodiments of the present application, the above-mentioned processor 403 is further configured to, in response to a start instruction of the camera module 402, retrieve the calibration data stored in the first storage area 401 and calibrate the camera parameters of the camera module 402.

[0331] In some embodiments of the present application, the above-mentioned processor 403 is further configured to, when the electronic device is powered on, before reading the first calibration data from the first storage area 401 of the electronic device, read the second calibration data from the storage unit 4021 of the camera module 402. When the second calibration data is encrypted calibration data, decrypt the second calibration data to obtain the decrypted second calibration data, and write the decrypted second calibration data into the first storage area 401; or, when the second calibration data is unencrypted calibration data, write the second calibration data into the first storage area 401.

[0332] In some embodiments of the present application, the storage unit 4021 of the above-mentioned camera module 402 is further configured to store a camera module identifier, and the camera module identifier is used to indicate a camera module 402.

[0333] The above-mentioned processor 403 is further configured to, when the electronic device is powered on, read the camera module identifier from the storage unit 4021 of the camera module 402 before reading the first calibration data from the first storage area 401 of the electronic device; and perform a security check on the camera module identifier to obtain a check result, where the check result is used to indicate whether the camera module 402 indicated by the camera module identifier is the original camera module of the electronic device.

[0334] Specifically, when the electronic device is powered on, the above-mentioned processor 403 is configured to read the first calibration data from the first storage area 401 when the check result indicates that the camera module 402 indicated by the camera module identifier is the original camera module of the electronic device.

[0335] In the electronic device provided in the embodiment of the present application, the calibration data originally burned in the storage unit of the camera module is pre-stored in the first storage area, so that when the camera of the electronic device is used each time, the calibration data can be read from the first storage area to calibrate the camera parameters of the camera module, without having to read from the storage unit of the camera module, reducing the power-on / off and data reading operations performed on the storage unit of the camera module, avoiding damage to the data stored in the storage unit of the camera module, thereby being able to avoid abnormal data reading and improving the accuracy of data reading. Moreover, when the electronic device is powered on each time, the reliability of the first calibration data read from the first storage area is verified, and when the first calibration data is unreliable, the calibration data burned in the storage unit of the camera module is used to update the first calibration data in the first storage area to ensure that the calibration data stored in the first storage area of the electronic device is accurate, and further ensure that the calibration data used for calibrating the camera parameters of the camera module is reliable. Therefore, the solution of the present application can ensure the security of the calibration data, improve the accuracy and reliability of the calibration data, and further improve the accuracy and reliability of data reading.

[0336] The data processing device in the embodiment of the present application can be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices other than terminals. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a handheld computer, a vehicle-mounted electronic device, a mobile Internet device, an augmented reality / virtual reality device, a robot, a wearable device, a super mobile personal computer, a netbook, or a personal digital assistant, etc., and can also be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc. The embodiment of the present application does not make specific limitations.

[0337] The data processing device in the embodiments of the present application can be a device with an operating system. The operating system can be the Android operating system, the iOS operating system, or other possible operating systems, which are not specifically limited in the embodiments of the present application.

[0338] The data processing device provided in the embodiments of the present application can implement each process implemented by the above-mentioned data processing method. To avoid repetition, details are not described herein again.

[0339] It should be noted that in this article, the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the phrase "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in a reverse order according to the functions involved. For example, the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0340] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions for causing a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application.

[0341] The embodiments of the present application have been described above with reference to the accompanying drawings. However, the present application is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Under the inspiration of the present application, those of ordinary skill in the art can also make many forms without departing from the purpose of the present application and the scope protected by the claims, and all of them belong to the protection scope of the present application.

Claims

1. A data processing method, characterized in that: The method comprises: When the electronic device is turned on, first calibration data is read from a first storage area of ​​the electronic device, the first storage area is an area where stored data is not released after power failure, and the first storage area is in a readable mode during the use phase of the electronic device; Verifying the first calibration data to obtain a verification result, wherein the verification result indicates reliability of the first calibration data; If the verification result indicates that the first calibration data is unreliable, updating the first calibration data stored in the first storage area based on second calibration data; The second calibration data is calibration data burned into a storage unit of a camera module of the electronic device, the calibration data stored in the first storage area is used to calibrate camera parameters of the camera module of the electronic device, and the storage unit of the camera module is in read-only mode during the use phase of the electronic device.

2. The method according to claim 1, characterized in that Before updating the first calibration data stored in the first storage area based on the second calibration data, the method further includes: The second calibration data is read from a second storage area, the second storage area is an area where the stored data is not released after power failure, the second storage area is in read-only mode during the use phase of the electronic device, and the second storage area stores the second calibration data burned in the storage unit of the camera module.

3. The method according to claim 1 or 2, characterized in that: The verifying the first calibration data to obtain a verification result includes: Reading reference calibration data from a third storage area of ​​the electronic device, wherein the third storage area is an area where stored data is not released after power failure, and the third storage area is in a readable mode during the use phase of the electronic device; The first calibration data is compared with the reference calibration data to obtain the verification result.

4. The method according to claim 3, characterized in that The comparing the first calibration data with the reference calibration data to obtain the verification result includes: In the event that the first calibration data is different from the reference calibration data, it is determined that the verification result indicates that the first calibration data is unreliable.

5. The method according to claim 3, characterized in that: The updating of the first calibration data stored in the first storage area based on the second calibration data includes: When the reference calibration data is identical to the second calibration data, updating the first calibration data stored in the first storage area to the second calibration data; or, In a case where the reference calibration data is different from the second calibration data, the first calibration data stored in the first storage area and the reference calibration data stored in the third storage area are updated to the second calibration data.

6. The method according to claim 1 or 2, characterized in that: The first calibration data is encrypted calibration data, and the verifying the first calibration data to obtain a verification result includes: Reading a first key and a first verification code of the first calibration data from a third storage area of ​​the electronic device, wherein the third storage area is an area where stored data is not released after power failure; generating a second verification code based on the first key and the first calibration data; The first verification code is compared with the second verification code to obtain the verification result.

7. The method according to claim 6, characterized in that The comparing the first verification code with the second verification code to obtain the verification result includes: In a case where the first verification code is different from the second verification code, it is determined that the verification result indicates that the first calibration data is unreliable.

8. The method according to claim 6, characterized in that The second calibration data is encrypted calibration data, and updating the first calibration data stored in the first storage area based on the second calibration data includes: Calculate a third verification code based on the first key and the second calibration data; The first calibration data stored in the first storage area is updated to the second calibration data, and the first check code stored in the third storage area is updated to the third check code.

9. The method according to claim 1, characterized in that: The method further comprises: In response to a start-up instruction of the camera module, the calibration data stored in the first storage area is retrieved to calibrate the camera parameters of the camera module.

10. The method according to claim 1, characterized in that When the electronic device is powered on, before reading the first calibration data from the first storage area of ​​the electronic device, the method further includes: Reading the second calibration data from a storage unit of the camera module; In the case where the second calibration data is encrypted calibration data, decrypting the second calibration data to obtain decrypted second calibration data, and writing the decrypted second calibration data into the first storage area; In a case where the second calibration data is unencrypted calibration data, the second calibration data is written into the first storage area.

11. The method according to claim 1, characterized in that: A camera module identifier is stored in the storage unit of the camera module, and the camera module identifier is used to indicate a camera module; When the electronic device is powered on, before reading the first calibration data from the first storage area of ​​the electronic device, the method further includes: Reading the camera module identification from a storage unit of the camera module; Performing a security check on the camera module identifier to obtain a check result, wherein the check result is used to indicate whether the camera module indicated by the camera module identifier is an original camera module of the electronic device; The step of reading the first calibration data from the first storage area of ​​the electronic device when the electronic device is turned on includes: When the electronic device is turned on, if the verification result indicates that the camera module indicated by the camera module identifier is an original camera module of the electronic device, the first calibration data is read from the first storage area.

12. An electronic device, characterized in that: The system comprises a first storage area, a camera module and a processor, wherein the camera module comprises a storage unit, and the processor is connected to the first storage area and the camera module; The first storage area is used to store calibration data for camera parameter calibration of a camera module of the electronic device, the first storage area is an area where the stored data is not released after power failure, and the first storage area is in a readable mode during the use phase of the electronic device; The storage unit is used to store the burned second calibration data, and the storage unit is in a read-only mode during the use phase of the electronic device; The processor is configured to read the first calibration data from the first storage area when the electronic device is turned on; and verify the first calibration data to obtain a verification result, wherein the verification result indicates the reliability of the first calibration data; And, in a case where the verification result indicates that the first calibration data is unreliable, the first calibration data stored in the first storage area is updated based on second calibration data.