Embedded device, hardware version configuration device and method thereof, and terminal product
Through the combination of voltage divider module and controller, the hardware version is characterized by voltage values and dynamic configuration, the problem of high configuration cost and poor accuracy of embedded devices is solved, and low-cost, accurate and efficient hardware version management is achieved.
Patent Information
- Application Number
- CN202510504120.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2025-08-08
AI Technical Summary
The prior art is expensive in the hardware version configuration of embedded devices, complex design, poor flexibility, and error-prone to relying on manual operations, resulting in poor configuration accuracy.
The voltage divider module and controller are used to characterize the hardware version number by outputting the voltage value of the voltage divider module, and the target configuration file is obtained from the configuration file storage area, and the voltage divider resistance value is dynamically adjusted to configure the new hardware version.
Achieve low-cost, accurate and efficient hardware version configuration, improve identification accuracy and flexibility, and reduce maintenance costs.
Smart Images

Figure CN120447946A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of embedded systems, and in particular to an embedded device and a hardware version configuration device, method, and terminal product thereof. Background Art
[0002] In the development of Linux-based embedded devices, multiple hardware versions (e.g., different sensors) are often available for configuration within the same product line. Currently, hardware version configuration for embedded devices is typically performed using methods such as GPIO (General-Purpose Input / Output) level markers or EEPROM (Electrically Erasable Programmable Read-Only Memory) storage markers to identify the required hardware version for the device.
[0003] However, the implementation of these methods generally requires the use of high-cost hardware or involves high design costs, which results in relatively high costs when implementing hardware version configuration of embedded devices. Summary of the Invention
[0004] The main purpose of this application is to provide an embedded device and its hardware version configuration device, method, and terminal product, aiming to realize hardware version configuration of the embedded device at low cost.
[0005] To achieve the above objectives, the present application proposes a hardware version configuration device for an embedded device, comprising:
[0006] a voltage dividing module, connected to the embedded device and configured to divide the voltage of the embedded device;
[0007] a controller in the embedded device, the controller being connected to the voltage divider module and configured to obtain a voltage value output by the voltage divider module, obtain a target configuration file corresponding to the voltage value output by the voltage divider module from a preset configuration file storage area, and configure a hardware version of the embedded device based on the target configuration file;
[0008] The voltage value output by the voltage dividing module is used to represent the version number of the hardware version required to be configured by the embedded device.
[0009] In one embodiment, the voltage dividing module includes a first resistor, a second resistor, a third resistor, a fourth resistor and a capacitor;
[0010] The first end of the first resistor is connected to a power supply, the second end of the first resistor is respectively connected to the first end of the second resistor, the first end of the third resistor, the embedded device and the controller, the first end of the third resistor is connected to the first end of the fourth resistor, the first end of the capacitor is respectively connected to the embedded device and the controller, and the second end of the second resistor, the second end of the fourth resistor and the second end of the capacitor are grounded.
[0011] In one embodiment, the controller is further connected to a control end of the first resistor, a control end of the second resistor, a control end of the third resistor, and a control end of the fourth resistor;
[0012] The controller is also used for:
[0013] When receiving a configuration instruction for a new hardware version, obtaining a voltage value corresponding to the version number of the new hardware version as a target voltage value;
[0014] The voltage dividing resistance value of the voltage dividing module is adjusted based on the target voltage value to adjust the voltage value output by the voltage dividing module to the target voltage value, so as to control the embedded device to configure the new hardware version.
[0015] In one embodiment, the error ranges of the circuit elements in the voltage divider module are all within a preset error range.
[0016] In addition, to achieve the above-mentioned purpose, the present application also provides an embedded device, which includes a device body and a hardware version configuration device of the embedded device as described above; the hardware version configuration device is arranged in the device body.
[0017] In addition, to achieve the above-mentioned purpose, the present application also provides a method for configuring the hardware version of an embedded device, wherein the embedded device and a controller in the embedded device are both connected to a voltage divider module, and the method includes:
[0018] Obtaining a voltage value output by the voltage dividing module after dividing the voltage of the embedded device;
[0019] Obtaining a target configuration file corresponding to the voltage value output by the voltage divider module from a preset configuration file storage area;
[0020] Configuring the hardware version of the embedded device based on the target configuration file;
[0021] The voltage value output by the voltage dividing module is used to represent the version number of the hardware version required to be configured by the embedded device.
[0022] In one embodiment, the target configuration file includes a target device tree file and a target initialization program, and the step of configuring the hardware version of the embedded device based on the target configuration file includes:
[0023] The target device tree file is loaded into the embedded device, and after the loading is completed, the embedded device is controlled to run the target initialization program to configure the hardware version of the embedded device.
[0024] In one embodiment, before the step of obtaining the voltage value output by the voltage dividing module after dividing the voltage of the embedded device, the method further includes:
[0025] Obtain the kernel source code to be burned, and obtain and combine the configuration files to be burned to obtain a configuration file set;
[0026] Combining the configuration file set with the kernel source code to generate an image file;
[0027] The image file is burned into the embedded device, and after burning, each configuration file in the image file is associated with a different voltage value range so as to be stored in the configuration file storage area.
[0028] In one embodiment, the method further comprises:
[0029] When receiving a configuration instruction for a new hardware version, obtaining a voltage value corresponding to the version number of the new hardware version as a target voltage value;
[0030] The voltage dividing resistance value of the voltage dividing module is adjusted based on the target voltage value to adjust the voltage value output by the voltage dividing module to the target voltage value, so as to control the embedded device to configure the new hardware version.
[0031] In addition, to achieve the above-mentioned purpose, the present application also proposes a terminal product, which includes: a memory, a processor, and a computer program stored in the memory and runnable on the processor, and the computer program is configured to implement the steps of the hardware version configuration method of the embedded device as described above.
[0032] In addition, to achieve the above-mentioned purpose, the present application also provides a computer-readable storage medium, on which a computer program is stored. The computer program is executed by a processor to implement the steps of the hardware version configuration method of the embedded device as described above.
[0033] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the hardware version configuration method of the embedded device as described above.
[0034] The present application provides a hardware version configuration device for an embedded device, which includes a voltage divider module and a controller in the embedded device. The voltage divider module is connected to the embedded device and is used to divide the voltage of the embedded device; the controller is connected to the voltage divider module and is used to obtain the voltage value output by the voltage divider module, and obtain a target configuration file corresponding to the voltage value output by the voltage divider module from a preset configuration file storage area, and configure the hardware version of the embedded device based on the target configuration file; wherein the voltage value output by the voltage divider module is used to represent the version number of the hardware version required to be configured for the embedded device.
[0035] Therefore, the present application provides a voltage divider module connected to the embedded device and to the controller in the embedded device. Thus, when configuring the hardware version of the embedded device, the voltage divider module divides the voltage of the embedded device to output a voltage value representing the version number of the hardware version to be configured for the embedded device, thereby identifying the version number of the hardware version to be configured for the embedded device. Based on this, the controller uses the voltage value output by the voltage divider module to retrieve the corresponding target configuration file from a preset configuration file storage area, thereby configuring the hardware version of the embedded device using the target configuration file.
[0036] In summary, the technical solution provided by this application only requires a voltage divider module connected to the embedded device and the controller in the embedded device to configure the hardware version of the embedded device. Generally, the hardware and design costs involved in the voltage divider module are relatively low. Therefore, compared to conventional methods, the technical solution provided by this application can achieve hardware version configuration of the embedded device at a low cost.
[0037] Furthermore, the technical solution provided by this application automatically configures the hardware version of an embedded device without manual intervention, resulting in higher configuration accuracy compared to conventional manual hardware version configuration methods. Furthermore, this application also ensures that the error range of the circuit components in the voltage divider module is within a preset error range. This improves the voltage fault tolerance of the voltage divider module, thereby increasing the accuracy of identifying the version number of the hardware version required for the embedded device, further enhancing configuration accuracy.
[0038] Furthermore, the present application also provides a controller that can dynamically adjust the voltage divider resistance value of the voltage divider module based on the configuration instructions of the new hardware version received, so that the voltage divider module outputs a voltage value corresponding to the version number of the new hardware version. As a result, the new voltage value output by the voltage divider module can be used to control the embedded device to configure the new hardware version. Therefore, the technical solution provided by the present application only requires adjusting the voltage divider resistance value of the voltage divider module to complete the hardware version change of the embedded device. Compared with the conventional method of manually changing the hardware version, the change efficiency is not only higher, but also more flexible.
[0039] In addition, the technical solution provided by the present application, when burning the image file, will first combine the configuration files to be burned together to obtain a configuration file set, and then combine the configuration file set with the kernel source code to be burned so that each configuration file shares the same kernel source code to obtain the image file. As a result, only one image file needs to be burned to the embedded device to store each configuration file in the configuration file storage area. Therefore, compared with the conventional technology in which each configuration file needs to be individually associated with the kernel source code when burning, thereby requiring multiple image files to be burned to the embedded device, the technical solution provided by the present application only needs to maintain one image file when maintaining the image firmware to complete the maintenance work, thereby reducing maintenance costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying any creative work.
[0041] Figure 1 A schematic diagram of the module structure of the hardware version configuration device for an embedded device provided in an embodiment of the present application;
[0042] Figure 2 A schematic diagram of a circuit structure of a voltage divider module provided in an embodiment of the present application;
[0043] Figure 3 This is another circuit structure diagram of the voltage divider module provided in an embodiment of the present application;
[0044] Figure 4 A flowchart of a method for configuring the hardware version of an embedded device provided in an embodiment of the present application;
[0045] Figure 5 A flowchart of the implementation method of the hardware version configuration method of the embedded device provided in the embodiment of the present application;
[0046] Figure 6 A structural diagram of the hardware operating environment of the hardware version configuration method for an embedded device provided in an embodiment of the present application.
[0047] The purpose, features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings.
[0048] Description of Figure Numbers:
[0049] 10. Voltage divider module; 20. Controller; R1 to R4, resistors; C1, capacitor; VCC, power supply; GND, ground;
[0050] 101. Processing device; 102. Read-only memory; 103. Storage device; 104. Random access memory; 105. Bus; 106. Input / output interface; 107. Input device; 108. Output device; 109. Communication device. DETAILED DESCRIPTION
[0051] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0052] It should be noted that all directional indications in the embodiments of the present application (such as up, down, left, right, front, back, etc.) are only used to explain the relative position relationship, movement status, etc. between the various components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.
[0053] In addition, the descriptions of "first", "second", etc. in this application are for descriptive purposes only and should not be understood as indicating or implying their relative importance or implicitly indicating the number of the technical features indicated. Therefore, the features defined as "first" or "second" may explicitly or implicitly include at least one of such features. In addition, the technical solutions between the various embodiments can be combined with each other, but this must be based on the fact that they can be implemented by ordinary technicians in this field. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0054] In the development of Linux-based embedded devices, multiple hardware versions (such as different sensors) are often available for configuration within the same product line. Traditional hardware version configuration methods require manual firmware compilation or configuration switching for each hardware version, which leads to the following problems:
[0055] 1. High maintenance cost: Independent system images need to be set up for different hardware versions, which reduces upgrade and testing efficiency.
[0056] 2. Poor flexibility: Changing the hardware version requires re-burning the firmware, and dynamic adaptation is not possible.
[0057] 3. Excessive manual intervention: Relying on manual operations is prone to errors, resulting in poor configuration accuracy.
[0058] On this basis, currently, when configuring the hardware version of an embedded device, GPIO level identification or EEPROM storage identification is usually used to identify the hardware version number that the device needs to configure, so as to configure the hardware version of the embedded device.
[0059] However, the GPIO level identification method requires the use of multiple GPIO pins to identify the hardware version number required for the device configuration. Its hardware design is highly complex and costly, and the number of configurable hardware versions is limited by the number of pins. The EEPROM storage identification method is expensive, and the EEPROM chip is easily damaged or data lost, leading to recognition failure.
[0060] Therefore, the implementation of these methods generally requires the use of high-cost hardware or involves high design costs, which results in relatively high costs when implementing the hardware version configuration of embedded devices.
[0061] Based on this, the embodiment of the present application proposes a hardware version configuration device for an embedded device, please refer to Figure 1 , the hardware version configuration device of the embedded device may include:
[0062] A voltage dividing module 10, which is connected to the embedded device and is used to divide the voltage of the embedded device;
[0063] A controller 20 in the embedded device, connected to the voltage divider module 10, configured to obtain a voltage value output by the voltage divider module 10, obtain a target configuration file corresponding to the voltage value output by the voltage divider module 10 from a preset configuration file storage area, and configure the hardware version of the embedded device based on the target configuration file;
[0064] The voltage value output by the voltage dividing module 10 is used to represent the version number of the hardware version required to be configured by the embedded device.
[0065] It should be noted that different version numbers correspond to different voltage ranges. Therefore, the configuration file storage area can be used to directly record the configuration files corresponding to each version number; it can also be used to record the configuration files corresponding to each voltage range, thereby indirectly recording the configuration files corresponding to each version number. This embodiment does not specifically limit this. The configuration file may include a device tree file and / or an initialization program, etc., which is not specifically limited in this embodiment. The target configuration file is the configuration file recorded in the configuration file storage area that corresponds to the voltage value output by the voltage divider module 10.
[0066] In addition, it should be noted that the voltage divider module 10 can be a voltage divider circuit or other device with a voltage divider function, etc., and this embodiment does not specifically limit this. In a feasible implementation, please refer to Figure 2 , the voltage dividing module 10 may include a first resistor R1, a second resistor R2, a third resistor R3, a fourth resistor R4 and a capacitor C1;
[0067] A first end of the first resistor R1 is connected to the power supply VCC, a second end of the first resistor R1 is respectively connected to a first end of the second resistor R2, a first end of the third resistor R3, the AD0_ID pin of the embedded device, and the controller 20, a first end of the third resistor R3 is connected to a first end of the fourth resistor R4, a first end of the capacitor C1 is respectively connected to the AD0_ID pin of the embedded device and the controller 20, a second end of the second resistor R2, a second end of the fourth resistor R4, and a second end of the capacitor C1 are grounded GND.
[0068] It should be noted that by adjusting the resistance values of the first resistor R1, the second resistor R2, the third resistor R3, and the fourth resistor R4, the voltage divided by the voltage divider module 10 can be adjusted, so that the voltage value output by the voltage divider module 10 will also change. In combination with the above content, it can be seen that different voltage value ranges correspond to different configuration files. Therefore, when the voltage value output by the voltage divider module 10 changes, the hardware version configured by the embedded device will also change accordingly. On this basis, in a feasible implementation method, please refer to Figure 3 , the controller 20 may also be connected to the control end of the first resistor R1, the control end of the second resistor R2, the control end of the third resistor R3 and the control end of the fourth resistor R4;
[0069] The controller 20 is further configured to:
[0070] When receiving a configuration instruction for a new hardware version, obtaining a voltage value corresponding to the version number of the new hardware version as a target voltage value;
[0071] The voltage dividing resistance value of the voltage dividing module 10 is adjusted based on the target voltage value, so as to adjust the voltage value output by the voltage dividing module 10 to the target voltage value, so as to control the embedded device to configure the new hardware version.
[0072] It should be noted that the configuration instruction for the new hardware version is used to indicate that the embedded device needs to be configured to the new hardware version indicated by the instruction. The voltage divider resistance value of the voltage divider module 10 may include the resistance value of the first resistor R1, the resistance value of the second resistor R2, the resistance value of the third resistor R3, and / or the resistance value of the fourth resistor R4, which is not specifically limited in this embodiment.
[0073] In this embodiment, the controller 20 is further connected to the control end of the first resistor R1, the control end of the second resistor R2, the control end of the third resistor R3, and the control end of the fourth resistor R4. Therefore, when the hardware version configured in the embedded device needs to be adjusted, the controller 20 can be used to adjust the voltage divider resistance value of the voltage divider module 10 to adjust the magnitude of the voltage divided by the voltage divider module 10. The new voltage value output by the voltage divider module 10 can then be used to control the embedded device to configure a new hardware version.
[0074] In a feasible implementation, the error range of the circuit elements in the voltage divider module 10 can be set within a preset error range to improve the voltage fault tolerance of the voltage divider module 10, thereby improving the recognition accuracy of the version number of the hardware version required to be configured for the embedded device.
[0075] It should be noted that the preset error range may be a default range, such as [-5%, +5%]; or it may be flexibly set by the user according to actual conditions, and this embodiment does not specifically limit this.
[0076] As can be seen from the above, this embodiment connects the voltage divider module 10 to the embedded device and to the controller 20 in the embedded device. Therefore, when configuring the hardware version of the embedded device, the voltage divider module 10 divides the voltage of the embedded device and outputs a voltage value representing the version number of the hardware version to be configured for the embedded device, thereby identifying the version number of the hardware version to be configured for the embedded device. Based on this, the controller 20 uses the voltage value output by the voltage divider module 10 to retrieve the corresponding target configuration file from a preset configuration file storage area, thereby configuring the hardware version of the embedded device using the target configuration file.
[0077] In summary, the technical solution provided by this embodiment only requires a single voltage divider module 10 connected to the embedded device and the controller 20 within the embedded device to implement hardware version configuration for the embedded device. Typically, the hardware and design costs associated with the voltage divider module 10 are relatively low. Therefore, compared to conventional methods, the technical solution provided by this embodiment can achieve hardware version configuration for the embedded device at a lower cost.
[0078] In addition, the embodiment of the present application also provides a method for configuring the hardware version of an embedded device, wherein the embedded device and the controller in the embedded device are both connected to the voltage divider module, please refer to Figure 4 The hardware version configuration method of the embedded device may include steps S10 to S30:
[0079] Step S10, obtaining the voltage value output by the voltage dividing module after dividing the voltage of the embedded device;
[0080] Step S20, obtaining a target configuration file corresponding to the voltage value output by the voltage divider module from a preset configuration file storage area;
[0081] It should be noted that when obtaining a target configuration file corresponding to the voltage value output by the voltage divider module in a preset configuration file storage area, if the configuration file storage area is used to record configuration files corresponding to various voltage value ranges, the voltage value output by the voltage divider module can be directly used as an index to search the configuration file corresponding thereto from the configuration file storage area as the target configuration file. If the configuration file storage area is used to directly record configuration files corresponding to various version numbers, it is necessary to first determine the version number corresponding to the voltage value output by the voltage divider module based on the voltage value range within which the voltage value output by the voltage divider module falls; then, using the determined version number as an index, search the configuration file corresponding thereto from the configuration file storage area as the target configuration file. This embodiment does not specifically limit the specific implementation of step S20.
[0082] In the case where the configuration file storage area is used to directly record the configuration files corresponding to each version number, the code implementation of step S20 can be expressed as follows:
[0083]
[0084] Step S30, configuring the hardware version of the embedded device based on the target configuration file;
[0085] The voltage value output by the voltage divider module is used to represent the version number of the hardware version required to be configured by the embedded device.
[0086] In a feasible implementation, the target configuration file may include a target device tree file and a target initialization program, and step S30 may include step S31:
[0087] Step S31 : loading the target device tree file into the embedded device, and after the loading is completed, controlling the embedded device to run the target initialization program to configure the hardware version of the embedded device.
[0088] It should be noted that the target device tree file is the device tree file corresponding to the voltage value output by the voltage divider module, and the target initialization program is the initialization program corresponding to the voltage value output by the voltage divider module. The device tree file is a data structure file used to describe hardware devices. It is organized in a tree structure and clearly presents the hierarchical relationship and attribute information of the hardware devices. The device tree file usually has the ".dts" (Device Tree Source) extension as the source file name. After compilation, it will generate a binary file. The kernel will load this binary file at startup to understand the hardware configuration. The initialization program is the first piece of code executed during the startup process of an embedded device. Its main purpose is to initialize the hardware and software environment to create the necessary conditions for the normal operation of subsequent programs.
[0089] On this basis, the target device tree file can be loaded during the startup phase of the embedded device (U-Boot (Universal Boot Loader) or early kernel) to achieve dynamic adaptation of the hardware configuration. The specific code implementation can be expressed as follows:
[0090]
[0091] After loading is complete, the embedded device can be controlled to run the target initialization program in the user state of the embedded device to complete the differentiation operations such as peripheral calibration and service configuration during the hardware version configuration process. The specific code implementation can be expressed as follows:
[0092]
[0093] The hardware version configuration method for an embedded device provided in the embodiments of the present application can implement hardware version configuration for an embedded device at a low cost. Compared with the prior art, the beneficial effects of the hardware version configuration method for an embedded device provided in the present application are the same as the beneficial effects of the hardware version configuration apparatus for an embedded device provided in the above embodiments. The other technical features of the hardware version configuration method for an embedded device are the same as those disclosed in the above embodiments and are not further described here.
[0094] Based on the first embodiment of the hardware version configuration method of the embedded device described above, a second embodiment of the hardware version configuration method of the embedded device of the present application is proposed. In the second embodiment, before step S10, the hardware version configuration method of the embedded device may further include steps S01 to S03:
[0095] Step S01, obtaining the kernel source code to be burned, and obtaining and combining the configuration files to be burned to obtain a configuration file set;
[0096] It should be noted that the kernel source code is a set of program codes written in a high-level programming language (such as C language), which can realize various functions of the embedded device kernel.
[0097] Step S02, combining the configuration file set and the kernel source code to generate an image file;
[0098] In step S03 , the image file is burned into the embedded device. After burning, each configuration file in the image file is associated with a different voltage value range so as to be stored in the configuration file storage area.
[0099] In other feasible implementations, after the image file is burned into the embedded device, each configuration file in the image file may be associated with a different version number and stored in the configuration file storage area. This embodiment does not specifically limit this.
[0100] In this embodiment, when burning an image file, the configuration files to be burned are first combined together to obtain a configuration file set. Then, the configuration file set is combined with the kernel source code to be burned so that each configuration file shares the same kernel source code to obtain an image file. As a result, only one image file needs to be burned to the embedded device to store each configuration file in the configuration file storage area. Compared with the conventional method in which each configuration file needs to be individually associated with the kernel source code when burning, thereby requiring multiple image files to be burned to the embedded device, this embodiment only needs to maintain one image file when maintaining the image firmware to complete the maintenance work, thereby reducing the workload of firmware maintenance and improving the efficiency of firmware maintenance.
[0101] For example, to help understand the implementation process of the hardware version configuration method for an embedded device formed by combining this embodiment with the first embodiment of the hardware version configuration method for an embedded device, take the configuration file storage area for recording the configuration files corresponding to each voltage value range, and the configuration file includes a device tree file as an example, please refer to Figure 5 ;
[0102] First, after compiling each device tree 1 to n to be burned, the device tree files v1.dtb to vn.dtb to be burned can be obtained; then, by combining each device tree file v1.dtb to vn.dtb, a device tree file set (i.e., n dtb files in the figure) is obtained; then, by compiling the device tree file set and the kernel source code to be burned, and combining the compiled device tree file set and the kernel source code, an image file is generated; then, the image file is burned to the embedded device, and after burning, each device tree file in the image file is associated with a different voltage value range to be stored in the configuration file storage area.
[0103] After completing the burning and storage of the device tree file, the embedded device is controlled to power on and obtain the voltage value output by the voltage divider module after the embedded device is divided; then the voltage value range of the voltage value output by the voltage divider module is determined; then, according to the voltage value range of the voltage value output by the voltage divider module, the corresponding target device tree file is determined in the configuration file storage area; for example, if the voltage value output by the voltage divider module is within the voltage value range (0V, 0.05V), the target device tree file is determined to be v1.dtb; if the voltage value output by the voltage divider module is within the voltage value range (0.05V, 0.1V), the target device tree file is determined to be v2.dtb; if the voltage value output by the voltage divider module is within the voltage value range (2.95V, 3.0V), the target device tree file is determined to be vn.dtb.
[0104] After the target device tree file is determined, the target device tree file is loaded into the embedded device to start the kernel of the embedded device, thereby completing the configuration of the hardware version of the embedded device.
[0105] It should be noted that the above examples are only used to understand this application and do not constitute a limitation on the hardware version configuration method of the embedded device of this application. More forms of simple transformations based on this technical concept are all within the scope of protection of this application.
[0106] Based on the first embodiment and / or the second embodiment of the hardware version configuration method of the embedded device described above, a third embodiment of the hardware version configuration method of the embedded device of the present application is proposed. In the third embodiment, the hardware version configuration method of the embedded device may further include steps S40 to S50:
[0107] Step S40, when a configuration instruction of a new hardware version is received, obtaining a voltage value corresponding to the version number of the new hardware version as a target voltage value;
[0108] It should be noted that the new hardware version is the new hardware version that the embedded device needs to be configured with. As can be seen from the above, a version number can correspond to a voltage range. Therefore, any voltage value within the voltage range corresponding to the version number of the new hardware version can be used as the target voltage value; a fixed voltage value (e.g., a middle voltage value within the voltage range) can also be used as the target voltage value. This embodiment does not specifically limit this.
[0109] Step S50 , adjusting the voltage dividing resistance value of the voltage dividing module based on the target voltage value to adjust the voltage value output by the voltage dividing module to the target voltage value, so as to control the embedded device to configure the new hardware version.
[0110] Because the voltage divider module has different voltage divider resistor values, the voltage it can divide will also be different, and thus the voltage value it outputs will also be different. Therefore, in this embodiment, when it is necessary to adjust the hardware version configured in the embedded device, the voltage divider module's voltage divider resistor value can be adjusted based on the voltage value corresponding to the new hardware version number, so that the voltage divider module outputs the voltage value corresponding to the version number. In this way, the new voltage value output by the voltage divider module can be used to control the embedded device to configure the new hardware version.
[0111] In addition, an embodiment of the present application further provides an embedded device, comprising a device body and the aforementioned embedded device hardware version configuration device; the hardware version configuration device is disposed in the device body. The structure of the embedded device hardware version configuration device can refer to the aforementioned embodiment and will not be further described here.
[0112] The embedded device provided in this embodiment can realize hardware version configuration of the embedded device at low cost. Since the embedded device of this embodiment includes all technical solutions of all embodiments of the hardware version configuration device of the above embedded device, and the technical effects achieved are exactly the same, they will not be repeated here.
[0113] In addition, an embodiment of the present application also provides a terminal product, which may include a processor and a memory, wherein the memory stores a soft start control program for the processor to call to implement the hardware version configuration method of the embedded device provided in the above embodiment.
[0114] Reference below Figure 6 , which shows a structural schematic diagram of a terminal product suitable for implementing the embodiments of the present application. Figure 6 The terminal product shown is merely an example and should not limit the functions and scope of use of the embodiments of the present application.
[0115] like Figure 6As shown, the terminal product may include a processing device 101 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to programs stored in a read-only memory 102 or programs loaded from a storage device 103 into a random access memory 104. Random access memory 104 also stores various programs and data required for the operation of the terminal product. Processing device 101, read-only memory 102, and random access memory 104 are interconnected via a bus 105. An input / output interface 106 is also connected to bus 105. Typically, the following systems may be connected to input / output interface 106: input device 107 including, for example, a touch screen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output device 108 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage device 103 including, for example, a magnetic tape, hard disk, etc.; and communication device 109. Communication device 109 may allow the terminal product to communicate with other devices wirelessly or wired to exchange data. Although the figures show an end product with various systems, it should be understood that it is not required to implement or have all of the systems shown, and more or fewer systems may be implemented or have instead.
[0116] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device 103, or installed from a read-only memory 102. When the computer program is executed by the processing device 101, the above-mentioned functions defined in the method of the embodiment of the present application are performed.
[0117] The terminal product provided in the embodiment of the present application can realize the hardware version configuration of the embedded device at a low cost. Compared with the prior art, the beneficial effects of the terminal product provided in the embodiment of the present application are the same as the beneficial effects of the hardware version configuration method of the embedded device provided in the above embodiment, and will not be repeated here.
[0118] It should be understood that the various parts of the embodiments of the present application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any appropriate manner in any one or more embodiments or examples.
[0119] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the above claims.
[0120] In addition, an embodiment of the present application further provides a computer-readable storage medium storing a computer program that can be run on a processor, and the computer program is used to execute the hardware version configuration method of the embedded device in the above embodiment.
[0121] The computer-readable storage medium provided in the embodiments of the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in combination with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0122] The computer-readable storage medium may be included in the terminal product, or may exist independently without being incorporated into the terminal product.
[0123] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by a terminal product, the terminal product: obtains the voltage value output by the voltage divider module after the embedded device performs voltage division; obtains a target configuration file corresponding to the voltage value output by the voltage divider module from a preset configuration file storage area; and configures the hardware version of the embedded device based on the target configuration file; wherein the voltage value output by the voltage divider module is used to represent the version number of the hardware version required to be configured for the embedded device.
[0124] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0125] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, program segment or a part of code, and the module, program segment or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a combination of dedicated hardware and computer instructions.
[0126] The modules described in the embodiments of the present application may be implemented in software or hardware, wherein the name of a module does not necessarily limit the unit itself.
[0127] The computer-readable storage medium provided in the embodiments of the present application stores computer-readable program instructions for executing the aforementioned method for configuring the hardware version of an embedded device, thereby enabling low-cost hardware version configuration of the embedded device. Compared to the prior art, the beneficial effects of the computer-readable storage medium provided in the embodiments of the present application are the same as those of the method for configuring the hardware version of an embedded device provided in the aforementioned embodiments, and are not further elaborated here.
[0128] In addition, an embodiment of the present application also provides a computer program product, including a computer program, which implements the hardware version configuration method of the embedded device as described above when the computer program is executed by a processor.
[0129] The computer program product provided in the embodiment of the present application can realize the hardware version configuration of the embedded device at a low cost. Compared with the existing technology, the beneficial effects of the computer program product provided in the embodiment of the present application are the same as the beneficial effects of the hardware version configuration method of the embedded device provided in the above embodiment, and will not be repeated here.
[0130] The above description is only a preferred embodiment of the present application and does not limit the patent scope of the present application. All equivalent structural transformations made based on the contents of the present application specification and drawings, or direct / indirect application in other related technical fields, are included in the patent protection scope of the present application.
Claims
1. A hardware version configuration device for an embedded device, characterized in that: include: a voltage dividing module, connected to the embedded device and configured to divide the voltage of the embedded device; a controller in the embedded device, the controller being connected to the voltage divider module and configured to obtain a voltage value output by the voltage divider module, obtain a target configuration file corresponding to the voltage value output by the voltage divider module from a preset configuration file storage area, and configure a hardware version of the embedded device based on the target configuration file; The voltage value output by the voltage dividing module is used to represent the version number of the hardware version required to be configured by the embedded device.
2. The hardware version configuration device of an embedded device according to claim 1, wherein: The voltage dividing module includes a first resistor, a second resistor, a third resistor, a fourth resistor and a capacitor; The first end of the first resistor is connected to a power supply, the second end of the first resistor is respectively connected to the first end of the second resistor, the first end of the third resistor, the embedded device and the controller, the first end of the third resistor is connected to the first end of the fourth resistor, the first end of the capacitor is respectively connected to the embedded device and the controller, and the second end of the second resistor, the second end of the fourth resistor and the second end of the capacitor are grounded.
3. The hardware version configuration device of an embedded device according to claim 2, wherein: The controller is further connected to the control end of the first resistor, the control end of the second resistor, the control end of the third resistor, and the control end of the fourth resistor; The controller is also used to: When receiving a configuration instruction for a new hardware version, obtaining a voltage value corresponding to the version number of the new hardware version as a target voltage value; The voltage dividing resistance value of the voltage dividing module is adjusted based on the target voltage value to adjust the voltage value output by the voltage dividing module to the target voltage value, so as to control the embedded device to configure the new hardware version.
4. The hardware version configuration device of an embedded device according to any one of claims 1 to 3, characterized in that: The error ranges of the circuit elements in the voltage divider module are all within a preset error range.
5. An embedded device, characterized in that: The embedded device comprises a device body and a hardware version configuration device for the embedded device according to any one of claims 1 to 4; the hardware version configuration device is provided in the device body.
6. A method for configuring the hardware version of an embedded device, characterized in that: The embedded device and a controller in the embedded device are both connected to a voltage divider module, and the method includes: Obtaining a voltage value output by the voltage dividing module after dividing the voltage of the embedded device; Obtaining a target configuration file corresponding to the voltage value output by the voltage divider module from a preset configuration file storage area; Configuring the hardware version of the embedded device based on the target configuration file; The voltage value output by the voltage dividing module is used to represent the version number of the hardware version required to be configured by the embedded device.
7. The method for configuring the hardware version of an embedded device according to claim 6, wherein: The target configuration file includes a target device tree file and a target initialization program. The step of configuring the hardware version of the embedded device based on the target configuration file includes: The target device tree file is loaded into the embedded device, and after the loading is completed, the embedded device is controlled to run the target initialization program to configure the hardware version of the embedded device.
8. The method for configuring the hardware version of an embedded device according to claim 6, wherein: Before the step of obtaining the voltage value output by the voltage dividing module after dividing the voltage of the embedded device, the method further includes: Obtain the kernel source code to be burned, and obtain and combine the configuration files to be burned to obtain a configuration file set; Combining the configuration file set with the kernel source code to generate an image file; The image file is burned into the embedded device, and after burning, each configuration file in the image file is associated with a different voltage value range so as to be stored in the configuration file storage area.
9. The method for configuring the hardware version of an embedded device according to any one of claims 6 to 8, wherein: The method further comprises: When receiving a configuration instruction for a new hardware version, obtaining a voltage value corresponding to the version number of the new hardware version as a target voltage value; The voltage dividing resistance value of the voltage dividing module is adjusted based on the target voltage value to adjust the voltage value output by the voltage dividing module to the target voltage value, so as to control the embedded device to configure the new hardware version.
10. A terminal product, characterized in that: The terminal product includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the hardware version configuration method for an embedded device according to any one of claims 6 to 9.