WO2017185669A1 - 传感器的校准参数的配置方法及电子设备 - Google Patents
传感器的校准参数的配置方法及电子设备 Download PDFInfo
- Publication number
- WO2017185669A1 WO2017185669A1 PCT/CN2016/102396 CN2016102396W WO2017185669A1 WO 2017185669 A1 WO2017185669 A1 WO 2017185669A1 CN 2016102396 W CN2016102396 W CN 2016102396W WO 2017185669 A1 WO2017185669 A1 WO 2017185669A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- calibration
- electronic device
- sensor unit
- variable
- sensor
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
Definitions
- the present invention relates to the field of sensors, and more particularly to a method for configuring calibration parameters of a sensor and an electronic device.
- the sensor in the mobile phone is a component that is sensed by the chip on the mobile phone, such as temperature value, brightness value and pressure value, magnetic field value, etc., is an important module in the mobile phone. Sensors usually have accuracy requirements, so it is necessary to calibrate the sensors frequently during the operation of the phone to ensure that it meets the accuracy requirements.
- a method of configuring a calibration parameter of a sensor the electronic device comprising a sensor, at least one processor, and a memory communicatively coupled to the at least one processor, The method is implemented by at least one processor and a sensor, including:
- the memory stores a command executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
- the calibration variable is a global variable that is configurable by the at least one processor and read by the sensor;
- the sensor is configured to configure a calibration parameter for the sensor to perform its own calibration based on the read calibration variable.
- the calibration configuration information is a calibration parameter of the sensor.
- the calibration configuration information is a structural type of the electronic device, and the structural type is used to characterize a structural relationship between the electronic device and a sensor, and the method includes:
- the at least one processor sets the calibration variable to the structure type according to a structure type of the acquired electronic device
- the alternative calibration parameters corresponding to the structure type are configured as calibration parameters.
- the method further includes the step of the at least one processor reading the preset calibration configuration information.
- the electronic device is a mobile phone of an Android operating system
- the calibration configuration information is a product model of the mobile phone
- the calibration variable is an environment variable Type in an Android compilation environment
- a memory communicatively coupled to the at least one processor stores a command executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
- the sensor assigns a local predefined parameter according to the environment variable Type read by the corresponding sensor program script, and selects, according to the predefined parameter, a plurality of alternatives corresponding to the product models of different mobile phones respectively In the alternative list of calibration parameters, an alternative calibration parameter corresponding to the product model of the handset is selected and defined as a calibration parameter.
- the at least one processor invokes a system compilation script to obtain a product model of the mobile phone.
- a second aspect of the present invention provides an electronic device with a sensor, comprising: at least one processor;
- the memory stores a command executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
- the calibration variable is a global variable that is configurable by the at least one processor and read by the sensor;
- the sensor is configured to configure a calibration parameter for the sensor to perform its own calibration based on the read calibration variable.
- the calibration configuration information is a calibration parameter of the sensor.
- the calibration configuration information is a structural type of the electronic device, and the structural type is used to characterize a structural relationship between the electronic device and a sensor, and
- the at least one processor is configured to set the calibration variable to the structure type according to a structure type of the acquired electronic device
- the sensor is configured to select, according to the type of structure of the electronic device that is read, from a preset candidate list that includes multiple candidate calibration parameters respectively corresponding to different types of structures of different electronic devices.
- An alternative calibration parameter corresponding to the structure type of the electronic device is configured as a calibration parameter.
- the processor of the electronic device further includes means for reading the calibration configuration information set in advance.
- the inventors of the present invention have found that in the prior art, a method for configuring calibration parameters of a sensor and an electronic device have not been provided, and the calibration parameters of the sensor can be adaptively configured according to the structure of the electronic device, thereby avoiding designing different structures.
- FIG. 1 is a flow chart showing a method for configuring calibration parameters of a sensor according to an embodiment of the present invention.
- FIG. 2 is still another flowchart of a method for configuring calibration parameters of a sensor according to an embodiment of the present invention.
- FIG. 3 is a flowchart of a method for configuring calibration parameters of sensors of an Android mobile phone according to an embodiment of the present invention.
- FIG. 4 is a schematic block diagram of an electronic device according to an embodiment of the present invention.
- Embodiments of the present invention provide a method for configuring calibration parameters of a sensor, as shown in FIG. 1 .
- the invention is applied to an electronic device, the electronic device comprising a processor unit and a sensor unit, the method being implemented by the processor unit and the sensor unit, comprising the following steps:
- Step S1100 The processor unit sets a calibration variable according to the acquired calibration configuration information, where the calibration variable is a global variable that can be set by the processor unit and read by the sensor unit;
- Step S2100 the sensor unit configures a calibration parameter according to the read calibration variable, and the calibration parameter is used by the sensor unit to perform self-calibration.
- the electronic device in this embodiment includes a processor unit and a sensor unit, and the sensor unit usually has an accuracy requirement, so the sensor unit needs to be calibrated during the startup of the electronic device and during operation to enable the accuracy requirement, but different electronic
- the device has different structural design, and the difference of the position of the corresponding sensor unit in the electronic device brings about the difference of the calibration parameters. Therefore, the calibration of the sensor unit in different electronic devices requires different calibration parameters.
- the processor unit sets the calibration variable for the sensor unit to read and configure the calibration parameter according to the acquired calibration configuration information, and can adaptively adapt the calibration difference of the sensor caused by different structural designs of different electronic devices, without Additional product code development and maintenance to reduce costs.
- the calibration configuration information is a calibration parameter of the sensor unit.
- the processor unit sets the calibration variable to the calibration parameter of the sensor unit according to the calibration parameter of the acquisition sensor unit
- the number is configured for reading by the sensor unit, and the calibration parameters of the sensor unit can be directly transmitted to the sensor unit, which can adaptively adapt to the calibration difference of the sensor caused by different structural designs of different electronic devices, and can also be adapted adaptively.
- the calibration difference of the sensor caused by other conditions (such as different sensor unit models, different structures, etc.) further reduces the cost.
- the storage space limited by the electronic device or the poor performance of the device cannot support the calibration parameters that transmit more content, or the purpose is to adaptively adapt different structural design bands of different electronic devices.
- the calibration difference of the sensor the embodiment further provides a configuration method of the calibration parameter of the sensor, the calibration configuration information is a structural type of the electronic device, and the structure type is used to represent the electronic device and the sensor unit.
- Step S2100 the processor unit sets the calibration variable to the structure type according to the acquired structure type of the electronic device
- Step S2200 the sensor unit selects from the preset candidate list including a plurality of alternative calibration parameters respectively corresponding to the structure types of the different electronic devices according to the read structure type of the electronic device.
- An alternative calibration parameter corresponding to the structure type of the electronic device is configured as a calibration parameter.
- Different electronic devices have different structural designs.
- structural types are used to distinguish different structural designs, so that the structural type of the electronic device has a unique mapping relationship with the structural design of the electronic device, and the sensor unit including the electronic device in the structural design is Position information in the electronic device, so the structure type can characterize the structural relationship between the electronic device and the sensor unit, and the structural relationship between the electronic device and the sensor unit corresponds to the calibration parameter, and thus the processor unit is configured to read the calibration variable for the sensor unit to read.
- the structure type of the acquired electronic device is transmitted to the sensor unit, and the sensor unit can select an alternative calibration parameter corresponding to the structure type of the electronic device from the preset candidate list as the calibration parameter.
- the candidate list may be preset in the sensor unit before the electronic device is shipped from the factory, and the candidate list preset in the sensor unit may be downloaded from the remote server after the electronic device is powered on, or may be remotely The server sends the latest candidate list to the electronic device for sensor unit update.
- the electronic device is a mobile phone of an Android operating system
- the calibration configuration information is a product model of the mobile phone
- the calibration variable is in the Android compilation environment.
- the environment variable Type the method shown in Figure 3, includes the following steps:
- step S3100 the processor unit sets the environment variable Type to the product model of the mobile phone by using a system compilation script according to the obtained product model of the mobile phone.
- the product model of the mobile phone can be used as an indication of the type of mobile phone structure to characterize the electronic device and The structural relationship of the sensor unit.
- the system compilation script can be a shell script
- the environment variable is a global variable that can be set by the processing unit through the export command and read by the sensor unit. Therefore, in the mobile phone of the Android operating system, the processor unit can set the environment variable Type to the product model of the mobile phone through a shell script.
- the processor unit can also call the system compilation script to obtain the product model of the mobile phone, for example, by calling a shell script to obtain the product model of the mobile phone.
- the sensor unit assigns a local predefined parameter according to the environment variable Type read by the corresponding sensor unit program script, and includes multiple from the predefined one according to the predefined parameter.
- an alternative calibration parameter corresponding to the product model of the mobile phone is selected and defined as a calibration parameter.
- the sensor unit program script may be a Python script
- the sensor unit reads the environment variable Type through the Python script, and assigns the value of the environment variable Type to the predefined parameter through the CCFLAGS-Dxxx compile command
- the predefined parameters may be pre-defined in the driver code of the sensor unit, and the predefined parameters may be defined by the #ifdef XXX command
- the candidate calibration parameters corresponding to the product model of the handset selected from the predefined candidate list are defined as calibration parameters.
- the method for configuring the calibration parameters of the sensor as shown in FIG. 1 or FIG. 2 further includes that the processor unit reads the calibration configuration information set in advance.
- a further embodiment of the present invention further provides an electronic device 4000, as shown in FIG. 4, including a processor unit 4100 and a sensor unit 4200 for implementing the embodiment as shown in FIG. 1 or 2. The method shown is not repeated here.
- the electronic device 4000 includes a processor unit 4100 and a sensor unit 4200:
- the processor unit 4100 is configured to set a calibration variable according to the acquired calibration configuration information, where the calibration variable is a global variable that can be set by the processor unit and read by the sensor unit;
- the sensor unit 4200 is configured to configure a calibration parameter for the sensor unit to perform self-calibration according to the read calibration variable.
- the calibration configuration information is a calibration parameter of the sensor unit 4200.
- the calibration configuration information is a structural type of the electronic device, and the structural type is used to characterize a structural relationship between the electronic device and the sensor unit, and
- the processor unit 4100 is configured to set the calibration variable to the structure type according to the acquired structure type of the electronic device
- the sensor unit 4200 is configured to select, according to the structure type of the electronic device that is read, from a preset candidate list that includes multiple candidate calibration parameters respectively corresponding to the structure types of different electronic devices.
- An alternative calibration parameter corresponding to the structure type of the electronic device is configured as a calibration parameter.
- the processor unit 4100 further includes means for reading the calibration configuration information set in advance.
- the sensor can set the calibration for its own calibration by reading the calibration variable.
- the parameters enable the electronic device to adaptively configure the calibration parameters of the sensor, eliminating the need to develop and maintain different product codes for electronic devices of different structures, reducing product development and maintenance costs.
- the processor unit and sensor unit can be implemented in a variety of ways.
- the processor unit and the sensor unit can be implemented by instructions to configure the processor unit.
- the instructions can be stored in the ROM, and when the device is booted, the instructions are read from the ROM into the programmable device to implement the processor unit and the sensor unit.
- the processor unit and sensor unit can be cured into a dedicated device (eg, an ASIC). Can handle the processor unit and The sensor unit is divided into mutually independent units or they can be combined together.
- the processor unit and the sensor unit may be implemented by one of the various implementations described above, or may be implemented by a combination of two or more of the various implementations described above.
- the invention can be a system, method and/or computer program product.
- the computer program product can comprise a computer readable storage medium having computer readable program instructions embodied thereon for causing a processor unit to implement various aspects of the present invention.
- the computer readable storage medium can be a tangible device that can hold and store the instructions used by the instruction execution device.
- the computer readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing.
- Non-exhaustive list of computer readable storage media include: portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM) Or flash memory), static random access memory (SRAM), portable compact disk read only memory (CD-ROM), digital versatile disk (DVD), memory stick, floppy disk, mechanical encoding device, for example, with instructions stored thereon A raised structure in the hole card or groove, and any suitable combination of the above.
- a computer readable storage medium as used herein is not to be interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (eg, a light pulse through a fiber optic cable), or through a wire The electrical signal transmitted.
- the computer readable program instructions described herein can be downloaded from a computer readable storage medium to various computing/processing devices or downloaded to an external computer or external storage device over a network, such as the Internet, a local area network, a wide area network, and/or a wireless network.
- the network may include copper transmission cables, fiber optic transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and/or edge servers.
- a network adapter card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium in each computing/processing device .
- Computer program instructions for performing the operations of the present invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine related instructions, microcode, firmware instructions, state setting data, or in one or more programming languages.
- the computer readable program instructions can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer, partly on the remote computer, or entirely on the remote computer or server. carried out.
- the remote computer can be connected to the user's computer through any kind of network, including a local area network (LAN) or wide area network (WAN), or can be connected to an external computer (eg, using an Internet service provider to access the Internet) connection).
- the customized electronic circuit such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), can be customized by utilizing state information of computer readable program instructions.
- Computer readable program instructions are executed to implement various aspects of the present invention.
- the computer readable program instructions can be provided to a processor unit of a general purpose computer, special purpose computer or other programmable data processing apparatus to produce a machine such that the instructions are in a processor unit through a computer or other programmable data processing apparatus When executed, means are implemented that implement the functions/acts specified in one or more of the flowcharts and/or block diagrams.
- the computer readable program instructions can also be stored in a computer readable storage medium that causes the computer, programmable data processing device, and/or other device to operate in a particular manner, such that the computer readable medium storing the instructions includes An article of manufacture that includes instructions for implementing various aspects of the functions/acts recited in one or more of the flowcharts.
- the computer readable program instructions can also be loaded onto a computer, other programmable data processing device, or other device to perform a series of operational steps on a computer, other programmable data processing device or other device to produce a computer-implemented process.
- instructions executed on a computer, other programmable data processing apparatus, or other device implement the functions/acts recited in one or more of the flowcharts and/or block diagrams.
- the flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the invention.
- the flow chart or Each block in the block diagrams can represent a module, a program segment, or a portion of an instruction that comprises one or more executable instructions for implementing the specified logical functions.
- the functions noted in the blocks may also occur in a different order than those illustrated in the drawings. For example, two consecutive blocks may be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending upon the functionality involved.
- each block of the block diagrams and/or flowcharts, and combinations of blocks in the block diagrams and/or flowcharts can be implemented in a dedicated hardware-based system that performs the specified function or function. Or it can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that implementation by hardware, implementation by software, and implementation by a combination of software and hardware are equivalent.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Telephone Function (AREA)
Abstract
一种传感器的校准参数的配置方法,应用于包含处理器单元以及传感器单元的电子设备,包括步骤:处理器单元根据所获取的校准配置信息,设置校准变量(S1100);传感器单元根据所读取的校准变量,配置自身用于校准的校准参数(S1200)。采用该方法,可以自适应地根据电子设备的结构设计配置对应的传感器的校准参数,无需对不同结构设计的电子设备开发和维护不同的产品代码,降低了成本。
Description
相关申请的交叉参考
本申请要求于2016年4月27日提交中国专利局、申请号为2016102708911、发明名称为“一种传感器的校准参数的配置方法及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本发明涉及传感器领域,更具体地,涉及一种传感器的校准参数的配置方法及电子设备。
手机中的传感器是手机上通过芯片来感应的元器件,如温度值、亮度值和压力值、磁场值等,是手机中的一个重要模块。而传感器通常都存在精度要求,所以在手机运行过程中需要时常进行校准传感器以保证其满足精度要求。
而不同手机(不同品牌、不同型号的)的结构设计不同,相应地,传感器在不同手机中的放置位置也存在差异,进而带来校准参数的差异。因而具有不同结构设计的手机,即使包含的传感器型号相同,也需要对应设置不同的校准参数。而手机中的传感器与处理器是相互独立的,传感器不能直接通过手机中现有的系统接口(例如安卓手机的系统属性ro.product.name)获取能表征手机结构设计的产品型号等信息,因此现有技术中通常需要对不同手机维护其对应的不同的产品代码,以解决不同手机的校准参数不同的问题。但在手机产品日新月异的今天,手机的产品型号繁多,就会存在产品代码繁多带来的开发及维护成本过高的问题。
因此,发明人认为,有必要针对上述现有技术中存在的问题进行改进。
发明内容
本发明的一个目的是提供一种用于配置传感器的校准参数的新技术方案。
根据本发明的第一方面,提供了一种传感器的校准参数的配置方法,应用于电子设备,所述电子设备包含传感器、至少一个处理器以及与所述至少一个处理器通信连接的存储器,所述方法通过至少一个处理器以及传感器实施,包括:
所述存储器存储有可被所述至少一个处理器执行的命令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够:
用于根据所获取的校准配置信息,设置校准变量,所述校准变量为可供所述至少一个处理器设置以及所述传感器读取的全局变量;
所述传感器用于根据所读取的所述校准变量,配置校准参数,所述校准参数用于所述传感器进行自身校准。
在一个实施例中,所述校准配置信息为所述传感器的校准参数。
在另一个实施例中,所述校准配置信息为所述电子设备的结构类型,所述结构类型用于表征所述电子设备与传感器的结构关系,所述方法包括:
所述至少一个处理器根据所获取的电子设备的结构类型,将所述校准变量设置为所述结构类型;
所述传感器根据所读取的所述电子设备的结构类型,从预置的包含多个分别与不同电子设备的结构类型对应的备选校准参数的备选列表中,选取与所述电子设备的结构类型对应的备选校准参数,配置为校准参数。
在上述实施例中,可选地,所述方法还包括,所述至少一个处理器读取预先设置的所述校准配置信息的步骤。
在一个实施例中,所述电子设备为安卓操作系统的手机,所述校准配置信息为所述手机的产品型号,所述校准变量为安卓编译环境中的环境变量Type,所述方法包括以下步骤:
与所述至少一个处理器通信连接的存储器存储有可被所述至少一个处理器执行的命令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够:
根据所获取的所述手机的产品型号,通过系统编译脚本将所述环境变量Type设置为所述手机的产品型号;
所述传感器根据通过对应的传感器程序脚本读取的环境变量Type,赋值本地的预定义参数,根据所述预定义参数从预定义的所述包含多个分别与不同手机的产品型号对应的备选校准参数的备选列表中,选取与所述手机的产品型号对应的备选校准参数,定义为校准参数。
进一步可选地,所述至少一个处理器调用系统编译脚本获取所述手机的产品型号。
本发明的第二方面,提供一种带有传感器的电子设备,包括:至少一个处理器;以及,
与所述至少一个处理器通信连接的存储器;其中,
所述存储器存储有可被所述至少一个处理器执行的命令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够:
用于根据所获取的校准配置信息,设置校准变量,所述校准变量为可供所述至少一个处理器设置以及所述传感器读取的全局变量;
所述传感器用于根据所读取的所述校准变量,配置校准参数,所述校准参数用于所述传感器进行自身校准。
在一个实施例中,所述校准配置信息为所述传感器的校准参数。
在另一个实施例中,所述校准配置信息为所述电子设备的结构类型,所述结构类型用于表征所述电子设备与传感器的结构关系,以及
所述至少一个处理器,用于根据所获取的电子设备的结构类型,将所述校准变量设置为所述结构类型;
所述传感器,用于根据所读取的所述电子设备的结构类型,从预置的包含多个分别与不同电子设备的结构类型对应的备选校准参数的备选列表中,选取与所述电子设备的结构类型对应的备选校准参数,配置为校准参数。
上述实施例中,可选地,所述电子设备的所述处理器还包括用于读取预先设置的所述校准配置信息的装置。
本发明的发明人发现,在现有技术中,尚未提供一种传感器的校准参数的配置方法以及电子设备,可以自适应地根据电子设备的结构设计配置传感器的校准参数,进而避免对不同结构设计的电子设备开发和维护的不同的产品代码带来的成本。因此,本发明所要实现的技术任务或者所要解决的技术问题是本领域技术人员从未想到的或者没有预期到的,故本发明是一种新的技术方案。
通过以下参照附图对本发明的示例性实施例的详细描述,本发明的其它特征及其优点将会变得清楚。
一个或多个实施例通过与之对应的附图中的图片进行示例性说明,这些示例性说明并不构成对实施例的限定,附图中具有相同参考数字标号的元件表示为类似的元件,除非有特别申明,附图中的图不构成比例限制。
图1示出了本发明实施例提供的传感器的校准参数的配置方法的一个流程图。
图2示出了本发明实施例提供的传感器的校准参数的配置方法的又一个流程图。
图3示出了本发明实施例提供的安卓手机的传感器的校准参数的配置方法的流程图。
图4示出了本发明实施例提供的电子设备的示意性框图。
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。
现在将参照附图来详细描述本发明的各种示例性实施例。应注意到:除非另外具体说明,否则在这些实施例中阐述的部件和步骤的相对布置、数字
表达式和数值不限制本发明的范围。
以下对至少一个示例性实施例的描述实际上仅仅是说明性的,决不作为对本发明及其应用或使用的任何限制。
对于相关领域普通技术人员已知的技术、方法和设备可能不作详细讨论,但在适当情况下,所述技术、方法和设备应当被视为说明书的一部分。
在这里示出和讨论的所有例子中,任何具体值应被解释为仅仅是示例性的,而不是作为限制。因此,示例性实施例的其它例子可以具有不同的值。
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步讨论。
<实施例>
本发明实施例提供一种传感器的校准参数的配置方法,如图1所示,
应用于电子设备,所述电子设备包含处理器单元以及传感器单元,所述方法通过处理器单元以及传感器单元实施,包括以下步骤:
步骤S1100,处理器单元根据所获取的校准配置信息,设置校准变量,其中,校准变量为可供处理器单元设置以及传感器单元读取的全局变量;
步骤S2100,所述传感器单元根据所读取的所述校准变量,配置校准参数,所述校准参数用于所述传感器单元进行自身校准。
本实施例中的电子设备包含处理器单元以及传感器单元,所述传感器单元通常具有精度要求,因此在电子设备启动时以及运行过程中传感器单元需要进行校准以使得能满足精度要求,但不同的电子设备具有不同的结构设计,对应的传感器单元在电子设备中的位置差异会带来校准参数的差异,因此不同电子设备中的传感器单元进行校准需要不同的校准参数。本实施例由处理器单元根据所获取的校准配置信息,设置校准变量供传感器单元读取后配置校准参数,可以自适应地适配不同电子设备的不同结构设计带来的传感器的校准差异,无需额外的产品代码开发和维护,降低成本。
在一个例子中,所述校准配置信息为传感器单元的校准参数。处理器单元根据获取传感器单元的校准参数,将校准变量设置为传感器单元的校准参
数供传感器单元读取后进行配置,可以直接将传感器单元的校准参数传递至传感器单元,不仅可以自适应地适配不同电子设备的不同结构设计带来的传感器的校准差异,还可以自适应适配其他情况(例如传感器单元的型号不同、结构不同等)带来的传感器的校准差异,进一步降低成本。
但在一些应用场景中,受限于电子设备的存储空间较小或设备性能较差不能支持传递内容较多的校准参数,或是目的仅为自适应地适配不同电子设备的不同结构设计带来的传感器的校准差异,本实施例还提供一种传感器的校准参数的配置方法,所述校准配置信息为所述电子设备的结构类型,所述结构类型用于表征所述电子设备与传感器单元的结构关系,所述方法如图2所示,包括:
步骤S2100,所述处理器单元根据所获取的电子设备的结构类型,将所述校准变量设置为所述结构类型;
步骤S2200,所述传感器单元根据所读取的所述电子设备的结构类型,从预置的包含多个分别与不同电子设备的结构类型对应的备选校准参数的备选列表中,选取与所述电子设备的结构类型对应的备选校准参数,配置为校准参数。
不同的电子设备,对应的结构设计不同,通常采用结构类型来区分不同的结构设计,使得电子设备的结构类型与电子设备的结构设计具有唯一映射的关系,结构设计中包含电子设备的传感器单元在电子设备中的位置信息,因此结构类型可以表征电子设备与传感器单元的结构关系,而电子设备与传感器单元的结构关系又与校准参数对应,因而处理器单元通过配置校准变量供传感器单元读取,将所获取的电子设备的结构类型传递给传感器单元,传感器单元就可以从预置的备选列表中选取与所述电子设备的结构类型对应的备选校准参数配置为校准参数。在本实施例中,可以在电子设备出厂前就将备选列表预置在传感器单元中,还可以在电子设备开机后从远程服务器下载预置在传感器单元中的备选列表,也可以由远程服务器将最新的备选列表下发给电子设备供传感器单元更新。
在一个更具体的例子中,所述电子设备为安卓操作系统的手机,所述校准配置信息为所述手机的产品型号,所述校准变量为所述安卓编译环境中的
环境变量Type,所述方法如图3所示,包括以下步骤:
步骤S3100,所述处理器单元根据所获取的所述手机的产品型号,通过系统编译脚本将所述环境变量Type设置为所述手机的产品型号。
不同产品型号的手机,通常具有不同的结构设计,手机的产品型号与手机的结构设计存在隐含的对应关系,所以手机的产品型号可以作为手机结构类型的一种指示,用于表征电子设备与传感器单元的结构关系。在安卓操作系统中,系统编译脚本可以是shell脚本,而在安卓的编译环境中,环境变量是可以供处理单元通过export命令设置,并供传感器单元读取的全局变量。因此,安卓操作系统的手机中,处理器单元可以通过shell脚本将环境变量Type设置为手机的产品型号。
处理器单元还可以调用系统编译脚本获取所述手机的产品型号,例如通过调用shell脚本获取手机的产品型号。
在步骤S3100之后,进入步骤S3200,所述传感器单元根据通过对应的传感器单元程序脚本读取的环境变量Type,赋值本地的预定义参数,根据所述预定义参数从预定义的所述包含多个分别与不同手机的产品型号对应的备选校准参数的备选列表中,选取与所述手机的产品型号对应的备选校准参数,定义为校准参数。
在本例中,传感器单元程序脚本可以是Python脚本,传感器单元通过Python脚本读取环境变量Type,通过CCFLAGS-Dxxx编译命令将环境变量Type的取值赋值给预定义参数,并且预定义的所述包含多个分别与不同手机的产品型号对应的备选校准参数的备选列表可以预先在传感器单元的驱动程序代码中进行定义,在通过#ifdef XXX命令定义预定义参数,就可以将根据所述预定义参数从预定义的备选列表中选取的所述手机的产品型号对应的备选校准参数定义为校准参数。
在一个例子中,如图1或图2所示的传感器的校准参数的配置方法,还包括,所述处理器单元读取预先设置的所述校准配置信息。
本发明的再一个实施例,还提供一种电子设备4000,如图4所示,包括处理器单元4100和传感器单元4200,用于实施本实施例中如图1或2所
示的方法,在此不再赘述。
电子设备4000,包括处理器单元4100和传感器单元4200:
处理器单元4100,用于根据所获取的校准配置信息,设置校准变量,所述校准变量为可供所述处理器单元设置以及所述传感器单元读取的全局变量;
传感器单元4200,用于根据所读取的所述校准变量,配置校准参数,所述校准参数用于所述传感器单元进行自身校准。
在一个例子中,所述校准配置信息为所述传感器单元4200的校准参数。
在一个例子中,所述校准配置信息为所述电子设备的结构类型,所述结构类型用于表征所述电子设备与传感器单元的结构关系,以及
处理器单元4100,用于根据所获取的电子设备的结构类型,将所述校准变量设置为所述结构类型;
传感器单元4200,用于根据所读取的所述电子设备的结构类型,从预置的包含多个分别与不同电子设备的结构类型对应的备选校准参数的备选列表中,选取与所述电子设备的结构类型对应的备选校准参数,配置为校准参数。
在又一个例子中,处理器单元4100还包括用于读取预先设置的所述校准配置信息的装置。
以上已经结合附图描述了本发明的实施例,根据本实施例,电子设备的处理器根据获取的校准配置信息设置校准变量后,传感器可以通过读取校准变量设置用于其自身校准的较准参数,使得电子设备可以自适应地配置传感器的校准参数,无需对不同结构的电子设备开发和维护不同的产品代码,降低了产品的开发和维护成本。
本领域技术人员应当明白,可以通过各种方式来实现处理器单元和传感器单元。例如,可以通过指令配置处理器单元来实现处理器单元和传感器单元。例如,可以将指令存储在ROM中,并且当启动设备时,将指令从ROM读取到可编程器件中来实现处理器单元和传感器单元。例如,可以将处理器单元和传感器单元固化到专用器件(例如ASIC)中。可以将处理器单元和
传感器单元分成相互独立的单元,或者可以将它们合并在一起实现。处理器单元和传感器单元可以通过上述各种实现方式中的一种来实现,或者可以通过上述各种实现方式中的两种或更多种方式的组合来实现。
本发明可以是系统、方法和/或计算机程序产品。计算机程序产品可以包括计算机可读存储介质,其上载有用于使处理器单元实现本发明的各个方面的计算机可读程序指令。
计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是――但不限于――电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、静态随机存取存储器(SRAM)、便携式压缩盘只读存储器(CD-ROM)、数字多功能盘(DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。这里所使用的计算机可读存储介质不被解释为瞬时信号本身,诸如无线电波或者其他自由传播的电磁波、通过波导或其他传输媒介传播的电磁波(例如,通过光纤电缆的光脉冲)、或者通过电线传输的电信号。
这里所描述的计算机可读程序指令可以从计算机可读存储介质下载到各个计算/处理设备,或者通过网络、例如因特网、局域网、广域网和/或无线网下载到外部计算机或外部存储设备。网络可以包括铜传输电缆、光纤传输、无线传输、路由器、防火墙、交换机、网关计算机和/或边缘服务器。每个计算/处理设备中的网络适配卡或者网络接口从网络接收计算机可读程序指令,并转发该计算机可读程序指令,以供存储在各个计算/处理设备中的计算机可读存储介质中。
用于执行本发明操作的计算机程序指令可以是汇编指令、指令集架构(ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码,所述编程语言包括面向对象的编程语言—诸如Smalltalk、C++等,以及常规的过
程式编程语言—诸如“C”语言或类似的编程语言。计算机可读程序指令可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络—包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。在一些实施例中,通过利用计算机可读程序指令的状态信息来个性化定制电子电路,例如可编程逻辑电路、现场可编程门阵列(FPGA)或可编程逻辑阵列(PLA),该电子电路可以执行计算机可读程序指令,从而实现本发明的各个方面。
这里参照根据本发明实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本发明的各个方面。应当理解,流程图和/或框图的每个方框以及流程图和/或框图中各方框的组合,都可以由计算机可读程序指令实现。
这些计算机可读程序指令可以提供给通用计算机、专用计算机或其它可编程数据处理装置的处理器单元,从而生产出一种机器,使得这些指令在通过计算机或其它可编程数据处理装置的处理器单元执行时,产生了实现流程图和/或框图中的一个或多个方框中规定的功能/动作的装置。也可以把这些计算机可读程序指令存储在计算机可读存储介质中,这些指令使得计算机、可编程数据处理装置和/或其他设备以特定方式工作,从而,存储有指令的计算机可读介质则包括一个制造品,其包括实现流程图和/或框图中的一个或多个方框中规定的功能/动作的各个方面的指令。
也可以把计算机可读程序指令加载到计算机、其它可编程数据处理装置、或其它设备上,使得在计算机、其它可编程数据处理装置或其它设备上执行一系列操作步骤,以产生计算机实现的过程,从而使得在计算机、其它可编程数据处理装置、或其它设备上执行的指令实现流程图和/或框图中的一个或多个方框中规定的功能/动作。
附图中的流程图和框图显示了根据本发明的多个实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或
框图中的每个方框可以代表一个模块、程序段或指令的一部分,所述模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。对于本领域技术人员来说公知的是,通过硬件方式实现、通过软件方式实现以及通过软件和硬件结合的方式实现都是等价的。
以上已经描述了本发明的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。本发明的范围由所附权利要求来限定。
Claims (10)
- 一种传感器的校准参数的配置方法,应用于电子设备,其特征在于,所述电子设备包含处理器单元以及传感器单元,所述方法通过处理器单元以及传感器单元实施,包括:所述处理器单元根据所获取的校准配置信息,设置校准变量,所述校准变量为可供所述处理器单元设置以及所述传感器单元读取的全局变量;所述传感器单元根据所读取的所述校准变量,配置校准参数,所述校准参数用于所述传感器单元进行自身校准。
- 根据权利要求1所述的方法,其特征在于,所述校准配置信息为所述传感器单元的校准参数。
- 根据权利要求1所述的方法,其特征在于,所述校准配置信息为所述电子设备的结构类型,所述结构类型用于表征所述电子设备与传感器单元的结构关系,所述方法包括:所述处理器单元根据所获取的电子设备的结构类型,将所述校准变量设置为所述结构类型;所述传感器单元根据所读取的所述电子设备的结构类型,从预置的包含多个分别与不同电子设备的结构类型对应的备选校准参数的备选列表中,选取与所述电子设备的结构类型对应的备选校准参数,配置为校准参数。
- 根据权利要求1-3任意一项所述的方法,其特征在于,还包括,所述处理器单元读取预先设置的所述校准配置信息的步骤。
- 根据权利要求3所述的方法,其特征在于,所述电子设备为安卓操作系统的手机,所述校准配置信息为所述手机的产品型号,所述校准变量为安卓编译环境中的环境变量Type,所述方法包括以下步骤:所述处理器单元根据所获取的所述手机的产品型号,通过系统编译脚本将所述环境变量Type设置为所述手机的产品型号;所述传感器单元根据通过对应的传感器单元程序脚本读取的环境变量Type,赋值本地的预定义参数,根据所述预定义参数从预定义的所述包含多个分别与不同手机的产品型号对应的备选校准参数的备选列表中,选取与所 述手机的产品型号对应的备选校准参数,定义为校准参数。
- 根据权利要求5所述的方法,其特征在于,还包括:所述处理器单元调用系统编译脚本获取所述手机的产品型号。
- 一种电子设备,其特征在于,包括:处理器单元和传感器单元;所述处理器单元,用于根据所获取的校准配置信息,设置校准变量,所述校准变量为可供所述处理器单元设置以及所述传感器单元读取的全局变量;所述传感器单元,用于根据所读取的所述校准变量,配置校准参数,所述校准参数用于所述传感器单元进行自身校准。
- 根据权利要求7所述的电子设备,其特征在于,所述校准配置信息为所述传感器单元的校准参数。
- 根据权利要求7所述的电子设备,其特征在于,所述校准配置信息为所述电子设备的结构类型,所述结构类型用于表征所述电子设备与传感器单元的结构关系,以及所述处理器单元,用于根据所获取的电子设备的结构类型,将所述校准变量设置为所述结构类型;所述传感器单元,用于根据所读取的所述电子设备的结构类型,从预置的包含多个分别与不同电子设备的结构类型对应的备选校准参数的备选列表中,选取与所述电子设备的结构类型对应的备选校准参数,配置为校准参数。
- 根据权利7-9任意一项所述的电子设备,其特征在于,所述处理器单元还包括用于读取预先设置的所述校准配置信息的装置。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610270891.1A CN105912341A (zh) | 2016-04-27 | 2016-04-27 | 一种传感器的校准参数的配置方法及电子设备 |
| CN2016102708911 | 2016-04-27 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2017185669A1 true WO2017185669A1 (zh) | 2017-11-02 |
Family
ID=56752836
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2016/102396 Ceased WO2017185669A1 (zh) | 2016-04-27 | 2016-10-18 | 传感器的校准参数的配置方法及电子设备 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN105912341A (zh) |
| WO (1) | WO2017185669A1 (zh) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113447064A (zh) * | 2021-06-30 | 2021-09-28 | 东莞市小精灵教育软件有限公司 | 一种校准方法和电子设备 |
| CN114338889A (zh) * | 2021-12-16 | 2022-04-12 | 深圳市中兴移动软件有限公司 | 一种光感校准测试方法、设备及计算机可读存储介质 |
Families Citing this family (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105912341A (zh) * | 2016-04-27 | 2016-08-31 | 乐视控股(北京)有限公司 | 一种传感器的校准参数的配置方法及电子设备 |
| CN107389878B (zh) * | 2017-08-31 | 2021-05-28 | 广东美的制冷设备有限公司 | 传感器的自校验方法、装置及计算机可读存储介质 |
| CN107942861A (zh) * | 2017-11-27 | 2018-04-20 | 上海上实龙创智慧能源科技股份有限公司 | 一种远程设备管控方法 |
| CN109656633B (zh) * | 2018-11-26 | 2022-05-10 | 广州致远电子有限公司 | 仪器校准方法、装置、系统、终端设备及可读存储介质 |
| CN111398523B (zh) * | 2020-03-30 | 2022-08-02 | 清华-伯克利深圳学院筹备办公室 | 基于分布的传感器数据校准方法及系统 |
| CN113804232A (zh) * | 2021-08-20 | 2021-12-17 | 深圳市撰文科技有限公司 | 传感器校准方法、装置以及终端设备 |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20060161368A1 (en) * | 2005-01-14 | 2006-07-20 | Zhengrong Zhou | Incremental generation of calibration factors for automated test equipment |
| CN102374875A (zh) * | 2010-08-04 | 2012-03-14 | 福禄克公司 | 用于多个传感器的单传感器电子数据表 |
| CN102735284A (zh) * | 2012-06-25 | 2012-10-17 | 青岛海信移动通信技术股份有限公司 | 一种传感器校准方法及装置 |
| CN103186267A (zh) * | 2011-12-30 | 2013-07-03 | 希姆通信息技术(上海)有限公司 | 触摸屏校准方法及装置 |
| CN103699320A (zh) * | 2012-09-27 | 2014-04-02 | 华为终端有限公司 | 设置触屏参数值的方法及装置 |
| CN105912341A (zh) * | 2016-04-27 | 2016-08-31 | 乐视控股(北京)有限公司 | 一种传感器的校准参数的配置方法及电子设备 |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US9625490B2 (en) * | 2011-12-01 | 2017-04-18 | Qualcomm Incorporated | Mitigating the effect of a change in sensor calibration parameters |
-
2016
- 2016-04-27 CN CN201610270891.1A patent/CN105912341A/zh active Pending
- 2016-10-18 WO PCT/CN2016/102396 patent/WO2017185669A1/zh not_active Ceased
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20060161368A1 (en) * | 2005-01-14 | 2006-07-20 | Zhengrong Zhou | Incremental generation of calibration factors for automated test equipment |
| CN102374875A (zh) * | 2010-08-04 | 2012-03-14 | 福禄克公司 | 用于多个传感器的单传感器电子数据表 |
| CN103186267A (zh) * | 2011-12-30 | 2013-07-03 | 希姆通信息技术(上海)有限公司 | 触摸屏校准方法及装置 |
| CN102735284A (zh) * | 2012-06-25 | 2012-10-17 | 青岛海信移动通信技术股份有限公司 | 一种传感器校准方法及装置 |
| CN103699320A (zh) * | 2012-09-27 | 2014-04-02 | 华为终端有限公司 | 设置触屏参数值的方法及装置 |
| CN105912341A (zh) * | 2016-04-27 | 2016-08-31 | 乐视控股(北京)有限公司 | 一种传感器的校准参数的配置方法及电子设备 |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113447064A (zh) * | 2021-06-30 | 2021-09-28 | 东莞市小精灵教育软件有限公司 | 一种校准方法和电子设备 |
| CN114338889A (zh) * | 2021-12-16 | 2022-04-12 | 深圳市中兴移动软件有限公司 | 一种光感校准测试方法、设备及计算机可读存储介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN105912341A (zh) | 2016-08-31 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US9262237B2 (en) | Automating software availability management based on API versioning | |
| US20160321067A1 (en) | Infrastructure for hosting and publishing software packages | |
| US10261844B2 (en) | Generic language application programming interface interpreter | |
| US9311049B2 (en) | System to improve numereical conversions and associated methods | |
| US9442720B2 (en) | Adding on-the-fly comments to code | |
| CN104143067B (zh) | 一种终端设备及软件共享机制的实现方法 | |
| US11005719B2 (en) | Internet of Things system topology generation | |
| WO2017185684A1 (zh) | 无线路由器管理智能家居的方法、无线路由器 | |
| US10579347B2 (en) | Self re-encoding interpreted application | |
| US20140293306A1 (en) | System and method for keyed operation of devices using near field communication | |
| US8984487B2 (en) | Resource tracker | |
| WO2017148057A1 (zh) | 一种软件版本生成方法及装置 | |
| US9235391B2 (en) | Optimization of software symbol tables | |
| WO2016155387A1 (zh) | 基于移动终端的插件管理方法及装置 | |
| CN107368307A (zh) | 用于实时配置应用的界面的方法、设备和系统 | |
| US10366518B2 (en) | Extension of text on a path | |
| CN106951265B (zh) | 开发环境搭建方法及装置 | |
| KR101632288B1 (ko) | 고급 운영 시스템(hlos) 부팅 전에 스마트폰에 연결된 주변기기 디바이스들을 위한 디바이스 드라이버들을 프리페칭하기 위한 방법 및 장치 | |
| CN105892963A (zh) | 用于生成扩展显示标识数据edid的方法和显示设备 | |
| US9405655B2 (en) | System and method for running a validation process for an information handling system during a factory process | |
| US20130318509A1 (en) | Generating object code from a conjoined assembler directive | |
| CN107665124B (zh) | 模块化JavaScript文件处理方法、设备和服务器 | |
| US20210089621A1 (en) | Secondary language support | |
| CN113015957A (zh) | 用户设备、服务器、该用户设备的控制方法以及该服务器的控制方法 | |
| US20180365023A1 (en) | Teaser of an application available for installation |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 16900177 Country of ref document: EP Kind code of ref document: A1 |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 16900177 Country of ref document: EP Kind code of ref document: A1 |