CN111800488A - Data transmission method and system based on UDP (user Datagram protocol) and IPV6 (Internet protocol video protocol) protocols - Google Patents

Data transmission method and system based on UDP (user Datagram protocol) and IPV6 (Internet protocol video protocol) protocols Download PDF

Info

Publication number
CN111800488A
CN111800488A CN202010576633.2A CN202010576633A CN111800488A CN 111800488 A CN111800488 A CN 111800488A CN 202010576633 A CN202010576633 A CN 202010576633A CN 111800488 A CN111800488 A CN 111800488A
Authority
CN
China
Prior art keywords
computer
packet
target board
data
udp
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010576633.2A
Other languages
Chinese (zh)
Other versions
CN111800488B (en
Inventor
胡文
黄金华
于嘉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ASR Microelectronics Co Ltd
Original Assignee
ASR Microelectronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ASR Microelectronics Co Ltd filed Critical ASR Microelectronics Co Ltd
Priority to CN202010576633.2A priority Critical patent/CN111800488B/en
Publication of CN111800488A publication Critical patent/CN111800488A/en
Application granted granted Critical
Publication of CN111800488B publication Critical patent/CN111800488B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/382Information transfer, e.g. on bus using universal interface adapter
    • G06F13/385Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/654Updates using techniques specially adapted for alterable solid state memories, e.g. for EEPROM or flash memories
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/164Adaptation or special uses of UDP protocol
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0042Universal serial bus [USB]

Abstract

The application discloses a data transmission method based on UDP and IPV6 protocols. Step S10: implanting UDP and IPV6 protocols; and setting a UDP transparent transmission unit. Step S20: the computer runs the programming tool software and is connected to a target board card of the embedded system. Step S30: and a target board card of the embedded system runs a downloading program to become a data link server. Step S40: the computer is used as a client of the data link and is connected with the target board card through a handshake mechanism of the UDP transparent transmission unit; the transmission layer between the computer and the target board card adopts a UDP protocol, and the network layer adopts an IPV6 protocol. Step S50: and the computer sends a downloading command and/or data to the target board card, and the target board card responds to the computer, receives the firmware file transmitted by the computer according to the downloading command and writes the firmware file into the nonvolatile memory. The method realizes the rapid, sequential and high-reliability data transmission between the computer and the target board card of the embedded system.

Description

Data transmission method and system based on UDP (user Datagram protocol) and IPV6 (Internet protocol video protocol) protocols
Technical Field
The present disclosure relates to a method for programming firmware in an embedded system, and more particularly, to a method for transmitting data between a computer and a target board of the embedded system, where the data includes, for example, a firmware file of the embedded system.
Background
An embedded system (embedded system) is a computer system that contains processors, memory, input and/or output peripherals for performing specialized functions in a larger mechanical and/or electrical system. The memory of the embedded system stores a control program.
In mass production of the embedded system, firmware (firmware) needs to be programmed into memories such as NAND Flash (NAND Flash), NOR Flash (NOR Flash), eMMC (embedded multimedia card) and the like as an operating system object code. The firmware is a program solidified in a storage medium and determines the functions and performance of the embedded system. Generally, the firmware cannot be directly read or modified by a user after being written into the embedded system, and if data output is abnormal in the programming process, a product cannot be normally started, so that the programmed firmware is safe and reliable.
At present, the firmware programming modes capable of being produced in mass production include a FLASH programmer, an SD card mode, a USB mode and the like. Because the USB programming mode can display the mass production progress in real time and can simultaneously carry out mass production of a plurality of product devices, the existing embedded system generally adopts the USB mode to carry out mass production programming of firmware data.
However, in the conventional firmware programming mode, in order to ensure reliability, verification is performed when data is programmed, which slows down programming speed and affects production line efficiency.
Disclosure of Invention
The technical problem to be solved by the application is to provide a quick and reliable data transmission method, which is used for burning batch firmware of an embedded system, improving the production efficiency of mass production of the embedded system and facilitating the tracking of mass production state of production line workers.
In order to solve the above technical problem, the present application proposes a data transmission method based on UDP and IPV6 protocols, which includes the following steps. Step S10: the UDP and IPV6 protocols are implanted into the programming tool software of the computer and the downloading program of the target board card of the embedded system; UDP transparent transmission units are arranged between a UDP/IP protocol layer and a download protocol layer of a target board card of a computer and an embedded system; the UDP transparent transmission unit is used for realizing the bidirectional transparent transmission of data between the UDP/IP protocol layer and the download protocol layer. Step S20: the computer runs the programming tool software and is connected to a target board card of the embedded system. Step S30: and a target board card of the embedded system runs a downloading program to become a data link server. Step S40: the computer is used as a client of the data link and is connected with a target board card used as a server of the data link through a handshake mechanism of a UDP transparent transmission unit; the transmission layer between the computer and the target board card adopts a UDP protocol, and the network layer adopts an IPV6 protocol. Step S50: and the computer sends a downloading command and/or data to the target board card, the target board card responds to the computer, receives the firmware file transmitted by the computer according to the downloading command, and writes the firmware file into a nonvolatile memory of the embedded system. The method adopts the UDP protocol and the IPV6 protocol, and realizes the rapid, sequential and high-reliability data transmission between the computer and the target board card of the embedded system.
Further, in step S20, the computer is connected to a USB hub through a USB interface, and the USB hub is further connected to USB interfaces of target boards of one or more embedded systems. This is a typical application scenario for the above-described method.
Further, in step S30, the target board presses a specific key and powers on, and then enters a USB download mode, and automatically runs a download program. This is a preferred implementation of how the target board of the embedded system runs the downloading program.
Further, in step S50, the download command includes a request for the target board to receive a firmware file transmitted by the computer; the downloaded data comprises a firmware file which is stored in the computer and is suitable for the target board card. This shows that the present application is particularly suitable for use by a computer in programming firmware to an embedded system.
Furthermore, the programming tool software provides a first downloading protocol layer, the first downloading protocol layer actively pushes downloading commands and/or data to the target board card and blocks the reply and prompt information waiting for the target board card; and the download command and/or data sent by the first download protocol layer are sent to the UDP/IP protocol layer through the UDP transparent transmission unit, then packed into an Ethernet packet and forwarded to the bottom hardware drive layer, and finally sent to the USB hub from the USB interface of the computer. This is the software architecture of the programming tool software in the computer.
Further, a downloading command and/or data sent by the computer are transmitted to a USB interface of the target board card through a USB concentrator, sequentially pass through a bottom hardware driving layer, a UDP/IP protocol layer, a UDP transparent transmission unit and a downloading program transmitted to the target board card; the downloading program provides a second downloading protocol layer, the second downloading protocol layer passively receives the downloading command and/or data sent by the computer, immediately replies a response to the computer after receiving the downloading command and/or data, and executes a task corresponding to the downloading command. This is the software architecture of the downloaded program in the target board of the embedded system.
Further, the first download protocol layer and the second download protocol layer both adopt a fastboot protocol. This is the preferred implementation of both download protocol layers.
Furthermore, the UDP/IP protocol layer at the computer end and the UDP/IP protocol layer at the target board card end both adopt light codes, and comprise four layers of frameworks from top to bottom, namely an application layer, a transmission layer, a network layer and a data link layer. Therefore, the occupation of the storage space of a computer and an embedded system can be reduced, and the data transmission process is simplified.
Furthermore, a UDP transparent transmission unit at the computer end and a UDP transparent transmission unit at the target card end are added with a UDP transparent transmission field before the original data to realize transparent transmission; the UDP pass-through field includes a packet identifier for indicating the type of the packet, a packet flag for indicating whether there is a continuation, and a packet sequence number. The newly added UDP transparent transmission field records necessary information to realize the bidirectional transparent transmission of data.
Further, in step S40, the handshake mechanism of the UDP transparent unit on the computer side and the UDP transparent unit on the target card side includes the following steps. Step S401: an inquiry phase; the computer issues an empty packet. Step S402: an inquiry phase; after the target board card receives the empty packet sent by the computer, a reply packet is established and sent to the computer; the initial value of the local data packet sequence number of the target board card is contained. Step S403: an inquiry phase; and after the computer receives the reply packet of the target board card, the initial value of the sequence number of the data packet is locally recorded. Step S404: an initial stage; the computer sends out a packet with data, and the carried data at least comprises a downloading protocol number of the computer and the maximum load byte number of the data packet which can be supported by the computer. Step S405: an initial stage; the target board card receives a packet with data sent by the computer, constructs a reply packet and sends the reply packet to the computer; the method comprises the steps of receiving a target board card, wherein the target board card comprises a download protocol number of the target board card and the maximum load byte number of a data packet which can be supported by the target board card. Step S406: an initial stage; after receiving the reply packet of the target board card, the computer compares whether the download protocol numbers are matched or not; if not, the downloading is not carried out; and if so, changing the maximum load byte number of the data packet of the computer into the maximum load byte number of the data packet supported by the target board card, and adding 1 to the sequence number of the locally stored data packet. Step S407: a transmission stage; a computer issues a packet with download commands and/or data; the computer firstly backs up the packet locally, then sends the packet, and adds 1 to the sequence number of the data packet stored locally after the packet is sent. Step S408: a transmission stage; after receiving a packet with a download command and/or data sent by the computer, the target board card builds a reply packet and sends the reply packet to the computer, wherein the value of the sequence number of the data packet is the value obtained by adding 1 to the sequence number of the data packet sent by the computer. Step S409: a transmission stage; the computer receives the reply packet of the target board card and compares the serial numbers of the data packets; if the sequence number of the data packet in the reply packet is equal to the sequence number of the data packet stored locally minus 1, retransmitting the backup packet; if the data packet sequence number in the reply packet is equal to the locally stored data packet sequence number, deleting the backup packet; and repeating the step S407 to the step S409, wherein the data packet sequence number of each packet sent by the computer is the data packet sequence number of the last successfully sent packet plus 1. This is a detailed description of the handshake mechanism employed by the UDP transparent unit.
Further, the retransmission processing procedure after the computer finds the packet loss includes the following steps. Step S411: the computer sends the data packet to the target board card. Step S412: and the computer does not receive the reply packet of the target board card when the computer is overtime for the first time. Step S413: and the computer retransmits the last data packet to the target board card, and the sequence number of the data packet is unchanged. Step S414: and the computer does not receive the reply packet of the target board card after the second timeout. Step S415: and the computer retransmits the last data packet to the target board again, and the serial number of the data packet is unchanged. Step S416: and the target board card receives the data packet sent by the computer, constructs a reply packet and sends the reply packet to the computer. Step S417: the computer receives the reply packet of the target board card and completes the operation of writing data once; the computer adds 1 to the data packet serial number of the next packet. This is the retransmission mechanism adopted by the UDP transparent transmission unit.
The application also provides a data transmission system based on UDP and IPV6 protocols, which comprises a setting unit, a first connecting unit, a second connecting unit, a handshake unit and a transmission unit. The setting unit is used for implanting UDP and IPV6 protocols in programming tool software of the computer and a downloading program of a target board card of the embedded system, and setting UDP transparent transmission units between the UDP/IP protocol layers and downloading protocol layers of the computer and the target board card of the embedded system; the UDP transparent transmission unit is used for realizing the bidirectional transparent transmission of data between the UDP/IP protocol layer and the download protocol layer. The first connecting unit is used for running programming tool software in a computer and connecting the computer to a target board card of the embedded system through a USB interface. And the second connecting unit is used for running a downloading program on a target board card of the embedded system so that the target board card becomes a data link service end. The handshake unit is used for enabling a computer to serve as a client of a data link and connecting a target board card serving as a server of the data link through a handshake mechanism of the UDP transparent transmission unit; the transmission layer between the computer and the target board card adopts a UDP protocol, and the network layer adopts an IPV6 protocol. The transmission unit is used for enabling the computer to send a downloading command and/or data to the target board card, the target board card responds to the computer, receives the firmware file transmitted by the computer according to the downloading command, and writes the firmware file into the nonvolatile memory of the embedded system.
The technical effect that this application obtained is: a UDP transparent transmission unit is added on the light UDP and IPV6 protocol, a data link between a computer and a target board card is established, protocol stack codes are simplified, and the occupied memory amount is small. The application adopts UDP and IPV6 protocols to have better real-time performance, and the client can handshake the server again even if the UDP transparent transmission unit encounters a network loss. The UDP transparent transmission unit also provides a retransmission mechanism to realize reliable and sequential transmission, and prevents packet transmission delay or packet loss caused by long time for writing in the storage space.
Drawings
Fig. 1 is a flowchart of a data transmission method based on UDP and IPV6 protocols according to the present application.
Fig. 2 is a schematic diagram of the hardware connection between the computer and the target board.
FIG. 3 is a software architecture diagram of the programming tool software in the computer and the downloading program in the target board.
Fig. 4 is a diagram illustrating a data structure of the UDP transparent field.
Fig. 5 is a flow chart of the three phases of the handshake process of the UDP transparent mechanism.
Fig. 6 is a flowchart of retransmission of the UDP transparent transmission mechanism in case of packet loss.
Fig. 7 is a schematic structural diagram of a data transmission system based on UDP and IPV6 protocols according to the present application.
The reference numbers in the figures illustrate: 10 is a setting unit; 20 is a first connecting unit; 30 is a second connecting unit; 40 is a handshake unit; and 50 is a transmission unit.
Detailed Description
Referring to fig. 1, the data transmission method based on UDP and IPV6 protocols includes the following steps.
Step S10: UDP (User Datagram Protocol) and IPV6 (Internet Protocol version 6, version 6) protocols are embedded in the programming tool software of a computer and the downloading program of a target board of an embedded system. UDP transparent transmission units are arranged between a UDP/IP protocol layer and a download protocol layer of a target board card of the computer and the embedded system.
The UDP protocol is a core component of the Internet protocol suite (Internet protocol suite), which is a simple datagram-oriented communication protocol located in the transport layer (transport layer) of the OSI model.
The IPV6 Protocol is an Internet Protocol newer than IPV4 (Internet Protocol version 4, version 4 of the Internet Protocol) Protocol, and is located at the network layer (network layer) of the OSI model.
The UDP transparent transmission unit is used for realizing the bidirectional transparent transmission of data between the UDP/IP protocol layer and the download protocol layer.
Step S20: and running programming tool software by the computer, and connecting the computer to a target board card of the embedded system through a USB interface.
Step S30: and a target board card of the embedded system runs a downloading program to become a data link server. For example, when the target board presses a specific key and powers on, the target board enters a USB download mode and automatically runs a download program.
Step S40: the computer is used as a client of the data link and is connected with a target board card used as a server of the data link through a handshake mechanism of the UDP transparent transmission unit. The transmission layer between the computer and the target board card adopts a UDP protocol, and the network layer adopts an IPV6 protocol. The data transmission of the UDP protocol has the advantage of high speed, and the handshaking, retransmission and continuous transmission mechanism of the UDP transparent transmission unit can also ensure the transmission sequence and reliable transmission.
Step S50: the computer sends a download command and/or data to the target board, where the download command is, for example, to request the target board to receive a firmware file transmitted by the computer. The downloaded data is, for example, a firmware file stored in the computer and applicable to the target board. The target board card responds to the computer, receives the firmware file transmitted by the computer according to the downloading command, and writes the firmware file into a Flash (Flash memory) or other nonvolatile memories of the embedded system.
Please refer to fig. 2, which is a typical application scenario of the present application. The computer is connected to a USB hub (hub) through a USB interface, and the USB hub is connected to the USB interfaces of one or more target board cards. And after the computer runs the programming tool software and the target board card runs the downloading program, the computer is connected with the automatically identified target board card. The firmware file is stored in a computer, the target board card receives the firmware file and carries out programming by operating programming tool software at the computer end, and the power is cut off after the programming progress is completed, so that the mass production firmware programming work of the target board card of the embedded system is completed.
Referring to fig. 3, from the perspective of the software architecture, the programming tool software in the computer provides a first download protocol layer, which actively pushes a download command and/or data to the target board, and blocks waiting for a reply response, a prompt message, and the like of the target board. And the download command and/or data sent by the first download protocol layer are sent to the UDP/IP protocol layer through the UDP transparent transmission unit, then packed into an Ethernet packet and forwarded to the bottom hardware drive layer, and finally sent to the USB hub from the USB interface of the computer. Preferably, the first download protocol layer adopts a fastboot protocol, which is a mechanism for communicating with a bootloader (boot loader) through a USB connection. Preferably, the UDP/IP protocol layer adopts lightweight codes, and includes four layers of architectures from top to bottom, namely an application layer, a transport layer, a network layer, and a data link layer. And the application layer sets the computer to work in a client mode. The transport layer adopts UDP protocol, and the network layer adopts IPV6 protocol.
The downloading command and/or data sent by the computer are transmitted to the USB interface of the target board card through the USB concentrator, sequentially pass through the bottom hardware driving layer, the UDP/IP protocol layer, the UDP transparent transmission unit and the downloading program transmitted to the target board card. The downloading program provides a second downloading protocol layer, the second downloading protocol layer passively receives the downloading command and/or data sent by the computer, immediately replies a response to the computer after receiving the downloading command and/or data, and executes a task corresponding to the downloading command. Preferably, the second download protocol layer adopts a fastboot protocol. Preferably, the UDP/IP protocol layer adopts lightweight codes, and includes four layers of architectures from top to bottom, namely an application layer, a transport layer, a network layer, and a data link layer. And setting the target board card to work in a server side mode in the application layer. The transport layer adopts UDP protocol, and the network layer adopts IPV6 protocol.
Referring to fig. 4, the UDP transparent transmission unit of the computer and the UDP transparent transmission unit of the target board add the UDP transparent transmission field before the original data to implement transparent transmission. The UDP transparent field has a total length of 4 bytes, and sequentially includes a 1-byte packet identifier, and a 2-byte packet sequence number.
The packet identifier has, for example, 4 values: 0x0 is an error prompt packet, 0x1 is a query packet, 0x2 is an initial packet, and 0x3 is a transport packet, where 0x represents a hexadecimal number. 0x1 is the initial value used by the query packet to negotiate the packet sequence number. 0x2 is the data length of the initial packet used to negotiate the protocol number of the UDP pass-through and the maximum supported payload of the transport packet. The handshake process of the UDP protocol needs to go through two stages, namely, inquiry and initial, before entering the transmission stage to transmit the download command and/or data. No matter which of the three phases is currently in, if the network between the computer and the target board is interrupted, the UDP transparent code will be re-handshake to connect.
The grouping flag has 2 values: 0x0 is no retransmission and 0x1 is retransmission, where 0x represents a hexadecimal number. For example, a download command can be issued only by one data packet, which is a continuously transmitted data packet. For example, a plurality of data packets are required for transmitting a firmware file, and the data packets except the last data packet are all continuous transmission packets, and the last data packet is a non-continuous transmission packet. Only when the data packet is not continuously transmitted, the UDP transparent transmission can reply an empty packet as a response.
The packet sequence number is sequentially increased by, for example, a value of 0x0 to 0xFFFF, where 0x denotes a hexadecimal number, and an initial value of the sequence number is negotiated at an initial stage. During the transmission phase, the packet sequence number starts counting with the initial value plus 1. The computer firstly backs up the data packet locally and then sends the data packet, and the sequence number of the local data packet is added with 1; the computer receives a reply data packet of the target board card and compares the serial numbers of the data packets; if the number of the data packet sequence is minus 1, retransmitting the backup data packet; if the serial numbers of the data packets are equal, the correct reply data packet is received, and the backup data packet is deleted.
Referring to fig. 5, the handshake mechanism of the UDP transparent transmission unit of the computer and the UDP transparent transmission unit of the target board card includes an inquiry phase, an initial phase, and a transmission phase, and specifically includes the following steps.
Step S401: a query phase. The computer sends out a null packet, the value of the data packet identifier in the UDP transparent transmission field is 0x1, the value of the packet identifier is 0x0, and the sequence number of the data packet can be any value.
Step S402: a query phase. And after the target board card receives the empty packet sent by the computer, establishing a reply packet and sending the reply packet to the computer. In the reply packet, the value of the data packet identifier of the UDP transparent transmission field is 0x1, the value of the packet identifier is 0x0, and the data packet sequence number is the initial value of the local data packet sequence number of the target board card.
Step S403: a query phase. And after the computer receives the reply packet of the target board card, the initial value of the sequence number of the data packet is locally recorded.
Step S404: and (5) an initial stage. The computer sends out the packet with data, the value of the packet identifier of the UDP transparent transmission field is 0x2, the value of the packet identifier is 0x0, and the value of the packet sequence number is the initial value of the packet sequence number obtained in the inquiry stage. The carried data at least comprises the download protocol number of the computer and the maximum load byte number of the data packet which can be supported by the computer.
Step S405: and (5) an initial stage. And the target board card receives the packet with the data sent by the computer, constructs a reply packet and sends the reply packet to the computer. In the reply packet, the value of the data packet identifier of the UDP transparent transmission field is 0x2, the value of the packet identifier is 0x0, and the value of the sequence number of the data packet is the sequence number of the computer transmission packet. The reply packet also includes a download protocol number of the target board card and the maximum load byte number of the data packet which can be supported by the target board card.
Step S406: and (5) an initial stage. And after receiving the reply packet of the target board card, the computer compares whether the download protocol numbers are matched. If not, the download is not performed. And if so, changing the maximum load byte number of the data packet of the computer into the maximum load byte number of the data packet supported by the target board card, and adding 1 to the sequence number of the locally stored data packet.
Step S407: and (5) a transmission stage. The computer sends out a packet with a download command and/or data, the value of the packet identifier of the UDP transparent transmission field is 0x3, the value of the packet identifier is 0x0, and the value of the packet sequence number is the locally stored packet sequence number. The computer firstly backs up the packet locally, then sends the packet, and adds 1 to the sequence number of the data packet stored locally after the packet is sent.
Step S408: and (5) a transmission stage. And after the target board card receives the package of the download command and/or the data sent by the computer, the reply package is constructed and sent to the computer. In the reply packet, the value of the data packet sequence number of the UDP transparent transmission field is the value obtained by adding 1 to the data packet sequence number of the computer sending packet.
Step S409: and (5) a transmission stage. And the computer receives the reply packet of the target board card and compares the serial numbers of the data packets. And if the data packet sequence number in the reply packet is equal to the locally stored data packet sequence number minus 1, retransmitting the backup packet. If the data packet serial number in the reply packet is equal to the locally stored data packet serial number, the correct reply packet is received, and the backup packet is deleted. And repeating the step S407 to the step S409, wherein the data packet sequence number of each packet sent by the computer is the data packet sequence number of the last successfully sent packet plus 1.
In the inquiry, initial or transmission phase, if the network connection between the computer and the target board is interrupted, the process returns to step S401 to start again, and the two parties handshake again until the transmission phase is entered again.
In the steps S407 to S409, the process of writing data into the target board by the computer is as follows: the computer sends a packet with a download command and/or data, and the target board card replies an empty packet as a response. The process of reading data from the target board card by the computer is as follows: the computer sends an empty packet to the target board card, the target board card sends the packet as a response, and data in the response packet can be empty or contain actual data content.
Referring to fig. 6, if the target board delays the packet reply time due to a long processing time for writing the firmware into the memory, or loses the packet due to a network problem, the retransmission processing process after the computer finds the packet loss includes the following steps.
Step S411: the computer sends the data packet to the target board card.
Step S412: and the computer does not receive the reply packet of the target board card when the computer is overtime for the first time. At this time, the target board may not receive the data packet sent by the computer, or the target board may receive the data packet sent by the computer but is busy processing other tasks (for example, writing the firmware into the memory) without timely processing.
Step S413: and the computer retransmits the last data packet to the target board card, and the sequence number of the data packet is unchanged.
Step S414: and the computer does not receive the reply packet of the target board card after the second timeout.
Step S415: and the computer retransmits the last data packet to the target board again, and the serial number of the data packet is unchanged.
Step S416: and the target board card receives the data packet sent by the computer, constructs a reply packet and sends the reply packet to the computer.
Step S417: and the computer receives the reply packet of the target board card and completes the operation of writing data once. The computer adds 1 to the data packet serial number of the next packet.
Referring to fig. 7, the data transmission system based on UDP and IPV6 protocols includes a setting unit 10, a first connection unit 20, a second connection unit 30, a handshake unit 40, and a transmission unit 50.
The setting unit 10 is used for embedding UDP and IPV6 protocols in the programming tool software of the computer and the downloading program of the target board of the embedded system, and setting UDP transparent transmission units between the UDP/IP protocol layers and the downloading protocol layers of the target board of the embedded system and the computer.
The first connection unit 20 is used for running programming tool software in the computer and connecting the computer to a target board card of the embedded system through a USB interface. The first connection unit 20 is executed by, for example, a programming tool software in a computer.
The second connection unit 30 is used for running a downloading program on a target board card of the embedded system to become a data link server. The second connection unit 30 is, for example, executed by a download program in a target board of the embedded system.
The handshake unit 40 is used to enable the computer to serve as a client of the data link, and connect with a target board card serving as a server of the data link through a handshake mechanism of the UDP transparent transmission unit. The transmission layer between the computer and the target board card adopts a UDP protocol, and the network layer adopts an IPV6 protocol.
The transmission unit 50 is configured to enable the computer to send a download command and/or data to the target board, and the target board responds to the computer, receives a firmware file transmitted by the computer according to the download command, and writes the firmware file into the nonvolatile memory of the embedded system.
The method and the device adopt UDP and IPV6 protocols to realize data transmission of the computer and the embedded system, are mainly used for programming firmware files, have the advantages of high transmission speed, provide retransmission function and guarantee sequential transmission by the added UDP transparent transmission unit, and improve the reliability of data transmission.
The above are merely preferred embodiments of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (12)

1. A data transmission method based on UDP and IPV6 protocol is characterized by comprising the following steps;
step S10: the UDP and IPV6 protocols are implanted into the programming tool software of the computer and the downloading program of the target board card of the embedded system; UDP transparent transmission units are arranged between a UDP/IP protocol layer and a download protocol layer of a target board card of a computer and an embedded system; the UDP transparent transmission unit is used for realizing the bidirectional transparent transmission of data between a UDP/IP protocol layer and a download protocol layer;
step S20: the computer runs the programming tool software and is connected to a target board card of the embedded system;
step S30: a target board card of the embedded system runs a downloading program to become a data link server;
step S40: the computer is used as a client of the data link and is connected with a target board card used as a server of the data link through a handshake mechanism of a UDP transparent transmission unit; a transmission layer between the computer and the target board card adopts a UDP protocol, and a network layer adopts an IPV6 protocol;
step S50: and the computer sends a downloading command and/or data to the target board card, the target board card responds to the computer, receives the firmware file transmitted by the computer according to the downloading command, and writes the firmware file into a nonvolatile memory of the embedded system.
2. The method for data transmission according to claim 1 and based on UDP and IPV6 protocols, wherein in step S20, the computer is connected to a USB hub via a USB interface, and the USB hub is further connected to USB interfaces of target boards of one or more embedded systems.
3. The data transmission method according to claim 2, wherein in step S30, when the target board is powered on after holding down a specific key, the target board enters a USB download mode to automatically run a download program.
4. The method for data transmission according to claim 1 and based on UDP and IPV6 protocols, wherein in step S50, the download command includes a request for the target board to receive the firmware file transmitted from the computer; the downloaded data comprises a firmware file which is stored in the computer and is suitable for the target board card.
5. The UDP and IPV6 protocol-based data transmission method according to claim 1, wherein the programming tool software provides a first download protocol layer, and the first download protocol layer actively pushes a download command and/or data to the target board card and blocks waiting for a reply response and a prompt message from the target board card; and the download command and/or data sent by the first download protocol layer are sent to the UDP/IP protocol layer through the UDP transparent transmission unit, then packed into an Ethernet packet and forwarded to the bottom hardware drive layer, and finally sent to the USB hub from the USB interface of the computer.
6. The data transmission method based on the UDP and IPV6 protocols as claimed in claim 5, wherein a download command and/or data sent by the computer is transmitted to the USB interface of the target board via the USB hub, sequentially passing through the bottom hardware driver layer, the UDP/IP protocol layer, the UDP transparent transmission unit, and the download program transmitted to the target board; the downloading program provides a second downloading protocol layer, the second downloading protocol layer passively receives the downloading command and/or data sent by the computer, immediately replies a response to the computer after receiving the downloading command and/or data, and executes a task corresponding to the downloading command.
7. The method for data transmission based on UDP and IPV6 protocols according to claim 5 or 6, wherein the first download protocol layer and the second download protocol layer both use fastboot protocol.
8. The method for data transmission based on UDP and IPV6 protocols according to claim 5 or 6, wherein the UDP/IP protocol layer at the computer end and the UDP/IP protocol layer at the target board card end both use lightweight codes and comprise four layers of architectures from top to bottom, namely an application layer, a transport layer, a network layer and a data link layer.
9. The data transmission method according to claim 1, wherein the UDP transparent transmission unit at the computer end and the UDP transparent transmission unit at the target card end are both implemented by adding a UDP transparent transmission field before the original data; the UDP pass-through field includes a packet identifier for indicating the type of the packet, a packet flag for indicating whether there is a continuation, and a packet sequence number.
10. The method for data transmission based on UDP and IPV6 protocols as claimed in claim 1, wherein the handshake mechanism of the UDP pass-through unit at the computer end and the UDP pass-through unit at the target card end in the step S40 comprises the steps of;
step S401: an inquiry phase; the computer sends out an empty packet;
step S402: an inquiry phase; after the target board card receives the empty packet sent by the computer, a reply packet is established and sent to the computer; the initial value of the sequence number of the local data packet of the target board card is contained;
step S403: an inquiry phase; after receiving a reply packet of a target board card, the computer locally records an initial value of a sequence number of a data packet;
step S404: an initial stage; the computer sends out a packet with data, and the carried data at least comprises a downloading protocol number of the computer and the maximum load byte number of the data packet which can be supported by the computer;
step S405: an initial stage; the target board card receives a packet with data sent by the computer, constructs a reply packet and sends the reply packet to the computer; the method comprises the steps of obtaining a target board card, wherein the target board card comprises a download protocol number of the target board card and the maximum load byte number of a data packet which can be supported by the target board card;
step S406: an initial stage; after receiving the reply packet of the target board card, the computer compares whether the download protocol numbers are matched or not; if not, the downloading is not carried out; if the number of the maximum load bytes of the data packet of the computer is matched with the number of the maximum load bytes of the data packet supported by the target board card, and adding 1 to the sequence number of the data packet stored locally;
step S407: a transmission stage; a computer issues a packet with download commands and/or data; the computer firstly backs up the packet locally, then sends the packet, adds 1 to the sequence number of the data packet stored locally after sending the packet;
step S408: a transmission stage; after receiving a packet of a download command and/or data sent by a computer, a target board card builds a reply packet and sends the reply packet to the computer, wherein the value of the sequence number of the data packet is the value obtained by adding 1 to the sequence number of the data packet sent by the computer;
step S409: a transmission stage; the computer receives the reply packet of the target board card and compares the serial numbers of the data packets; if the sequence number of the data packet in the reply packet is equal to the sequence number of the data packet stored locally minus 1, retransmitting the backup packet; if the data packet sequence number in the reply packet is equal to the locally stored data packet sequence number, deleting the backup packet; and repeating the step S407 to the step S409, wherein the data packet sequence number of each packet sent by the computer is the data packet sequence number of the last successfully sent packet plus 1.
11. The data transmission method based on UDP and IPV6 protocols as claimed in claim 10, wherein the retransmission process after the computer finds a packet loss includes the following steps;
step S411: the computer sends a data packet to a target board card;
step S412: the computer does not receive the reply packet of the target board card when overtime for the first time;
step S413: the computer retransmits the last data packet to the target board card, and the serial number of the data packet is unchanged;
step S414: the computer does not receive the reply packet of the target board card after the second overtime;
step S415: the computer retransmits the last data packet to the target board card again, and the serial number of the data packet is unchanged;
step S416: the target board card receives the data packet sent by the computer, constructs a reply packet and sends the reply packet to the computer;
step S417: the computer receives the reply packet of the target board card and completes the operation of writing data once; the computer adds 1 to the data packet serial number of the next packet.
12. A data transmission system based on UDP and IPV6 protocol is characterized by comprising a setting unit, a first connecting unit, a second connecting unit, a handshake unit and a transmission unit;
the setting unit is used for implanting UDP and IPV6 protocols in programming tool software of the computer and a downloading program of a target board card of the embedded system, and setting UDP transparent transmission units between the UDP/IP protocol layers and downloading protocol layers of the computer and the target board card of the embedded system; the UDP transparent transmission unit is used for realizing the bidirectional transparent transmission of data between a UDP/IP protocol layer and a download protocol layer;
the first connecting unit is used for running programming tool software in a computer and connecting the computer to a target board card of the embedded system through a USB interface;
the second connection unit is used for running a downloading program on a target board card of the embedded system to enable the target board card to become a data link server;
the handshake unit is used for enabling a computer to serve as a client of a data link and connecting a target board card serving as a server of the data link through a handshake mechanism of the UDP transparent transmission unit; a transmission layer between the computer and the target board card adopts a UDP protocol, and a network layer adopts an IPV6 protocol;
the transmission unit is used for enabling the computer to send a downloading command and/or data to the target board card, the target board card responds to the computer, receives the firmware file transmitted by the computer according to the downloading command, and writes the firmware file into the nonvolatile memory of the embedded system.
CN202010576633.2A 2020-06-23 2020-06-23 Data transmission method and system based on UDP (user Datagram protocol) and IPV6 (Internet protocol video protocol) Active CN111800488B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010576633.2A CN111800488B (en) 2020-06-23 2020-06-23 Data transmission method and system based on UDP (user Datagram protocol) and IPV6 (Internet protocol video protocol)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010576633.2A CN111800488B (en) 2020-06-23 2020-06-23 Data transmission method and system based on UDP (user Datagram protocol) and IPV6 (Internet protocol video protocol)

Publications (2)

Publication Number Publication Date
CN111800488A true CN111800488A (en) 2020-10-20
CN111800488B CN111800488B (en) 2023-01-24

Family

ID=72804589

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010576633.2A Active CN111800488B (en) 2020-06-23 2020-06-23 Data transmission method and system based on UDP (user Datagram protocol) and IPV6 (Internet protocol video protocol)

Country Status (1)

Country Link
CN (1) CN111800488B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112291243A (en) * 2020-10-29 2021-01-29 苏州浪潮智能科技有限公司 Method, system medium and equipment for transparently transmitting data packet in routing mode
CN115022252A (en) * 2022-05-31 2022-09-06 青岛海信移动通信技术股份有限公司 Method and equipment for configuring maximum length of transmission data packet

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101674303A (en) * 2009-07-31 2010-03-17 厦门敏讯信息技术股份有限公司 Embedded network product programming equipment and method thereof
CN101715113A (en) * 2009-07-27 2010-05-26 北京正唐科技有限责任公司 Two-way radio embedded gateway based on ground digital television channels
CN107147655A (en) * 2017-05-25 2017-09-08 北京中电普华信息技术有限公司 A kind of network dual stack parallel process model and its processing method
CN108958781A (en) * 2018-07-05 2018-12-07 嘉兴天控信息科技有限公司 A kind of remote embedded firmware on line upgrading method
CN109828769A (en) * 2018-12-24 2019-05-31 同济大学 A kind of embedded program remote update system and method based on TCP/IP

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101715113A (en) * 2009-07-27 2010-05-26 北京正唐科技有限责任公司 Two-way radio embedded gateway based on ground digital television channels
CN101674303A (en) * 2009-07-31 2010-03-17 厦门敏讯信息技术股份有限公司 Embedded network product programming equipment and method thereof
CN107147655A (en) * 2017-05-25 2017-09-08 北京中电普华信息技术有限公司 A kind of network dual stack parallel process model and its processing method
CN108958781A (en) * 2018-07-05 2018-12-07 嘉兴天控信息科技有限公司 A kind of remote embedded firmware on line upgrading method
CN109828769A (en) * 2018-12-24 2019-05-31 同济大学 A kind of embedded program remote update system and method based on TCP/IP

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112291243A (en) * 2020-10-29 2021-01-29 苏州浪潮智能科技有限公司 Method, system medium and equipment for transparently transmitting data packet in routing mode
CN112291243B (en) * 2020-10-29 2022-07-12 苏州浪潮智能科技有限公司 Method, system medium and equipment for transparent transmission of data packet in routing mode
CN115022252A (en) * 2022-05-31 2022-09-06 青岛海信移动通信技术股份有限公司 Method and equipment for configuring maximum length of transmission data packet
CN115022252B (en) * 2022-05-31 2024-04-09 青岛海信移动通信技术有限公司 Method and equipment for configuring maximum length of transmission data packet

Also Published As

Publication number Publication date
CN111800488B (en) 2023-01-24

Similar Documents

Publication Publication Date Title
KR101627097B1 (en) Inter-processor protocol in a multi-processor system
US5577210A (en) Remote booting of an operating system by a network
EP1719276B1 (en) Encoding a tcp offload engine within fcp
US7580406B2 (en) Remote direct memory access segment generation by a network controller
CN111800488B (en) Data transmission method and system based on UDP (user Datagram protocol) and IPV6 (Internet protocol video protocol)
CN111897585B (en) Linux-based multi-hardware adaptation method
US20030028731A1 (en) Block data storage within a computer network
US7523378B2 (en) Techniques to determine integrity of information
US6701373B1 (en) Data transmission apparatus
US20130205288A1 (en) Parallel Programming and Updating of Lighting Bus Subscribers
CN101409727B (en) Document transmission method and apparatus
JP4204891B2 (en) Data upgrade method for switching device in layer-2 network environment
CN109688208B (en) Data loading method based on FC-AE-ASM message
CN111198704A (en) FPGA remote upgrading system based on TCP protocol
CN114416135A (en) Internet of things cloud platform remote terminal upgrading system and method
CN105407003B (en) A kind of data of 1553 bus add discharging method
EP3826244B1 (en) Congestion control method and related device
CN111475445A (en) Method and system for converting USB or UART data and Ethernet data
CN115883360A (en) Remote upgrading method based on multi-layer grading of Internet of things
US11726666B2 (en) Network adapter with efficient storage-protocol emulation
CN115604070A (en) Message transmission method, device, equipment and medium based on MCTP (Multi-function peripheral protocol)
US20120072520A1 (en) System and Method for Establishing Reliable Communication in a Connection-Less Environment
EP2726992B1 (en) Network control model driver
TWI779858B (en) System and method for upgrading firmware
US20060067241A1 (en) Reliable file transfers using protocol scripting

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant