Serial port file transmission system and method, storage medium and equipment

By introducing metadata packets and end verification data packets in serial communication, recording the tag sequence number of sub-data packets and requesting retransmission, the bandwidth occupation problem caused by frequent ACK signal confirmation is solved, and the transmission speed and reliability are improved.

CN118869684AInactive Publication Date: 2024-10-29ZHEJIANG LAB

Patent Information

Application Number
CN202411363286.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2024-10-29
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Frequent ACK signal confirmations in existing serial communication occupy a large amount of bandwidth, resulting in high time costs and low transmission efficiency.

Method used

By introducing metadata packets and end verification packets between the source and destination, record the tag sequence numbers of erroneous or missing sub-data packets, and request retransmission after receiving the prompt packet to avoid each sub-data packet. The confirmation response signal is transmitted using full-duplex communication to improve transmission efficiency.

Benefits of technology

It reduces the bandwidth usage, increases the transmission speed, improves the reliability of serial port transmission and the success rate of file transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118869684A_ABST
    Figure CN118869684A_ABST
Patent Text Reader

Abstract

In the serial port file transmission system and method, the storage medium and the equipment provided by the specification, a source end sends a prompt data packet to a destination end to inform the destination end that the data packet is sent completely, and when the destination end receives the prompt data packet, a recorded mark serial number of an error or missing sub-data packet is used as a missing serial number; according to the embodiment of the invention, the metadata packet initially sent by the source end is used for enabling the destination end to know the basic information of the file to be transmitted, determining the feedback data packet and sending the feedback data packet to the source end to request retransmission, namely, the situation that each sub-data packet confirms the transmission of the response signal is avoided, so that the bandwidth occupation is reduced, and the transmission speed is improved; the metadata packet initially sent by the source end is used for enabling the destination end to know the basic information of the file to be transmitted; the verification ending data packet sent when the source end is ended is used for carrying out file verification on the sub-data packet, and the metadata packet and the verification ending data packet can ensure the reliability of serial port file transmission.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of serial communication, and in particular to a serial file transmission system, method, storage medium and device. Background Art

[0002] Serial transmission has been widely used in various industries such as industrial control, consumer electronics and even aerospace products due to its simple design, easy implementation and low cost. Equipment in these fields often requires highly reliable communication to avoid data loss or damage. Therefore, it is very important to ensure the reliability of data transmission in serial transmission.

[0003] At present, the Acknowledgment (ACK) feedback mechanism is generally used to ensure that the data packet is successfully transmitted to the destination. That is, after the source sends the data packet to the destination, it needs to wait for the destination to correctly receive the ACK signal sent by the data packet before continuing to send the next data packet to ensure that all data packets are correctly received. However, this serial port transmission method with an ACK feedback mechanism requires frequent ACK signal confirmation, which occupies a large amount of bandwidth, resulting in high time cost and low transmission efficiency.

[0004] Based on this, this specification provides a serial port file transmission system, method, storage medium and device. Summary of the invention

[0005] This specification provides a serial port file transmission system, method, storage medium and device to partially solve the above problems existing in the prior art.

[0006] This manual adopts the following technical solutions: This specification provides a serial port file transmission system, the system includes a source end and a destination end, the system includes: The source end is used to divide the file to be transmitted into packets to obtain a metadata packet and a sub-packet, and determine the mark sequence number of the sub-packet; send the metadata packet to the destination end; receive a first response signal sent by the destination end, and send the sub-packets to the destination end in sequence according to the mark sequence number; when all sub-packets are sent, send a prompt packet to the destination end; receive a feedback packet sent by the destination end, and resend the sub-packets corresponding to the missing sequence number in the feedback packet to the destination end in sequence, and send an end check packet to the destination end; in response to the received second response signal, determine that the transmission of the file to be transmitted is completed; The destination end is used to receive the metadata data packet, verify the metadata data packet, and determine a first response signal to return to the source end after the verification is successful; receive the sub-data packets in sequence, and verify the accuracy of the sub-data packets, and perform integrity verification on the sub-data packets according to the metadata data packet, and determine the mark number of the abnormal sub-data packet as the missing sequence number based on the accuracy verification and the integrity verification; determine the feedback data packet according to the missing sequence number in response to the received prompt data packet, and send the feedback data packet to the source end; receive the sub-data packets corresponding to the missing sequence number sent by the source end in sequence, and perform file verification on each received sub-data packet according to the end verification data packet sent by the source end; determine the second response signal according to the result of the file verification; and return the second response signal to the source end.

[0007] Optionally, the source end is further configured to, when the feedback data packet is not empty, resend the sub-data packets corresponding to the missing sequence numbers in the feedback data packet to the destination end in sequence, and after resending, send the prompt data packet to the destination end; when the feedback data packet is empty, send an end verification data packet; The destination end is further used to update the feedback data packet after sequentially receiving the sub-data packets corresponding to the missing sequence numbers resent by the source end, and send the updated feedback data packet to the source end until the end verification data packet is received.

[0008] Optionally, the destination end is further configured to determine that a third response signal is returned to the source end when verification of the metadata packet fails; The source end is further configured to resend the metadata packet when the time for waiting for the first response signal exceeds a preset first duration, or when the third response signal is received within the preset first duration.

[0009] Optionally, the source end is further used to resend the prompt data packet when the waiting time for the feedback data packet exceeds a preset second time length; and to resend the end verification data packet when the waiting time for the second response signal exceeds a preset third time length.

[0010] Optionally, the communication mode between the source end and the destination end is full-duplex; The source end is further configured to send the sub-data packet while waiting for the destination end to return a first response signal of the metadata packet; and insert the metadata packet into the sending sequence of the sub-data packet upon receiving a third response signal sent by the destination end; The destination end is also used to determine whether the type of the data packet initially received is a sub-data packet; if so, determine that a third response signal is returned to the source end; if not, when the metadata packet verification fails, determine that a third response signal is returned to the source end.

