Programmable logic device online upgrading method and device, equipment and storage medium

By treating the upgrade data packet to divide and gradually send it, and the method of confirming the results after each sending, the problem of poor data transmission stability when CPLD upgrades is solved, and more reliable data transmission is achieved.

CN119336689APending Publication Date: 2025-01-21SHANGHAI SMARTLOGIC TECHNOLOGY LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411386344.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

In the prior art, the data transmission stability during the upgrade of programmable logic devices (CPLDs) is poor, and the integrity and accuracy of data transmission cannot be effectively guaranteed.

Method used

By obtaining the source data of the data packet to be upgraded, it is gradually divided into data packets to be sent, and the sending result is determined before each sending. Only after the sending is successful, the next part of data continues to be sent until all data packets are sent.

Benefits of technology

Improve the stability of data transmission, ensure that each sent data packet is successfully received, avoiding data loss and transmission errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119336689A_ABST
    Figure CN119336689A_ABST
Patent Text Reader

Abstract

The invention discloses a programmable logic device online upgrading method and device, equipment and a storage medium. The method comprises the following steps: acquiring source data of a to-be-upgraded data packet of the programmable logic device; selecting a part of data from the source data as a to-be-sent data packet; sending the data packet to be sent to the programmable logic device, and determining a sending result; and when the sending result is successful sending, continuously obtaining a new to-be-sent data packet from the source data and sending the new to-be-sent data packet until all the source data in the to-be-upgraded data packet are sent. According to the method, the data in the to-be-upgraded data packet is respectively sent to the programmable logic device, whether the sending result of each time is successful sending is judged, and other data is continuously sent after the sending is successful, so that the stability of data transmission can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of electronic communication control technology, and in particular to a method, device, equipment and storage medium for online upgrading of a programmable logic device. Background Art

[0002] A complex programmable logic device (CPLD) is a programmable logic device used to build digital logic circuits. CPLD combines the programmability of logic functions with the reconfigurability of traditional digital circuits, allowing design engineers to implement complex logic functions on a single chip. During product development, when customer needs change, the old CPLD design is not compatible with new devices, or the old version has logic vulnerabilities, etc., the CPLD needs to be upgraded to add new functions or modify existing functions. By upgrading the CPLD online or offline, designers can adapt the product to new market needs or technical standards.

[0003] The prior art usually upgrades the CPLD through an upgrade package, but the stability of data transmission cannot be guaranteed during the process of upgrading the CPLD using the prior method. Summary of the invention

[0004] The invention provides a programmable logic device online upgrade method, device, equipment and storage medium to solve the problem of poor stability of data transmission when upgrading CPLD in the prior art.

[0005] According to one aspect of the present invention, a method for online upgrading of a programmable logic device is provided, the method comprising:

[0006] Acquire source data of a data packet to be upgraded of a programmable logic device;

[0007] Selecting part of the data from the source data as data packets to be sent;

[0008] Sending the data packet to be sent to the programmable logic device and determining a sending result;

[0009] When the sending result is successful, continue to obtain new data packets to be sent from the source data and send them until all source data in the data packets to be upgraded are sent.

[0010] According to another aspect of the present invention, there is provided an online upgrade device for a programmable logic device, the device comprising:

[0011] An acquisition module, used for acquiring source data of a data packet to be upgraded of a programmable logic device;

[0012] A determination module, used for selecting part of the data from the source data as the data packet to be sent;

[0013] A first sending module, used for sending the data packet to be sent to the programmable logic device and determining a sending result;

[0014] The second sending module is used for, when the sending result is successful sending, continuing to obtain a new data packet to be sent from the source data and sending it, until all source data in the data packet to be upgraded are sent.

[0015] According to another aspect of the present invention, there is provided an electronic device, the electronic device comprising: at least one processor; and

[0016] a memory communicatively connected to the at least one processor; wherein,

[0017] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the online upgrade method for a programmable logic device described in any embodiment of the present invention.

[0018] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the programmable logic device online upgrade method described in any embodiment of the present invention when executed.

[0019] The programmable logic device online upgrade method, device, equipment and storage medium of the embodiment of the present invention include: obtaining source data of the data packet to be upgraded of the programmable logic device; selecting part of the data from the source data as the data packet to be sent; sending the data packet to be sent to the programmable logic device and determining the sending result; when the sending result is successful, continue to obtain new data packets to be sent from the source data and send them until all the source data in the data packet to be upgraded are sent. The method sends the data in the data packet to be upgraded to the programmable logic device respectively, and judges whether the sending result is successful each time, and continues to send other data only after the sending is successful, which can improve the stability of data transmission and solve the problem of poor stability of data transmission when upgrading CPLD in the prior art.

[0020] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. 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 creative work.

[0022] Figure 1 A schematic diagram of a flow chart of an online upgrade method for a programmable logic device provided in the first embodiment of the present invention;

[0023] Figure 2 A schematic diagram of a flow chart of a method for online upgrading of a programmable logic device provided in the second embodiment of the present invention;

[0024] Figure 3 A schematic diagram of a flow chart of an online upgrade method for a programmable logic device provided by an embodiment of the present invention;

[0025] Figure 4 A schematic diagram of the structure of an online upgrade device for a programmable logic device provided in Embodiment 3 of the present invention;

[0026] Figure 5 Schematic diagram of the structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only an embodiment of a part of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work should belong to the scope of protection of the present invention. It should be understood that the various steps recorded in the method implementation of the present invention can be performed in different orders and / or in parallel. In addition, the method implementation may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.

[0028] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, any variations of the terms "including" and "having" are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0030] It should be noted that the modifications of "one" and "plurality" mentioned in the present invention are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0031] The names of the messages or information exchanged between multiple devices in the embodiments of the present invention are only used for illustrative purposes, and are not used to limit the scope of these messages or information.

[0032] Embodiment 1

[0033] Figure 1 A flow chart of a method for online upgrading of a programmable logic device provided in the first embodiment of the present invention is applicable to the case of upgrading or updating a CPLD. The method can be executed by an online upgrading device for a programmable logic device, wherein the device can be implemented by software and / or hardware and is generally integrated on an electronic device. In this embodiment, the electronic device includes but is not limited to: an industrial computer motherboard and other devices.

[0034] like Figure 1 As shown, a method for online upgrading of a programmable logic device provided in Embodiment 1 of the present invention is applied to an industrial computer mainboard, and includes the following steps:

[0035] S110: Acquire source data of a data packet to be upgraded of a programmable logic device.

[0036] Among them, a programmable logic device is an integrated circuit chip that can be reprogrammed according to user needs to achieve different logical functions. A programmable logic device has the characteristics of strong flexibility and reusability, and is a semi-custom circuit in a digital electronic system. The type of the programmable logic device in this embodiment may be CPLD. The data packet to be upgraded may be a data packet related to the upgrade of the programmable logic device. The source data may refer to data directly from a source file, or "copy data" directly copied from a source file. The source data in this embodiment may be understood as text source data of the data packet to be upgraded.

[0037] In this embodiment, the industrial computer motherboard can obtain the source data of the data packet to be upgraded of the programmable logic device. The industrial computer motherboard can be a COME (COM Express) modular motherboard. COM Express is a computer module standard defined by the International Industrial Electrical Association. This modular motherboard integrates core functional components such as the central processing unit (CPU), chipset and memory, making it equivalent to a simplified computer system. Through dedicated interfaces, these motherboards can be seamlessly connected with other components to further expand their functions and form a complete computer system.

[0038] S120: Select part of the data from the source data as data packets to be sent.

[0039] The data packet to be sent may be a data packet that needs to be sent to a programmable logic device.

[0040] In this embodiment, a portion of data may be selected from the data packets to be sent as the data packets to be sent.

[0041] S130, sending the data packet to be sent to the programmable logic device, and determining the sending result.

[0042] The sending result may include sending success or sending failure.

[0043] In this embodiment, the mainboard of the industrial computer may send the data packet to be sent to the programmable logic device, and determine the sending result of the data packet to be sent.

[0044] S140: When the sending result is successful, continue to obtain new data packets to be sent from the source data and send them until all source data in the data packets to be upgraded are sent.

