A calibration method and electronic device
By establishing an interface between the calibration application and the sensor in the electronic device, and using the processor to perform automatic calibration data acquisition and calculation, the problem of complex sensor calibration process and low accuracy is solved, and the effects of simplifying the calibration process and improving calibration accuracy are achieved.
Patent Information
- Application Number
- CN202110741732.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-30
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-06-30
AI Technical Summary
The sensor calibration process in the existing technology is complex and low in accuracy, and cannot adapt to the structural differences of different electronic products, resulting in differences in calibration data.
By establishing a communication connection between the calibration application and the sensor's running test interface, the processor is used to obtain calibration data, measurements related to the sensor type and calibration type are made, and calibration data is generated through mean calculation to realize automatic calibration of the sensor.
It simplifies the sensor calibration process, improves calibration accuracy, and ensures the applicability and performance of the sensor in different electronic products.
Smart Images

Figure CN113447064B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a calibration method and electronic equipment. Background Art
[0002] Sensors are important components in electronic products, and sensors usually have accuracy requirements. Therefore, sensors need to be calibrated frequently during the operation of electronic products to ensure that the accuracy of the sensors meets the accuracy requirements.
[0003] Different electronic products (brands and models) have different structural designs. Consequently, the placement of sensors within these products also varies, leading to discrepancies in calibration data. Therefore, even if the sensors within these products are the same model, sensor calibration is required for all electronic products with different structural designs.
[0004] The existing technology can only perform simple calibration. Since the sensor to be calibrated and the processor in the electronic product are independent of each other, the calibration process of the sensor to be calibrated in the electronic product in the existing technology is relatively complicated and the calibration accuracy is not high. Summary of the Invention
[0005] The purpose of the present invention is to provide a calibration method and electronic equipment to achieve the purpose of simplifying the sensor calibration process and improving the sensor calibration accuracy.
[0006] The technical solutions provided by the present invention are as follows:
[0007] The present invention provides a calibration method, comprising the steps of:
[0008] Establishing a communication connection between an application interface of a calibration application and an operation test interface of a sensor to be calibrated, and respectively connecting the calibration application and the sensor to be calibrated to a processor;
[0009] The calibration application triggers the run test interface to start a calibration thread to obtain calibration data;
[0010] The processor calibrates the sensor to be calibrated according to the calibration data, and obtains a corresponding calibration result from the sensor to be calibrated.
[0011] Furthermore, the calibration application triggers the run test interface to start a calibration thread to obtain calibration data, including the following steps:
[0012] Acquiring calibration input parameters through the calibration application; the calibration input parameters include sensor type information and calibration type information;
[0013] The calibration application transmits the calibration input parameters to the operation test interface corresponding to the sensor type information through the processor;
[0014] The sensor to be calibrated performs measurement according to the calibration type information to obtain measurement data, and transmits the measurement value to the processor;
[0015] The processor obtains corresponding calibration data according to the received measurement data.
[0016] Furthermore, the processor generates corresponding calibration data according to the received measurement data, comprising the steps of:
[0017] The processor periodically obtains the measurement data through the operation test interface at a preset time interval;
[0018] The processor deletes the maximum value and the minimum value in the measurement data, and performs mean calculation on the remaining measurement data;
[0019] The processor obtains calibration data according to the mean value calculation result.
[0020] Furthermore, the processor calibrates the sensor to be calibrated according to the calibration data, and obtains a corresponding calibration result from the sensor to be calibrated, including the steps of:
[0021] The processor sends the calibration data to the operation test interface, so that the sensor to be calibrated is calibrated according to the calibration data;
[0022] After completing the calibration operation, the sensor to be calibrated performs measurement again to obtain a test result, and transmits the test result to the processor;
[0023] The processor performs a difference calculation between the set value in the calibration type information and the test result;
[0024] When the difference calculation result is greater than a preset threshold, the processor determines that the calibration result is a calibration failure;
[0025] When the difference calculation result is less than a preset threshold, the processor determines that the calibration result is a successful calibration.
[0026] Furthermore, after the processor calibrates the sensor to be calibrated according to the calibration data and obtains a corresponding calibration result from the sensor to be calibrated, the following steps are included:
[0027] The processor transmits the calibration data and calibration results to the calibration application for display.
[0028] The present invention also provides an electronic device, comprising: a calibration application, a processor, and a sensor to be calibrated;
[0029] The calibration application includes an application interface, and the sensor to be calibrated includes a running test interface; the application interface of the calibration application and the running test interface of the sensor to be calibrated are connected to each other; the calibration application and the sensor to be calibrated are respectively connected to the processor;
[0030] The calibration application is used to trigger the run test interface to start a calibration thread to obtain calibration data;
[0031] The processor is configured to calibrate the sensor to be calibrated according to the calibration data, and obtain a corresponding calibration result from the sensor to be calibrated.
[0032] Furthermore, the calibration application includes: an input module; the sensor to be calibrated includes a measurement module;
[0033] An input module, configured to obtain calibration input parameters, wherein the calibration input parameters include sensor type information and calibration type information;
[0034] The application interface is used to transmit the calibration input parameters to the operation test interface corresponding to the sensor type information through the processor;
[0035] The measurement module is configured to perform measurement according to the calibration type information and obtain measurement data;
[0036] The operation test interface is used to transmit the measured value to the processor;
[0037] The processor is further configured to obtain corresponding calibration data according to the received measurement data.
[0038] Furthermore, the processor includes:
[0039] An acquisition module, configured to periodically acquire the measurement data through the operation test interface at a preset time interval;
[0040] The calculation module is used to delete the maximum value and the minimum value in the measurement data, perform mean calculation on the remaining measurement data, and obtain calibration data according to the mean calculation result.
[0041] Furthermore, the processor further includes: a processing module;
[0042] The processor is further configured to send the calibration data to the operation test interface;
[0043] The measuring module is further configured to perform calibration according to the calibration data, and after completing the calibration operation, perform measurement again to obtain a test result;
[0044] The running test interface is further used to transmit the test result to the processor;
[0045] The processing module is used to perform a difference calculation between the set value in the calibration type information and the test result; when the difference calculation result is greater than a preset threshold, the sensor to be calibrated determines that the calibration result is a calibration failure; when the difference calculation result is less than the preset threshold, the sensor to be calibrated determines that the calibration result is a calibration success.
[0046] Furthermore, the processor is further configured to transmit the calibration data and calibration results to the calibration application for display.
[0047] The calibration method and electronic equipment provided by the present invention can simplify the sensor calibration process and improve the sensor calibration accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The preferred implementation scheme will be described below in a clear and understandable manner with reference to the accompanying drawings to further illustrate the above-mentioned characteristics, technical features, advantages and implementation methods of a calibration method and electronic device.
[0049] Figure 1 is a flow chart of an embodiment of a calibration method of the present invention;
[0050] Figure 2 is a flow chart of another embodiment of a calibration method of the present invention;
[0051] Figure 3 is a flow chart of another embodiment of a calibration method of the present invention;
[0052] Figure 4 is a flow chart of another embodiment of a calibration method of the present invention;
[0053] Figure 5 It is a structural diagram of an embodiment of an electronic device of the present invention. DETAILED DESCRIPTION
[0054] In the following description, specific details such as specific system structures and technologies are provided for illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obstructing the description of the present application with unnecessary details.
[0055] It will be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections.
[0056] To simplify the drawings, only the parts relevant to the present invention are schematically shown in each figure. They do not represent the actual structure of the product. Furthermore, to simplify the drawings and facilitate understanding, in some figures, only one of the components with the same structure or function is schematically depicted or labeled. As used herein, "one" not only means "only one" but also "more than one."
[0057] It should be further understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0058] In addition, in the description of the present application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0059] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the specific embodiments of the present invention will be described below with reference to the accompanying drawings. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings and other embodiments can be obtained based on these drawings without inventive work.
[0060] One embodiment of the present invention, as Figure 1 As shown, a calibration method includes:
[0061] S100 establishes a communication connection between an application interface of a calibration application and an operation test interface of a sensor to be calibrated, and establishes connections between the calibration application and the sensor to be calibrated and a processor respectively;
[0062] Specifically, the sensors to be calibrated include but are not limited to gyroscopes, distance sensors, light sensors, lidars and other ranging sensors, as well as temperature sensors, pressure sensors, humidity sensors, gyroscopes and the like. The runtest interface refers to the runtest interface of the sensor to be calibrated. The electronic device includes a processor and a sensor to be calibrated. In addition, the electronic device can be installed with a calibration application. In this way, the calibration application in the electronic device establishes a connection with the processor via wireless means, the sensor to be calibrated establishes a connection with the processor via wired or wireless means, and a communication connection is established between the application interface of the calibration application and the runtest interface of the sensor to be calibrated.
[0063] Exemplarily, the sensor to be calibrated uses a runtest interface to establish a communication connection with a processor (eg, an ADSP chip). The runtest interface includes sensor_open, sensor_write(), and sensor_close() interfaces.
[0064] S200: the calibration application triggers the run test interface to start a calibration thread to obtain calibration data;
[0065] S300 The processor calibrates the sensor to be calibrated according to the calibration data, and obtains a corresponding calibration result from the sensor to be calibrated.
[0066] The present invention provides a calibration application program by itself, which communicates with the running test interface of the sensor to be calibrated through the application interface provided by the electronic device. Then, the electronic device starts a calibration thread under the running test interface, and obtains calibration data obtained by testing the sensor to be calibrated during the calibration thread through the running test interface. Then, the electronic device calibrates the sensor to be calibrated according to the calibration data and obtains the calibration result corresponding to the sensor to be calibrated.
[0067] One embodiment of the present invention, as Figure 2 As shown, a calibration method includes:
[0068] S100 establishes a communication connection between an application interface of a calibration application and an operation test interface of a sensor to be calibrated, and establishes connections between the calibration application and the sensor to be calibrated and a processor respectively;
[0069] S210 obtains calibration input parameters through the calibration application; the calibration input parameters include sensor type information and calibration type information;
[0070] Specifically, this embodiment is an optimized embodiment of the above embodiment. For the parts that are the same as those in the above embodiment in this embodiment, please refer to the above embodiment and will not be elaborated here. The present invention needs to define the calibration type and pre-store the corresponding processes and methods for implementing the calibration type. For example, adding sns_ddf_test_e, that is, the definition of the calibration type information is as follows:
[0071] SNS_DDF_TEST_PS_25CM, / **< ps_25cm calibration * /
[0072] SNS_DDF_TEST_PS_CROSS, / **< obstacle-free calibration * /
[0073] The calibration application passes the calibration input parameters to the operation test interface corresponding to the sensor type information through the processor;
[0074] The to-be-calibrated sensor measures according to the calibration type information and obtains measurement data, and transmits the measurement value to the processor;
[0075] The processor obtains corresponding calibration data according to the received measurement data;
[0076] Specifically, the calibration application provides a human-computer interaction interface for obtaining calibration input parameters to initiate a calibration process. The sensor type information includes the above temperature sensor, humidity sensor, ranging sensor, etc. The calibration type information is set according to the sensor type. For example, for a distance sensor, the calibration types include obstacle-free calibration, distance 10 cm calibration, distance 25 cm calibration and other custom calibrations (that is, setting the distance between the measurement reference object and the electronic device as the preset distance).
[0077] After obtaining the calibration input parameters through the calibration application, the calibration application passes the calibration input parameters to the processor, and then the processor passes the calibration input parameters to the operation test interface of the corresponding sensor according to the sensor type information. Then, the to-be-calibrated sensor controls itself to measure according to the test process corresponding to the calibration type information to obtain corresponding measurement data, and the to-be-calibrated sensor sends the measurement value to the processor. The processor makes a judgment and analysis based on the received measurement data to obtain the corresponding calibration data.
[0078] For example, the method of initiating calibration through the calibration application is to call the calibration Native method.
[0079] Calibration Native method:
[0080] a) The calibration input parameters that this native method needs to obtain are: the calibrated sensor type information (light sensor, distance sensor, etc.) and the calibration type information (custom, such as 25cm distance calibration, barrier-free calibration).
[0081] b) The native method uses the sensor_open(), sensor_write(), and sensor_close() interfaces to establish communication with the processor, and then passes the calibration input parameters sent by the upper-level calibration application, that is, the calibration input parameters obtained by the calibration application, to the runtest interface corresponding to the specific sensor to be calibrated.
[0082] S300 The processor calibrates the sensor to be calibrated according to the calibration data, and obtains a corresponding calibration result from the sensor to be calibrated.
[0083] The present invention solves the problem that the sensor to be calibrated cannot be automatically calibrated under the electronic device system platform. The sensor to be calibrated can be calibrated based on calibration data obtained by simple calculation, so that the sensor to be calibrated has better performance and better performance after successful calibration, thereby providing a better experience for users.
[0084] One embodiment of the present invention, as Figure 3 As shown, a calibration method includes:
[0085] S100 establishes a communication connection between an application interface of a calibration application and an operation test interface of a sensor to be calibrated, and establishes connections between the calibration application and the sensor to be calibrated and a processor respectively;
[0086] S210 obtains calibration input parameters through the calibration application; the calibration input parameters include sensor type information and calibration type information;
[0087] S220, the calibration application transmits the calibration input parameters to the operation test interface corresponding to the sensor type information through the processor;
[0088] S230: the sensor to be calibrated performs measurement according to the calibration type information to obtain measurement data, and transmits the measurement value to the processor;
[0089] S241, the processor periodically obtains the measurement data through the operation test interface at a preset time interval;
[0090] At S242, the processor deletes the maximum value and the minimum value in the measurement data, and performs mean calculation on the remaining measurement data;
[0091] S243: The processor obtains calibration data according to the mean calculation result;
[0092] Specifically, this embodiment is an optimized embodiment of the above embodiment. For the parts of this embodiment that are the same as the above embodiment, please refer to the above embodiment and will not be repeated here. Since the processor obtains the calibration input parameters through the calibration application, the processor can know what type of calibration is required and the type of sensor to be calibrated. In addition, the processor can also start a thread to obtain the measurement data of the sensor to be calibrated, and perform corresponding calibration on the sensor to be calibrated according to the measurement data. Then, the processor periodically obtains the measurement data from the sensor to be calibrated through the run test interface at a preset time interval (for example, 5s or 10s), deletes the maximum and minimum values in the measurement data, performs mean calculation on the remaining measurement data, and then obtains the calibration data based on the mean calculation result.
[0093] Exemplarily, the processor implements a simple process for the sensor to be calibrated, such as a distance sensor, and the selected calibration type is SNS_DDF_TEST_PS_25CM (i.e., the 25 cm distance calibration in the above embodiment) as follows: the processor starts a thread interval to periodically obtain the distance value of the distance sensor (i.e., a type of measurement data of the present invention), removes the maximum and minimum values of the distance value, and then calculates the average value of the other distance values, compares the distance average value with 25 cm, and obtains the corresponding calibration data based on the comparison result.
[0094] S300 The processor calibrates the sensor to be calibrated according to the calibration data, and obtains a corresponding calibration result from the sensor to be calibrated.
[0095] The present invention solves the problem that the sensor to be calibrated cannot be automatically calibrated under the electronic device system platform. The sensor to be calibrated can be calibrated based on calibration data obtained by simple calculation, so that the sensor to be calibrated has better performance and better performance after successful calibration, thereby providing a better experience for users.
[0096] One embodiment of the present invention, as Figure 4 As shown, a calibration method includes:
[0097] S100 establishes a communication connection between an application interface of a calibration application and an operation test interface of a sensor to be calibrated, and establishes connections between the calibration application and the sensor to be calibrated and a processor respectively;
[0098] S200: the calibration application triggers the run test interface to start a calibration thread to obtain calibration data;
[0099] S310: the processor sends the calibration data to the operation test interface, so that the sensor to be calibrated is calibrated according to the calibration data;
[0100] S320: After completing the calibration operation, the sensor to be calibrated performs measurement again to obtain a test result, and transmits the test result to the processor;
[0101] S330: the processor performs a difference calculation between the set value in the calibration type information and the test result;
[0102] S340: When the difference calculation result is greater than a preset threshold, the processor determines that the calibration result is a calibration failure;
[0103] S350: When the difference calculation result is less than a preset threshold, the processor determines that the calibration result is a successful calibration.
[0104] Specifically, this embodiment is an optimized embodiment of the above embodiment. For the parts of this embodiment that are the same as the above embodiment, please refer to the above embodiment and will not be repeated here. The processor sends the calibration data to the run test interface, so that the sensor to be calibrated obtains the calibration data from the run test interface, and the sensor to be calibrated is calibrated according to the obtained calibration data. After completing the calibration operation according to the calibration data, the sensor to be calibrated is measured again to obtain the test result, and then the sensor to be calibrated sends the test result to the processor through the run test interface. The processor calculates the difference between the set value in the calibration type information and the test result. If the difference calculation result is greater than the preset threshold, the processor determines that the calibration result is a calibration failure. If the difference calculation result is less than the preset threshold, the processor determines that the calibration result is a calibration success.
[0105] The present invention solves the problem that the sensor to be calibrated cannot be automatically calibrated under the electronic device system platform. The sensor to be calibrated can be calibrated based on calibration data obtained by simple calculation, so that the sensor to be calibrated has better performance and better performance after successful calibration, thereby providing a better experience for users.
[0106] One embodiment of the present invention provides a calibration method, comprising:
[0107] S100 establishes a communication connection between an application interface of a calibration application and an operation test interface of a sensor to be calibrated, and establishes connections between the calibration application and the sensor to be calibrated and a processor respectively;
[0108] S200: the calibration application triggers the run test interface to start a calibration thread to obtain calibration data;
[0109] S300: the processor calibrates the sensor to be calibrated according to the calibration data, and obtains a corresponding calibration result from the sensor to be calibrated;
[0110] At S400 , the processor transmits the calibration data and calibration results to the calibration application for display.
[0111] Specifically, this embodiment is an optimized embodiment of the above embodiment. For the parts of this embodiment that are the same as the above embodiment, please refer to the above embodiment and will not be repeated here. The processor returns the obtained calibration results and calibration data to the above native method through sns_ddf_smgr_notify_test_complete_with_data() and sns_ddf_smgr_notify_event(), that is, returns to the application interface of the calibration application. The present invention solves the problem that the sensor to be calibrated cannot be calibrated automatically under the electronic device system platform. It can calibrate the sensor to be calibrated based on the calibration data obtained by simple calculation, so that the sensor to be calibrated has better performance and better performance after successful calibration, thereby providing a better experience for the user. Moreover, the calibration application can display the calibration data and calibration results corresponding to the sensor to be calibrated through the provided human-computer interaction interface, which is conducive to intuitively and conveniently viewing the calibration status of the sensor to be calibrated, and then deciding whether to re-initiate a new calibration, which simplifies the reference.
[0112] One embodiment of the present invention provides a calibration method, comprising:
[0113] S100 establishes a communication connection between an application interface of a calibration application and an operation test interface of a sensor to be calibrated, and establishes connections between the calibration application and the sensor to be calibrated and a processor respectively;
[0114] S200: the calibration application triggers the run test interface to start a calibration thread to obtain calibration data;
[0115] S310: the processor sends the calibration data to the operation test interface, so that the sensor to be calibrated is calibrated according to the calibration data;
[0116] S320: After completing the calibration operation, the sensor to be calibrated performs measurement again to obtain a test result, and transmits the test result to the processor;
[0117] S330: the processor performs a difference calculation between the set value in the calibration type information and the test result;
[0118] S340: When the difference calculation result is greater than a preset threshold, the processor determines that the calibration result is a calibration failure;
[0119] S350: When the difference calculation result is less than a preset threshold, the processor determines that the calibration result is a successful calibration;
[0120] At S400 , the processor transmits the calibration data and calibration results to the calibration application for display.
[0121] Specifically, this embodiment is an optimized embodiment of the above embodiment. For the parts of this embodiment that are the same as those in the above embodiment, please refer to the above embodiment and will not be described in detail here.
[0122] Exemplarily, by downloading and installing a calibration application on the electronic device, and then providing a measurement reference object (such as a baffle, hand, etc.), the distance value between the electronic device and the measurement reference object is detected by a distance sensor, and the processor calculates the calibration data based on the distance value and the preset distance, and then writes the calibration data into the electronic device. The calibration method is added to the testing or manufacturing process of each electronic device, and it can automatically detect and calibrate without the need for peripheral equipment, which is low cost and high efficiency.
[0123] The present invention independently implements a distance sensor calibration application, and communicates with the runtest interface of the distance measuring sensor through the interface provided by the Qualcomm platform, and then starts the calibration thread through the runtest interface to perform barrier-free calibration and 25CM calibration on the distance sensor.
[0124] Exemplarily, by downloading and installing a calibration application on the electronic device, providing a test light source with the preset light intensity value and corresponding to the light sensor, and then using the light sensor to detect the light intensity when irradiated by the test light source, the processor calculates the calibration data based on the light intensity and the preset light intensity value, and then writes the calibration data into the electronic device, and adds the calibration method to the testing or manufacturing process of each electronic device, it can automatically detect and calibrate without the need for peripheral equipment, which is low cost and high efficiency.
[0125] One embodiment of the present invention is an electronic device, such as Figure 5 As shown, it includes: a calibration application, a processor and a sensor to be calibrated;
[0126] The calibration application includes an application interface, and the sensor to be calibrated includes a running test interface; the application interface of the calibration application and the running test interface of the sensor to be calibrated are connected to each other; the calibration application and the sensor to be calibrated are respectively connected to the processor;
[0127] The calibration application is used to trigger the run test interface to start a calibration thread to obtain calibration data;
[0128] The processor is configured to calibrate the sensor to be calibrated according to the calibration data, and obtain a corresponding calibration result from the sensor to be calibrated.
[0129] Specifically, the sensors to be calibrated include but are not limited to gyroscopes, distance sensors, light sensors, lidars and other ranging sensors, as well as temperature sensors, pressure sensors, humidity sensors, gyroscopes and the like. The runtest interface refers to the runtest interface of the sensor to be calibrated. The electronic device includes a processor and a sensor to be calibrated. In addition, the electronic device can be installed with a calibration application. In this way, the calibration application in the electronic device establishes a connection with the processor via wireless means, the sensor to be calibrated establishes a connection with the processor via wired or wireless means, and a communication connection is established between the application interface of the calibration application and the runtest interface of the sensor to be calibrated.
[0130] Exemplarily, the sensor to be calibrated uses a runtest interface to establish a communication connection with a processor (eg, an ADSP chip). The runtest interface includes sensor_open, sensor_write(), and sensor_close() interfaces.
[0131] The present invention provides a calibration application program by itself, which communicates with the running test interface of the sensor to be calibrated through the application interface provided by the electronic device. Then, the electronic device starts a calibration thread under the running test interface, and obtains calibration data obtained by testing the sensor to be calibrated during the calibration thread through the running test interface. Then, the electronic device calibrates the sensor to be calibrated according to the calibration data and obtains the calibration result corresponding to the sensor to be calibrated.
[0132] Based on the above embodiment, the calibration application includes: an input module; the sensor to be calibrated includes a measurement module;
[0133] An input module, configured to obtain calibration input parameters, wherein the calibration input parameters include sensor type information and calibration type information;
[0134] The application interface is used to transmit the calibration input parameters to the operation test interface corresponding to the sensor type information through the processor;
[0135] The measurement module is configured to perform measurement according to the calibration type information and obtain measurement data;
[0136] The operation test interface is used to transmit the measured value to the processor;
[0137] The processor is further configured to obtain corresponding calibration data according to the received measurement data.
[0138] Specifically, the present invention needs to define the calibration type, and pre-store the corresponding processes and methods for implementing the calibration type. For example, adding sns_ddf_test_e, that is, the definition of the calibration type information is as follows:
[0139] SNS_DDF_TEST_PS_25CM, / **<ps_25cm calibration* /
[0140] SNS_DDF_TEST_PS_CROSS, / **<barrier-free calibration* /
[0141] The calibration application provides a human-computer interaction interface for obtaining calibration input parameters to initiate the calibration process. The sensor type information includes the above temperature sensor, humidity sensor, ranging sensor, etc. The calibration type information is set according to the sensor type. For example, for a distance sensor, the calibration types include barrier-free calibration, 10 cm distance calibration, 25 cm distance calibration, and other custom calibrations (i.e., setting the distance between the measurement reference object and the electronic device as the preset distance).
[0142] After obtaining the calibration input parameters through the calibration application, the calibration application passes the calibration input parameters to the processor, and then the processor passes the calibration input parameters to the run test interface of the corresponding sensor according to the sensor type information. Then, the sensor to be calibrated controls itself to measure the corresponding measurement data according to the test process corresponding to the calibration type information, and the sensor to be calibrated sends the measurement value to the processor. The processor makes a judgment and analysis based on the received measurement data to obtain the corresponding calibration data.
[0143] For example, the method of initiating calibration through the calibration application is to call the calibration Native method.
[0144] Calibration Native method:
[0145] a) The calibration input parameters required by this native method are: calibration sensor type information (light sensor, distance sensor, etc.), calibration type information (custom, such as 25 cm distance calibration, barrier-free calibration).
[0146] b) This native method uses the sensor_open, sensor_write(), and sensor_close() interfaces to establish communication with the processor, and then passes the calibration input parameters sent by the upper-layer calibration application, that is, the calibration input parameters obtained by the calibration application, to the runtest interface corresponding to the specific sensor to be calibrated.
[0147] The present invention solves the problem that the sensor to be calibrated cannot be automatically calibrated under the electronic device system platform. The sensor to be calibrated can be calibrated based on calibration data obtained by simple calculation, so that the sensor to be calibrated has better performance and better performance after successful calibration, thereby providing a better experience for users.
[0148] Based on the above embodiment, the processor includes:
[0149] An acquisition module, configured to periodically acquire the measurement data through the operation test interface at a preset time interval;
[0150] The calculation module is used to delete the maximum value and the minimum value in the measurement data, perform mean calculation on the remaining measurement data, and obtain calibration data according to the mean calculation result.
[0151] Specifically, because the processor obtains calibration input parameters through the calibration application, it can determine the type of calibration required and the type of sensor to be calibrated. Furthermore, the processor can initiate a thread to obtain measurement data from the sensor to be calibrated and calibrate the sensor accordingly based on the measurement data. The processor then periodically obtains measurement data from the sensor to be calibrated through the run test interface at preset time intervals (e.g., 5s or 10s). The processor removes the maximum and minimum values from the measurement data, performs an average calculation on the remaining measurement data, and then obtains calibration data based on the average calculation result.
[0152] Exemplarily, the processor implements a simple process for the sensor to be calibrated, such as a distance sensor, and the selected calibration type is SNS_DDF_TEST_PS_25CM (i.e., the 25 cm distance calibration in the above embodiment) as follows: the processor starts a thread interval to periodically obtain the distance value of the distance sensor (i.e., a type of measurement data of the present invention), removes the maximum and minimum values of the distance value, and then calculates the average value of the other distance values, compares the distance average value with 25 cm, and obtains the corresponding calibration data based on the comparison result.
[0153] The present invention solves the problem that the sensor to be calibrated cannot be automatically calibrated under the electronic device system platform. The sensor to be calibrated can be calibrated based on calibration data obtained by simple calculation, so that the sensor to be calibrated has better performance and better performance after successful calibration, thereby providing a better experience for users.
[0154] Based on the above embodiment, the processor further includes: a processing module;
[0155] The processor is further configured to send the calibration data to the operation test interface;
[0156] The measuring module is further configured to perform calibration according to the calibration data, and after completing the calibration operation, perform measurement again to obtain a test result;
[0157] The running test interface is further used to transmit the test result to the processor;
[0158] The processing module is used to perform a difference calculation between the set value in the calibration type information and the test result; when the difference calculation result is greater than a preset threshold, the sensor to be calibrated determines that the calibration result is a calibration failure; when the difference calculation result is less than the preset threshold, the sensor to be calibrated determines that the calibration result is a calibration success.
[0159] Specifically, the processor sends the calibration data to the run test interface, so that the sensor to be calibrated obtains the calibration data from the run test interface, and the sensor to be calibrated is calibrated according to the obtained calibration data. After completing the calibration operation according to the calibration data, the sensor to be calibrated performs another measurement to obtain a test result, and then the sensor to be calibrated sends the test result to the processor through the run test interface. The processor calculates the difference between the set value in the calibration type information and the test result. If the difference calculation result is greater than a preset threshold, the processor determines that the calibration result is a calibration failure. If the difference calculation result is less than the preset threshold, the processor determines that the calibration result is a calibration success.
[0160] The present invention solves the problem that the sensor to be calibrated cannot be automatically calibrated under the electronic device system platform. The sensor to be calibrated can be calibrated based on calibration data obtained by simple calculation, so that the sensor to be calibrated has better performance and better performance after successful calibration, thereby providing a better experience for users.
[0161] Based on the above embodiment, the processor is further configured to transmit the calibration data and calibration results to the calibration application for display.
[0162] Specifically, after the processor obtains the calibration data and calibration results in the above manner, it returns the calibration results and calibration data to the above native method through sns_ddf_smgr_notify_test_complete_with_data() and sns_ddf_smgr_notify_event(), that is, returns to the application interface of the calibration application. The present invention solves the problem that the sensor to be calibrated cannot be calibrated automatically under the electronic device system platform. It can calibrate the sensor to be calibrated based on the calibration data obtained by simple calculations, so that the sensor to be calibrated has better performance and better performance after successful calibration, thereby providing a better experience for the user. Moreover, the calibration application can display the calibration data and calibration results corresponding to the sensor to be calibrated through the provided human-computer interaction interface, which is conducive to intuitively and conveniently viewing the calibration status of the sensor to be calibrated, and then deciding whether to re-initiate a new calibration, which simplifies the reference.
[0163] Those skilled in the art will clearly understand that, for the sake of convenience and brevity of description, only the division of the above-mentioned program modules is used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different program modules as needed, that is, the internal structure of the device can be divided into different program units or modules to complete all or part of the functions described above. The program modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one processing unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software program unit. In addition, the specific names of the program modules are only for the purpose of distinguishing each other and are not used to limit the scope of protection of this application.
[0164] They can be implemented using program code executable by a computing device, and thus, can be stored in a storage device and executed by the computing device, or can be fabricated into separate integrated circuit modules, or multiple modules or steps can be fabricated into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0165] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0166] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0167] In the embodiments provided in this application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are merely illustrative. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be electrical, mechanical or other forms.
[0168] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0169] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0170] It should be noted that the above embodiments can be freely combined as needed. The above description is only a preferred embodiment of the present invention. It should be pointed out that those skilled in the art can make several improvements and modifications without departing from the principles of the present invention, and such improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A calibration method is applied to an electronic device, wherein the electronic device includes a processor and a sensor to be calibrated, the runtest interface refers to the runtest interface of the sensor to be calibrated, the runtest interface includes sensor_open, sensor_write() and sensor_close() interfaces, and the electronic device can install and run a calibration application, comprising the steps of: Establishing a communication connection between an application interface of a calibration application and an operation test interface of a sensor to be calibrated, and establishing connections between the calibration application and the sensor to be calibrated and a processor respectively; The calibration application triggers the run test interface to start a calibration thread to obtain calibration data; The processor calibrates the sensor to be calibrated according to the calibration data, and obtains a corresponding calibration result from the sensor to be calibrated; The calibration application triggers the run test interface to start the calibration thread to obtain calibration data, including the following steps: Acquiring calibration input parameters through the calibration application; the calibration input parameters include sensor type information and calibration type information; The calibration application transmits the calibration input parameter to the operation test interface corresponding to the sensor type information through the processor; The sensor to be calibrated performs measurement according to the calibration type information and obtains measurement data, and transmits the measurement data to the processor; The processor obtains corresponding calibration data according to the received measurement data.
2. The calibration method according to claim 1, wherein the processor generates corresponding calibration data according to the received measurement data, comprising the steps of: The processor periodically obtains the measurement data through the operation test interface at a preset time interval; The processor deletes the maximum value and the minimum value in the measurement data, and performs mean calculation on the remaining measurement data; The processor obtains calibration data according to the mean value calculation result.
3. The calibration method according to claim 1, wherein the processor calibrates the sensor to be calibrated according to the calibration data, and obtains the corresponding calibration result from the sensor to be calibrated, comprising the steps of: The processor sends the calibration data to the operation test interface, so that the sensor to be calibrated is calibrated according to the calibration data; After completing the calibration operation, the sensor to be calibrated performs measurement again to obtain a test result, and transmits the test result to the processor; The processor performs a difference calculation between the set value in the calibration type information and the test result; When the difference calculation result is greater than a preset threshold, the processor determines that the calibration result is a calibration failure; When the difference calculation result is less than a preset threshold, the processor determines that the calibration result is a successful calibration.
4. The calibration method according to any one of claims 1 to 3, wherein the processor calibrates the sensor to be calibrated according to the calibration data and obtains the corresponding calibration result from the sensor to be calibrated, and then comprises the following steps: The processor transmits the calibration data and calibration results to the calibration application for display.
5. An electronic device, include: Calibration application, processor and sensor to be calibrated; The calibration application includes an application interface, and the sensor to be calibrated includes a running test interface; The communication connection between the application interface of the calibration application and the runtest interface of the sensor to be calibrated; the calibration application and the sensor to be calibrated are respectively connected to the processor; the runtest interface refers to the runtest interface of the sensor to be calibrated; the runtest interface includes sensor_open, sensor_write() and sensor_close() interfaces; The calibration application is used to trigger the run test interface to start a calibration thread to obtain calibration data; The processor is configured to calibrate the sensor to be calibrated according to the calibration data, and obtain a corresponding calibration result from the sensor to be calibrated; The calibration application comprises: an input module; the sensor to be calibrated comprises a measurement module; An input module, used to obtain calibration input parameters; the calibration input parameters include sensor type information and calibration type information; The application interface is used to transmit the calibration input parameter to the operation test interface corresponding to the sensor type information through the processor; The measuring module is used to perform measurement according to the calibration type information and obtain measurement data; The operation test interface is used to transfer the measurement data to the processor; The processor is further configured to obtain corresponding calibration data according to the received measurement data.
6. The electronic device according to claim 5, wherein the processor include: An acquisition module, used for periodically acquiring the measurement data through the operation test interface at a preset time interval; The calculation module is used to delete the maximum value and the minimum value in the measurement data, perform mean calculation on the remaining measurement data, and obtain calibration data according to the mean calculation result.
7. The electronic device according to claim 5, wherein the processor further include: Processing module; The processor is further configured to send the calibration data to the operation test interface; The measuring module is further used to perform calibration according to the calibration data, and after completing the calibration operation, perform measurement again to obtain a test result; The running test interface is also used to transmit the test result to the processor; The processing module is used to calculate the difference between the set value in the calibration type information and the test result; When the difference calculation result is greater than a preset threshold, the sensor to be calibrated determines that the calibration result is a calibration failure; when the difference calculation result is less than the preset threshold, the sensor to be calibrated determines that the calibration result is a calibration success.
8. The electronic device according to any one of claims 5 to 7, Features: The processor is further configured to transmit the calibration data and calibration results to the calibration application for display.
Citation Information
Patent Citations
Method and apparatus for calibrating mobile terminal
CN105049602A
System and method for scalable cloud-based sensor calibration
CN108292285A