[0011] Optionally, the destination end is further used to receive the sub-data packets in sequence when the communication mode with the source end is full-duplex, and determine the mark number of the missing sub-data packet as the missing sequence number according to the consistency of the mark number of the received sub-data packet; determine to return a negative response signal of the sub-data packet corresponding to the missing sequence number to the source end, and continuously listen to the source end returning the sub-data packet corresponding to the missing sequence number; when the continuous listening time exceeds a preset fourth time length, resend the negative response signal of the sub-data packet corresponding to the missing sequence number; The source end is further configured to, upon receiving a negative response signal of the sub-data packet corresponding to the missing sequence number, insert the sub-data packet with the missing sequence number into the sending sequence of the sub-data packet.

[0012] This specification provides a serial port file transmission method, which is applied to a source end in the system, and includes: Divide the file to be transmitted into packets to obtain a metadata packet and a sub-packet, and determine the marking serial number of the sub-packet; Sending the metadata packet to a destination; receiving a first response signal sent by the destination end, and sending the sub-data packets to the destination end in sequence according to the marked sequence numbers; When all sub-data packets have been sent, a prompt data packet is sent to the destination end; Receive a feedback data packet sent by the destination end, and resend the sub-data packets corresponding to the missing sequence numbers in the feedback data packet to the destination end in sequence, and send an end verification data packet to the destination end; In response to the received second response signal, it is determined that the transmission of the file to be transmitted is complete.

[0013] This specification provides a serial port file transmission method, which is applied to the destination end of the system, and the method includes: Responding to a metadata packet sent by a source end, verifying the metadata packet, and determining to return a first response signal to the source end after the verification succeeds; receiving the sub-data packets sent by the source end in sequence, performing accuracy checks on the sub-data packets, and performing integrity checks on the sub-data packets according to the metadata packet, and determining the marking sequence number of the abnormal sub-data packet as the missing sequence number based on the accuracy check and the integrity check; In response to the received prompt data packet, determining the feedback data packet according to the missing sequence number, and sending the feedback data packet to the source end; receiving the sub-data packets corresponding to the missing sequence numbers sent by the source end in sequence, and performing file verification on each received sub-data packet according to the end verification data packet sent by the source end; and determining the second response signal according to the result of the file verification; The second response signal is returned to the source end.

[0014] This specification provides a computer-readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, a serial port file transmission method is implemented.

[0015] The present specification provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements a serial port file transmission method when executing the program.

[0016] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects: In a serial port file transmission system provided in this specification, the source end obtains a metadata packet and a sub-data packet by packetizing the file to be transmitted, and determines the tag sequence number of the sub-data packet, and then sends the metadata packet to the destination end. The destination end receives the metadata packet, verifies the metadata packet, and after the verification is successful, determines a first response signal to return to the source end. The source end receives the first response signal, and sends the sub-data packets to the destination end in sequence according to the tag sequence number, and sends a prompt data packet to the destination end after each sub-data packet is sent. The destination end receives the sub-data packets in sequence, verifies the accuracy of the sub-data packets, and verifies the integrity of the sub-data packets according to the metadata packet, determines the tag sequence number of the abnormal sub-data packet as the missing sequence number, and responds to the received prompt data packet, determines the feedback data packet according to the missing sequence number and returns it to the source end. The source end receives the feedback data packet, and resends the sub-data packets corresponding to the missing sequence number in the feedback data packet to the destination end in sequence, and sends an end verification data packet to the destination end. The destination end sequentially receives the sub-data packets corresponding to the missing sequence numbers sent by the source end, and performs file verification on the received sub-data packets according to the end verification data packet sent by the source end, and determines the second response signal to be returned to the source end according to the result of the file verification, and the receiving process of the file to be transmitted ends. The source end receives the second response signal, and the sending process of the file to be transmitted ends, that is, the transmission of the file to be transmitted is completed.

[0017] It can be seen from the above method that by recording the mark number of the erroneous or missing sub-packet as the missing number, and after receiving the prompt data packet sent by the source end, sending a feedback data packet to request the source end to retransmit, the transmission of the confirmation response signal of each sub-packet is avoided, thereby reducing the bandwidth occupancy and improving the transmission speed. The metadata packet is used to inform the destination end of the basic information of the file to be transmitted and the end verification data packet is used to perform file verification on the sub-packet. The introduction of the metadata packet and the end verification data can improve the reliability of serial port transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The illustrative embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation on this specification. In the drawings: Figure 1 A flowchart of a serial port file transmission system provided in this specification; Figure 2 This is a schematic diagram of the process of the source end sending the file to be transmitted provided in this manual; Figure 3 A schematic diagram of the process of receiving a file to be transmitted by a destination end provided in this specification; Figure 4 A schematic diagram of the process of the source end sending a file to be transmitted in full-duplex communication mode provided in this manual; Figure 5 A schematic diagram of the process of receiving a file to be transmitted at the destination end in full-duplex communication mode provided in this manual; Figure 6 A flowchart of a serial port file transmission method provided in this manual; Figure 7 A flowchart of a serial port file transmission method provided in this manual; Figure 8 A schematic diagram of a serial port file transmission device provided in this manual; Fig. 9 A schematic diagram of a serial port file transmission device provided in this manual; Fig.10 This is a schematic diagram of the structure of an electronic device corresponding to a serial port file transmission method provided in this specification. DETAILED DESCRIPTION

[0019] In order to make the purpose, technical solutions and advantages of this specification more clear, the technical solutions of this specification will be clearly and completely described below in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.

[0020] In this specification, a process of a serial port file transfer system is executed, and the system consists of a source end and a destination end. Both the source end and the destination end involve data analysis and processing. Therefore, in the embodiments of this specification, the data analysis and processing of the source end and the destination end can be performed by the server, such as the file server performs the packetization of the file to be transferred, the sending of sub-data packets, the sending of metadata packets, the sending of end verification packets, the receiving of feedback packets, etc., and the receiving server performs the receiving of sub-data packets, the receiving of sub-data packets, the receiving of metadata packets, the receiving of end verification packets, the sending of feedback packets, etc. Of course, this specification does not limit which device performs the file transfer process of the file to be transferred. The source end and the destination end can be any device with corresponding computing power and communication functions, and the software programs running in the source end and the destination end have the function of implementing the serial port file transfer protocol, such as personal computers and embedded systems.

[0021] The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.

[0022] Figure 1The present invention is a flowchart of a serial port file transmission system provided in the present specification, the system includes a source end and a destination end, wherein the source end is used to packetize the file to be transmitted, obtain a metadata packet and a sub-data packet, determine the tag sequence number of the sub-data packet, and then send the metadata packet to the destination end; after the destination end receives the metadata packet, it verifies the metadata packet, and determines a first response signal to return to the source end after the verification is successful; when the source end receives the first response signal, it sends the sub-data packets to the destination end in sequence according to the tag sequence number, and after all the sub-data packets are sent, it sends a prompt data packet to the destination end; the destination end receives the sub-data packets in sequence, verifies the accuracy of the sub-data packets, and verifies the integrity of the sub-data packets according to the metadata packet, and determines the errors or missing The marking sequence number of the sub-packet is used as the missing sequence number; the destination end determines the feedback data packet according to the missing sequence number in response to the prompt data packet sent by the source end, and sends the feedback data packet to the source end; when the source end receives the feedback data packet, the sub-packet corresponding to the missing sequence number in the feedback data packet is resent to the destination end, and an end verification data packet is sent to the destination end; the destination end sequentially receives the sub-packets corresponding to the missing sequence number resent by the source end, and performs file verification on the received sub-packets according to the received end verification data packet, and determines a second response signal according to the result of the file verification, and returns the second response signal to the source end, and the receiving process of the file to be transmitted ends; when the source end receives the second response signal, the sending process of the file to be transmitted ends.

[0023] In one or more embodiments of the present specification, in order to ensure the reliability of serial port file transmission while improving the transmission speed. To this end, a prompt data packet is sent from the source end to the destination end. After receiving the prompt data packet, the destination end determines a feedback data packet based on the missing sequence number to request the source end to retransmit the sub-data packet corresponding to the missing sequence number, thereby avoiding the transmission of a confirmation response signal for each sub-data packet, thereby reducing bandwidth occupancy and improving the transmission speed. At the same time, the metadata data packet is used to perform integrity verification on the sub-data packet, and the end verification data packet is used to perform file verification on the sub-data packet. The introduction of the metadata data packet and the end verification data packet can ensure that the file to be transmitted is accurately received by the destination end, thereby improving the reliability of serial port file transmission.

[0024] In one or more embodiments of the present specification, in serial port file transmission, the amount of data is usually limited, so the file is usually divided into small data packets for transmission to ensure the reliability of data transmission. Therefore, in order to ensure the reliability of the source and the destination in the subsequent steps, the source can perform a packet initialization process before sending the file to be transmitted, that is, the initialization process of sending the file to be transmitted is to packetize the file to be transmitted, obtain a metadata packet and a sub-data packet, and determine the tag sequence number of the sub-data packet.

[0025] Specifically, the source end is used to divide the file to be transmitted into packets, obtain sub-packets, and determine the tag numbers of the metadata packet and the sub-packets. The metadata packet is used to inform the destination end of the relevant information of the file to be transmitted that is about to be received. The sub-packet includes the tag number and part of the data of the file to be transmitted. The tag number represents the order in which the source end sends the sub-packets. Packetization may result in the last sub-packet containing part of the data of the file to be transmitted being smaller than that of other sub-packets.

[0026] It should be noted that the common data packet structure consists of a fixed header, a data field, and a tail check. The header contains control information, such as the protocol version number, data packet type, source end identifier, destination end identifier, data field length, etc. The protocol version number is used to ensure that the source and destination use the same version of the protocol for communication to avoid version incompatibility issues; the data packet type is used to identify the category of the data packet, such as file control class and file data class; the source end identifier is used to identify the sender of the data packet; the destination end identifier is used to identify the receiver of the data packet; the data field length is used to assist the destination end to correctly parse the boundaries of the data field and correctly process each sub-data packet; the data field contains the transmitted file data; the tail check is the check field contained in the end field of the data packet, which is used by the destination end receiving the data packet to verify whether an error occurred in the data packet during transmission.

[0027] In this specification, the specific content of the information related to the file to be transmitted included in the metadata data package is not limited. For example, the metadata data package data field may include information such as file command words, file size of the file to be transmitted, subpacket size, number of subpackets, string length of the file name, and file name string. The file size is used to inform the destination end of the total volume of the file to be transmitted, so that the destination end can pre-allocate storage space; the subpacket size is used to inform the destination end of the data volume of a single subpacket; the number of subpackets is used to inform the destination end of the total number of subpackets; the string length of the file name and the file name string are used to inform the destination end of the name and length when storing. The data packet type is used to identify the category of the data packet, such as the file control class and the file data class. Since the file control class includes other data packets in subsequent steps in addition to the metadata packet, the file command word is also required to be set in this specification to distinguish data packets of different file control classes, and the file data class only includes subpackets, so the subpacket data field does not need to include the file command word, that is, the subpacket data field may include the identification number and part of the data of the file to be transmitted, that is, all data packets can be distinguished by combining the data packet type and the file command word, so that the source and destination ends can identify the category of the data packet.

[0028] In one or more embodiments of the present specification, the source end may send a metadata package to the destination end after the initialization process of the file subpacket to be transmitted is completed. The destination end receives the metadata package, verifies the metadata package, and determines a first response signal to return to the source end after the verification is successful.

[0029] Specifically, the source end sends the metadata packet to the destination end. After receiving the metadata packet, the destination end verifies the metadata packet, and after the verification is successful, determines that a first response signal is returned to the source end. The first response signal is an acknowledgment (ACK) signal of the metadata packet, which is used to inform that the data has been successfully received.

[0030] In one or more embodiments of the present specification, the source end receives a first response signal sent by the destination end, and sends each sub-data packet to the destination end in sequence according to the tag sequence number.

[0031] Specifically, the source end receives the first response signal, and sends sub-data packets to the destination end in sequence according to the tag sequence numbers.

[0032] It should be noted that, in serial port file transmission, instantaneous interference in the link may cause the destination end to fail to receive the metadata packet, or the metadata packet may fail during the transmission process. Therefore, there is no need to terminate the transmission of the file to be transmitted after an error, and the success rate of file transmission can be improved by setting a retransmission mechanism. In one or more embodiments of the present specification, the destination end is also used to determine that a third response signal is returned to the source end after the verification of the metadata packet fails; the source end is also used to resend the metadata packet to the destination end when the time waiting for receiving the first response signal exceeds the preset first duration, or when the third response signal is received within the preset first duration, wherein the third response signal is a negative response (Negative Acknowledgment, NAK) signal of the metadata packet, which is used to inform that an error occurs in the transmission of the metadata packet. The value of the preset first duration is not limited in the present specification, and can be set according to actual needs.

[0033] In one or more embodiments of the present specification, the source end may send a prompt data packet to the destination end after all sub-data packets have been sent. The destination end sequentially receives each sub-data packet sent by the source end, and performs accuracy check on each sub-data packet respectively, and performs integrity check on each sub-data packet according to the metadata packet, determines the marking sequence number of the abnormal sub-data packet as the missing sequence number, and then determines the feedback data packet according to the missing sequence number when receiving the prompt data packet sent by the source end.

[0034] Specifically, the source end may send a prompt data packet to the destination end after each sub-data packet is sent. The destination end sequentially receives each sub-data packet sent by the source end, and performs accuracy check on each sub-data packet, and performs integrity check on the sub-data packet according to the metadata packet, determines the marking sequence number of the abnormal sub-data packet as the missing sequence number, and then determines the feedback data packet according to the missing sequence number when receiving the prompt data packet sent by the source end, wherein, if the accuracy check of each sub-data packet received by the destination end is successful before receiving the prompt data packet, and there is no missing sub-data packet, that is, there is no abnormal situation of "error or missing" of the sub-data packet, then the feedback data packet determined by the destination end is empty.

[0035] It should be noted that the source and the destination send each sub-data packet in the order of the marking sequence number. Therefore, when the destination receives each sub-data packet in sequence and finds that the marking sequence numbers between the received sub-data packets are incoherent, it means that there is an abnormal situation in which the sub-data packet is missing, and the metadata packet can provide the destination with relevant information of the file to be transmitted, such as the file size, the number of sub-packets, etc. Therefore, the integrity of the received sub-data packet can be checked based on the metadata packet. At the same time, a checksum, i.e., a tail check, is usually calculated before the data packet is sent. After receiving the data packet, the destination will calculate the checksum of the data packet in the same way and compare it with the tail check provided by the source. If the two are inconsistent, this indicates that the data in the data packet has changed during transmission, i.e., the accuracy check of the sub-data packet has failed. Of course, this specification does not limit the specific method of calculating the checksum, such as cyclic redundancy check, hash checksum, etc. In this specification, the prompt data packet is only used to inform that the sending of each sub-data packet is completed. Therefore, only the file command word is included in the data field of the prompt data packet to facilitate the destination to identify the prompt data packet. The feedback data packet is a NAK data packet, and the data field of the feedback data packet includes a file command word, a retransmission sequence encoding method, and a retransmission sequence encoding. The retransmission sequence encoding method is not limited in this specification and can be set according to actual needs. For example, if the number of missing or erroneous sub-data packets is small, the retransmission sequence encoding is composed of a marker sequence number, and each marker sequence number occupies a fixed byte. If the number of missing or erroneous sub-data packets is large, the retransmission sequence encoding can be determined by a bitmap method, as follows: Assume that there are 10 subpackets in total, of which 3, 5, 7, 8, and 9 are received incorrectly. If the retransmission sequence is composed of the tag sequence number, it is coded as 00030005000700080009H. If the bitmap method is used, bit 0 indicates correct reception, and bit 1 indicates erroneous reception 0010101110. Since it is less than 16 bits (2 bytes), after padding, the retransmission sequence is coded as 0010101110000000b, that is, 2B80H. The bitmap method can significantly reduce the amount of data that needs to be transmitted. Therefore, in the case of a large number of missing or erroneous sub-packets, this retransmission sequence coding method can be selected to improve transmission efficiency and save bandwidth. Of course, the specific content of how to select the retransmission sequence coding method is not limited in this manual, and can be set according to actual needs.

[0036] In one or more embodiments of the present specification, the destination end may send a determined feedback data packet to the source end. The source end receives the feedback data packet, and resends the sub-data packets corresponding to the missing sequence numbers in the feedback data packet to the destination end in sequence, and sends an end check data packet to the destination end.

[0037] Specifically, the destination end may send a determined feedback data packet to the source end. After the source end receives the feedback data packet, if the feedback data packet is not empty, the sub-data packet corresponding to the missing sequence number in the feedback data packet is resent to the destination end, and the end verification data packet is sent to the destination end. If the feedback data packet is empty, the end verification data packet is sent to the destination end.

[0038] It should be noted that, in serial port file transmission, instantaneous interference in the link may cause the destination end to fail to receive the prompt data packet, or the prompt data packet may fail during the transmission process. Therefore, there is no need to terminate the transmission of the file to be transmitted after an error. A retransmission mechanism can be set to improve the success rate of file transmission, that is, when the source end does not receive the feedback data packet within a certain period of time, the prompt data packet is resent. In one or more embodiments of the present specification, the source end is also used to resend the prompt data packet when the waiting time for the feedback data packet exceeds a preset second time length until the feedback data packet is received. The value of the preset second time length is not limited in the present specification and can be set according to actual needs.

[0039] It should be noted that, since a retransmission may also result in missing or erroneous sub-packets, in order to further ensure that each sub-packet is received by the destination, in one or more embodiments of the present specification, the source is also used to receive a feedback packet. If the feedback packet is not empty, the sub-packet corresponding to the missing sequence number in the feedback packet is resent to the destination, and after the retransmission of the sub-packet is completed, a prompt packet is sent to the destination; if the feedback packet is empty, an end check packet is sent to the destination; after receiving the prompt packet, the destination can update the feedback packet and resend the updated feedback packet to the source until the end check packet sent by the source is received. That is to say, the prompt packet is used to inform the destination that the sub-packet has been sent. In the half-duplex communication mode, the destination can be prompted to perform integrity check and accuracy check on the sub-packet, so as to determine the updated feedback packet. Of course, iterative integrity check means "the current updated feedback packet is based on the feedback packet sent last time, and determines whether the sub-packet with the missing sequence number is resent accurately. If so, the updated feedback packet is empty. If not, the updated feedback packet is determined according to the missing sequence number that has not been resent".

[0040] In one or more embodiments of the present specification, the destination end needs to sequentially receive the sub-packets corresponding to the missing sequence numbers sent by the source end, and perform file verification on the received sub-packets based on the end verification packet sent by the source end, and determine a second response signal based on the result of the file verification, and return the second response signal to the source end, thereby completing the reception process of the file to be transmitted.

[0041] Specifically, the destination end sequentially receives the sub-data packets corresponding to the missing sequence numbers resent by the source end, and receives the end verification data packet. After the destination end receives the end verification data packet sent by the source end, each sub-data packet can be reassembled according to the marked sequence number to obtain the target file, and the target file is verified according to the end verification data packet. Based on the result of the file verification, a second acknowledgment signal is determined, and the second acknowledgment signal is returned to the source end, and the receiving process of the file to be transmitted ends. Among them, the end verification data packet (End of File Acknowledgment, EOF ACK) is used to perform file verification on the sub-data packet, and the data field of the end verification data packet may include a file command word, a file verification and a file size. The file size is used to check whether the size of the target file is correct. If the size of the target file is inconsistent with the file size, it indicates that there is a problem with the integrity of the target file. The file verification includes a file verification value and the number of bits of the file verification value. The file verification value is a verification value of the file to be transmitted provided by the source end, which is used to verify whether the target file is consistent with the file to be transmitted. For example, if the file checksum is a 32-bit value, then when performing file checksum, the data of the target file needs to be calculated according to 32 bits. If it is less than 32 bits, it is aligned after the low-order 0 is added before participating in the calculation. When calculating, it is necessary to ensure that the byte order of the data is correct, and the high-order byte is in front and the low-order byte is in the back in big-endian mode. The calculation method of file checksum is not limited in this manual and can be set according to actual needs, such as accumulating and summing each 32-bit data block and then negating it.

[0042] It should be noted that in this specification, there are two types of ACK, namely, the ACK signal of the metadata data packet and the second ACK signal, which belong to the same data packet category. Therefore, in addition to the file command word, an instruction code can be added to the data field of the second ACK signal and the ACK signal of the metadata data packet, and the two ACKs are distinguished by different instruction codes. Among them, based on the result of the file verification, the second ACK signal is determined, and the second ACK signal must also include a conditional information field for identifying the result of the file verification in the destination. For example, 0000b means no error, that is, the result of the file verification is a successful verification; 0100b means file storage rejection, that is, the destination may have insufficient storage space, file system permissions or other storage-related errors; 0101b means that the result of the file verification is a verification failure, that is, the file has been successfully received by the destination, but the verification failed.

[0043] In one or more embodiments of the present specification, when the source end receives the second response signal sent by the destination end, the sending process of the file to be transmitted ends.

[0044] Specifically, when the source end receives the second response signal, the sending process of the file to be transmitted ends.

[0045] It should be noted that, in the serial port file transmission, the instantaneous interference in the link may cause the destination end to fail to receive the end verification data packet, or the end verification data packet may fail during the transmission process. Therefore, there is no need to terminate the transmission of the file to be transmitted after an error. A retransmission mechanism can be set to improve the success rate of the file transmission, that is, when the source end does not receive the second response signal within a certain period of time, the end verification data packet is resent. In one or more embodiments of the present specification, the source end is also used to resend the end verification data packet when the waiting time for the missing sequence number exceeds a preset third time length. The value of the preset third time length is not limited in the present specification and can be set according to actual needs.

[0046] In the above system, the system records the mark number of the erroneous or missing sub-packet as the missing number, and after receiving the prompt data packet sent by the source end, sends a feedback data packet to request the source end to retransmit, thereby avoiding the transmission of the confirmation response signal of each sub-packet, reducing the bandwidth occupancy, and improving the transmission speed. The metadata packet is used to enable the destination end to understand the basic information of the file to be transmitted, ensuring the correctness of the data processed by the destination end, and the end verification data packet is used to perform file verification on the sub-packet, thereby improving the reliability of serial port transmission. In addition, the introduction of the retransmission mechanism can improve the success rate of the transmission of the file to be transmitted.

[0047] It should be noted that in the serial communication of the above system, data packets need to be transmitted in two directions. Therefore, the above system can be applied to full-duplex or half-duplex communication. Although RS-422 in the serial interface standard supports full-duplex communication, if it is a multi-device bus structure (one source and multiple destinations), in order to ensure the accuracy of data transmission and avoid transmission conflicts, half-duplex communication is generally used.

[0048] like Figure 2 As shown in FIG. 1 , it is a schematic diagram of the process of the source end sending the file to be transmitted provided in this manual. Figure 3 The figure is a flow chart of the destination end receiving the file to be transmitted provided in this specification.

[0049] In addition, this manual provides a pre-set number of resends to limit the number of resends of metadata packets, prompt packets, and end verification packets, thereby avoiding an endless loop caused by the source end constantly trying to resend due to communication errors or hardware failures, and improving the stability of serial port file transmission.

[0050] In one or more embodiments of the present specification, the source end is further used to terminate the sending process of the file to be transmitted in advance when the number of times the metadata packet is resent exceeds a preset first value, the source end is further used to terminate the sending process of the file to be transmitted in advance when the number of times the prompt packet is sent exceeds a preset second value, and the source end is further used to terminate the sending process of the file to be transmitted in advance when the number of times the end check packet is resent exceeds a preset third value. The first value, the second value, and the third value may be the same or different, and the size of the first value, the second value, and the third value is not limited in the present specification, and can be set according to actual needs. For example, the first value, the second value, and the third value may all be 3.

[0051] In addition, in one or more embodiments of the present specification, when the source end receives the second response signal, it is also used to re-execute the sending process of the file to be transmitted when the result of the file verification in the second response signal is a verification failure, and when the number of times the sending process of the file to be transmitted is re-executed exceeds a preset fourth value, stop sending the file to be transmitted.

[0052] In addition, this specification provides that when the source end and the destination end are in full-duplex communication, the source end is also used to execute the transmission of the sub-data packet and continue to listen while waiting for the destination end to return the first response signal of the metadata packet; the destination end can determine whether the type of the data packet initially received is a metadata packet, if not, then determine to return the third response signal to the source end, if so, then determine to return the third response signal to the source end when the metadata packet verification fails; the source end can insert the metadata packet in the transmission sequence of the sub-data packet when receiving the third response signal. The details are as follows: Specifically, when the communication mode between the source end and the destination end is full-duplex, the source end can execute the sending of sub-data packets while waiting for the destination end to return the first response signal of the metadata packet, and continue to listen to the signal or data packet returned by the destination end; the destination end can determine whether the type of data packet initially received is a metadata packet, and if not, determine that the third response signal is returned to the source end; if so, when the metadata packet verification fails, determine that the third response signal is returned to the source end; the source end can insert the metadata packet in the sending sequence of the sub-data packet when receiving the third response signal.

[0053] It should be noted that, since the source and the destination can send data packets at the same time in the full-duplex communication mode, the source can execute the sending of sub-data packets without waiting for the first response signal returned by the destination in the full-duplex communication mode, thereby improving the transmission efficiency in the full-duplex communication mode. At the same time, the destination does not need to determine the first response signal of the successful verification of the metadata packet, because, in the full-duplex communication mode, the source can determine whether it is necessary to resend the metadata packet by judging whether the initial reception is a metadata packet or confirming whether the received metadata packet fails to be verified, that is, in the full-duplex communication mode, it is defaulted that it does not belong to the above two situations, that is, the destination has received the metadata packet, and the verification of the metadata packet is successful, thereby ensuring the accurate transmission of the metadata packet.

[0054] In addition, this specification provides that when the communication mode between the source end and the destination end is full-duplex, the destination end is also used to determine the mark number of the missing sub-packet as the missing sequence number according to the consistency of the mark number of the received sub-packets when receiving each sub-packet in sequence; determine the negative response signal of the sub-packet corresponding to the missing sequence number and return it to the source end, and continuously listen to the sub-packet corresponding to the missing sequence number returned by the source end, and when the continuous listening time exceeds the preset fourth time length, resend the negative response signal of the sub-packet corresponding to the missing sequence number. When the source end receives the negative response signal of the sub-packet, the sub-packet is inserted into the transmission sequence of the sub-packet. Among them, the value of the fourth time length is not limited in this specification, and can be set according to actual needs. Among them, the data field of the negative response signal of the sub-packet corresponding to the missing sequence number includes a file command word and a retransmission sequence number, which is similar to the feedback data packet, but the feedback data packet contains one or more missing sequence numbers. Since the destination end can send a negative acknowledgement signal of the sub-data packet corresponding to the missing sequence number when there is discontinuity, the negative acknowledgement signal of the sub-data packet corresponding to the missing sequence number includes the missing sequence number of a single sub-data packet.

[0055] In the above, since the source end can execute the transmission of the sub-data packet while waiting for the first response signal of the metadata packet in full-duplex mode, when the metadata packet is not received, the destination end can determine the marked sequence number of the missing sub-data packet by whether the marked sequence number is continuous, as the missing sequence number, and can determine the missing sequence number based on the metadata packet after receiving the metadata packet. At the same time, since the source end and the destination end can simultaneously transmit data packets in full-duplex mode, the destination end can determine the negative response signal of the missing sequence number to be returned to the source end during the process of receiving the sub-data packet, and resend the negative response signal of the sub-data packet corresponding to the missing sequence number when the sub-data packet corresponding to the missing sequence number is not detected within the preset fourth time length.

[0056] In addition, the number of retransmissions of the negative acknowledgement signal of each sub-packet can be set. In one or more embodiments of the present specification, the destination end can be used to terminate the sending process of the negative acknowledgement signal of the sub-packet corresponding to the missing sequence number when the number of retransmissions of the negative acknowledgement signal of the sub-packet corresponding to the missing sequence number exceeds a preset fifth value.

[0057] In addition, the total number of retransmissions of negative acknowledgement signals of all sub-data packets can be set. In one or more embodiments of this specification, the destination end can be used to end the receiving process of the file to be transmitted when the number of negative acknowledgement signals sent for the sub-data packets exceeds a preset sixth value.

[0058] In addition, in full-duplex mode, since the destination does not need to wait for the completion of the transmission of each sub-packet at the source end, it can send a negative response signal for the sub-packet corresponding to the missing sequence number. Therefore, the source end can wait for the preset fifth time length after sending each sub-packet. If the source end does not receive the "negative response signal for the sub-packet corresponding to the missing sequence number" within the preset fifth time length, it can send an end verification data packet to the destination end. The destination end can perform an integrity check on the received sub-packets based on the metadata packet to determine whether all sub-packets have been received. If not all sub-packets have been received, a feedback data packet can be sent to the source end.

[0059] Specifically, the source end is further configured to wait for a preset fifth time period after the sub-data packet is sent, and if no negative response signal is received from the destination end within the preset fifth time period, the source end sends the end verification data packet to the destination end. The process of the destination end determining the feedback data packet based on the metadata data packet is not described in detail here.

[0060] like Figure 4 As shown in FIG. 1 , it is a flow chart of the source end sending a file to be transmitted in full-duplex communication mode provided in this specification. Figure 5 The figure is a flow chart of a destination receiving a file to be transmitted in a full-duplex communication mode provided in this specification.

[0061] Figure 6 A serial port file transmission method provided in this specification is applied to the source end of the above-mentioned serial port file transmission system, and includes the following steps: S600: Divide the file to be transmitted into packets to obtain metadata packets and sub-data packets, and determine the marking serial numbers of the sub-data packets.

[0062] S602: Send the metadata package to the destination.

[0063] S604: Receive a first response signal sent by the destination end, and send the sub-data packets to the destination end in sequence according to the marked sequence numbers.

[0064] S606: After all sub-data packets have been sent, a prompt data packet is sent to the destination end.