[0045] In this embodiment, when the sending result is successfully sent, it means that the data packet to be sent is successfully sent to the programmable logic device. At this time, a new data packet to be sent can be obtained from the source data and sent until all source data in the data packet to be upgraded are sent. In this embodiment, the sending result is determined each time the data packet to be sent is sent, so that the programmable logic device can successfully receive the data each time, thereby ensuring the stability of data transmission.

[0046] A method for online upgrading of a programmable logic device provided in a first embodiment of the present invention includes: obtaining source data of a data packet to be upgraded of a programmable logic device; selecting part of the data from the source data as a data packet to be sent; sending the data packet to be sent to the programmable logic device and determining the sending result; when the sending result is a successful sending, continuing to obtain new data packets to be sent from the source data and sending them until all the source data in the data packet to be upgraded are sent. The method sends the data in the data packet to be upgraded to the programmable logic device respectively, and determines whether the sending result is a successful sending each time, and continues to send other data only after the sending is successful, which can improve the stability of data transmission and solve the problem of poor stability of data transmission when upgrading CPLD in the prior art.

[0047] Based on the above embodiment, a variant embodiment of the above embodiment is proposed. It should be noted that in order to make the description concise, only the differences from the above embodiment are described in the variant embodiment.

[0048] In one embodiment, selecting part of the data from the source data as the data packet to be sent includes: determining the number of sendable bytes based on the number of receivable bytes of the programmable logic device; selecting data of a corresponding number of bytes from the source data based on the number of sendable bytes, and using the data as the data packet to be sent.

[0049] The number of receivable bytes may refer to the number of bytes that the programmable logic device can receive simultaneously, and the number of transmittable bytes may refer to the number of bytes that the transmitted data may include.

[0050] In this embodiment, the number of bytes that can be received can be determined according to the actual structure of the programmable logic device, and the number of bytes that can be received can be used as the number of bytes that can be sent. The industrial computer motherboard can determine how many bytes can be included in each data packet sent according to the number of bytes that can be sent, and select data with the same number of bytes as the number of bytes that can be sent from the source data, and use the selected data as the data packet to be sent. For example, if the number of bytes that can be sent is 16 bytes, 16 bytes of data are read from the source data each time as the data packet to be sent.

[0051] Embodiment 2

[0052] Figure 2This is a flow chart of a method for online upgrading of a programmable logic device provided in the second embodiment of the present invention. The second embodiment is optimized on the basis of the above embodiments. For details not yet provided in this embodiment, please refer to the first embodiment.

[0053] like Figure 2 As shown, a method for online upgrading of a programmable logic device provided in Embodiment 2 of the present invention comprises the following steps:

[0054] S210: Acquire source data of a data packet to be upgraded of a programmable logic device.

[0055] S220: Select part of the data from the source data as data packets to be sent.

[0056] S230: Determine whether the data packet to be sent is stored in a specified address of the programmable logic device.

[0057] The designated address may be the address of the data packet to be sent when it is stored in the programmable logic device.

[0058] In this embodiment, the address of the data packet to be sent when it is stored in the programmable logic device can be specified in advance.

[0059] S240. Send the data packet to be sent and the corresponding designated address to the programmable logic device through the current line for data transmission with the programmable logic device, so that the programmable logic device stores the data packet to be sent to the address corresponding to the designated address.

[0060] The current line may be a line currently used to transmit data.

[0061] In this embodiment, when the data packet to be sent is sent to the programmable logic device, a corresponding designated address may also be sent so that the programmable logic device stores the data packet to be sent at an address corresponding to the designated address.

[0062] In this embodiment, data can be transmitted through an integrated circuit bus (Inter-Integrated Circuit, I2C), which is a serial communication bus that uses a multi-master-slave architecture and is widely used for communication between microcontrollers and sensor arrays, displays and other devices. The circuit of this embodiment can be implemented by installing a driver. For example, an I2C driver can be installed to perform data transmission.

[0063] S250, determining the sending result; when the sending result is successful, continue to obtain new data packets to be sent from the source data and send them until all source data in the data packets to be upgraded are sent.

[0064] A method for online upgrading of a programmable logic device provided in the second embodiment of the present invention specifically sends the data packet to be sent to the programmable logic device, including: determining that the data packet to be sent is stored at a specified address of the programmable logic device; sending the data packet to be sent and the corresponding specified address to the programmable logic device through the current line for data transmission with the programmable logic device, so that the programmable logic device stores the data packet to be sent at the address corresponding to the specified address. By determining that the data packet to be sent is stored at the specified address of the programmable logic device, this method can conveniently obtain the corresponding data packet from the specified address when determining the sending result, which can improve the efficiency of determining the sending result.

[0065] In one embodiment, determining the sending result includes: obtaining a received data packet corresponding to the data packet to be sent from the programmable logic device; comparing whether the data in the received data packet is consistent with the data in the data packet to be sent, and obtaining the sending result.

[0066] The received data packet may be data stored locally after the programmable logic device receives the data packet to be sent.

[0067] In this embodiment, since the programmable logic device stores the received data packet at the address corresponding to the specified address, this embodiment can directly obtain the received data packet corresponding to the data packet to be sent from the programmable logic device according to the specified address, and compare whether the data in the received data packet and the data packet to be sent are consistent, thereby obtaining the sending result. When the data are consistent, the sending result is a successful sending, and when the data are inconsistent, the sending result is a sending failure.

[0068] In one embodiment, the method further includes: when the sending result is a sending failure, if the number of sending failures does not exceed a line replacement threshold, reinitializing the current line for data transmission with the programmable logic device, and resending the data packet to be sent through the initialized current line; when the sending result is a sending failure, if the number of sending failures exceeds a line replacement threshold, using the backup line as a new current line, and resending the data packet to be sent through the new current line.

[0069] The line replacement threshold may be the number of line replacements, and the line replacement threshold may be set according to actual conditions. The standby line may be a line other than the current line. In this embodiment, there may be multiple lines for data transmission, and the specific number may be set according to actual conditions. Initialization refers to the process of reinstalling the driver corresponding to the line. For example, when the line is I2C, initialization may refer to the process of uninstalling the I2C-n driver (multiple drivers of I2C) and reinstalling the I2C-n driver.

[0070] In this embodiment, when the sending result is a sending failure, if the number of sending failures of the data packet to be sent does not exceed the line change threshold, the current line is reinitialized, and the data packet to be sent is resent through the initialized current line; if the number of sending failures exceeds the line change threshold, it means that there may be a problem with the current line and the line needs to be replaced. Specifically, the backup line can be used as the new current line, and the data packet to be sent can be resent through the new current line.

[0071] In this embodiment, if the line of the data packet to be sent has been changed once, but the number of sending failures after the line change exceeds the line change threshold, the line can be changed again or an error can be reported directly, which is not limited in this embodiment.

[0072] This embodiment can prevent the problem of being unable to scan the device connected to the communication line due to frequent errors in the communication line (such as I2C) by changing the transmission line when the number of transmission failures is too many.

[0073] In one embodiment, the method further includes: if the sending of the data packet to be sent has changed the current line, and the number of sending failures after the change exceeds the abnormal number, then stopping the sending of the data packet to be sent and issuing an alarm message.

[0074] The number of abnormalities may be the same as or different from the line replacement threshold. The alarm information may be in the form of sound or indicator light, etc., which is not limited in this embodiment.

[0075] In this embodiment, if the number of failed transmissions of the data packet to be transmitted after the line is replaced exceeds the number of abnormal transmissions, it indicates that the replaced line may also have abnormalities. At this time, it is necessary to stop the transmission of the data packet to be transmitted and issue an alarm message to prompt relevant staff. In this embodiment, after the data packet fails to be transmitted, it can be determined whether to resend the data packet according to the number of failed transmissions. When the number of failed transmissions does not exceed a certain number, the upgrade will not be stopped, but the data packet will be resent, thereby solving the problem of cumbersome operation and complex upgrade caused by the need to re-program the programmable logic device once the upgrade fails in the prior art.

[0076] In one embodiment, the method further includes: when the sending result is a sending failure, recording an error log at the time of the failure; the error log at least includes an error line identifier, an error address, and an error data packet.

[0077] The error log may be a log recording relevant information of a data packet failure. The error line identifier may be an identifier of a line used when the data packet fails to be sent, the error address may be an offset position of the data packet that fails to be sent in the source data, and the error data packet may include a data packet to be sent and a data packet that has been received by the programmable logic device.

[0078] In this embodiment, when the sending result of the data packet to be sent is a sending failure, an error log at the time of the failure may be recorded, and the error log may include relevant information such as an error line identifier, an error address, and an error data packet.

[0079] The embodiments of the present invention provide several specific implementation methods based on the technical solutions of the above embodiments.

[0080] As a specific implementation method of this embodiment, Figure 3 The present invention provides a flowchart of a method for online upgrading of a programmable logic device. In this embodiment, the mainboard of the industrial computer is COME, the programmable logic device is CPLD, and the line for transmitting data is I2C. Figure 3 As shown in the figure, after determining that the CPLD needs to be upgraded, the I2C driver can be installed to ensure smooth data interaction between COME and CPLD. COME detects the CPLD to confirm its existence and status. Calculate the amount of data transmitted: Calculate the amount of data transmitted, and 16 bytes can be transmitted at a time. Each time COME transmits a 16-byte data packet to the CPLD through the I2C bus.

[0081] This embodiment adds a data verification function, by comparing the sent data packet with the received data packet of the CPLD, to check whether the sent data is successful. If the data packet transmission fails, the error log is recorded, and it is determined whether the sent data packet is retransmitted more than 3 times through the backup line. If so, the transmission is stopped and an alarm is issued; otherwise, the current I2C bus is reinitialized, and it is continued to determine whether the number of retransmissions on the current I2C bus exceeds 3 times. If so, the backup line is switched and initialized, and the subsequent steps of retransmitting data are continued; otherwise, the subsequent steps of retransmitting data are directly performed.

[0082] When it is confirmed that all data has been sent successfully, the data sending is completed.

[0083] Embodiment 3

[0084] Figure 4 This is a structural diagram of an online upgrade device for a programmable logic device provided in Example 3 of the present invention. The device can be applicable to situations where a CPLD is upgraded or updated. The device can be implemented by software and / or hardware and is generally integrated on an electronic device.

[0085] like Figure 4 As shown, the device comprises:

[0086] The acquisition module 310 is used to acquire source data of a data packet to be upgraded of a programmable logic device;

[0087] A determination module 320, configured to select part of the data from the source data as a data packet to be sent;

[0088] A first sending module 330, configured to send the data packet to be sent to a programmable logic device and determine a sending result;

[0089] The second sending module 340 is used for, when the sending result is successful, continuing to obtain a new data packet to be sent from the source data and sending it, until all source data in the data packet to be upgraded are sent.

[0090] The present embodiment provides an online upgrade device for a programmable logic device, comprising: an acquisition module, used to acquire source data of a data packet to be upgraded of the programmable logic device; a determination module, used to select part of data from the source data as a data packet to be sent; a first sending module, used to send the data packet to be sent to the programmable logic device and determine a sending result; and a second sending module, used to continue to acquire and send new data packets to be sent from the source data when the sending result is successful sending, until all source data in the data packet to be upgraded are sent.

[0091] Furthermore, the determination module 320 is specifically configured to:

[0092] Determining the number of bytes that can be sent according to the number of bytes that can be received by the programmable logic device;

[0093] According to the number of bytes that can be sent, data with a corresponding number of bytes are selected from the source data, and the data are used as data packets to be sent.

[0094] Furthermore, the first sending module 330 is specifically configured to:

[0095] Determining that the data packet to be sent is stored at a specified address of the programmable logic device;

[0096] The data packet to be sent and the corresponding designated address are sent to the programmable logic device through the current line for data transmission with the programmable logic device, so that the programmable logic device stores the data packet to be sent at the address corresponding to the designated address.

[0097] Furthermore, the first sending module 330 is specifically configured to:

[0098] Acquire a received data packet corresponding to the data packet to be sent from the programmable logic device;

[0099] Compare the data in the received data packet and the data in the to-be-sent data packet to see if they are consistent, and obtain a sending result.

[0100] Furthermore, the device is also used for:

