CN113010186A - Firmware and application data integration method and system applied to optical module - Google Patents
Firmware and application data integration method and system applied to optical module Download PDFInfo
- Publication number
- CN113010186A CN113010186A CN202110160239.5A CN202110160239A CN113010186A CN 113010186 A CN113010186 A CN 113010186A CN 202110160239 A CN202110160239 A CN 202110160239A CN 113010186 A CN113010186 A CN 113010186A
- Authority
- CN
- China
- Prior art keywords
- application data
- hex
- firmware program
- original
- firmware
- 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.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/61—Installation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
A firmware and application data integration method and system applied to an optical module are provided, the method comprises the following steps: acquiring a firmware program and corresponding application data; encoding the application data according to the encoding format of the original HEX file of the firmware program; and synthesizing the firmware program and the coded application data into a new executable HEX file, and downloading the synthesized new HEX file into a specified single chip microcomputer through a downloader or upper computer software according to the mode of downloading the HEX file. The invention combines the firmware program and the application data into a unified executable file, and downloads the unified executable file into the firmware at one time, thereby improving the production efficiency and reducing the risk. And because the firmware program has a uniform address data corresponding coding format, the application of the firmware program in application data import is also a uniform management mode, and the reliability of data downloading is improved.
Description
Technical Field
The invention relates to the technical field of embedded firmware import and application data import of an optical module, in particular to a firmware and application data integration method and system applied to the optical module.
Background
Driven by 5G of big data, the demand of higher network speed bandwidth for higher speed fibre channel is more urgent, resulting in a rapid increase in demand for more high speed modules, which require larger firmware programs and more records of application information.
In the production process of the optical module, the firmware program and the application data in the optical module need to be separately imported, the firmware program needs to be imported, and then the application information is imported by means of the firmware program, so that multi-step operation and opening of different software are needed to complete different operations, more risk items are brought, and after separate downloading, version information needs to be verified and compared for many times, so that additional production cost expenditure and risk items are caused.
Disclosure of Invention
In view of the technical defects and technical drawbacks in the prior art, embodiments of the present invention provide a method and a system for integrating firmware and application data applied to an optical module, which overcome the above problems or at least partially solve the above problems, and the specific solution is as follows:
as a first aspect of the present invention, there is provided a firmware and application data integration method applied to a light module, the method including:
step 1, acquiring a firmware program and corresponding application data;
step 2, encoding the application data according to the encoding format of the original HEX file of the firmware program;
and 3, synthesizing the firmware program and the coded application data into a new executable HEX file, and downloading the synthesized new HEX file into a specified single chip microcomputer through a downloader or upper computer software according to a HEX file downloading mode, so as to integrate the firmware and the application data of the optical module.
Further, the step 2 further includes analyzing the encoding format of the original HEX file of the firmware program to obtain the encoding format of the original HEX file, and in the step 2, encoding the application data by using the encoding format of the original HEX file of the firmware program specifically includes: and encoding the application data according to the address and the data encoding mode of the original HEX file.
Further, in step 2, the encoded application data is stored in a table form, including an application data address mapping table and an application data table, where the application data table stores a mapping relationship between a table sequence number and corresponding data, and the application data address mapping table stores a mapping relationship between a table sequence number and an address.
Further, step 3 specifically comprises: matching the addresses in the application data address mapping table with the addresses of original HEX files of the firmware programs one by one, generating an address comparison table index of the application data and the original HEX files based on the application data table, finally generating a HEX frame structure of the application data according to the arrangement rule of the original HEX files, and synthesizing a new executable HEX file based on the HEX frame structure of the application data and the firmware programs.
As a second aspect of the present invention, there is provided a firmware and application data integration system applied to an optical module, the system including a data acquisition module, an encoding module, and a composition module;
the data acquisition module is used for acquiring a firmware program and corresponding application data;
the encoding module is used for encoding the application data according to the encoding format of the original HEX file of the firmware program;
the synthesis module is used for synthesizing the firmware program and the coded application data into a new executable HEX file, and downloading the synthesized new HEX file to a specified single chip microcomputer through a downloader or upper computer software according to a mode of downloading the HEX file.
Further, the encoding module is specifically configured to analyze an encoding format of an original HEX file of the firmware program to obtain the encoding format of the original HEX file, and encode the application data according to an address and a data encoding mode of the original HEX file.
Further, the coded application data is stored in a table form, and includes an application data address mapping table and an application data table, where the application data table stores a mapping relationship between a table sequence number and corresponding data, and the application data address mapping table stores a mapping relationship between a table sequence number and an address.
Further, the synthesis module is specifically configured to match addresses in the application data address mapping table with addresses of original HEX files of the firmware program one by one, generate an address comparison table index of the application data and the original HEX files based on the application data table, finally generate a HEX frame structure of the application data according to an arrangement rule of the original HEX files, and synthesize a new executable HEX file based on the HEX frame structure of the application data and the firmware program.
The invention has the following beneficial effects:
the method is mainly used in the production process of the optical module firmware, firmware information and application data need to be downloaded in the existing firmware production process, and the production efficiency is low and the complexity is increased due to multiple downloads, so that the error probability is improved. The invention combines the firmware program and the application data into a unified executable file, downloads the file into the firmware at one time, improves the production efficiency and reduces the risk, and because the firmware program has a unified address data corresponding coding format, the application of the firmware program in the application data import is also a unified management mode, and improves the reliability of data download.
Drawings
Fig. 1 is a flowchart of a firmware and application data integration method applied to an optical module according to an embodiment of the present invention;
fig. 2 is a schematic diagram of data import performed by an upper computer according to this embodiment.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As shown in fig. 1, as a first embodiment of the present invention, there is provided a firmware and application data integration method applied to an optical module, the method including:
step 1, acquiring a firmware program and corresponding application data;
step 2, encoding the application data according to the encoding format of the original HEX file of the firmware program;
and 3, synthesizing the firmware program and the coded application data into a new executable HEX file, and downloading the synthesized new HEX file into a specified single chip microcomputer through a downloader or upper computer software according to a HEX file downloading mode, so as to integrate the firmware and the application data of the optical module.
As an embodiment of the present invention, a specific HEX file format and a data pattern after the integration are provided, where the HEX file format is shown in table 1 below:
TABLE 1
The HEX file contains 6 parts, which are: colon, length, start address, data type, data and check code, each part length and example in HEX frame format are given in table 2 below;
TABLE 2
In example 1, the behavior is a data frame in which data has 5 bytes, the start address of the address allocated in the firmware is 0x0010, and the check code is 0x 67;
in example 2, the frame end ends with a check code of 0 xFF;
the HEX frame has several data types, as shown in table 3 below:
TABLE 3
The algorithm of the checksum is as follows: the cumulative sum (not counting the carry) of all 16-ary codes before the checksum is calculated.
Test sum of 0x 100-cumulative sum
Table 4 below shows a simple full HEX file format (for format style presentation only):
TABLE 4
Preferably, the step 2 further includes analyzing the encoding format of the original HEX file of the firmware program to obtain the encoding format of the original HEX file, and the encoding of the application data by using the encoding format of the original HEX file of the firmware program in the step 2 is specifically: and encoding the application data according to the address and the data encoding mode of the original HEX file.
Preferably, in step 2, the encoded application data is stored in a form of a table, including an application data address mapping table and an application data table, where the application data table stores a mapping relationship between a table number and corresponding data, and the application data address mapping table stores a mapping relationship between a table number and an address.
The application data table is shown in table 5 below, where the application data is generated based on the optical module, and is a table according to a protocol corresponding to 128 bytes, so that the application data is divided into N data tables, where 128 bytes are one segment.
TABLE 5
The above is an application data storage format, each table is 128 bytes, and storage and address allocation are performed according to the sequence of table sequence numbers. The method can increase and decrease application data according to requirements, is flexible in distribution, can be suitable for optical modules with various rates, can be adjusted according to protocols and application requirements, and can be adjusted according to the corresponding rear address mapping.
The application data address lookup table is shown in table 6 below:
TABLE 6
The above is an application data address mapping table, the addresses in the table are matched with the addresses in the firmware program, and the number and definition of the table are matched with the application data table.
Preferably, step 3 is specifically: matching the addresses in the application data address mapping table with the addresses of original HEX files of the firmware programs one by one, generating an address comparison table index of the application data and the original HEX files based on the application data table, finally generating a HEX frame structure of the application data according to the arrangement rule of the original HEX files, and synthesizing a new executable HEX file based on the HEX frame structure of the application data and the firmware programs.
According to the invention, by means of an upper computer, three import data interfaces are provided, one is an original executable file and a firmware program, the other is application data (application data coded according to a set format), and the other is application data corresponding to address information, as shown in fig. 2, an executable HEX file with application data and combining the executable file and the application data is finally generated, and then the combined HEX file is downloaded to a specified single chip microcomputer through a downloader or upper computer software according to a HEX downloading mode.
The merged file is generated by upper computer integration, and the data style of the merged file is shown in the following table 7:
TABLE 7
And generating a final executable HEX file after integration, and importing the file into an embedded carrier (such as a singlechip) at one time according to a HEX import mode.
As a second embodiment of the present invention, there is also provided a firmware and application data integration system applied to an optical module, the system including a data acquisition module, a coding module, and a synthesis module;
the data acquisition module is used for acquiring a firmware program and corresponding application data;
the encoding module is used for encoding the application data according to the encoding format of the original HEX file of the firmware program;
the synthesis module is used for synthesizing the firmware program and the coded application data into a new executable HEX file, and downloading the synthesized new HEX file to a specified single chip microcomputer through a downloader or upper computer software according to a mode of downloading the HEX file.
Preferably, the encoding module is specifically configured to analyze an encoding format of an original HEX file of the firmware program to obtain the encoding format of the original HEX file, and encode the application data according to an address and a data encoding mode of the original HEX file.
Preferably, the encoded application data is stored in a table form, and includes an application data address mapping table and an application data table, where the application data table stores a mapping relationship between a table sequence number and corresponding data, and the application data address mapping table stores a mapping relationship between a table sequence number and an address.
Preferably, the synthesis module is specifically configured to match addresses in the application data address mapping table with addresses of original HEX files of the firmware program one by one, generate an address comparison table index of the application data and the original HEX files based on the application data table, finally generate a HEX frame structure of the application data according to an arrangement rule of the original HEX files, and synthesize a new executable HEX file based on the HEX frame structure of the application data and the firmware program.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.
Claims (8)
1. A firmware and application data integration method applied to an optical module is characterized by comprising the following steps:
step 1, acquiring a firmware program and corresponding application data;
step 2, encoding the application data according to the encoding format of the original HEX file of the firmware program;
and 3, synthesizing the firmware program and the coded application data into a new executable HEX file, and downloading the synthesized new HEX file into a specified single chip microcomputer through a downloader or upper computer software according to a mode of downloading the HEX file.
2. The method as claimed in claim 1, wherein the step 2 further includes parsing an encoding format of an original HEX file of the firmware program to obtain an encoding format of the original HEX file, and the step 2 encoding the application data in the encoding format of the original HEX file of the firmware program specifically includes: and encoding the application data according to the address and the data encoding mode of the original HEX file.
3. The method as claimed in claim 1, wherein in step 2, the encoded application data is stored in a table form, and includes an application data address mapping table and an application data table, the application data table stores a mapping relationship between a table number and corresponding data, and the application data address mapping table stores a mapping relationship between a table number and an address.
4. The method for integrating firmware and application data applied to an optical module according to claim 3, wherein the step 3 is specifically: matching the addresses in the application data address mapping table with the addresses of original HEX files of the firmware programs one by one, generating an address comparison table index of the application data and the original HEX files based on the application data table, finally generating a HEX frame structure of the application data according to the arrangement rule of the original HEX files, and synthesizing a new executable HEX file based on the HEX frame structure of the application data and the firmware programs.
5. The system is characterized by comprising a data acquisition module, a coding module and a synthesis module;
the data acquisition module is used for acquiring a firmware program and corresponding application data;
the encoding module is used for encoding the application data according to the encoding format of the original HEX file of the firmware program;
the synthesis module is used for synthesizing the firmware program and the coded application data into a new executable HEX file, and downloading the synthesized new HEX file to a specified single chip microcomputer through a downloader or upper computer software according to a mode of downloading the HEX file.
6. The system as claimed in claim 5, wherein the encoding module is specifically configured to parse an encoding format of an original HEX file of the firmware program to obtain the encoding format of the original HEX file, and encode the application data according to an address and a data encoding manner of the original HEX file.
7. The system as claimed in claim 5, wherein the encoded application data is stored in a table form, and includes an application data address mapping table and an application data table, the application data table stores a mapping relationship between a table number and corresponding data, and the application data address mapping table stores a mapping relationship between a table number and an address.
8. The system as claimed in claim 5, wherein the synthesis module is specifically configured to match addresses in the application data address mapping table with addresses of original HEX files of the firmware program one by one, generate an address lookup table index of the application data and the original HEX files based on the application data table, finally generate a HEX frame structure of the application data according to an arrangement rule of the original HEX files, and synthesize a new executable HEX file based on the HEX frame structure of the application data and the firmware program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110160239.5A CN113010186B (en) | 2021-02-05 | 2021-02-05 | Firmware and application data integration method and system applied to optical module |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110160239.5A CN113010186B (en) | 2021-02-05 | 2021-02-05 | Firmware and application data integration method and system applied to optical module |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113010186A true CN113010186A (en) | 2021-06-22 |
CN113010186B CN113010186B (en) | 2023-03-21 |
Family
ID=76383780
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110160239.5A Active CN113010186B (en) | 2021-02-05 | 2021-02-05 | Firmware and application data integration method and system applied to optical module |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113010186B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113849245A (en) * | 2021-09-23 | 2021-12-28 | 武汉深之度科技有限公司 | Application program running method, computing device and storage medium |
Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1811961A (en) * | 2006-01-27 | 2006-08-02 | 肖辉 | MP3 file generating method and playing method for generated MP3 file |
CN103019794A (en) * | 2012-12-27 | 2013-04-03 | 安徽中兴继远信息技术股份有限公司 | Off-line batching programming method of multiple embedded program files |
US20130086338A1 (en) * | 2011-10-03 | 2013-04-04 | International Business Machines Corporation | Linking code for an enhanced application binary interface (abi) with decode time instruction optimization |
CN104317618A (en) * | 2014-10-24 | 2015-01-28 | 福州瑞芯微电子有限公司 | Firmware partitioning method and device |
CN104424105A (en) * | 2013-08-26 | 2015-03-18 | 华为技术有限公司 | Memory data reading and writing processing method and device |
CN104679507A (en) * | 2015-02-05 | 2015-06-03 | 四川长虹电器股份有限公司 | Generation method and device for NAND Flash programmer burn image file |
CN105224370A (en) * | 2015-10-21 | 2016-01-06 | 安一恒通(北京)科技有限公司 | A kind of method and apparatus of loading ELF document |
CN105677422A (en) * | 2016-01-05 | 2016-06-15 | 惠州市蓝微新源技术有限公司 | Method for renewing monitoring program, application and subsequent renewing application at same time |
US20160321089A1 (en) * | 2015-04-30 | 2016-11-03 | Microsoft Technology Licensing, Llc | Binary file generation |
CN108388435A (en) * | 2018-02-10 | 2018-08-10 | 山东国金汽车制造有限公司 | A method of by BootLoader and the disposable programming of application program |
CN110045978A (en) * | 2019-04-16 | 2019-07-23 | 杭州阿姆科技有限公司 | A kind of firmware of different type SSD equipment unifies upgrade method and system |
CN111796836A (en) * | 2020-06-18 | 2020-10-20 | 徐州帝意电子有限公司 | Method for modifying HEX file based on PC software and application |
-
2021
- 2021-02-05 CN CN202110160239.5A patent/CN113010186B/en active Active
Patent Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1811961A (en) * | 2006-01-27 | 2006-08-02 | 肖辉 | MP3 file generating method and playing method for generated MP3 file |
US20130086338A1 (en) * | 2011-10-03 | 2013-04-04 | International Business Machines Corporation | Linking code for an enhanced application binary interface (abi) with decode time instruction optimization |
CN103019794A (en) * | 2012-12-27 | 2013-04-03 | 安徽中兴继远信息技术股份有限公司 | Off-line batching programming method of multiple embedded program files |
CN104424105A (en) * | 2013-08-26 | 2015-03-18 | 华为技术有限公司 | Memory data reading and writing processing method and device |
CN104317618A (en) * | 2014-10-24 | 2015-01-28 | 福州瑞芯微电子有限公司 | Firmware partitioning method and device |
CN104679507A (en) * | 2015-02-05 | 2015-06-03 | 四川长虹电器股份有限公司 | Generation method and device for NAND Flash programmer burn image file |
US20160321089A1 (en) * | 2015-04-30 | 2016-11-03 | Microsoft Technology Licensing, Llc | Binary file generation |
CN105224370A (en) * | 2015-10-21 | 2016-01-06 | 安一恒通(北京)科技有限公司 | A kind of method and apparatus of loading ELF document |
CN105677422A (en) * | 2016-01-05 | 2016-06-15 | 惠州市蓝微新源技术有限公司 | Method for renewing monitoring program, application and subsequent renewing application at same time |
CN108388435A (en) * | 2018-02-10 | 2018-08-10 | 山东国金汽车制造有限公司 | A method of by BootLoader and the disposable programming of application program |
CN110045978A (en) * | 2019-04-16 | 2019-07-23 | 杭州阿姆科技有限公司 | A kind of firmware of different type SSD equipment unifies upgrade method and system |
CN111796836A (en) * | 2020-06-18 | 2020-10-20 | 徐州帝意电子有限公司 | Method for modifying HEX file based on PC software and application |
Non-Patent Citations (1)
Title |
---|
邹宏伟: "应用Excel实现教案首页自动化生成及通用表格正反向数据整合", 《电脑知识与技术》 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113849245A (en) * | 2021-09-23 | 2021-12-28 | 武汉深之度科技有限公司 | Application program running method, computing device and storage medium |
CN113849245B (en) * | 2021-09-23 | 2023-09-12 | 武汉深之度科技有限公司 | Application program running method, computing device and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN113010186B (en) | 2023-03-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN1187944C (en) | Reuse of static checksum and information in header compression/decompression application | |
CN108664239B (en) | Cross-technology-stack web front-end development system and method based on micro-service | |
CN113010186B (en) | Firmware and application data integration method and system applied to optical module | |
CN111683066A (en) | Heterogeneous system integration method and device, computer equipment and storage medium | |
EP2219117A1 (en) | A processing module, a device, and a method for processing of XML data | |
CN109120477A (en) | Dynamic analysis method, apparatus, server and storage medium based on modbus agreement | |
CN115086449A (en) | Data analysis method and device and computer readable storage medium | |
CN103297554B (en) | The method and device of IPv4 and IPv6 compatible processing | |
CN101202736A (en) | Method for realizing encoding-decoding in communication network | |
US7890548B2 (en) | Automation process system and method to upgrade from non-unicode transformation support to unicode data transformation support | |
KR20190088112A (en) | Method for transforming data for low volume transmission of meta model base protocol which monitors power amount data of new recycle energy, and data transmitting system for low volume transmission of meta model base protocol which monitors power amount data of new recycle energy | |
CN110839022A (en) | Vehicle-mounted control software communication protocol analysis method based on xml language | |
CN111901453A (en) | Identification generation method and device, computer equipment and storage medium | |
CN114979307B (en) | Analysis method of communication protocol, intelligent terminal and storage medium | |
CN112486885B (en) | Data frame generation method, storage medium and computer equipment | |
CN115276889B (en) | Decoding processing method, decoding processing device, computer equipment and storage medium | |
CN115203482A (en) | Application data analysis method, electronic device and storage medium | |
CN115048920A (en) | Front-end data exporting method, device, equipment and storage medium | |
CN113890541A (en) | Data compression method and system, computer readable storage medium | |
KR100968083B1 (en) | Method and devices for encoding/decoding structured documents, especially xml documents | |
Jia et al. | Research on vehicle OTA upgrade technology based on BSDIFF difference algorithm | |
CN113625965B (en) | Data storage method, system and device of distributed storage system and storage medium | |
CN113759884B (en) | Method and system for generating input/output point product file of distributed control system | |
CN117707603A (en) | Corresponding association method and system of window resource file and character string resource file | |
CN113094040B (en) | Applet compiling method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |