Optical module firmware download method, device, system, electronic equipment and storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- EOPTOLINK TECH INC LTD
- Filing Date
- 2026-04-14
- Publication Date
- 2026-07-14
Smart Images

Figure CN122395053A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of optical communication technology, and more specifically, to a method, apparatus, system, electronic device, and storage medium for downloading firmware for an optical module. Background Technology
[0002] As a core component of optical communication equipment, the firmware running inside the optical module needs to be reliably and efficiently downloaded and updated during the manufacturing and maintenance processes.
[0003] In existing optical module firmware download solutions, static firmware storage is mainly used. That is, some optical module firmware files of certain models are pre-burned into the memory (Flash chip) of the firmware download device. The content is fixed. When the firmware version of a certain model of optical module is updated or new optical module firmware is added, the Flash chip needs to be replaced manually or the entire disk needs to be burned. The process is cumbersome, inefficient and error-prone, and cannot achieve dynamic management and on-demand updates of firmware. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a method, apparatus, system, electronic device and storage medium for downloading optical module firmware, so as to solve the problem that existing optical module firmware download schemes cannot achieve dynamic management and on-demand updates of firmware.
[0005] To achieve the above objectives, the technical solutions adopted in the embodiments of the present invention are as follows: In a first aspect, the present invention provides a method for downloading firmware for an optical module, the method comprising: Obtain the model number of the target optical module for which the firmware to be downloaded; The latest firmware version number of the target optical module is obtained from the firmware database according to the model of the target optical module; Based on the latest firmware version number of the target optical module and the firmware metadata stored in the memory of the firmware download device, it is determined whether a data update operation needs to be performed on the memory; the memory stores firmware metadata and firmware files for different models of optical modules. If no data update operation is required for the memory, the firmware file of the target optical module stored in the memory is downloaded to the target optical module. If a data update operation needs to be performed on the memory, the firmware metadata and firmware file stored in the memory are updated according to the latest firmware file of the target optical module, and the firmware file of the target optical module stored in the memory is downloaded to the target optical module.
[0006] In an optional implementation, the data update operation includes data addition and data modification operations; the firmware metadata includes the model of the optical module and the local firmware version number; the step of determining whether a data update operation needs to be performed on the memory based on the latest firmware version number of the target optical module and the firmware metadata stored in the memory of the firmware download device includes: Determine whether the model number of the target optical module exists in the firmware metadata stored in the memory; If the model of the target optical module does not exist, it is determined that a data addition operation needs to be performed on the memory; If the model of the target optical module exists, then based on the comparison result between the latest firmware version number of the target optical module and the local firmware version number, it is determined whether a data modification operation needs to be performed on the memory.
[0007] In an optional implementation, determining whether a data modification operation needs to be performed on the memory based on a comparison between the latest firmware version number of the target optical module and the local firmware version number includes: If the latest firmware version number of the target optical module is the same as the local firmware version number, or if the latest firmware version number of the target optical module is lower than the local firmware version number and it is determined that the firmware file corresponding to the local firmware version number is used, then it is determined that no data modification operation needs to be performed on the memory. If the latest firmware version number of the target optical module is higher than the local firmware version number, or if the latest firmware version number of the target optical module is lower than the local firmware version number and it is determined that the firmware file corresponding to the latest firmware version number is used, then it is determined that a data modification operation needs to be performed on the memory.
[0008] In an optional implementation, if a data update operation needs to be performed on the memory, updating the firmware metadata and firmware file stored in the memory according to the latest firmware file of the target optical module includes: If it is necessary to perform a data addition operation on the memory, the latest firmware file of the target optical module is downloaded from the firmware database, the latest firmware file of the target optical module is written into the memory, and the firmware metadata corresponding to the latest firmware file of the target optical module is added to the memory.
[0009] In an optional implementation, if a data update operation needs to be performed on the memory, updating the firmware metadata and firmware file stored in the memory according to the latest firmware file of the target optical module includes: If data modification operations need to be performed on the memory, the firmware file of the target optical module currently stored in the memory is erased, the latest firmware file of the target optical module is downloaded from the firmware database, the latest firmware file of the target optical module is written into the memory, and the firmware metadata of the target optical module currently stored in the memory is modified.
[0010] In an optional implementation, the firmware download device is communicatively connected to the target optical module via a communication interface that supports different communication modes; before downloading the firmware file of the target optical module stored in the memory to the target optical module, the method further includes: Switch the communication interface to a communication mode that matches the target optical module.
[0011] In an optional implementation, downloading the firmware file of the target optical module stored in the memory to the target optical module includes: Check whether the target optical module is in the firmware write-ready state; When the target optical module is in the firmware writing ready state, the firmware file of the target optical module stored in the memory is downloaded to the target optical module.
[0012] In an optional implementation, the storage space of the memory includes a firmware metadata area and a firmware file area. The firmware metadata area is used to store a firmware metadata mapping table, and multiple records in the firmware metadata mapping table correspond to the firmware metadata of different models of optical modules. The firmware file area is used to store firmware files of different models of optical modules.
[0013] In a second aspect, the present invention provides an optical module firmware download device, the device comprising: The optical module model acquisition module is used to obtain the model of the target optical module to which the firmware is to be downloaded; The database query module is used to obtain the latest firmware version number of the target optical module from the firmware database according to the model of the target optical module; The data update decision module is used to determine whether a data update operation needs to be performed on the memory based on the latest firmware version number of the target optical module and the firmware metadata stored in the memory of the firmware download device; the memory stores firmware metadata and firmware files of different models of optical modules. The download execution module is used to download the firmware file of the target optical module stored in the memory to the target optical module if no data update operation is required; and to update the firmware metadata and firmware file stored in the memory according to the latest firmware file of the target optical module if a data update operation is required, and then download the firmware file of the target optical module stored in the memory to the target optical module.
[0014] Thirdly, the present invention provides an optical module firmware download system, including a host computer and a firmware download device, wherein the host computer is communicatively connected to the firmware download device, and the firmware download device stores firmware metadata and firmware files of different models of optical modules in its memory. The host computer is used to obtain the model of the target optical module whose firmware is to be downloaded, obtain the latest firmware version number of the target optical module from the firmware database according to the model of the target optical module, and determine whether it is necessary to perform a data update operation on the memory according to the latest firmware version number of the target optical module and the firmware meta-information stored in the memory. The firmware download device is used to download the firmware file of the target optical module stored in the memory to the target optical module if no data update operation is required; and to update the firmware metadata and firmware file stored in the memory according to the latest firmware file of the target optical module if a data update operation is required, and then download the firmware file of the target optical module stored in the memory to the target optical module.
[0015] Fourthly, the present invention provides an electronic device including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the optical module firmware download method as described in any of the foregoing embodiments.
[0016] Fifthly, the present invention provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the optical module firmware download method as described in any of the foregoing embodiments.
[0017] This invention provides a method, apparatus, system, electronic device, and storage medium for downloading firmware for optical modules. The method includes: obtaining the model number of the target optical module whose firmware is to be downloaded; obtaining the latest firmware version number of the target optical module from a firmware database based on the target optical module's model number; determining whether a data update operation needs to be performed on the storage device based on the latest firmware version number of the target optical module and firmware metadata stored in the storage device's memory; the storage device stores firmware metadata and firmware files for different models of optical modules; if no data update operation is needed, downloading the firmware file of the target optical module stored in the storage device to the target optical module; if a data update operation is needed, updating the firmware metadata and firmware file stored in the storage device based on the latest firmware file of the target optical module, and then downloading the firmware file of the target optical module stored in the storage device to the target optical module. This invention achieves dynamic management and on-demand updates of the firmware in the storage device by recording firmware metadata and firmware files for different models of optical modules in the storage device and based on the latest firmware version in the firmware database.
[0018] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0019] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 A schematic diagram of the optical module firmware download system provided in an embodiment of the present invention is shown; Figure 2 This invention provides a schematic flowchart of an optical module firmware download method according to an embodiment of the present invention. Figure 3 A hardware block diagram of a communication interface is shown; Figure 4 This diagram illustrates a functional block diagram of an optical module firmware download device provided in an embodiment of the present invention. Figure 5 A block diagram of an electronic device provided in an embodiment of the present invention is shown.
[0021] Icons: 10-Optical module firmware download system; 20-Optical module; 100-Host computer; 200-Firmware download device; 500-Electronic device; 510-Memory; 520-Processor; 530-Communication module; 600-Optical module firmware download device; 610-Optical module model acquisition module; 620-Database query module; 630-Data update decision module; 640-Download execution module. Detailed Implementation
[0022] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0023] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0024] It should be noted that relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0025] Existing optical module firmware download solutions mainly rely on dedicated firmware download devices and host computers. The firmware download device connects to the optical module based on a fixed communication protocol (such as I2C). The firmware download device's memory is pre-programmed with firmware files for certain optical module models. The host computer reads the firmware files from the memory according to a preset process and writes them into the target optical module via the firmware download device.
[0026] However, optical modules come in a wide variety of models, firmware versions iterate rapidly, and their communication interfaces are evolving from the traditional I2C to the more advanced I3C. This requires the download system in production lines and maintenance centers to have higher flexibility, compatibility, and automation to meet the needs of flexible manufacturing and efficient operation and maintenance for small batches and diverse product types. Therefore, existing optical module firmware download solutions have the following drawbacks: 1. Poor compatibility: The firmware download device uses a single communication protocol, such as only supporting I2C, which cannot be adapted to the new generation I3C interface or dual-mode compatible optical modules, resulting in redundant production line tools and high upgrade costs.
[0027] 2. Inflexible firmware management: The contents of the memory storing the firmware are fixed. When the firmware version of a certain model of optical module is updated or a new optical module firmware is added, it is necessary to manually replace the Flash chip or burn the entire disk. The process is cumbersome, inefficient and prone to errors, and it is impossible to achieve dynamic management and on-demand updates of firmware.
[0028] 3. Lack of intelligent status management: During the download process, a simple delay is usually used, which cannot reliably detect the busy or idle status of the optical module. This can easily lead to data writing failure due to bus conflicts, reducing the download success rate.
[0029] 4. Information silos: The host computer cannot perceive the latest status of the external optical module firmware database, nor can it intelligently identify the specific information of the firmware stored in the Flash chip. Operators need to manually select and confirm, which can easily lead to version errors or model mismatches due to human error.
[0030] To address the aforementioned problems, embodiments of the present invention provide a method, apparatus, system, electronic device, and storage medium for downloading firmware for optical modules. The method includes: obtaining the model number of the target optical module whose firmware is to be downloaded; obtaining the latest firmware version number of the target optical module from a firmware database based on the target optical module's model number; determining whether a data update operation needs to be performed on the storage device based on the latest firmware version number of the target optical module and firmware metadata stored in the storage device's memory; the storage device stores firmware metadata and firmware files for different models of optical modules; if no data update operation is needed, downloading the firmware file of the target optical module stored in the storage device to the target optical module; if a data update operation is needed, updating the firmware metadata and firmware file stored in the storage device based on the latest firmware file of the target optical module, and then downloading the firmware file of the target optical module stored in the storage device to the target optical module. The present invention achieves dynamic management and on-demand updates of the firmware in the storage device by recording firmware metadata and firmware files for different models of optical modules in the storage device and based on the latest firmware version in the firmware database. Furthermore, the firmware download device is equipped with communication interfaces supporting different communication modes, covering various optical modules from traditional I2C to the new generation I3C interface. This greatly reduces the cost and complexity of production line tools, significantly improves compatibility with optical modules for future technological evolution, and actively queries whether the optical module is in the firmware write-ready state, avoiding bus contention and data write failures, thus significantly improving the flashing yield and production efficiency of optical modules. It also streamlines the data flow from "production / repair work orders" to "central database" and then to "local flashing device," ensuring the absolute correctness and real-time up-to-dateness of the firmware version used, and realizing full automation of the optical module production and maintenance process.
[0031] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0032] Please refer to Figure 1 This is a schematic diagram illustrating the composition of an optical module firmware download system 10 provided in an embodiment of the present invention. The optical module firmware download system 10 includes a host computer 100 and a firmware download device 200, which are communicatively connected.
[0033] The firmware download device 200 includes a communication interface that supports different communication modes and can connect to optical modules 20 with different communication modes. The firmware download device 200 also includes a memory (high-capacity Flash chip) that stores firmware metadata and firmware files for different models of optical modules, serving as a centralized storage repository for optical module firmware. The internal firmware (FW) of the firmware download device 200 enables a busy status query function for optical modules. The host computer 100 can send specific commands to request the firmware download device 200 to query the current status of the optical modules (e.g., by polling the optical module's status register), ensuring that data is written only when the optical module is ready. It also manages the read / write operations of the memory, executes communication mode switching commands issued by the host computer 100, and controls the switching of the communication interface between different communication modes.
[0034] The host computer 100 can be understood as a computer or software located at a high level in the system, used to issue control commands and perform data processing. In this embodiment, it can receive order information from the production management system or maintenance work orders, query the firmware database according to the order information, make intelligent decisions based on the firmware version in the firmware database and the firmware version recorded in the memory of the firmware download device 200, so as to realize dynamic management and on-demand updates of the firmware in the memory, configure the communication mode of the firmware download device 200 according to the optical module type, and coordinate the timing of busy status query and data writing of the firmware inside the device during the download process to ensure the reliability of the entire download process.
[0035] Please refer to Figure 2 This is a schematic flowchart illustrating a method for downloading optical module firmware according to an embodiment of the present invention. It should be noted that the optical module firmware download method of this embodiment is not based on... Figure 2 The specific order described below is a limitation. It should be understood that in other embodiments, the order of some steps in the optical module firmware download method of this invention can be interchanged according to actual needs, or some steps can be omitted or deleted. The executing entity of this optical module firmware download method can be an electronic device such as a host computer 100 or a firmware download device 200, and different steps of this optical module firmware download method can be executed by the same device or by different devices. For example, some steps are executed by the host computer 100, and some steps are executed by the firmware download device 200. This embodiment does not limit this. The following will describe... Figure 2 The specific process shown will be explained in detail.
[0036] Step S201: Obtain the model number of the target optical module for which the firmware to be downloaded.
[0037] In this embodiment, the host computer 100 can receive order information sent by the production management system, and then obtain information such as the model of the target optical module from the order information.
[0038] Step S202: Obtain the latest firmware version number of the target optical module from the firmware database according to the model of the target optical module.
[0039] In this embodiment, after obtaining the model number of the target optical module, the host computer 100 initiates a query to the firmware database to obtain relevant information about the latest firmware of the target optical module, such as the latest firmware version number.
[0040] Step S203: Based on the latest firmware version number of the target optical module and the firmware metadata stored in the memory of the firmware download device, determine whether a data update operation needs to be performed on the memory; the memory stores firmware metadata and firmware files for different models of optical modules.
[0041] In this embodiment, firmware metadata is used to describe the firmware files of different models of optical modules stored in the memory, and may include the optical module model, local firmware version number, storage address, firmware size, CRC checksum, etc.
[0042] In this embodiment, the host computer 100 can read the firmware metadata stored in the memory through the firmware download device and compare it with the latest firmware version number of the target optical module to determine whether a data update operation needs to be performed on the memory.
[0043] Step S204: If no data update operation is required for the memory, the firmware file of the target optical module stored in the memory is downloaded to the target optical module.
[0044] In this embodiment, when the host computer 100 determines that it does not need to perform a data update operation on the memory, it directly executes the firmware download process, reads the firmware file of the target optical module stored in the memory through the firmware download device, and downloads the firmware file of the target optical module into the target optical module.
[0045] Step S205: If a data update operation needs to be performed on the memory, the firmware metadata and firmware file stored in the memory are updated according to the latest firmware file of the target optical module, and the firmware file of the target optical module stored in the memory is downloaded to the target optical module.
[0046] In this embodiment, when the host computer 100 determines that a data update operation needs to be performed on the memory, it first needs to perform a data update operation on the memory, that is, update the firmware metadata and firmware file stored in the memory according to the latest firmware file of the target optical module, and then execute the firmware download process. Similarly, the firmware file of the target optical module stored in the memory is read by the firmware download device and the firmware file of the target optical module is downloaded to the target optical module.
[0047] As can be seen, the optical module firmware download method provided in this embodiment of the invention includes: obtaining the model of the target optical module to be downloaded; obtaining the latest firmware version number of the target optical module from the firmware database according to the model of the target optical module; determining whether a data update operation needs to be performed on the memory based on the latest firmware version number of the target optical module and the firmware metadata stored in the memory of the firmware download device; the memory stores firmware metadata and firmware files of different models of optical modules; if no data update operation is required, the firmware file of the target optical module stored in the memory is downloaded to the target optical module; if a data update operation is required, the firmware metadata and firmware file stored in the memory are updated according to the latest firmware file of the target optical module, and the firmware file of the target optical module stored in the memory is downloaded to the target optical module. By recording the firmware metadata and firmware files of different models of optical modules in the memory, and realizing dynamic management and on-demand updating of the firmware in the memory based on the latest firmware version in the firmware database.
[0048] In some implementations, the storage space of the memory can be structurally divided, that is, the storage space of the memory includes a firmware metadata area and a firmware file area. The firmware metadata area is used to store a firmware metadata mapping table, and multiple records in the firmware metadata mapping table correspond to the firmware metadata of different models of optical modules. The firmware file area is used to store the firmware files of different models of optical modules.
[0049] For example, the first 2KB of the memory is the firmware metadata area, used to store a structured firmware metadata mapping table. This firmware metadata mapping table includes multiple records, each of which contains firmware metadata for a specific model of optical module, such as the optical module model, local firmware version number, starting address in memory, firmware size, CRC checksum, etc. The firmware file area starts at a 2KB offset address and is used to actually store the binary file of the optical module firmware.
[0050] In other embodiments, the firmware metadata mapping table may not be fixed in the first 2KB, but may be stored in any location in memory using a chained or log structure, and can be looked up by a fixed root pointer.
[0051] It is understandable that the above-mentioned data update operation on the memory mainly involves updating the data in the firmware metadata mapping table and the firmware file area.
[0052] As can be seen, this embodiment transforms the firmware download device into an "optical module firmware repository" that can be updated and queried in real time through the Flash storage structure of "firmware metadata mapping table + firmware file area". It supports online firmware updates and incremental additions, perfectly adapts to flexible production, and is more conducive to the dynamic management and on-demand updates of firmware in the memory.
[0053] In some implementations, the above data update operation includes data addition and data modification operations; the firmware metadata includes the optical module model and local firmware version number. Step S203 above determines whether a data update operation needs to be performed on the memory based on the latest firmware version number of the target optical module and the firmware metadata stored in the firmware download device's memory. Specifically, this includes: Determine if the target optical module model exists in the firmware metadata stored in the memory; if the target optical module model does not exist, determine if a data addition operation needs to be performed on the memory; if the target optical module model exists, determine whether a data modification operation needs to be performed on the memory based on the comparison result between the latest firmware version number of the target optical module and the local firmware version number.
[0054] For example, after obtaining the model number of the target optical module (xx.xxxx), the host computer 100 reads the firmware metadata mapping table through the firmware download device 200 to check if the firmware metadata of the optical module with model number xx.xxxx is recorded in the firmware metadata mapping table. If it is not found in the firmware metadata mapping table, it indicates that the firmware metadata and firmware file of the target optical module do not exist in the memory, so a data addition operation needs to be performed on the memory. If it is found in the firmware metadata mapping table, it indicates that the firmware metadata and firmware file of the target optical module exist in the memory. At this time, it is necessary to compare the latest firmware version number of the target optical module with the local firmware version number recorded in the memory to determine whether a data modification operation needs to be performed on the memory.
[0055] In one implementation, when determining whether a data modification operation needs to be performed on the memory based on a comparison between the latest firmware version number of the target optical module and the local firmware version number, the specific steps include: If the latest firmware version number of the target optical module is the same as the local firmware version number, or if the latest firmware version number of the target optical module is lower than the local firmware version number and it is determined that the firmware file corresponding to the local firmware version number will be used, then it is determined that no data modification operation needs to be performed on the memory. If the latest firmware version number of the target optical module is higher than the local firmware version number, or if the latest firmware version number of the target optical module is lower than the local firmware version number and it is determined that the firmware file corresponding to the latest firmware version number will be used, then it is determined that a data modification operation needs to be performed on the memory.
[0056] For example, if the local firmware version number of the target optical module recorded in the memory is Va.bc, and the latest firmware version number of the target optical module found in the firmware database is Vx.yz, the system first checks if Va.bc and Vx.yz are consistent. If they are consistent, it indicates that the firmware file of the target optical module stored in the memory is the latest version, and the download process can be directly executed without modifying or adding data to the memory; that is, no data update operation is required. If Va.bc and Vx.yz are inconsistent, and Va.bc is less than Vx.yz, it indicates that the firmware file version of the target optical module stored in the memory is too old. The firmware metadata and firmware file of the target optical module stored in the memory need to be modified to update to the latest version. If Va.bc and Vx.yz are inconsistent, and Va.bc is greater than Vx.yz, this is a special case, meaning that the firmware file version of the target optical module stored in the memory is newer. In this case, a preset strategy can be used to determine which firmware version to use.
[0057] The preset strategy can be either "force use of local version" or "downgrade to database version." "Force use of local version" means selecting the firmware file corresponding to the local firmware version number, while "downgrade to database version" means selecting the firmware file corresponding to the latest firmware version number obtained from the firmware database. In other embodiments, the preset strategy can also be to output an error message when Va.bc is greater than Vx.yz, resolving the version conflict through manual intervention, and ultimately using either the local version or the database version based on operator confirmation.
[0058] Therefore, if Va.bc and Vx.yz are inconsistent, and Va.bc is greater than Vx.yz, and it is determined that the firmware file corresponding to the local firmware version number will be used, the download process can be directly executed without modifying the data in the storage. However, if Va.bc and Vx.yz are inconsistent, and Va.bc is greater than Vx.yz, and it is determined that the firmware file corresponding to the latest firmware version number in the firmware version database will be used, then the firmware metadata and firmware file of the target optical module stored in the storage need to be modified to update to the latest version.
[0059] In one implementation, when no data update operation is required on the memory and the download process is executed directly, the firmware download device 200 can read the firmware storage address of the target optical module from the firmware metadata mapping table, and read the firmware file of the target optical module from the firmware file area according to the firmware storage address, and burn the firmware file of the target optical module into the target optical module to complete the firmware download process.
[0060] In one implementation, if a data update operation needs to be performed on the memory in step S205, the firmware metadata and firmware file stored in the memory are updated according to the latest firmware file of the target optical module, specifically including: If it is necessary to perform a data addition operation on the memory, the latest firmware file of the target optical module is downloaded from the firmware database, written to the memory, and the firmware metadata corresponding to the latest firmware file of the target optical module is added to the memory.
[0061] In this embodiment, when it is determined that the firmware metadata and firmware file of the target optical module do not exist in the memory, a data addition operation needs to be performed on the memory. At this time, the host computer 100 can allocate a free area in the firmware file area of the memory through the firmware download device 200 and determine the address of the free area. After downloading the latest firmware file of the target optical module from the firmware database, the downloaded latest firmware file of the target optical module is written into the allocated free area, and a new record is added to the firmware metadata mapping table, that is, the firmware metadata corresponding to the latest firmware file of the target optical module. Then, the firmware download process can be executed to burn the firmware file of the target optical module (the latest firmware file of the target optical module written into the free area) into the target optical module.
[0062] In one implementation, if a data update operation needs to be performed on the memory in step S205, the firmware metadata and firmware file stored in the memory are updated according to the latest firmware file of the target optical module, specifically including: If data modification operations need to be performed on the memory, the firmware file of the target optical module currently stored in the memory is erased, the latest firmware file of the target optical module is downloaded from the firmware database, the latest firmware file of the target optical module is written into the memory, and the firmware metadata of the target optical module currently stored in the memory is modified.
[0063] In this embodiment, when data modification operations need to be performed on the memory, the host computer 100 can first erase the firmware file (i.e., the old firmware file) of the target optical module currently stored in the memory using the firmware download device 200. Then, it downloads the latest firmware file of the target optical module from the firmware database and writes it to a free area of the memory (which can be the area where the firmware file of the target optical module was originally stored, or other free areas), and modifies the firmware metadata of the target optical module in the firmware metadata mapping table accordingly. Next, the firmware download process can be executed to burn the updated firmware file of the target optical module into the target optical module.
[0064] In one embodiment, the firmware download device 200 is communicatively connected to the target optical module via a communication interface, which supports different communication modes. Before downloading the firmware file of the target optical module stored in the memory to the target optical module, the optical module firmware download method provided in this embodiment may further include: Switch the communication interface to a communication mode that matches the target optical module.
[0065] In this embodiment, before executing the firmware download process, the host computer 100 can send a communication mode switching command to the firmware download device 200, so that the firmware download device 200 switches the communication interface to a communication mode that matches the target optical module according to the communication mode switching command.
[0066] like Figure 3 The diagram shown is a hardware block diagram of a communication interface. This communication interface supports both I2C and I3C communication modes, and can be used to connect optical modules with I2C or I3C interfaces, improving compatibility with optical modules. Ports "SCL-DUT1, SDA-DUT1", "SCL-DUT2, SDA-DUT2", and "I3C-SCL-DUT1, I3C-SDA-DUT1" can all be used to connect optical modules.
[0067] When the target optical module uses an I2C interface, the communication interface of the firmware download device 200 can be switched to I2C communication mode, so that the firmware download device 200 and the target optical module can communicate using the I2C protocol; when the target optical module uses an I3C interface, the communication interface of the firmware download device 200 can be switched to I3C communication mode, so that the firmware download device 200 and the target optical module can communicate using the I3C protocol.
[0068] Specifically, the firmware download device 200 can switch between I2C and I3C communication modes based on the level of the EN-UPr port of the communication interface. For example, if the host computer 100 sends a communication mode switching command to the firmware download device 200, indicating that a low level (0) is input to the EN-UPr port, then the device switches to I2C communication mode (requiring a pull-up resistor); if the host computer 100 sends a communication mode switching command to the firmware download device 200, indicating that a high level (1) is input to the EN-UPr port, then the device switches to I3C communication mode (not requiring a pull-up resistor).
[0069] In this embodiment, the communication mode switching instruction sent by the host computer 100 to the firmware download device 200 can adopt the following format: frame header (e.g., 0xC0) + command code (0xA0) + data length (e.g., 0x1) + data area (e.g., 0 or 1) + checksum (e.g., CS).
[0070] In other embodiments, the communication interface of the firmware download device 200 can be set to use I2C communication mode by default. In this way, when connecting an optical module with an I2C interface, there is no need to configure the communication mode; only when connecting an optical module with an I3C interface is it necessary to issue a communication mode switching command so that the firmware download device 200 switches the communication interface to I3C communication mode.
[0071] It should be noted that in this embodiment, the communication mode switching of the communication interface is achieved through the main controller software in the firmware download device 200; in other embodiments, a dual-mode interface chip can also be used in the hardware design of the firmware download device 200, and its working mode can be controlled by the host computer through issuing commands.
[0072] In one embodiment, the above step of downloading the firmware file of the target optical module stored in the memory to the target optical module specifically includes: Check if the target optical module is in the firmware write-ready state; if the target optical module is in the firmware write-ready state, download the firmware file of the target optical module stored in the memory to the target optical module.
[0073] In this embodiment, the host computer 100 can send a status query command to the firmware download device 200. The firmware download device 200 queries whether the target optical module is in a firmware writing ready state (e.g., by polling the optical module's status register), that is, queries the busy / idle status of the target optical module. Data writing is only performed when the target optical module is in a firmware writing ready state (i.e., not in a busy state), downloading the firmware file of the target optical module stored in the memory to the target optical module. In this way, by actively querying whether the optical module is in a firmware writing ready state through the firmware download device, bus contention and data writing failures are avoided, significantly improving the optical module's programming yield and production efficiency.
[0074] It should be noted that in practical applications, in addition to polling the status register of the optical module to achieve status query, for optical modules that support I3C in-band interrupts, they can be configured to actively notify the firmware download device when the busy state ends, and the firmware download device will then report to the host computer. This interrupt-driven method is more efficient than polling.
[0075] It should also be noted that the above embodiments are illustrated by the example of the host computer determining whether a data update operation needs to be performed on the memory; in practical applications, this can be partially or entirely handled by the firmware download device, with the host computer only obtaining order information and querying the firmware database, while the firmware download device autonomously completes firmware version comparison, decision-making, and firmware update operations, thus achieving a more distributed intelligent download solution.
[0076] To perform the corresponding steps in the above embodiments and various possible methods, an implementation of an optical module firmware download device is given below. Please refer to... Figure 4 This is a functional block diagram of an optical module firmware download device 600 provided in an embodiment of the present invention. It should be noted that the basic principle and technical effects of the optical module firmware download device 600 provided in this embodiment are the same as those in the above embodiments. For the sake of brevity, any parts not mentioned in this embodiment can be referred to the corresponding content in the above embodiments. The optical module firmware download device 600 includes: an optical module model acquisition module 610, a database query module 620, a data update decision module 630, and a download execution module 640.
[0077] The optical module model acquisition module 610 is used to acquire the model of the target optical module to which the firmware is to be downloaded.
[0078] It is understandable that the optical module model acquisition module 610 can perform the above step S201.
[0079] The database query module 620 is used to obtain the latest firmware version number of the target optical module from the firmware database based on the model of the target optical module.
[0080] It is understandable that the database query module 620 can execute the above step S202.
[0081] The data update decision module 630 is used to determine whether a data update operation needs to be performed on the memory based on the latest firmware version number of the target optical module and the firmware metadata stored in the memory of the firmware download device; the memory stores firmware metadata and firmware files of different models of optical modules.
[0082] It is understandable that the data update decision module 630 can execute the above step S203.
[0083] The download execution module 640 is used to download the firmware file of the target optical module stored in the memory to the target optical module if no data update operation is required; if a data update operation is required, it updates the firmware metadata and firmware file stored in the memory according to the latest firmware file of the target optical module, and downloads the firmware file of the target optical module stored in the memory to the target optical module.
[0084] It is understandable that the download execution module 640 can perform the above steps S204 and S205.
[0085] Optionally, the data update operation includes data addition and data modification operations; the firmware metadata includes the optical module model and the local firmware version number. The data update decision module 630 is used to determine whether the target optical module model exists in the firmware metadata stored in the memory; if the target optical module model does not exist, it determines that a data addition operation needs to be performed on the memory; if the target optical module model exists, it determines whether a data modification operation needs to be performed on the memory based on the comparison result between the latest firmware version number of the target optical module and the local firmware version number.
[0086] Optionally, the data update decision module 630 is further configured to determine that no data modification operation needs to be performed on the memory if the latest firmware version number of the target optical module is the same as the local firmware version number, or if the latest firmware version number of the target optical module is lower than the local firmware version number and it is determined that the firmware file corresponding to the local firmware version number is used; and if the latest firmware version number of the target optical module is higher than the local firmware version number, or if the latest firmware version number of the target optical module is lower than the local firmware version number and it is determined that the firmware file corresponding to the latest firmware version number is used, then it is determined that a data modification operation needs to be performed on the memory.
[0087] Optionally, the download execution module 640 is specifically used to download the latest firmware file of the target optical module from the firmware database, write the latest firmware file of the target optical module into the memory, and add the firmware metadata corresponding to the latest firmware file of the target optical module into the memory if it is necessary to perform a data addition operation on the memory.
[0088] Optionally, the download execution module 640 is further configured to, if it is necessary to perform data modification operations on the memory, erase the firmware file of the target optical module currently stored in the memory, download the latest firmware file of the target optical module from the firmware database, write the latest firmware file of the target optical module into the memory, and modify the firmware metadata of the target optical module currently stored in the memory.
[0089] Optionally, the firmware download device communicates with the target optical module via a communication interface that supports different communication modes. The download execution module 640 is also used to switch the communication interface to a communication mode compatible with the target optical module before downloading the firmware file of the target optical module stored in the memory to the target optical module.
[0090] Optionally, the download execution module 640 is further configured to query whether the target optical module is in a firmware write-ready state; if the target optical module is in a firmware write-ready state, the firmware file of the target optical module stored in the memory is downloaded to the target optical module.
[0091] Please refer to Figure 5This is a block diagram of an electronic device 500 provided in an embodiment of the present invention. The electronic device 500 includes a memory 510, a processor 520, and a communication module 530. The memory 510, processor 520, and communication module 530 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.
[0092] The memory 510 is used to store programs or data. The memory 510 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.
[0093] The processor 520 is used to read / write data or programs stored in the memory 510 and perform corresponding functions. For example, when a computer program stored in the memory 510 is executed by the processor 520, the optical module firmware download method disclosed in the above embodiments can be implemented.
[0094] The communication module 530 is used to establish a communication connection between the electronic device 500 and other devices via a network, and to send and receive data via the network.
[0095] It should be understood that, Figure 5 The structure shown is only a schematic diagram of the electronic device 500. The electronic device 500 may also include components that are larger than those shown. Figure 5 The more or fewer components shown, or having the same Figure 5 The different configurations shown. Figure 5 The components shown can be implemented using hardware, software, or a combination thereof.
[0096] This invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor 520, implements the optical module firmware download method disclosed in the above embodiments.
[0097] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0098] In addition, the functional modules in the various embodiments of the present invention can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0099] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0100] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for downloading firmware for an optical module, characterized in that, The method includes: Obtain the model number of the target optical module for which the firmware to be downloaded; The latest firmware version number of the target optical module is obtained from the firmware database according to the model of the target optical module; Based on the latest firmware version number of the target optical module and the firmware metadata stored in the memory of the firmware download device, it is determined whether a data update operation needs to be performed on the memory; the memory stores firmware metadata and firmware files for different models of optical modules. If no data update operation is required for the memory, the firmware file of the target optical module stored in the memory is downloaded to the target optical module. If a data update operation needs to be performed on the memory, the firmware metadata and firmware file stored in the memory are updated according to the latest firmware file of the target optical module, and the firmware file of the target optical module stored in the memory is downloaded to the target optical module.
2. The optical module firmware download method according to claim 1, characterized in that, The data update operation includes data addition and data modification operations; the firmware metadata includes the optical module model and local firmware version number; determining whether a data update operation needs to be performed on the memory based on the latest firmware version number of the target optical module and the firmware metadata stored in the memory of the firmware download device includes: Determine whether the model number of the target optical module exists in the firmware metadata stored in the memory; If the model of the target optical module does not exist, it is determined that a data addition operation needs to be performed on the memory; If the model of the target optical module exists, then based on the comparison result between the latest firmware version number of the target optical module and the local firmware version number, it is determined whether a data modification operation needs to be performed on the memory.
3. The optical module firmware download method according to claim 2, characterized in that, The step of determining whether to perform data modification operations on the memory based on the comparison result between the latest firmware version number of the target optical module and the local firmware version number includes: If the latest firmware version number of the target optical module is the same as the local firmware version number, or if the latest firmware version number of the target optical module is lower than the local firmware version number and it is determined that the firmware file corresponding to the local firmware version number is used, then it is determined that no data modification operation needs to be performed on the memory. If the latest firmware version number of the target optical module is higher than the local firmware version number, or if the latest firmware version number of the target optical module is lower than the local firmware version number and it is determined that the firmware file corresponding to the latest firmware version number is used, then it is determined that a data modification operation needs to be performed on the memory.
4. The optical module firmware download method according to claim 1, characterized in that, If a data update operation needs to be performed on the memory, the firmware metadata and firmware file stored in the memory are updated according to the latest firmware file of the target optical module, including: If it is necessary to perform a data addition operation on the memory, the latest firmware file of the target optical module is downloaded from the firmware database, the latest firmware file of the target optical module is written into the memory, and the firmware metadata corresponding to the latest firmware file of the target optical module is added to the memory.
5. The optical module firmware download method according to claim 1, characterized in that, If a data update operation needs to be performed on the memory, the firmware metadata and firmware file stored in the memory are updated according to the latest firmware file of the target optical module, including: If data modification operations need to be performed on the memory, the firmware file of the target optical module currently stored in the memory is erased, the latest firmware file of the target optical module is downloaded from the firmware database, the latest firmware file of the target optical module is written into the memory, and the firmware metadata of the target optical module currently stored in the memory is modified.
6. The optical module firmware download method according to claim 1, characterized in that, The firmware download device is communicatively connected to the target optical module via a communication interface, which supports different communication modes; before downloading the firmware file of the target optical module stored in the memory to the target optical module, the method further includes: Switch the communication interface to a communication mode that matches the target optical module.
7. The optical module firmware download method according to claim 1, characterized in that, The step of downloading the firmware file of the target optical module stored in the memory to the target optical module includes: Check whether the target optical module is in the firmware write-ready state; When the target optical module is in the firmware writing ready state, the firmware file of the target optical module stored in the memory is downloaded to the target optical module.
8. The method for downloading optical module firmware according to any one of claims 1-7, characterized in that, The storage space of the memory includes a firmware metadata area and a firmware file area. The firmware metadata area is used to store a firmware metadata mapping table, and multiple records in the firmware metadata mapping table correspond to the firmware metadata of different models of optical modules. The firmware file area is used to store the firmware files of different models of optical modules.
9. A firmware download device for an optical module, characterized in that, The device includes: The optical module model acquisition module is used to obtain the model of the target optical module to which the firmware is to be downloaded; The database query module is used to obtain the latest firmware version number of the target optical module from the firmware database according to the model of the target optical module; The data update decision module is used to determine whether a data update operation needs to be performed on the memory based on the latest firmware version number of the target optical module and the firmware metadata stored in the memory of the firmware download device; the memory stores firmware metadata and firmware files of different models of optical modules. The download execution module is used to download the firmware file of the target optical module stored in the memory to the target optical module if no data update operation is required; and to update the firmware metadata and firmware file stored in the memory according to the latest firmware file of the target optical module if a data update operation is required, and then download the firmware file of the target optical module stored in the memory to the target optical module.
10. A firmware download system for an optical module, characterized in that, It includes a host computer and a firmware download device. The host computer is communicatively connected to the firmware download device. The firmware download device stores firmware metadata and firmware files for different models of optical modules in its memory. The host computer is used to obtain the model of the target optical module whose firmware is to be downloaded, obtain the latest firmware version number of the target optical module from the firmware database according to the model of the target optical module, and determine whether it is necessary to perform a data update operation on the memory according to the latest firmware version number of the target optical module and the firmware meta-information stored in the memory. The firmware download device is used to download the firmware file of the target optical module stored in the memory to the target optical module if no data update operation is required on the memory. If a data update operation needs to be performed on the memory, the firmware metadata and firmware file stored in the memory are updated according to the latest firmware file of the target optical module, and the firmware file of the target optical module stored in the memory is downloaded to the target optical module.
11. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the optical module firmware download method as described in any one of claims 1-7.
12. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the steps of the optical module firmware download method as described in any one of claims 1-7.