Talkback equipment model identification method
By obtaining and matching the model of the intercom device, compiling and updating the dtb data, a kernel image package compatible with all models is realized, which solves the problems of redundant work and bug introduction in the existing technology, reduces maintenance costs and improves Improve development efficiency.
Patent Information
- Application Number
- CN202410689717.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-30
- Publication Date
- 2024-08-30
AI Technical Summary
Existing intercom equipment needs to manage software versions of multiple models during the software development process, resulting in redundant work and waste of labor costs, and it is easy to introduce new bugs, causing project progress delays and being unable to meet usage needs.
Obtain the machine model through hardware or software environment parameters, use DTC tools to compile and package the dtb file, match and update the hardware circuit or software environment variables, create a kernel image package compatible with all models, and only need to update the dtb data to repair System bug.
It reduces labor intensity and developer maintenance costs, avoids the redundant work of synchronizing each software version one by one, and improves development efficiency and accuracy.
Smart Images

Figure CN118567725A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intercom equipment model identification, and in particular to a method for intercom equipment model identification. Background Art
[0002] The intercom equipment in the existing technology needs to manage the software versions of dozens of models at the same time. When fixing a system bug, each software version must be synchronized one by one. This redundant work will cause a waste of manpower costs. In addition, in the software development process, new bugs may be introduced if you are not careful, resulting in project delays and failure to meet usage requirements. Based on the above situation, we propose a method for identifying the model of intercom equipment. Summary of the invention
[0003] Based on the technical problems existing in the background technology, the present invention proposes a method for identifying the model of an intercom device.
[0004] The present invention provides a method for identifying the model of an intercom device, comprising the following steps:
[0005] S1: Get the machine model through hardware or software environment parameters. The format of the machine model is v160-1-0, where the first parameter is the system name, the second parameter indicates the same category (such as outdoor station, indoor station), and the third parameter indicates the sub-version number, which is used to distinguish the module differences on the hardware board, and store the obtained machine model in dts file format;
[0006] S2: Compile the dts files of all models obtained in S1 through the DTC (Device Tree Compiler) tool, then add a header through mkdtbs and combine and package all dtb files, and sort the dtb and related information through a special header protocol;
[0007] S3: After obtaining the machine model, use the Flash read operation interface to read the data of the dtbs partition, match the characters of dtb.name and the machine model according to the protocol of the dtbs packet header, use polling to pair, and finally filter out the corresponding dtb, then update the obtained dtb data. If the corresponding dtb is not found, use the default settings.
[0008] Preferably, in S1, when the machine model is obtained by hardware, a machine model identification circuit is used, and dozens of models can be combined in combination with gpio and ad. An IO / ADC detection interface is added to the uboot initialization list (init_sequence_r), and the machine model is assigned according to the corresponding IO level signal through the IO or ADC voltage detection pin reserved by the hardware;
[0009] When using software environment parameters to obtain the machine model, after the environment variables are initialized in uboot, the variable name of the corresponding machine model is read through the getenv interface, such as swversion, using a custom format with no upper limit on the combination. The corresponding machine model can be embedded in the whole machine image package through the host computer software. This information is stored in the env partition.
[0010] Preferably, in S2, mkdtbs is a custom shell script, which needs to be slightly adjusted according to different systems. Taking SSD20X SOC as an example, the processor adopts little-endian mode, the first byte uses 0xaabbccdd as the identifier of the dtbs file, the second byte indicates the number of dtbs, and then the information of each dtb file is provided; the script needs to calculate the offset position of each dtb file, and the program will match the dtb name and read the corresponding dtb resource file at the corresponding offset address.
[0011] Preferably, in S3, the starting address of the corresponding dtb is the gd->fdt_blob variable. Since the uboot initialization process of each system may be different, taking SSD20X as an example, it is explained that the function of parsing the packet header protocol should be placed after the flash operation interface is initialized.
[0012] Preferably, in S3, the process of parsing and updating dtb is as follows:
[0013] S301: Get the starting address of dtbs_hdr: Use dev_part_read to read the partition interface to read the corresponding data from the "dtb" partition. After the reading is successful, parse the byte size of default_dtb, and deduce the starting address of dtbs_hdr through the dtb_header structure.
[0014] S302: Read the variable in the "hwversion" environment to determine whether the corresponding model exists in the partition. If it does not exist or is empty, use the default dtb or the default model 0-0. Then read the value of the "swversion" variable through the getenv interface, and then select the matching dtb_info parameter by comparing dtb->name.
[0015] S303: Read the corresponding dtb data and copy it to the gd->fdt_blob address: According to the byte size, offset and CRC32 parameters of dtb_info in the dtbs header, read the corresponding dtb data, and after confirming that the data is legal and correct, copy it to the address pointed to by the system global variable gd->fdt_blob.
[0016] Preferably, in S1, dts is Device Tree Source, that is, a device tree source file.
[0017] Preferably, in S2, dtb is Device Tree Blob, that is, a device tree binary file.
[0018] Preferably, in S3, dtbs is Device Tree Blobs, that is, a collection of device tree binary files.
[0019] Compared with the prior art, the present invention has the following beneficial effects:
[0020] The present invention creates a corresponding resource file for the hardware characteristics of each model, and obtains the resource file corresponding to the current model through hardware circuits or software environment variables, so that one kernel image package is compatible with all models. Therefore, when repairing a system bug, only the obtained DTB data needs to be updated, and there is no need to synchronize each software version one by one, thereby reducing the labor intensity and maintenance cost of developers. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 The present invention provides a flowchart for analyzing and updating dtb of a method for identifying intercom device models. DETAILED DESCRIPTION
[0022] The present invention will be further explained below in conjunction with specific embodiments.
[0023] Example
[0024] Reference Figure 1 This embodiment proposes a method for identifying the model of an intercom device, comprising the following steps:
[0025] S1: Get the machine model through hardware or software environment parameters. The format of the machine model is v160-1-0, where the first parameter is the system name, the second parameter indicates the same category (such as outdoor station, indoor station), and the third parameter indicates the sub-version number, which is used to distinguish the module differences on the hardware board, and store the obtained machine model in dts file format, where dts is Device Tree Source, i.e., device tree source file;
[0026] When the machine model is obtained by hardware, the machine model identification circuit is used, combined with gpio and ad, and dozens of models can be combined. An IO / ADC detection interface is added to the uboot initialization list (init_sequence_r), and the machine model is assigned according to the corresponding IO level signal through the IO or ADC voltage detection pin reserved by the hardware;
[0027] When using software environment parameters to obtain the machine model, after the environment variables are initialized in uboot, the variable name of the corresponding machine model, such as swversion, is read through the getenv interface. A custom format is used with no upper limit on the combination. The corresponding machine model can be embedded into the whole machine image package through the host computer software. This information is stored in the env partition.
[0028] S2: Compile the dts files of all models obtained in S1 through the DTC (Device Tree Compiler) tool, then add the header through mkdtbs and combine and package all the dtb files, and sort the dtb and related information through a special header protocol, where dtb is Device Tree Blob, that is, the device tree binary file;
[0029] Among them, mkdtbs is a custom shell script, which needs to be slightly adjusted according to different systems. Take SSD20XSOC as an example. The processor uses little-endian mode. The first byte uses 0xaabbccdd as the identifier of the dtbs file, the second byte indicates the number of dtb files, and then the information of each dtb file. The script needs to calculate the offset position of each dtb file. The program will match the dtb name and read the corresponding dtb resource file at the corresponding offset address.
[0030] S3: After obtaining the machine model, use the Flash read operation interface to read the data of the dtbs partition. According to the protocol of the dtbs header, characters are matched through dtb.name and the machine model. Polling is used for pairing. Finally, the corresponding dtb is screened out, and then the obtained dtb data is updated. If the corresponding dtb is not found, the default setting is used, where the starting address of the corresponding dtb is the gd->fdt_blob variable. Since the uboot initialization process of each system may be different, taking SSD20X as an example, it is explained that the function of parsing the header protocol should be placed after the flash operation interface is initialized, where dtbs is DeviceTree Blobs, that is, a collection of device tree binary files;
[0031] The process of parsing and updating dtb is as follows:
[0032] S301: Get the starting address of dtbs_hdr: Use dev_part_read to read the partition interface to read the corresponding data from the "dtb" partition. After the reading is successful, parse the byte size of default_dtb, and deduce the starting address of dtbs_hdr through the dtb_header structure.
[0033] S302: Read the variable in the "hwversion" environment to determine whether the corresponding model exists in the partition. If it does not exist or is empty, use the default dtb or the default model 0-0. Then read the value of the "swversion" variable through the getenv interface, and then select the matching dtb_info parameter by comparing dtb->name.
[0034] S303: Read the corresponding dtb data and copy it to the address of gd->fdt_blob: Read the corresponding dtb data according to the byte size, offset and CRC32 parameters of dtb_info in the dtbs header, and after confirming that the data is legal and correct, copy it to the address pointed to by the system global variable gd->fdt_blob;
[0035] This embodiment creates a corresponding resource file for the hardware characteristics of each model, and obtains the resource file corresponding to the current model through hardware circuits or software environment variables, so that one kernel image package is compatible with all models. Therefore, when fixing a system bug, it is only necessary to update the obtained dtb data, and there is no need to synchronize each software version one by one, thereby reducing the labor intensity and maintenance costs of developers.
[0036] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A method for identifying the model of an intercom device, It is characterized in that The following steps are involved: S1: Get the machine model through hardware or software environment parameters. The format of the machine model is v160-1-0, where the first parameter is the system name, the second parameter indicates the same category (such as outdoor station, indoor station), and the third parameter indicates the sub-version number, which is used to distinguish the module differences on the hardware board, and store the obtained machine model in dts file format; S2: Compile the dts files of all models obtained in S1 through the DTC (Device Tree Compiler) tool, then add a header through mkdtbs and combine and package all dtb files, and sort the dtb and related information through a special header protocol; S3: After obtaining the machine model, use the Flash read operation interface to read the data of the dtbs partition, match the characters of dtb.name and the machine model according to the protocol of the dtbs packet header, use polling to pair, and finally filter out the corresponding dtb, then update the obtained dtb data. If the corresponding dtb is not found, use the default settings.
2. A method for identifying an intercom device model according to claim 1, It is characterized in that In S1, when the machine model is obtained by hardware, a machine model identification circuit is used, which can be combined into dozens of models by combining gpio and ad. An IO / ADC detection interface is added to the uboot initialization list (init_sequence_r), and the machine model is assigned according to the corresponding IO level signal through the IO or ADC voltage detection pin reserved by the hardware; When using software environment parameters to obtain the machine model, after the environment variables are initialized in uboot, the variable name of the corresponding machine model is read through the getenv interface, such as swversion, using a custom format with no upper limit on the combination. The corresponding machine model can be embedded in the whole machine image package through the host computer software. This information is stored in the env partition.
3. A method for identifying an intercom device model according to claim 1, It is characterized in that In S2, mkdtbs is a custom shell script that needs to be slightly adjusted according to different systems. Taking SSD20X SOC as an example, the processor uses little-endian mode. The first byte uses 0xaabbccdd as the identifier of the dtbs file, the second byte indicates the number of dtbs, and then the information of each dtb file; The script needs to calculate the offset position of each dtb file. The program will match the dtb name and read the corresponding dtb resource file at the corresponding offset address.
4. The method for identifying the model of an intercom device according to claim 1, It is characterized in that In S3, the starting address of the corresponding dtb is the gd->fdt_blob variable. Since the uboot initialization process of each system may be different, taking SSD20X as an example, it is explained that the function of parsing the packet header protocol should be placed after the flash operation interface is initialized.
5. The method for identifying the model of an intercom device according to claim 1, It is characterized in that In S3, the process of parsing and updating dtb is as follows: S301: Get the starting address of dtbs_hdr: Use dev_part_read to read the partition interface to read the corresponding data from the "dtb" partition. After the reading is successful, parse the byte size of default_dtb, and deduce the starting address of dtbs_hdr through the dtb_header structure. S302: Read the variable in the "hwversion" environment to determine whether the corresponding model exists in the partition. If it does not exist or is empty, use the default dtb or the default model 0-0. Then read the value of the "swversion" variable through the getenv interface, and then select the matching dtb_info parameter by comparing dtb->name. S303: Read the corresponding dtb data and copy it to the gd->fdt_blob address: According to the byte size, offset and CRC32 parameters of dtb_info in the dtbs header, read the corresponding dtb data, and after confirming that the data is legal and correct, copy it to the address pointed to by the system global variable gd->fdt_blob.
6. A method for identifying an intercom device model according to claim 1, It is characterized in that In S1, dts is Device Tree Source, that is, the device tree source file.
7. The method for identifying the model of an intercom device according to claim 1, It is characterized in that In S2, dtb is Device Tree Blob, that is, a device tree binary file.
8. The method for identifying the model of an intercom device according to claim 1, It is characterized in that In the S3, dtbs is Device Tree Blobs, that is, a collection of device tree binary files.