[0065] S608: Receive the feedback data packet sent by the destination end, and resend the sub-data packets corresponding to the missing sequence numbers in the feedback data packet to the destination end in sequence, and send an end verification data packet to the destination end.

[0066] S610: In response to the received second response signal, determine that the file to be transmitted is completely transmitted.

[0067] For the specific details of steps S600 to S610 in the above method, please refer to the previous description of the system and will not be described in detail here.

[0068] based on Figure 6 A serial port file transmission method provided in this specification is applied to the source end of a serial port file transmission system. By sending a prompt data packet to the destination end, it is used to inform the destination end that the sub-data packet has been sent, so that the destination end can be prompted to return a feedback data packet, and then based on the feedback data packet, the sub-data packet with the missing sequence number is reissued, that is, the transmission of the confirmation response signal of each sub-data packet is avoided, the bandwidth occupancy is reduced, and the transmission speed is improved. The metadata packet is used to enable the destination end to understand the basic information of the file to be transmitted, ensure the correctness of the data processed by the destination end, and the end verification data packet is used to perform file verification on the sub-data packet, thereby improving the reliability of serial port transmission.

[0069] Figure 7 A serial port file transmission method provided in this specification is applied to the destination end of the above-mentioned serial port file transmission system, and includes the following steps: S700: Respond to a metadata packet sent by a source end, verify the metadata packet, and determine a first response signal to be returned to the source end after the verification succeeds.

[0070] S702: Receive sub-data packets sent by the source end in sequence, perform accuracy checks on the sub-data packets, and perform integrity checks on the sub-data packets according to the metadata packet, and determine the marker number of the abnormal sub-data packet as the missing number based on the accuracy check and the integrity check.

[0071] S704: In response to the received prompt data packet, determine the feedback data packet according to the missing sequence number, and send the feedback data packet to the source end.

[0072] S706: sequentially receive the sub-data packets corresponding to the missing sequence numbers sent by the source end, and perform file verification on each received sub-data packet according to the end verification data packet sent by the source end; and determine the second response signal according to the result of the file verification.

[0073] S708: Return the second response signal to the source end.

[0074] For the specific details of steps S700 to S708 in the above method, please refer to the previous description of the system and will not be described in detail here.

[0075] based on Figure 7 A serial port file transmission method provided in this specification is applied to the destination end of a serial port file transmission system. The method records the mark number of the erroneous or missing sub-packet as the missing number, and after receiving the prompt data packet sent by the source end, sends a feedback data packet to request the source end to retransmit, thereby avoiding the transmission of a confirmation response signal for each sub-packet, reducing bandwidth occupancy, and improving the transmission speed. The metadata packet is used to enable the destination end to understand the basic information of the file to be transmitted and ensure the correctness of the data processed by the destination end. The end verification data packet is used to perform file verification on the sub-packet, thereby improving the reliability of serial port transmission.

[0076] The above is a serial port file transmission method provided in one or more embodiments of this specification. Based on the same idea, this specification also provides a corresponding serial port file transmission device, such as Figure 8 and Fig. 9 shown.

[0077] Figure 8 A schematic diagram of a serial port file transmission device provided in this specification, wherein the device is used to execute a serial port file transmission method corresponding to a source end in the serial port file transmission system, including: Initialization module 800, which divides the file to be transmitted into packets, obtains metadata packets and sub-data packets, and determines the marking serial numbers of the sub-data packets; A first sending module 801 sends the metadata packet to a destination end; The second sending module 802 receives the first response signal sent by the destination end, and sends the sub-data packets to the destination end in sequence according to the marked sequence numbers; Prompt module 803, when all sub-packets are sent, sends a prompt packet to the destination end; The third sending module 804 receives the feedback data packet sent by the destination end, and resends the sub-data packets corresponding to the missing sequence numbers in the feedback data packet to the destination end in sequence, and sends an end check data packet to the destination end; The sending end module 805 determines that the transmission of the file to be transmitted is completed in response to the received second response signal.

[0078] Fig. 9A schematic diagram of a serial port file transmission device provided in this specification, wherein the device is used to execute a serial port file transmission method corresponding to a destination end in the serial port file transmission system, including: The first receiving module 900 responds to the metadata packet sent by the source end, verifies the metadata packet, and determines to return a first response signal to the source end after the verification is successful.

[0079] The missing sequence number module 901 receives the sub-data packets sent by the source end in sequence, performs accuracy checks on the sub-data packets, and performs integrity checks on the sub-data packets according to the metadata packet, and determines the marker number of the abnormal sub-data packet as the missing sequence number based on the accuracy check and the integrity check.

[0080] The feedback module 902 determines the feedback data packet in response to the received prompt data packet according to the missing sequence number, and sends the feedback data packet to the source end.

[0081] The second receiving module 903 sequentially receives the sub-packets corresponding to the missing sequence numbers sent by the source end, and performs file verification on each received sub-packet according to the end verification packet sent by the source end; and determines the second response signal according to the result of the file verification.

[0082] The receiving end module 904 returns the second response signal to the source end.

[0083] This specification also provides a computer-readable storage medium, which stores a computer program, which can be used to execute the above Figure 8 or Fig. 9 A serial port file transmission method is provided.

[0084] This manual also provides Fig.10 The schematic structure diagram of the electronic device shown in FIG. Fig.10 As mentioned above, at the hardware level, the device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 8 or Fig. 9 Of course, in addition to the software implementation, this specification does not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0085] In the 1990s, it was very clear whether the improvement of a technology was hardware improvement (for example, improvement of the circuit structure of diodes, transistors, switches, etc.) or software improvement (improvement of the method flow). However, with the development of technology, many improvements of the method flow today can be regarded as direct improvements of the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be implemented with hardware entity modules. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask chip manufacturers to design and make dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one kind of HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages ​​and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.

[0086] The controller may be implemented in any suitable manner, for example, the controller may take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (e.g., software or firmware) executable by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, and the memory controller may also be implemented as part of the control logic of the memory. It is also known to those skilled in the art that, in addition to implementing the controller in a purely computer-readable program code manner, the controller may be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, such a controller may be considered as a hardware component, and the devices for implementing various functions included therein may also be considered as structures within the hardware component. Or even, the devices for implementing various functions may be considered as both software modules for implementing the method and structures within the hardware component.