[0101] When the sending result is a sending failure, if the number of sending failures does not exceed the line replacement threshold, reinitialize the current line for data transmission with the programmable logic device, and resend the to-be-sent data packet through the initialized current line;

[0102] When the sending result is a sending failure, if the number of sending failures exceeds a line change threshold, the standby line is used as a new current line, and the to-be-sent data packet is resent through the new current line.

[0103] Furthermore, the device is also used for:

[0104] If the sending of the data packet to be sent has changed the current line, and the number of sending failures after the change exceeds the abnormal number, the sending of the data packet to be sent is stopped, and an alarm message is issued.

[0105] Furthermore, the device is also used for:

[0106] When the sending result is a sending failure, an error log at the time of the failure is recorded; the error log at least includes an error line identifier, an error address and an error data packet.

[0107] The above-mentioned programmable logic device online upgrade device can execute the programmable logic device online upgrade method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0108] Embodiment 4

[0109] Figure 5 A schematic diagram of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic 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 components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.

[0110] like Figure 5As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0111] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0112] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a programmable logic device online upgrade method.

[0113] In some embodiments, the programmable logic device online upgrade method can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the programmable logic device online upgrade method described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to execute the programmable logic device online upgrade method in any other appropriate manner (for example, by means of firmware).

[0114] Various implementations 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), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0115] Computer programs for implementing 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, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0116] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0117] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0118] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0119] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0120] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0121] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for online upgrading of a programmable logic device, characterized in that: The method comprises: Acquire source data of a data packet to be upgraded of a programmable logic device; Selecting part of the data from the source data as data packets to be sent; Sending the data packet to be sent to the programmable logic device and determining a sending result; When the sending result is successful, continue to obtain new data packets to be sent from the source data and send them until all source data in the data packets to be upgraded are sent.

2. The method according to claim 1, characterized in that The selecting part of the data from the source data as the data packet to be sent includes: Determine the number of bytes that can be sent according to the number of bytes that can be received by the programmable logic device; According to the number of bytes that can be sent, data with a corresponding number of bytes are selected from the source data, and the data are used as data packets to be sent.

3. The method according to claim 1, characterized in that The step of sending the data packet to be sent to a programmable logic device comprises: Determining that the data packet to be sent is stored at a specified address of the programmable logic device; The data packet to be sent and the corresponding designated address are sent to the programmable logic device through the current line for data transmission with the programmable logic device, so that the programmable logic device stores the data packet to be sent at the address corresponding to the designated address.

4. The method according to claim 1, characterized in that: The determining of the sending result includes: Acquire a received data packet corresponding to the data packet to be sent from the programmable logic device; Compare the data in the received data packet and the data in the to-be-sent data packet to see if they are consistent, and obtain a sending result.

5. The method according to claim 1, characterized in that The method further comprises: When the sending result is a sending failure, if the number of sending failures does not exceed the line replacement threshold, reinitialize the current line for data transmission with the programmable logic device, and resend the to-be-sent data packet through the initialized current line; When the sending result is a sending failure, if the number of sending failures exceeds a line change threshold, the standby line is used as a new current line, and the to-be-sent data packet is resent through the new current line.

6. The method according to claim 5, characterized in that The method further comprises: If the sending of the data packet to be sent has changed the current line, and the number of sending failures after the change exceeds the abnormal number, the sending of the data packet to be sent is stopped, and an alarm message is issued.

7. The method according to claim 1, characterized in that The method further comprises: When the sending result is a sending failure, an error log at the time of the failure is recorded; the error log at least includes an error line identifier, an error address and an error data packet.

8. A programmable logic device online upgrade device, characterized in that: The device comprises: An acquisition module, used for acquiring source data of a data packet to be upgraded of a programmable logic device; A determination module, used for selecting part of the data from the source data as the data packet to be sent; A first sending module, used for sending the data packet to be sent to the programmable logic device and determining a sending result; The second sending module is used for, when the sending result is successful sending, continuing to obtain a new data packet to be sent from the source data and sending it, until all source data in the data packet to be upgraded are sent.

9. An electronic device, characterized in that: The device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the programmable logic device online upgrade method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the programmable logic device online upgrade method according to any one of claims 1 to 7 when executed.