CPLD (Complex Programmable Logic Device) remote online upgrading method and system based on multi-protocol cooperative transmission and electronic equipment
Through the multi-protocol collaborative transmission method, the problems of cumbersome operation and unsatisfactory transmission rate are solved, and efficient, flexible and reliable CPLD remote online upgrade is achieved, improving the upgrade efficiency and reliability.
Patent Information
- Application Number
- CN202510649488.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-20
- Publication Date
- 2025-08-12
AI Technical Summary
The existing CPLD upgrade methods have problems such as cumbersome operation, inefficiency, complex hardware, and unsatisfactory transmission rates, especially in large-scale equipment upgrades, which are difficult to meet the needs.
The multi-protocol collaborative transmission method is adopted, and the CAN communication protocol and Ethernet UDP protocol are used to transmit the binary format data of the CPLD upgrade file to the main control chip and transfer it to the CPLD module in blocks. Combined with data verification, breakpoint transmission and self-test of the upgrade program, online upgrade is achieved.
It realizes efficient, flexible and reliable CPLD remote online upgrade, reduces time and labor costs, improves upgrade efficiency and reliability, and has the function of breakpoint continuous transmission to avoid waste of resources.
Smart Images

Figure CN120474911A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of CPLD upgrade, and in particular to a CPLD remote online upgrade method, system and electronic equipment based on multi-protocol cooperative transmission. Background Art
[0002] CPLDs (Complex Programmable Logic Devices) are widely used in product prototyping and production due to their flexible programming, short development cycles, and low manufacturing costs. With technological advancements, CPLD architectures have evolved from logic macrocells to FPGAs with built-in Flash memory, resulting in even superior performance. Currently, CPLD upgrades are primarily performed through emulator programming and online upgrades.
[0003] 1. Traditional upgrade methods typically rely on dedicated programmers to upgrade CPLD firmware via the JTAG interface. To perform the upgrade, this method requires opening the device's casing, plugging in the programmer, and transferring data via the JTAG interface. This approach is not only cumbersome but also has several limitations. Frequent upgrades, in particular, can significantly increase the cost and time of manual intervention.
[0004] 2. The traditional remote online upgrade method for CPLDs still relies on the system's CPU or MCU to complete the upgrade by configuring the corresponding GPIO to simulate JTAG timing. At the same time, due to its parallelism and large number of control lines, the hardware and implementation of the JTAG interface are usually more complex, and the transmission rate is not high. Therefore, although this method can achieve remote online upgrades, its complex hardware requirements and slow transmission speed limit its application in high-efficiency, large-scale systems.
[0005] Therefore, there is a need to improve the existing technology.
[0006] The above information is presented as background information only to assist with an understanding of the present disclosure and is not a determination or admission that any of the above may be applicable as prior art with respect to the present disclosure. Summary of the Invention
[0007] The present invention provides a CPLD remote online upgrade method, system and electronic equipment based on multi-protocol cooperative transmission, so as to solve the problems existing in the prior art.
[0008] To achieve the above object, the present invention provides the following technical solutions:
[0009] A CPLD remote online upgrade method based on multi-protocol cooperative transmission includes:
[0010] Transmit the binary format data of the CPLD upgrade file to the main control chip to obtain the upgrade data;
[0011] The upgrade data is transferred from the main control chip to the CPLD module in blocks, and data reception and writing are completed to realize online upgrade;
[0012] The data processing mechanism includes data verification, breakpoint resume and program self-check after upgrade.
[0013] Furthermore, the data verification includes:
[0014] When sending data, the calculated CRC check code is appended to the end of the data packet;
[0015] After receiving the data, the receiver verifies the data integrity based on the CRC check code.
[0016] Furthermore, if the data verification fails, the CPLD module requests the main control chip to retransmit the current data block. When the main control chip does not receive a confirmation signal from the CPLD module, it automatically retransmits the current data block.
[0017] Furthermore, the breakpoint resuming includes:
[0018] When the upgrade process is interrupted, the main control chip automatically records the sequence number of the data block that has been successfully transmitted;
[0019] When the system is restarted, the unfinished data blocks are continued to be transmitted according to the recorded data block sequence numbers.
[0020] Furthermore, the CPLD remote online upgrade method based on multi-protocol coordinated transmission further includes:
[0021] The main control chip monitors the network connection status in real time during the transmission process;
[0022] If a communication interruption is detected, the current transfer progress is saved to non-volatile memory.
[0023] Furthermore, the post-upgrade program self-check includes:
[0024] After the CPLD module completes data reception and writing, it enters the self-refresh state to verify the validity of the new program, load the new firmware, and perform the initial configuration.
[0025] Furthermore, the preset communication protocol combination includes a CAN communication protocol and an Ethernet UDP protocol; the CAN communication protocol is used for data transmission between the data source end and the main control chip, and the Ethernet UDP protocol is used for network communication between the main control chip and the CPLD module;
[0026] The main control chip integrates a CAN communication module and a UDP protocol stack for protocol conversion and data block encapsulation.
[0027] Furthermore, after receiving the binary file, the main control chip encapsulates the upgrade data into blocks and data packets; the data packets include a sequence number field, a data field and a CRC check field;
[0028] After receiving the data packet, the CPLD module parses the preamble, source or destination MAC address, IP header, UDP header and data payload in sequence to obtain the data.
[0029] The present invention also provides a CPLD remote online upgrade system based on multi-protocol coordinated transmission, which is used to implement the CPLD remote online upgrade method based on multi-protocol coordinated transmission as described in any of the above items, comprising:
[0030] Data source end, used to generate and send CPLD upgrade files;
[0031] The main control chip integrates the CAN communication module and Ethernet UDP protocol stack for receiving, processing and transmission control of upgrade files;
[0032] The CPLD module has a built-in Ethernet interface and non-volatile memory, and is used to receive upgrade data, perform data verification, support breakpoint resuming, and complete program self-test after the upgrade.
[0033] Furthermore, the main control chip also includes a breakpoint resume control module and a CRC check module, the breakpoint resume control module is used to record the sequence number and status of the transmitted data block, and the CRC check module is used to generate and verify the check field of the data packet;
[0034] The Ethernet interface of the CPLD module adopts a differential signal transmission design and is connected through a shielded twisted pair cable to reduce electromagnetic interference.
[0035] The present invention also provides an electronic device, which includes a memory and a processor.
[0036] Memory for storing computer programs.
[0037] A processor is configured to execute a computer program to implement the steps described in any one of the above items.
[0038] Compared with the prior art, the present invention has the following beneficial effects:
[0039] The present invention provides a CPLD remote online upgrade method, system and electronic device based on multi-protocol collaborative transmission. Data transmission is achieved through a preset communication protocol combination, and the upgrade file is transmitted from the data source to the main control chip, and then transmitted in blocks to the CPLD module. The upgrade can be completed quickly and efficiently, avoiding the cumbersome process of traditional upgrade methods and saving time and labor costs.
[0040] The present invention has other features and advantages that will be apparent from or will be described in detail in the accompanying drawings and the following detailed description incorporated herein, which together serve to explain certain principles of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0042] Figure 1 This is a flow chart of a CPLD remote online upgrade method based on multi-protocol collaborative transmission provided by the first embodiment of the present invention;
[0043] Figure 2 This is a flowchart of CPLD online upgrade in a CPLD remote online upgrade method based on multi-protocol cooperative transmission provided by the first embodiment of the present invention;
[0044] Figure 3 This is a flowchart of an Ethernet communication program in a CPLD remote online upgrade method based on multi-protocol cooperative transmission provided by the first embodiment of the present invention;
[0045] Figure 4 This is a structural block diagram of a CPLD remote online upgrade system based on multi-protocol collaborative transmission provided by the second embodiment of the present invention.
[0046] Reference numerals: 10, data source end; 20, main control chip; 30, CPLD module. DETAILED DESCRIPTION
[0047] In order to explain in detail the possible application scenarios, technical principles, specific solutions that can be implemented, and the purpose and effects of the present invention, the following is a detailed description of the specific embodiments listed in conjunction with the accompanying drawings. The embodiments described herein are only used to more clearly illustrate the technical solutions of the present invention and are therefore only examples and are not intended to limit the scope of protection of the present invention.
[0048] References to "embodiments" herein mean that the specific features, structures, or characteristics described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the term "embodiment" in various places in the specification does not necessarily refer to the same embodiment, nor does it particularly limit its independence or relevance to other embodiments. In principle, in the present invention, as long as there are no technical contradictions or conflicts, the various technical features mentioned in the embodiments can be combined in any manner to form a corresponding implementable technical solution.
[0049] Unless otherwise defined, the technical terms used herein have the same meanings as those generally understood by those skilled in the art to which the present invention belongs. The use of relevant terms herein is only for describing specific embodiments and is not intended to limit the present invention.
[0050] In the description of the present invention, the term "and / or" is used to describe a logical relationship between objects, indicating that three possible relationships exist. For example, A and / or B means: A exists, B exists, and both A and B exist. Furthermore, the character " / " generally indicates that the objects are in a logical "or" relationship.
[0051] In the present invention, terms such as "first" and "second" are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship of quantity, priority or sequence between these entities or operations.
[0052] Without further restrictions, in the present invention, the words "include", "comprise", "have" or other similar expressions used in sentences are intended to cover non-exclusive inclusion. These expressions do not exclude the presence of additional elements in the process, method or product including the elements, so that the process, method or product including a series of elements may include not only those limited elements, but also other elements not explicitly listed, or also include elements inherent to such process, method or product.
[0053] Consistent with the understanding in the Examination Guidelines, in the present invention, expressions such as "greater than," "less than," and "exceed" are understood to exclude the number itself; expressions such as "above," "below," and "within" are understood to include the number itself. Furthermore, in the description of the embodiments of the present invention, "multiple" means two or more (including two), and similar expressions related to "multiple," such as "multiple groups" and "multiple times," are also understood in this manner, unless otherwise specifically defined.
[0054] In the description of the embodiments of the present invention, the space-related expressions used, such as "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "vertical", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential", etc., indicate the orientation or position relationship based on the orientation or position relationship shown in the specific embodiments or drawings, and are only for the convenience of describing the specific embodiments of the present invention or facilitating the reader's understanding, and do not indicate or imply that the device or component referred to must have a specific position, a specific orientation, or be constructed or operated in a specific orientation, and therefore cannot be understood as limiting the embodiments of the present invention.
[0055] Unless otherwise expressly specified or limited, in the description of the embodiments of the present invention, the terms "installed", "connected", "connected", "fixed", "set", etc. used should be understood in a broad sense. For example, the "connection" can be a fixed connection, a detachable connection, or an integrated setting; it can be a mechanical connection, an electrical connection, or a communication connection; it can be a direct connection or an indirect connection through an intermediate medium; it can be the internal connection between two elements or the interaction relationship between two elements. For those skilled in the art of the technology to which the present invention belongs, the specific meanings of the above terms in the embodiments of the present invention can be understood according to specific circumstances.
[0056] The core of the present invention is to provide a CPLD remote online upgrade method based on multi-protocol coordinated transmission, which can efficiently and reliably achieve remote online upgrade of CPLD. Another core of the present invention is to provide a CPLD remote online upgrade system based on multi-protocol coordinated transmission, which has the above technical effects.
[0057] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0058] Currently, CPLD upgrade methods have numerous shortcomings. Traditional programmer upgrades are cumbersome, require manual on-site operation, and are inefficient, making them difficult to meet the needs of large-scale device upgrades. Traditional remote online upgrades have complex hardware structures, suboptimal transmission rates, and interruptions during the upgrade often require restarting, wasting time and resources. Therefore, to address the technical shortcomings of traditional upgrade solutions, the present invention provides a CPLD remote online upgrade method, system, and electronic device based on multi-protocol coordinated transmission, enabling efficient, flexible, and reliable CPLD remote online upgrades.
[0059] Example 1
[0060] Please refer to Figure 1 ,refer to Figure 1 As shown, the upgrade method mainly includes:
[0061] S1. Under a preset communication protocol combination and data processing mechanism, the binary format data of the CPLD upgrade file is transmitted to the main control chip to obtain the upgrade data.
[0062] Specifically, step S1 involves the data source and the main control chip. The preset communication protocol combination includes the CAN communication protocol and the Ethernet UDP protocol. The CAN communication protocol is used for data transmission between the data source and the main control chip. After the data source collects and prepares the binary format data of the CPLD upgrade file, it sends it to the main control chip via the CAN communication protocol. The main control chip receives this data and prepares for subsequent upgrade operations. Specifically, the data source is a host computer or cloud platform.
[0063] The binary data of the CPLD upgrade file sent by the data source includes: the data source determines relevant information about the system where the CPLD to be upgraded is located, such as the identification of the main control chip, etc. Based on this information, the data source accurately sends the binary data to the main control chip via the CAN communication protocol.
[0064] Specifically, in an industrial control system, the host computer may be a monitoring computer, which integrates the upgrade requirements of various devices and sends the corresponding binary files to the main control chip; in the Internet of Things scenario, the cloud platform pushes the binary files to the main control chip based on the device's registration information and upgrade strategy.
[0065] S2. The upgrade data is transmitted from the main control chip to the CPLD module in blocks, and data reception and writing are completed to realize online upgrade.
[0066] Specifically, after receiving the upgrade data, the main control chip uses its integrated CAN communication module and UDP protocol stack to encapsulate the upgrade data into data packets. Each data packet contains a sequence number field, a data field, and a CRC checksum field. The main control chip then transmits these data packets to the CPLD module via the Ethernet UDP protocol.
[0067] The Ethernet UDP protocol is used for network communication between the main control chip and the CPLD module. The CPLD module has a built-in Ethernet interface, which receives data packets sent by the main control chip. Upon receiving the data packet, the CPLD module sequentially parses the preamble, source or destination MAC address, IP header, UDP header, and data payload to obtain the data.
[0068] Specifically, the main control chip monitors the network connection status in real time during the transmission process. If it detects that the Ethernet UDP communication is interrupted, it will save the current transmission progress to non-volatile memory. After receiving the data, the CPLD module will perform data verification and other operations to ensure data accuracy.
[0069] In addition, in a specific implementation manner, the above-mentioned data transmission process also involves a data verification link in the data processing mechanism.
[0070] Specifically, when sending data, the main control chip calculates a CRC checksum and appends it to the end of the data packet. Upon receiving the data, the CPLD module verifies its integrity based on the CRC checksum. If the checksum passes, the CPLD module writes the data to the target storage area and sends a confirmation signal back to the main control chip. If the checksum fails, the CPLD module requests the main control chip to retransmit the current data block. If the main chip does not receive a confirmation signal, it automatically retransmits the current data block. The maximum number of retries can be set based on actual needs.
[0071] Among them, if the data verification still fails after multiple retransmissions, the main control chip can feedback abnormal information to the management end (host computer or cloud platform) so that the management end can take corresponding measures, such as resending the upgrade file.
[0072] During the upgrade process, the breakpoint resume function in the data processing mechanism is also involved.
[0073] Specifically, if the upgrade process is interrupted due to a network outage, power failure, or other reasons, the main control chip automatically records the sequence numbers of successfully transferred data blocks and saves the relevant progress information to non-volatile memory. When the system restarts, the main control chip reads the stored progress information and continues to transfer the unfinished data blocks based on the recorded data block numbers.
[0074] Furthermore, the specific operations after the CPLD module completes data reception and writing also include a post-upgrade program self-check in the data processing mechanism.
[0075] Specifically, after the CPLD module completes data reception and writing, it enters the self-refresh state. In this state, the CPLD module verifies the validity of the new program, such as checking the integrity of the program code and the correctness of its functions; loads the new firmware, loading the updated program into the CPLD module's operating environment; and performs initial configuration, initializing the relevant parameters and logic units of the CPLD module to ensure that the new version of the program can start normally and run stably.
[0076] Furthermore, based on the above embodiment, as a specific implementation method, the main control chip can also feedback the upgrade progress of the CPLD module to the management end (host computer or cloud platform) so that the management end can display the upgrade progress of the CPLD module in real time and summarize the upgrade results to generate an upgrade record.
[0077] Specifically, each time the main control chip sends a data packet to the CPLD module, it reads the status information fed back by the CPLD module, such as whether the data packet is successfully received. Based on the total number of data packets to be sent and the status of each data packet sent, the main control chip can learn the upgrade progress of the CPLD module and further feed back the upgrade progress to the management end.
[0078] Furthermore, based on the main control chip feeding back the upgrade progress of the CPLD module to the management end, the management end can also display the upgrade progress of each CPLD module in real time, summarize the upgrade results of each CPLD module and generate an upgrade record, including statistics on device information that failed to upgrade, and generate reports so that management personnel can grasp the upgrade status in a timely manner.
[0079] Please refer to Figure 2 Flowchart of online upgrade of CPLD module, and Figure 3 In the Ethernet communication program block diagram; in this embodiment, the specific upgrade process includes:
[0080] The upgrade program generated by the CPLD module is typically compiled and converted into a binary file. This binary file contains all the necessary data for updating the CPLD module firmware. During the upgrade process, file transfer is typically performed by a host computer or a monitoring cloud platform. Specifically, the binary file is transferred from the host computer or cloud platform to the main control chip via the CAN communication protocol. A pre-installed program in the main control chip receives the binary file and transmits it back to the CPLD module via the Ethernet UDP protocol, completing the firmware upgrade process.
[0081] The program upgrade process typically consists of multiple phases to ensure smooth completion and stable program operation. The system upgrade process begins with system startup, initializing the hardware and software environment and ensuring all necessary resources are ready. After startup, the system configures the network interface for communication, including setting network parameters (such as IP address, subnet mask, and gateway) to ensure the device can properly communicate with the external network. The system also configures the source and destination MAC addresses to ensure that packets are correctly identified and directed within the Ethernet network.
[0082] Next, the system initializes the Ethernet driver. The Ethernet driver manages communication between the hardware and the operating system, ensuring smooth data packet transmission and reception. After driver initialization is complete, the system begins communicating with external servers or devices. At this point, the system begins receiving Ethernet-formatted data packets from the target device. Depending on the protocol, the system parses the frame according to a standard format.
[0083] When receiving an Ethernet data packet, the system first reads the preamble in the data packet, which is used to synchronize the sending and receiving timing of the data. Next, the system parses the Ethernet frame header, which contains the source and destination MAC addresses, as well as other necessary control information. Next, the system extracts the IP header, which contains the destination IP address and other network layer information to help the router or receiving device determine the final destination of the data. Subsequently, the system receives the UDP header, which contains application layer protocol information used to identify the source and destination ports of the data. Finally, the system receives the data portion, which is usually the actual data content of the upgrade program, until the entire data packet is received.
[0084] When sending data, the system operates similarly to when receiving data, but with several key differences. When sending data, the system performs a cyclic redundancy check (CRC) to ensure that the data has not been corrupted or lost during transmission. This CRC is typically appended to the end of the data packet, allowing the receiver to verify the integrity and accuracy of the data. The system calculates the CRC value for the data being sent and appends it to the packet, ensuring the receiver can verify the data's correctness. If the CRC passes, the packet is considered complete and valid.
[0085] After sending the data, the system exits programming mode, meaning it is no longer in the firmware update state. After exiting programming mode, the system automatically enters self-refresh mode, where it performs a self-check and initialization of the updated program to ensure that the new version can boot properly and run stably. The self-refresh process typically includes verifying the validity of the new program, loading the new firmware, and performing initial configuration, ultimately ensuring that the program update is not only successfully completed but also runs stably.
[0086] In summary, the present invention provides a remote online CPLD upgrade method based on multi-protocol coordinated transmission. The method includes, under a preset communication protocol combination and data processing mechanism, transmitting binary format data of a CPLD upgrade file to a master control chip to obtain upgrade data; and then transmitting the upgrade data from the master control chip in blocks to the CPLD module to complete data reception and writing, thereby achieving online upgrade. This upgrade method, through multi-protocol coordinated transmission and a comprehensive data processing mechanism, enables remote online upgrades of CPLD modules, effectively improving upgrade efficiency and ensuring upgrade reliability and security. It also provides practical functions such as breakpoint resume, avoiding resource waste.
[0087] Example 2
[0088] Based on the above embodiment, the present invention also provides a remote online upgrade system for the CPLD module 30 based on multi-protocol cooperative transmission. The system described below can be referenced with the method described above. Figure 4 , combined with Figure 4 As shown, the upgrade system includes:
[0089] The data source end 10 is used to generate and send a CPLD upgrade file.
[0090] The main control chip 20 integrates a CAN communication module and an Ethernet UDP protocol stack, and is used to receive, process, and control the transmission of upgrade files. It also includes a breakpoint resume control module and a CRC checksum module. The breakpoint resume control module records the sequence number and status of transmitted data blocks, and the CRC checksum module generates and verifies the checksum field of the data packet.
[0091] CPLD module 30, with its built-in Ethernet interface and non-volatile memory, is used to receive upgrade data, perform data verification, support breakpoint resuming, and complete post-upgrade program self-tests. The Ethernet interface of CPLD module 30 utilizes a differential signal transmission design and is connected via a shielded twisted-pair cable to reduce electromagnetic interference.
[0092] Based on the above embodiment, as a specific implementation method, the data source end 10 is a host computer or a cloud platform, which is used to manage and distribute CPLD upgrade files according to different application scenarios and requirements.
[0093] Based on the above embodiment, as a specific implementation method, the CAN communication module of the main control chip 20 and the Ethernet UDP protocol stack work together to achieve data conversion and transmission between different protocols.
[0094] Based on the above embodiment, as a specific implementation method, the Ethernet interface and the non-volatile memory of the CPLD module 30 cooperate with each other to ensure accurate reception and storage of data.
[0095] The present invention also provides an electronic device, which includes a memory and a processor.
[0096] Memory for storing computer programs.
[0097] The processor is used to execute a computer program to implement the following steps: under a preset communication protocol combination and data processing mechanism, transmit the binary format data of the CPLD upgrade file to the main control chip 20 to obtain the upgrade data; transmit the upgrade data from the main control chip 20 to the CPLD module 30 in blocks, complete data reception and writing, and realize online upgrade.
[0098] For an introduction to the device provided by the present invention, please refer to the above method embodiment, and the present invention will not be elaborated here.
[0099] The present invention also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the following steps can be implemented: under a preset communication protocol combination and data processing mechanism, the binary format data of the CPLD upgrade file is transmitted to the main control chip 20 to obtain the upgrade data; the upgrade data is transmitted from the main control chip 20 to the CPLD module 30 in blocks, and data reception and writing are completed to realize online upgrade.
[0100] The computer-readable storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0101] For an introduction to the computer-readable storage medium provided by the present invention, please refer to the above method embodiment, and the present invention will not elaborate on it here.
[0102] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. References to the common and similar parts between the various embodiments are sufficient. The systems, devices, and computer-readable storage media disclosed in the embodiments are described briefly because they correspond to the methods disclosed in the embodiments. For relevant details, refer to the description of the methods.
[0103] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.
[0104] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0105] Finally, it should be noted that although the above embodiments have been described in the specification and drawings of the present invention, this does not limit the scope of patent protection of the present invention. All technical solutions generated by replacing or modifying equivalent structures or equivalent processes based on the essential concepts of the present invention using the contents recorded in the specification and drawings of the present invention, as well as directly or indirectly implementing the technical solutions of the above embodiments in other related technical fields, are included in the scope of patent protection of the present invention.
Claims
1. A CPLD remote online upgrade method based on multi-protocol collaborative transmission, characterized in that: Included in the preset communication protocol combination and data processing mechanism: Transmit the binary format data of the CPLD upgrade file to the main control chip to obtain the upgrade data; The upgrade data is transferred from the main control chip to the CPLD module in blocks, and data reception and writing are completed to realize online upgrade; The data processing mechanism includes data verification, breakpoint resume and program self-check after upgrade.
2. The CPLD remote online upgrade method based on multi-protocol cooperative transmission according to claim 1, wherein The data verification includes: When sending data, the calculated CRC check code is appended to the end of the data packet; After receiving the data, the receiver verifies the data integrity based on the CRC check code.
3. The CPLD remote online upgrade method based on multi-protocol cooperative transmission according to claim 2, wherein: If the data verification fails, the CPLD module requests the main control chip to retransmit the current data block; when the main control chip does not receive the confirmation signal from the CPLD module, it automatically retransmits the current data block.
4. The CPLD remote online upgrade method based on multi-protocol cooperative transmission according to claim 1, wherein: The breakpoint resume includes: When the upgrade process is interrupted, the main control chip automatically records the sequence number of the data block that has been successfully transmitted; When the system is restarted, the unfinished data blocks are continued to be transmitted according to the recorded data block sequence numbers.
5. The CPLD remote online upgrade method based on multi-protocol cooperative transmission according to claim 4 is characterized in that, Also includes: The main control chip monitors the network connection status in real time during the transmission process; If a communication interruption is detected, the current transfer progress is saved to non-volatile memory.
6. The CPLD remote online upgrade method based on multi-protocol cooperative transmission according to claim 1 is characterized in that, The post-upgrade program self-test includes: After the CPLD module completes data reception and writing, it enters the self-refresh state to verify the validity of the new program, load the new firmware, and perform the initial configuration.
7. The CPLD remote online upgrade method based on multi-protocol cooperative transmission according to claim 1, wherein: The preset communication protocol combination includes a CAN communication protocol and an Ethernet UDP protocol; the CAN communication protocol is used for data transmission between the data source end and the main control chip, and the Ethernet UDP protocol is used for network communication between the main control chip and the CPLD module; The main control chip integrates a CAN communication module and a UDP protocol stack for protocol conversion and data block encapsulation.
8. The CPLD remote online upgrade method based on multi-protocol cooperative transmission according to claim 1 is characterized in that, After receiving the binary file, the main control chip will encapsulate the upgrade data into blocks and data packets; the data packets contain a sequence number field, a data field, and a CRC check field; After receiving the data packet, the CPLD module parses the preamble, source or destination MAC address, IP header, UDP header and data payload in sequence to obtain the data.
9. A CPLD remote online upgrade system based on multi-protocol collaborative transmission, characterized in that: The method for implementing the CPLD remote online upgrade based on multi-protocol cooperative transmission according to any one of claims 1 to 8 comprises: Data source end, used to generate and send CPLD upgrade files; The main control chip integrates the CAN communication module and Ethernet UDP protocol stack for receiving, processing and transmission control of upgrade files; The CPLD module has a built-in Ethernet interface and non-volatile memory, and is used to receive upgrade data, perform data verification, support breakpoint resuming, and complete program self-test after the upgrade.
10. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to execute a computer program to implement the CPLD remote online upgrade method based on multi-protocol cooperative transmission as described in any one of claims 1 to 8.