[0087] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0088] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0089] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0090] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0091] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0092] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0093] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0094] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0095] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0096] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0097] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0098] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0099] The above description is only an embodiment of the present specification and is not intended to limit the present specification. For those skilled in the art, the present specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification shall be included in the scope of the claims of the present specification.

Claims

1. A serial port file transmission system, characterized in that: The system includes a source end and a destination end, wherein: The source end is used to divide the file to be transmitted into packets to obtain a metadata packet and a sub-packet, and determine the mark sequence number of the sub-packet; send the metadata packet to the destination end; receive a first response signal sent by the destination end, and send the sub-packets to the destination end in sequence according to the mark sequence number; when all sub-packets are sent, send a prompt packet to the destination end; receive a feedback packet sent by the destination end, and resend the sub-packets corresponding to the missing sequence number in the feedback packet to the destination end in sequence, and send an end check packet to the destination end; in response to the received second response signal, determine that the transmission of the file to be transmitted is completed; The destination end is used to receive the metadata data packet, verify the metadata data packet, and determine a first response signal to return to the source end after the verification is successful; receive the sub-data packets in sequence, and verify the accuracy of the sub-data packets, and perform integrity verification on the sub-data packets according to the metadata data packet, and determine the mark number of the abnormal sub-data packet as the missing sequence number based on the accuracy verification and the integrity verification; determine the feedback data packet according to the missing sequence number in response to the received prompt data packet, and send the feedback data packet to the source end; receive the sub-data packets corresponding to the missing sequence number sent by the source end in sequence, and perform file verification on each received sub-data packet according to the end verification data packet sent by the source end; determine the second response signal according to the result of the file verification; and return the second response signal to the source end.

2. The system according to claim 1, characterized in that: The source end is further configured to, when the feedback data packet is not empty, sequentially resend the sub-data packets corresponding to the missing sequence numbers in the feedback data packet to the destination end, and after resending, send the prompt data packet to the destination end; and send an end verification data packet when the feedback data packet is empty; The destination end is further used to update the feedback data packet after sequentially receiving the sub-data packets corresponding to the missing sequence numbers resent by the source end, and send the updated feedback data packet to the source end until the end verification data packet is received.

3. The system according to claim 1, characterized in that: The destination end is further configured to determine, when verification of the metadata packet fails, to return a third response signal to the source end; The source end is further configured to resend the metadata packet when the time for waiting for the first response signal exceeds a preset first duration, or when the third response signal is received within the preset first duration.

4. The system according to claim 1, characterized in that: The source end is further used to resend the prompt data packet when the waiting time for the feedback data packet exceeds a preset second time length; and resend the end verification data packet when the waiting time for the second response signal exceeds a preset third time length.

5. The system according to claim 1, characterized in that: The communication mode between the source end and the destination end is full-duplex; The source end is further configured to send the sub-data packet while waiting for the destination end to return a first response signal of the metadata packet; and insert the metadata packet into the sending sequence of the sub-data packet upon receiving a third response signal sent by the destination end; The destination end is also used to determine whether the type of the data packet initially received is a sub-data packet; if so, determine that a third response signal is returned to the source end; if not, when the metadata packet verification fails, determine that a third response signal is returned to the source end.

6. The system according to claim 1, characterized in that: The destination end is further used to receive the sub-data packets in sequence when the communication mode with the source end is full-duplex, and determine the tag number of the missing sub-data packet as the missing sequence number according to the consistency of the tag number of the received sub-data packet; determine to return a negative response signal of the sub-data packet corresponding to the missing sequence number to the source end, and continuously listen to the source end returning the sub-data packet corresponding to the missing sequence number; when the continuous listening time exceeds a preset fourth time length, resend the negative response signal of the sub-data packet corresponding to the missing sequence number; The source end is further configured to, upon receiving a negative response signal of the sub-data packet corresponding to the missing sequence number, insert the sub-data packet with the missing sequence number into the sending sequence of the sub-data packet.

7. A serial port file transmission method, characterized in that: The method is applied to the source end in the system according to any one of claims 1 to 6, comprising: Divide the file to be transmitted into packets to obtain a metadata packet and a sub-packet, and determine the marking serial number of the sub-packet; Sending the metadata packet to a destination; receiving a first response signal sent by the destination end, and sending the sub-data packets to the destination end in sequence according to the marked sequence numbers; When all sub-data packets have been sent, a prompt data packet is sent to the destination end; Receive a feedback data packet sent by the destination end, and resend the sub-data packets corresponding to the missing sequence numbers in the feedback data packet to the destination end in sequence, and send an end verification data packet to the destination end; In response to the received second response signal, it is determined that the transmission of the file to be transmitted is complete.

8. A serial port file transmission method, characterized in that: The method is applied to a destination end of the system according to any one of claims 1 to 6, comprising: Responding to a metadata packet sent by a source end, verifying the metadata packet, and determining to return a first response signal to the source end after the verification succeeds; receiving the sub-data packets sent by the source end in sequence, performing accuracy checks on the sub-data packets, and performing integrity checks on the sub-data packets according to the metadata packet, and determining the marking sequence number of the abnormal sub-data packet as the missing sequence number based on the accuracy check and the integrity check; In response to the received prompt data packet, determining the feedback data packet according to the missing sequence number, and sending the feedback data packet to the source end; receiving the sub-data packets corresponding to the missing sequence numbers sent by the source end in sequence, and performing file verification on each received sub-data packet according to the end verification data packet sent by the source end; and determining the second response signal according to the result of the file verification; The second response signal is returned to the source end.

9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method of claim 7 or 8 is implemented.

10. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the method according to claim 7 or 8 is implemented when the processor executes the program.

Citation Information

Patent Citations

  • On-line progressive program updating method for wireless sensor network

    CN102665196A

  • Error processing method and apparatus

    CN107483148A

  • Data sending method and data receiving method based on audio interface

    CN107682095A

  • File transmission method and device and computer readable storage medium

    CN114598697A

  • Data transmission method and apparatus

    WO2023155690A1

Cited By

  • Ammeter data processing method based on WIZE technology

    CN121396392A