An optical module firmware upgrading method, a digital signal processor, an apparatus and a medium
Patent Information
- Application Number
- CN202611518270.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-29
- Publication Date
- 2026-10-30
AI Technical Summary
[0015]根据本发明的另一方面,提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机指令,所述计算机指令用于使处理器执行时实现本发明任一实施例所述的光模块固件升级方法。
Smart Images

Figure CN123011295A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication technology, and in particular to a method for upgrading optical module firmware, a digital signal processor, an apparatus, and a medium. Background Technology
[0002] Currently, with the development of communication technology, the firmware complexity of optical modules, as optoelectronic conversion devices for high-speed data transmission, has increased significantly. Manufacturers need to perform remote firmware updates for optical modules deployed in base stations or servers.
[0003] In existing technologies, upgrade equipment typically sends the complete new firmware data of the optical module to the microcontroller unit (MCU) inside the optical module. The MCU performs protocol parsing on the received complete firmware data, and then forwards the processed firmware data to the digital signal processor (DSP) inside the optical module based on the parsing results. Finally, the DSP completes the firmware upgrade based on the complete new firmware data.
[0004] However, due to the limited bandwidth of the optical module itself, sending the complete new firmware data to the MCU would result in low data transmission efficiency, and the risk of full data transmission is high in complex network operation and maintenance environments. Secondly, due to the limited computing power cache resources of the MCU in the optical module, the existing method of parse and send the received firmware data by the MCU requires a large amount of cache resources of the MCU, which is prone to data packet loss and seriously affects the firmware upgrade efficiency of the optical module. Summary of the Invention
[0005] This invention provides a method, digital signal processor, device, and medium for upgrading optical module firmware, which can reduce bandwidth usage during the firmware upgrade process and improve the firmware upgrade efficiency of optical modules while ensuring the accuracy of firmware data transmission results.
[0006] According to one aspect of the present invention, a method for firmware upgrade of an optical module is provided, the optical module including a microcontroller unit and a digital signal processor, the method being applied to the digital signal processor, comprising: Receive the differential data packet corresponding to the firmware upgrade transmitted transparently by the microcontroller unit; The differential data packet is generated by the upgrade device based on the comparison results between the new firmware version data and the old firmware version data corresponding to the optical module. The new firmware version data is determined based on the old firmware version data and differential data packets corresponding to the optical module, and the optical module firmware upgrade is completed based on the new firmware version data.
[0007] Optionally, receiving the differential data packet corresponding to the firmware upgrade transmitted transparently by the microcontroller unit includes: The system sequentially receives multiple data blocks transmitted through the microcontroller unit; these multiple data blocks are obtained by the upgrade device by segmenting the differential data packets. The received current data block is written into the first buffer of the random access memory in the optical module, and the current data block in the first buffer is verified. If the current data block in the first buffer is successfully verified, the current data block in the first buffer is written to the firmware spare area of the flash memory in the optical module. The current data block is read from the firmware spare area and written into the second buffer of the random access memory; The current data blocks written in the first buffer and the second buffer are compared, and the value of the upgrade status register in the flash memory is updated according to the comparison result.
[0008] Optionally, during the process of sequentially receiving multiple data blocks transparently transmitted by the microcontroller unit, the method further includes: If a transmission abnormality event occurs in the optical module, the sequence number of the target data block that has been successfully received is read from the upgrade status register after the optical module restarts. A retransmission instruction is generated based on the target data block sequence number, and the retransmission instruction is sent to the upgrade device through the microcontroller unit, so that the upgrade device sends the data block located after the target data block sequence number to the microcontroller unit.
[0009] Optionally, the new firmware version data is determined based on the old firmware version data and differential data packets corresponding to the optical module, including: After confirming that all data blocks have been successfully received, the old firmware version data corresponding to the optical module is read from the firmware runtime area of the flash memory, and the old firmware version data is written into the first buffer. Read the plurality of data blocks from the firmware spare area and write the plurality of data blocks into the second buffer; A differential decoding algorithm is used to decode the old firmware version data in the first buffer and multiple data blocks in the second buffer to obtain the new firmware version data.
[0010] Optionally, the optical module firmware is upgraded based on the new firmware version data, including: Write the new firmware version data into the firmware spare area of the flash memory in the optical module, and determine the current check value corresponding to the new firmware version data; The current check value is compared with the target check value in the differential data packet header. If the comparison results are consistent, the flag bit corresponding to the bootloader in the flash memory is updated. After the optical module restarts, the bootloader loads the new firmware version data from the firmware spare area into the running memory according to the updated flag bits.
[0011] Optionally, before receiving the differential data packet corresponding to the firmware upgrade transparently transmitted by the microcontroller unit, the method further includes: The system receives an upgrade request command transmitted transparently from the microcontroller unit; the upgrade request command is sent from the upgrade device to the microcontroller unit; the upgrade request command includes a new firmware version identifier. The upgrade status information corresponding to the new firmware version identifier is fed back to the microcontroller unit, and the microcontroller unit sends the upgrade status information to the upgrade device, so that when the upgrade device determines that the optical module has not completed the new firmware version upgrade, it sends the differential data packet to the microcontroller unit.
[0012] Optionally, the upgrade status information includes the firmware version identifier currently running on the optical module, and the sequence number of the last data block successfully received by the digital signal processor during the historical upgrade process; The upgrade device is also used to, based on the currently running firmware version identifier and the last data block sequence number, when it is determined that the optical module has not completed the new firmware version upgrade, divide the differential data packet into multiple data blocks and send each of the data blocks sequentially to the microcontroller unit of the optical module.
[0013] According to another aspect of the present invention, a digital signal processor is provided, the digital signal processor comprising: At least one memory; The memory stores a computer program that can be executed by the digital signal processor, which is then executed by the digital signal processor to enable the digital signal processor to perform the optical module firmware upgrade method according to any embodiment of the present invention.
[0014] According to another aspect of the present invention, an optical module firmware upgrade device is provided, wherein the optical module includes a microcontroller unit and a digital signal processor, and the device is configured on the digital signal processor, comprising: The data packet receiving module is used to receive the differential data packet corresponding to the firmware upgrade transmitted transparently by the microcontroller unit; The differential data packet is generated by the upgrade device based on the comparison results between the new firmware version data and the old firmware version data corresponding to the optical module. The firmware upgrade module is used to determine the new firmware version data based on the old firmware version data and differential data packets corresponding to the optical module, and to complete the firmware upgrade of the optical module based on the new firmware version data.
[0015] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the optical module firmware upgrade method according to any embodiment of the present invention.
[0016] The technical solution provided by this invention involves receiving differential data packets corresponding to firmware upgrades transmitted transparently by a microcontroller unit via a digital signal processor. These differential data packets are generated by the upgrade device based on a comparison between the new firmware version data and the old firmware version data corresponding to the optical module. The method of determining the new firmware version data based on the old firmware version data and the differential data packets, and then completing the optical module firmware upgrade based on the new firmware version data, can reduce bandwidth usage during the optical module firmware upgrade process and improve the firmware upgrade efficiency of the optical module while ensuring the accuracy of firmware data transmission results.
[0017] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a flowchart of an optical module firmware upgrade method provided according to an embodiment of the present invention; Figure 2 This is a schematic diagram of an optical module firmware upgrade system according to an embodiment of the present invention; Figure 3 This is a flowchart of another optical module firmware upgrade method provided by an embodiment of the present invention; Figure 4 This is a schematic diagram of the region division of flash memory within an optical module according to an embodiment of the present invention; Figure 5 This is a schematic diagram of the structure of an optical module firmware upgrade device according to an embodiment of the present invention; Figure 6This is a schematic diagram of the structure of an upgrade device that implements the optical module firmware upgrade method of this invention. Detailed Implementation
[0020] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0021] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0022] Figure 1 This is a flowchart illustrating a firmware upgrade method for an optical module according to an embodiment of the present invention. The optical module includes a microcontroller unit and a digital signal processor. This embodiment is applicable to situations involving firmware upgrades of optical modules. The method can be executed by the digital signal processor, such as... Figure 1 As shown, the method includes: Step 110: Receive the differential data packet corresponding to the firmware upgrade transmitted by the microcontroller unit.
[0023] The differential data packet is generated by the upgrade device based on the comparison between the new firmware version data and the old firmware version data corresponding to the optical module.
[0024] In this embodiment, optionally, the developer can trigger an optical module firmware upgrade command through an upgrade device. The upgrade device can obtain new firmware version data according to the storage address in the optical module firmware upgrade command, then compare the new firmware version data with the old firmware version data, and generate a differential data packet based on the difference between the two.
[0025] Figure 2 This can be a schematic diagram of an optical module firmware upgrade system, such as... Figure 2As shown, the system includes an upgrade device and an optical module. The optical module includes a microcontroller unit (MCU), flash memory, and a digital signal processor (DSP). After generating differential data packets in the manner described above, the upgrade device can send the differential data packets to the MCU of the optical module. Upon receiving the differential data packets, the MCU does not need to parse or process them; instead, it directly forwards the differential data packets to the DSP (i.e., passes them through to the DSP).
[0026] Step 120: Determine the new firmware version data based on the old firmware version data and differential data packets corresponding to the optical module, and complete the optical module firmware upgrade based on the new firmware version data.
[0027] In this embodiment, as Figure 2 As shown, after the DSP obtains the differential data packet, it can perform calculations on the old firmware version data and the differential data packet in its internal random access memory (RAM) to obtain the new firmware version data. Then, it writes the new firmware version data into the flash, and finally completes the optical module firmware upgrade based on the new firmware version data.
[0028] The advantages of this setup are twofold: First, compared to the existing technology that sends the complete new firmware data to the optical module MCU, this embodiment only sends differential data packets to the MCU. This solves the problems of severe bandwidth waste, low firmware data transmission rate, and high transmission risk in the existing technology. Second, since different MCU manufacturers implement MCUs differently, this embodiment transmits data to the DSP through the MCU without requiring the MCU to parse and process the data. This avoids the impact of different MCU manufacturers on data transmission. When the MCU's computing power cache resources are limited within the optical module, the pass-through method can significantly reduce the consumption of MCU cache resources, improving the firmware upgrade efficiency of the optical module while ensuring the accuracy of data transmission results.
[0029] The technical solution provided by this invention involves receiving differential data packets corresponding to firmware upgrades transmitted by the microcontroller unit through the digital signal processor of the optical module, determining the new firmware version data based on the old firmware version data and the differential data packets, and completing the firmware upgrade of the optical module based on the new firmware version data. This method can reduce bandwidth usage during the firmware upgrade process and improve the firmware upgrade efficiency of the optical module while ensuring the accuracy of firmware data transmission results.
[0030] Figure 3 This is a flowchart of another optical module firmware upgrade method provided by an embodiment of the present invention. The method is executed by the digital signal processor, such as... Figure 3 As shown, the method includes: Step 210: Receive multiple data blocks transmitted by the microcontroller unit in sequence; the multiple data blocks are obtained by the upgrade device by segmenting the differential data packets.
[0031] Optionally, prior to this step, the method further includes: receiving an upgrade request command transparently transmitted by the microcontroller unit; the upgrade request command being sent from the upgrade device to the microcontroller unit; the upgrade request command including a new firmware version identifier; feeding back the upgrade status information corresponding to the new firmware version identifier to the microcontroller unit, and sending the upgrade status information to the upgrade device through the microcontroller unit, so that when the upgrade device determines that the optical module has not completed the new firmware version upgrade, it sends the differential data packet to the microcontroller unit.
[0032] Specifically, the upgrade device can send upgrade request commands to the microcontroller unit of the optical module through the internal integrated circuit bus (I2C), serial peripheral interface (SPI), management data input / output interface (MDIO), etc.
[0033] After receiving an upgrade request command, the digital signal processor can read the value of the upgrade status register to obtain the current upgrade status information. Optionally, the upgrade status information includes the firmware version identifier currently running on the optical module, and the sequence number of the last data block successfully received by the digital signal processor during a historical upgrade process.
[0034] The upgrade device is also used to, based on the currently running firmware version identifier and the last data block sequence number, when it is determined that the optical module has not completed the new firmware version upgrade, divide the differential data packet into multiple data blocks and send each of the data blocks sequentially to the microcontroller unit of the optical module.
[0035] Specifically, Table 1 is the data structure table of the differential data packet. The differential data packet includes field values corresponding to various firmware upgrade fields. The packet header occupies a fixed 32 bytes of space to store control information.
[0036] Table 1 The advantage of this setup is that by dividing the differential data packets into multiple data blocks and transmitting them sequentially, the upgraded equipment can effectively reduce the amount of data transmitted in a single transmission, reduce the buffer pressure on the MCU in the optical module, and improve the reliability of the transmission results.
[0037] Step 220: Write the received current data block into the first buffer of the random access memory in the optical module, and verify the current data block in the first buffer; if the current data block in the first buffer is successfully verified, write the current data block in the first buffer into the firmware spare area of the flash memory in the optical module.
[0038] In this embodiment, the random access memory can be static random access memory (SRAM). The SRAM inside the digital signal processor can be divided into two buffers: a first buffer and a second buffer. The first buffer is used to receive the current data block passed through by the microcontroller unit, and the second buffer is used to back up the data blocks that have passed verification, and to merge the old firmware version data and differential data packets to obtain the new firmware version data. The storage capacity occupied by the first buffer or the second buffer is equal to the storage capacity occupied by a single data block plus 16 bytes.
[0039] In this embodiment, after receiving a data block, the digital signal processor can first store the data block in the first buffer and calculate the check value of the data block. If the check value is consistent with the preset value, the data block is determined to be successfully checked. Then, an atomic write operation is used to write the data block into the firmware spare area of the flash memory in the optical module.
[0040] Specifically, Figure 4 This can be a schematic diagram of the region division of the flash memory within an optical module in this embodiment, such as... Figure 4 As shown, in this embodiment, the flash memory can be divided into a bootloader storage area, an upgrade status register, a firmware running area, and a firmware spare area.
[0041] The Bootloader storage area is used to store the bootloader program, the upgrade status register is used to store the upgrade status of the optical module, the firmware running area is used to store the firmware version data currently running on the optical module (i.e., the old firmware version data), and the firmware spare area is used to store differential data packets and the data of the new firmware version to be determined later.
[0042] Step 230: Read the current data block from the firmware spare area and write the read current data block into the second buffer of the random access memory; compare the current data blocks written in the first buffer and the second buffer respectively, and update the value of the upgrade status register in the flash memory according to the comparison result.
[0043] In this step, data blocks can be read back from the firmware spare area of the flash memory to the second buffer of the SRAM inside the digital signal processor. Then, the data blocks written in the first buffer and the second buffer are compared to see if they are consistent. If they are consistent, the value of the upgrade status register is updated; if they are inconsistent, the data block in the firmware spare area is marked as a transmission failure.
[0044] The advantage of this setup is that, in the existing optical module firmware upgrade process, the entire data packet is usually verified only after all the new version firmware data has been received. If a data writing error occurs in the middle, the optical module needs to be restarted for identification. Compared with this method, this embodiment verifies each data block received by the data signal processor and writes it to the flash memory only after the data block has passed the verification, which can save the retry time consumed by data transmission errors.
[0045] Specifically, Table 2 is the data table stored in the upgrade status register. After comparing the current data blocks written in the first buffer and the second buffer respectively through step 430, if the comparison results are consistent, the maximum block number that has been successfully written to Flash and the cumulative checksum in the upgrade status register can be updated.
[0046] Table 2 In one embodiment of this invention, during the process of sequentially receiving multiple data blocks transparently transmitted by the microcontroller unit, the method further includes: if a transmission abnormality event occurs in the optical module, after the optical module restarts, reading the sequence number of the target data block that has been successfully received in the upgrade status register; generating a retransmission instruction based on the target data block sequence number, and sending the retransmission instruction to the upgrade device through the microcontroller unit, so that the upgrade device sends the data block located after the target data block sequence number to the microcontroller unit.
[0047] Specifically, if the optical module experiences events such as power failure, abnormal interruption, communication drop, or hardware failure during data transmission, it can read the sequence number of the target data block that has been successfully received (let's assume it's "9") from the upgrade status register after the optical module restarts. Then, the digital signal processor generates a retransmission instruction (e.g., "retransmit from the 10th data block"). After the microcontroller unit sends the retransmission instruction to the upgrade device, the upgrade device can send the data block specified in the retransmission instruction and subsequent data blocks to the microcontroller unit. Finally, the microcontroller unit transparently transmits the received data blocks to the digital signal processor.
[0048] In practical applications, due to the harsh environment in which optical modules are deployed, once power is lost or communication is interrupted, the firmware is in a "semi-burned" state. During the upgrade process, the old firmware data has been erased, and there is no rollback mechanism in case of failure. To address this issue, this embodiment proposes a breakpoint resume mechanism under transmission anomalies. Since the successfully received data blocks have already been written to the flash memory, there is no need to erase and rewrite the data in the flash memory after an anomaly occurs. This avoids repeated operations that cause flash memory wear and improves the firmware upgrade efficiency of the optical module.
[0049] Step 240: After confirming that all data blocks have been successfully received, read the old firmware version data corresponding to the optical module from the firmware running area of the flash memory and write the old firmware version data into the first buffer; read multiple data blocks from the firmware spare area and write the multiple data blocks into the second buffer.
[0050] Step 250: Using a differential decoding algorithm, decode the old firmware version data in the first buffer and multiple data blocks in the second buffer to obtain the new firmware version data.
[0051] In this embodiment, the differential decoding algorithm can be the third-generation Xdelta binary differential algorithm or the bsdiff differential algorithm, etc., and this embodiment does not limit it.
[0052] Step 260: Write the new firmware version data into the firmware spare area of the flash memory in the optical module, and determine the current checksum corresponding to the new firmware version data.
[0053] In this step, a 32-bit Cyclic Redundancy Check (CRC32) can be performed on the new firmware version data to obtain the current check value corresponding to the new firmware version data.
[0054] Step 270: Compare the current checksum with the target checksum in the differential data packet header. If the comparison results are consistent, update the flag bit corresponding to the bootloader in the flash memory.
[0055] In this step, if the current checksum matches the target checksum in the differential data packet header, the flag corresponding to the bootloader can be updated to the preset flag corresponding to the successful upgrade state (e.g., 0x03). If the comparison results do not match, the new firmware version data in the firmware spare area is erased, the flag corresponding to the bootloader is updated to the preset flag corresponding to the failed upgrade state (e.g., 0xFF), and then a re-upgrade command is sent to the upgrade device through the microcontroller unit.
[0056] Step 280: After the optical module restarts, the bootloader loads the new firmware version data from the firmware spare area into the running memory according to the updated flag bits.
[0057] In this embodiment, after the optical module restarts, if the flag bit corresponding to the bootloader is the preset flag bit corresponding to the successful upgrade state (e.g., 0x03), the new firmware version data can be loaded from the firmware spare area into the running memory, thereby enabling the optical module to run according to the new firmware version data.
[0058] The technical solution provided by this invention involves the optical module's digital signal processor sequentially receiving multiple data blocks transmitted from the microcontroller unit. The received current data block is written into the first buffer of the random access memory in the optical module. The current data block in the first buffer is then verified. If the verification is successful, the current data block in the first buffer is written into the firmware spare area of the flash memory in the optical module. The current data block is read from the firmware spare area and written into the second buffer of the random access memory. The current data blocks written into the first buffer and the second buffer are compared. Based on the comparison result, the value of the upgrade status register in the flash memory is updated. After confirming that all data blocks have been successfully received, the old firmware version data corresponding to the optical module is read from the firmware running area of the flash memory and written into the first buffer. This process involves reading multiple data blocks from the firmware backup area and writing them into a second buffer. A differential decoding algorithm is used to decode the old firmware version data in the first buffer and the multiple data blocks in the second buffer to obtain the new firmware version data. This new firmware version data is then written to the firmware backup area in the optical module's flash memory. The current checksum corresponding to the new firmware version data is determined and compared with the target checksum in the differential data packet header. If the comparison results match, the flag corresponding to the bootloader in the flash memory is updated. After the optical module restarts, the bootloader loads the new firmware version data from the firmware backup area into the running memory based on the updated flag. This technique reduces bandwidth usage during the optical module firmware upgrade process and improves the firmware upgrade efficiency while ensuring the accuracy of firmware data transmission results.
[0059] Figure 5 This is a schematic diagram of a firmware upgrade device for an optical module provided in an embodiment of the present invention. The optical module includes a microcontroller unit and a digital signal processor. The device is deployed on the digital signal processor, such as... Figure 5 As shown, the device includes a data packet receiving module 310 and a firmware upgrade module 320.
[0060] The data packet receiving module 310 is used to receive the differential data packet corresponding to the firmware upgrade transmitted transparently by the microcontroller unit; The differential data packet is generated by the upgrade device based on the comparison results between the new firmware version data and the old firmware version data corresponding to the optical module. The firmware upgrade module 320 is used to determine the new firmware version data based on the old firmware version data and differential data packets corresponding to the optical module, and to complete the firmware upgrade of the optical module based on the new firmware version data.
[0061] The technical solution provided by this invention involves receiving differential data packets corresponding to firmware upgrades transmitted by the microcontroller unit through the digital signal processor of the optical module, determining the new firmware version data based on the old firmware version data and the differential data packets, and completing the firmware upgrade of the optical module based on the new firmware version data. This method can reduce bandwidth usage during the firmware upgrade process and improve the firmware upgrade efficiency of the optical module while ensuring the accuracy of firmware data transmission results.
[0062] Based on the above embodiments, the data packet receiving module 310 includes: A data block receiving unit is configured to sequentially receive multiple data blocks transmitted by the microcontroller unit; the multiple data blocks are obtained by the upgrade device from the differential data packets; the received current data block is written into a first buffer of the random access memory in the optical module, and the current data block in the first buffer is verified; if the current data block in the first buffer is successfully verified, the current data block in the first buffer is written into the firmware spare area of the flash memory in the optical module; the current data block is read from the firmware spare area, and the read current data block is written into a second buffer of the random access memory; the current data blocks written in the first buffer and the second buffer are compared, and the value of the upgrade status register in the flash memory is updated according to the comparison result; The retransmission unit is used to read the target data block sequence number that has been successfully received in the upgrade status register after the optical module restarts if a transmission abnormality event occurs in the optical module; generate a retransmission instruction according to the target data block sequence number; and send the retransmission instruction to the upgrade device through the microcontroller unit, so that the upgrade device sends the data block located after the target data block sequence number to the microcontroller unit. An upgrade command receiving unit is used to receive an upgrade request command transparently transmitted by the microcontroller unit; the upgrade request command is sent from the upgrade device to the microcontroller unit; the upgrade request command includes a new firmware version identifier; the upgrade status information corresponding to the new firmware version identifier is fed back to the microcontroller unit, and the microcontroller unit sends the upgrade status information to the upgrade device, so that when the upgrade device determines that the optical module has not completed the new firmware version upgrade, it sends the differential data packet to the microcontroller unit.
[0063] The upgrade status information includes the firmware version identifier currently running on the optical module, and the sequence number of the last data block successfully received by the digital signal processor during the historical upgrade process. The upgrade device is also used to, based on the currently running firmware version identifier and the last data block sequence number, when it is determined that the optical module has not completed the new firmware version upgrade, divide the differential data packet into multiple data blocks and send each of the data blocks sequentially to the microcontroller unit of the optical module.
[0064] Firmware upgrade module 320 includes: The differential decoding unit is used to, after determining that all data blocks have been successfully received, read the old firmware version data corresponding to the optical module from the firmware running area of the flash memory and write the old firmware version data into the first buffer; read the multiple data blocks from the firmware spare area and write the multiple data blocks into the second buffer; and use a differential decoding algorithm to perform decoding operations on the old firmware version data in the first buffer and the multiple data blocks in the second buffer to obtain the new firmware version data. The data verification unit is used to write the new firmware version data into the firmware spare area of the flash memory in the optical module and determine the current verification value corresponding to the new firmware version data; compare the current verification value with the target verification value in the differential data packet header; if the comparison result is consistent, update the flag bit corresponding to the bootloader in the flash memory; after the optical module restarts, the bootloader loads the new firmware version data from the firmware spare area into the running memory according to the updated flag bit.
[0065] The above-described apparatus can execute the methods provided in all the foregoing embodiments of the present invention, and has the corresponding functional modules and beneficial effects for executing the above methods. Technical details not described in detail in the embodiments of the present invention can be found in the methods provided in all the foregoing embodiments of the present invention.
[0066] Figure 6 A schematic diagram of an upgrade device 10, which can be used to implement embodiments of the present invention, is shown. The upgrade device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The upgrade device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0067] like Figure 6As shown, the upgrade device 10 includes at least one processor 11 and a memory, such as read-only memory (ROM) or random access memory (RAM), communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the read-only memory 12 or loaded from the storage unit 18 into the random access memory 13. The random access memory 13 can also store various programs and data required for the operation of the upgrade device 10. The processor 11, read-only memory 12, and random access memory 13 are interconnected via a bus 14. Input / output (I / O) interfaces are also connected to the bus 14.
[0068] Multiple components in the upgrade device 10 are connected to the input / output interface 15, including: an input unit 16, such as a keyboard, mouse, etc.; an output unit 17, such as various types of monitors, speakers, etc.; a storage unit 18, such as a disk, optical disk, etc.; and a communication unit 19, such as a network card, modem, wireless transceiver, etc. The communication unit 19 allows the upgrade device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0069] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processing (DSP) processors, and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as the optical module firmware upgrade method.
[0070] In some embodiments, the optical module firmware upgrade method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed onto the upgrade device 10 via read-only memory 12 and / or communication unit 19. When the computer program is loaded into random access memory 13 and executed by processor 11, one or more steps of the optical module firmware upgrade method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the optical module firmware upgrade method by any other suitable means (e.g., by means of firmware).
[0071] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-chips (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0072] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0073] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, RAM, ROM, erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0074] To provide interaction with the user, the systems and techniques described herein can be implemented on an upgrade device having: a display device for displaying information to the user (e.g., a cathode ray tube (CRT) or a liquid crystal display (LCD)); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the upgrade device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0075] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0076] A computing system can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system. It addresses the shortcomings of traditional physical hosts and Virtual Private Servers (VPS) in terms of management difficulty and weak business scalability.
[0077] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0078] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for upgrading firmware of an optical module, wherein the optical module includes a microcontroller unit and a digital signal processor, characterized in that, The method is applied to the digital signal processor, including: Receive the differential data packet corresponding to the firmware upgrade transmitted transparently by the microcontroller unit; The differential data packet is generated by the upgrade device based on the comparison results between the new firmware version data and the old firmware version data corresponding to the optical module. The new firmware version data is determined based on the old firmware version data and differential data packets corresponding to the optical module, and the optical module firmware upgrade is completed based on the new firmware version data.
2. The method according to claim 1, characterized in that, Receiving the differential data packet corresponding to the firmware upgrade transmitted transparently by the microcontroller unit, including: The system sequentially receives multiple data blocks transmitted through the microcontroller unit; these multiple data blocks are obtained by the upgrade device by segmenting the differential data packets. The received current data block is written into the first buffer of the random access memory in the optical module, and the current data block in the first buffer is verified. If the current data block in the first buffer is successfully verified, the current data block in the first buffer is written to the firmware spare area of the flash memory in the optical module. The current data block is read from the firmware spare area and written into the second buffer of the random access memory; The current data blocks written in the first buffer and the second buffer are compared, and the value of the upgrade status register in the flash memory is updated according to the comparison result.
3. The method according to claim 2, characterized in that, In the process of sequentially receiving multiple data blocks transparently transmitted by the microcontroller unit, the method further includes: If a transmission abnormality event occurs in the optical module, the sequence number of the target data block that has been successfully received is read from the upgrade status register after the optical module restarts. A retransmission instruction is generated based on the target data block sequence number, and the retransmission instruction is sent to the upgrade device through the microcontroller unit, so that the upgrade device sends the data block located after the target data block sequence number to the microcontroller unit.
4. The method according to claim 2, characterized in that, The new firmware version data is determined based on the old firmware version data and differential data packets corresponding to the optical module, including: After confirming that all data blocks have been successfully received, the old firmware version data corresponding to the optical module is read from the firmware runtime area of the flash memory, and the old firmware version data is written into the first buffer. Read the plurality of data blocks from the firmware spare area and write the plurality of data blocks into the second buffer; A differential decoding algorithm is used to decode the old firmware version data in the first buffer and multiple data blocks in the second buffer to obtain the new firmware version data.
5. The method according to claim 1, characterized in that, The optical module firmware upgrade is completed based on the new firmware version data, including: Write the new firmware version data into the firmware spare area of the flash memory in the optical module, and determine the current check value corresponding to the new firmware version data; The current check value is compared with the target check value in the differential data packet header. If the comparison results are consistent, the flag bit corresponding to the bootloader in the flash memory is updated. After the optical module restarts, the bootloader loads the new firmware version data from the firmware spare area into the running memory according to the updated flag bits.
6. The method according to claim 2, characterized in that, Before receiving the differential data packet corresponding to the firmware upgrade transmitted transparently by the microcontroller unit, the method further includes: The system receives an upgrade request command transmitted transparently from the microcontroller unit; the upgrade request command is sent from the upgrade device to the microcontroller unit; the upgrade request command includes a new firmware version identifier. The upgrade status information corresponding to the new firmware version identifier is fed back to the microcontroller unit, and the microcontroller unit sends the upgrade status information to the upgrade device, so that when the upgrade device determines that the optical module has not completed the new firmware version upgrade, it sends the differential data packet to the microcontroller unit.
7. The method according to claim 6, characterized in that, The upgrade status information includes the firmware version identifier currently running on the optical module, and the sequence number of the last data block successfully received by the digital signal processor during the historical upgrade process. The upgrade device is also used to, based on the currently running firmware version identifier and the last data block sequence number, when it is determined that the optical module has not completed the new firmware version upgrade, divide the differential data packet into multiple data blocks and send each of the data blocks sequentially to the microcontroller unit of the optical module.
8. A digital signal processor, characterized in that, The digital signal processor includes: At least one memory; The memory stores a computer program that can be executed by the digital signal processor, which is then executed by the digital signal processor to enable the digital signal processor to perform the optical module firmware upgrade method according to any one of claims 1-7.
9. A firmware upgrade device for an optical module, wherein the optical module includes a microcontroller unit and a digital signal processor, characterized in that, The device is configured in the digital signal processor and includes: The data packet receiving module is used to receive the differential data packet corresponding to the firmware upgrade transmitted transparently by the microcontroller unit; The differential data packet is generated by the upgrade device based on the comparison results between the new firmware version data and the old firmware version data corresponding to the optical module. The firmware upgrade module is used to determine the new firmware version data based on the old firmware version data and differential data packets corresponding to the optical module, and to complete the firmware upgrade of the optical module based on the new firmware version data.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that are used to cause a processor to execute the optical module firmware upgrade method according to any one of claims 1-7.
