File transmission method for edge internet-of-things proxy device and internet-of-things master station

The MQTT protocol realizes the interruption of file transfer between the IoT master station and the edge IoT proxy device, which solves the problem of restarting after transmission interruption, improves transmission efficiency and has good compatibility and scalability.

CN119728669APending Publication Date: 2025-03-28XUCHANG XJ SOFTWARE TECHNOLOGIES LTD +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411741791.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

The file transfer method between the existing IoT master station and the edge IoT proxy device needs to start the transmission again after the file transfer fails, resulting in low transmission efficiency.

Method used

The MQTT protocol allows the edge IoT proxy device to send messages between the IoT master station. The sender determines whether the receiver responds successfully based on the status information in the received file transfer response message. If successful, the file segment will be read from the start position of the transmission and the file content request message will be sent to achieve breakpoint continuous transmission.

Benefits of technology

It avoids the problem of needing to start the transfer again after file transfer interruption, improves the efficiency of file transfer, and has the characteristics of flexible deployment, strong compatibility and scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119728669A_ABST
    Figure CN119728669A_ABST
Patent Text Reader

Abstract

The invention relates to a file transmission method for an edge internet-of-things proxy device and an internet-of-things master station, and belongs to the technical field of internet-of-things data transmission of a power system. A message is sent between the edge Internet of Things proxy device and the Internet of Things master station through an MQTT protocol; a sender needing to transmit a file in the two sends a file transmission request message, and a receiver sends a file transmission response message containing state information corresponding to request failure or a file transmission response message containing state information corresponding to request success and current transmission starting position information according to the received file transmission request message; and when the file transmission response is successful, sending a file content request message containing the file segment read from the current transmission starting position and the serial number of the file segment according to the current transmission starting position information, and selecting whether to store the file and send a file content response message by the receiver according to whether the serial number of the received file segment is consistent with the expectation. And if the response is successful, the sender continues to send the next file segment, or else, the process is ended.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a file transmission method between an edge IoT proxy device and an IoT master station, and belongs to the technical field of power system IoT data transmission. Background Art

[0002] The Internet of Things (IoT) is an information carrier of the Internet and traditional telecommunications networks. It can closely link all things with the Internet and traditional communication networks, allowing all ordinary objects with independent functions to be interconnected.

[0003] In the IoT environment, the IoT master station will be connected to a variety of edge IoT proxy devices to uniformly monitor various operation and measurement data information of the edge IoT proxy devices. The edge IoT proxy devices will contain logs, pictures, videos and other files, which need to be uploaded to the IoT master station by file transfer; at the same time, the IoT master station will contain device upgrade packages, application packages and other files, which need to be downloaded to the edge IoT proxy devices by file transfer.

[0004] At present, most IoT master stations and edge IoT proxy devices use FTP or HTTP protocols to transfer files. This file transfer method requires the deployment of additional file transfer services, which is not only cumbersome to operate and increase deployment costs, but also requires restarting the transfer when the file transfer fails, resulting in low transmission efficiency. Summary of the invention

[0005] The purpose of the present invention is to provide a file transmission method between an edge IoT proxy device and an IoT master station, so as to solve the problem that the current file transmission method between the IoT master station and the edge IoT proxy device needs to restart the transmission after the file transmission fails, resulting in low transmission efficiency.

[0006] In order to solve the above technical problems, the present invention provides a file transmission method between an edge IoT proxy device and an IoT master station, the method comprising: sending messages between the edge IoT proxy device and the IoT master station through the MQTT protocol; the sender of the file to be transmitted sends a file transfer request message, and the receiver sends a file transfer response message containing status information corresponding to the request failure or a file transfer response message containing status information corresponding to the request success and the starting position information of this transmission according to the received file transfer request message; the sender determines whether the receiver responds successfully according to the status information in the received file transfer response message, and if successful, sends a file content request message containing a file segment in the file to be transmitted read from the starting position of this transmission and the number of the file segment according to the starting position information of this transmission; if the number in the file content request message received by the receiver is consistent with the number expected by the receiver, the receiver saves the file segment and sends a file content response message containing status information corresponding to the successful transmission or status information corresponding to the failed transmission accordingly, otherwise the receiver does not save the file segment and sends a file content response message containing status information corresponding to the failed transmission;

[0007] The sender determines whether the receiver responds successfully based on the status information in the received file content response message. If successful, it continues to read the next file segment of the file to be transferred and sends a file content request message. Otherwise, the file transfer is terminated.

[0008] Furthermore, the method of sending messages between the edge IoT agent device and the IoT master station through the MQTT protocol includes: the edge IoT agent device and the IoT master station both subscribe to the preset topic group of the MQTT protocol that contains the unique identifier of the sender of the two and the unique identifier of the receiver of the two and contains at least one preset topic; the sender sends the message to be sent to the receiver through the preset topic, the receiver receives the message sent to itself by the sender through the preset topic, and obtains the unique identifier of the sender who sends the message according to the preset topic.

[0009] Furthermore, the file content request message also includes subsequent identification information;

[0010] The method in which the receiving party saves the file segment and sends the corresponding file content response message includes: after the receiving party saves the file segment in the received file content request message, the receiving party determines whether the file segment is the last file segment according to the subsequent identification information in the file content request message received this time, and if not, sends a file content response message containing transmission success information; if it is the last file segment, verifies whether the transmitted file is accurate, and if the verification is successful, sends a file content response message containing transmission success information; if the verification fails, deletes the transmitted file and sends a file content response message containing transmission failure information.

[0011] Furthermore, the file transfer request message includes a file name, a file size and a file check code information determined according to the file to be transferred;

[0012] The method for the receiving party to save the file segment includes: judging whether the receiving party has a file transfer record that is consistent with the file name, file size, file verification code information in the file transfer request message and the unique identifier of the sender according to the file transfer request message and the unique identifier of the sender; if so, saving the content of the file segment to an existing file corresponding to the file transfer record; if not, saving the content of the file segment to a newly created file, and saving the file transfer record containing the file name, file size, file verification code information in the file transfer request message and the unique identifier of the sender.

[0013] Furthermore, the sending party determines whether the receiving party has responded successfully based on the status information in the received file transfer response message, including: if the status information in the file transfer response message is status information corresponding to a successful request, then the receiving party is judged to have responded successfully; if the status information in the file transfer response message is status information corresponding to a failed request, then the receiving party is judged to have responded unsuccessfully.

[0014] Furthermore, the sender determines whether the receiver has responded successfully based on the status information in the received file content response message. If the status information in the file content response message is status information corresponding to successful transmission, then the receiver is judged to have responded successfully; if the status information in the file content response message is status information corresponding to failed transmission, then the receiver is judged to have responded unsuccessfully.

[0015] Furthermore, the method for determining the starting position of this transmission includes: judging whether the receiving party has a file transfer record that is consistent with the file name, file size, file verification code information in the file transfer request message and the unique identifier of the sender based on the file transfer request message; if so, setting the starting position of this transmission to the next byte of the transmitted byte corresponding to the file transfer record; if not, setting the starting position of this transmission to the first byte.

[0016] Furthermore, if the verification fails, the transfer file is deleted and a file content response message containing transmission failure information is sent. The method includes: if the verification fails, the recipient deletes the transfer file and searches the database record for whether there is a file transfer record that is completely consistent with the sender's unique identifier and the file name, file size, and file verification code information in the file transfer request message. If so, the file transfer record is deleted, and then a file content response message containing transmission failure information is sent.

[0017] Furthermore, the method of verifying whether the transmitted file is accurate includes: comparing whether the file size and the check code determined according to the actually stored file are consistent with the file size and the check code in the file transmission request message corresponding to the file.

[0018] Furthermore, the method for determining whether the receiving party has received the file content request message includes: if the receiving party has not received the expected file content request message after a preset timeout period, it is determined that the receiving party has not received the file content request message, and a file content response message containing status information corresponding to the transmission failure is sent to the sending party; otherwise, it is determined that the receiving party has received the file content request message.

[0019] Beneficial effect: The present invention provides a new file transfer method between an edge IoT proxy device and an IoT master station. In this method, the edge IoT proxy device and the IoT master station send messages through the MQTT protocol. The sender of the two sends a file transfer request message, and the receiver sends a file transfer response message containing status information corresponding to the request failure or a file transfer response message containing status information corresponding to the request success and the starting position information of this transmission according to the received file transfer request message; only when it is judged that the receiver's response is successful according to the status information in the file transfer response message, the file content transmission starts. When transmitting the file content, the sender sends a file content request message containing the file segment in the file to be transferred read from the starting position of this transmission and the number of the file segment; the receiver selects whether the number in the received file request message is consistent with the expected number. Whether to save the file and whether to continue the transmission, and send the corresponding file content response message; when the sender determines that the receiver responds successfully, the sender continues to send a file content request message containing the next file segment of the file to be transmitted, otherwise the transmission is terminated; when the receiver has received the file before, and the transmission process of the file is interrupted due to some reasons, the file content of this transmission continues to be transmitted from the file transmission position where the last interruption occurred, that is, the starting transmission position of this time is the next position of the file transmission position where the last interruption occurred. When the receiver receives the file for the first time, the starting position of this file transmission is the starting position of the file; this avoids the need to restart the transmission after the file transmission is interrupted in the prior art, resulting in low file transmission efficiency. The method performs file transmission through the MQTT protocol, can realize breakpoint resumption, is more efficient, and has the characteristics of flexible deployment, strong compatibility, and scalability. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 It is a structural diagram of a file transmission system between an edge IoT proxy device and an IoT master station in an embodiment of a file transmission method between an edge IoT proxy device and an IoT master station of the present invention;

[0021] Figure 2It is a flowchart of a file transfer request processing in an embodiment of a file transfer method between an edge IoT proxy device and an IoT master station of the present invention;

[0022] Figure 3 It is a flowchart of file transmission / content response processing in an embodiment of a file transmission method between an edge IoT proxy device and an IoT master station of the present invention;

[0023] Figure 4 It is a flow chart of file content request processing in an embodiment of a file transmission method between an edge IoT proxy device and an IoT master station of the present invention. DETAILED DESCRIPTION

[0024] The specific implementation of the present invention will be further described below in conjunction with the accompanying drawings.

[0025] Embodiment of file transmission method between edge IoT proxy device and IoT master station

[0026] The present embodiment provides a technical solution for a file transmission method between an edge IoT proxy device and an IoT master station. The method uses the MQTT protocol to implement file transmission between the edge IoT proxy device and the IoT master station. Four types of messages are set to ensure the reliability of file transmission. When the recipient has received the file before and the transmission process of the file is interrupted due to some reasons, the file content of this transmission continues to be transmitted from the file transmission position where the last interruption occurred, that is, breakpoint resumption can be achieved, which is more efficient.

[0027] The method specifically includes: an edge IoT proxy device and an IoT master station send messages through the MQTT protocol; the sender of the file to be transmitted sends a file transmission request message, and the receiver sends a file transmission response message containing status information corresponding to the request failure or a file transmission response message containing status information corresponding to the request success and the starting position information of this transmission according to the received file transmission request message; the sender judges whether the receiver responds successfully according to the status information in the received file transmission response message, and if successful, sends a file content request message containing a file segment in the file to be transmitted read from the starting position of this transmission and the number of the file segment according to the starting position information of this transmission; if the number in the file content request message received by the receiver is consistent with the number expected by the receiver, the receiver saves the file segment and sends a file content response message containing status information corresponding to the successful transmission or status information corresponding to the failed transmission accordingly, otherwise the receiver does not save the file segment and sends a file content response message containing status information corresponding to the failed transmission; the sender judges whether the receiver responds successfully according to the status information in the received file content response message, and if successful, continues to read the next file segment of the file to be transmitted and sends a file content request message, otherwise the file transmission is terminated. When the recipient has received the file before, but the transmission process of the file is interrupted due to some reasons, the file content of this transmission will be transmitted from the position of the file transmission interrupted last time, that is, the starting transmission position of this transmission is the next position of the file transmission position interrupted last time; this avoids the need to restart the transmission when the file transmission is interrupted in the prior art, resulting in low file transmission efficiency. The method uses the MQTT protocol to perform file transmission, which can realize breakpoint transmission and resumption, is more efficient, and has the characteristics of flexible deployment, strong compatibility and scalability.

[0028] The structure diagram of the file transmission system between the edge IoT proxy device and the IoT master station of this embodiment is as follows: Figure 1As shown, the IoT master station and the edge IoT proxy device of the file transmission system both include a database, a file sending service, and a file receiving service; wherein, the IoT master station also includes an MQTT service, the IoT master station serves as an MQTT server, and the edge IoT proxy device serves as an MQTT client; MQTT serves as a message bus, and there are multiple edge IoT proxy devices below that serve as MQTT clients connected to the MQTT service on the master station side, and can access various messages on the bus to each other, and transmit data or files and other information. In other embodiments, the MQTT service can be deployed in the edge IoT proxy device, and in this case, the master station needs to be connected to the device-side MQTT server as a client. If there are multiple edge IoT proxy devices, each device needs to deploy the MQTT service, and the master station needs to initiate multiple connections to the MQTT server on each device. At this time, the data messages on each connection channel cannot be shared; it can also be deployed in other devices except the IoT master station and the edge IoT proxy device; the file sending service of the IoT master station and the edge IoT proxy device is the sender of the file transfer, responsible for initiating the file transfer process, composing the file transfer request message and the file content request message, and publishing the message to the MQTT server; the file receiving service of the IoT master station and the edge IoT proxy device is the receiver of the file transfer, responsible for receiving and saving files, composing the file transfer response message and the file content response message; and publishing the message to the MQTT server.

[0029] The following is a detailed description of the file transmission method between the edge IoT proxy device and the IoT master station:

[0030] The edge IoT agent device and the IoT master station send messages via the MQTT protocol;

[0031] Among them, the method of sending messages between the edge IoT agent device and the IoT master station through the MQTT protocol includes: the edge IoT agent device and the IoT master station both subscribe to the MQTT protocol's preset topic group that contains the unique identifier of the sender of the two and the unique identifier of the receiver of the two and contains at least one preset topic; the sender sends the message to be sent to the receiver through the preset topic, the receiver receives the message sent to itself by the sender through the preset topic, and obtains the unique identifier of the sender who sends the message according to the preset topic.

[0032] In the two, the sender of the file to be transferred sends a file transfer request message, and the receiver sends a file transfer response message containing status information corresponding to the request failure or a file transfer response message containing status information corresponding to the request success and the starting position information of this transmission according to the received file transfer request message; in this embodiment, the receiver determines whether to receive the file according to business needs. If the file is received, a file transfer response message containing status information corresponding to the request success is sent; otherwise, a file transfer response message containing status information corresponding to the request failure is sent; in other embodiments, a default file reception can be set, and a file transfer response message containing status information corresponding to the request success is sent by default.

[0033] Specifically, the file transfer request processing flow of this embodiment is as follows: Figure 2 As shown, the receiving party receives a file transfer request message, and when the file transfer request fails, it sends a file transfer response message containing status information corresponding to the request failure; when the file transfer request is successful, it queries whether the transfer record exists in the database; if it exists, it is a breakpoint resume, and the starting position of this transmission corresponding to the breakpoint resume is determined; if it does not exist, it is a non-breakpoint resume, and the starting position of this transmission corresponding to the non-breakpoint resume is determined; and a file transfer response message containing status information corresponding to the request success and the starting position information of this transmission is sent.

[0034] In this embodiment, the file content transmission request message also includes the file name, file size and file verification code information determined according to the file to be transmitted;

[0035] The method for determining the starting position of this transmission is specifically as follows: according to the file content transmission request message and the unique identifier of the sender of the message, it is determined whether the receiving party has a file transmission record that is consistent with the file name, file size, file check code information in the file content transmission request message and the unique identifier of the sender; if so, the starting position of this transmission is set to the next byte of the transmitted byte corresponding to the file transmission record (corresponding to Figure 2 If it does not exist, the starting position of this transmission is set to the first byte (corresponding to Figure 2 non-resumable download in ).

[0036] The file transfer / content response processing flow is as follows Figure 3As shown, when the sender receives the file transfer response message, the sender determines whether the receiver responds successfully based on the status information in the received file transfer response message. In this embodiment, the sender determines whether the receiver responds successfully based on the status information in the received file transfer response message in the following way: if the status information in the file transfer response message is the status information corresponding to a successful request, then the receiver responds successfully; if the status information in the file transfer response message is the status information corresponding to a failed request, then the receiver responds unsuccessfully.

[0037] If successful, the file segment to be transferred (corresponding to the file segment read from the starting position of this transmission) is sent according to the starting position information of this transmission. Figure 3 In the embodiment, the file content request message further includes subsequent identification information; when the read file segment is the last file segment of the file, the subsequent identification information of the file content request message (corresponding to Figure 4 The subsequent identification information in the file content request message is set to 0, indicating that there is no subsequent file content request message and the file to be sent has been sent completely; when the read file segment is not the last file segment of the file, the subsequent identification information of the file content request message (corresponding to Figure 4 The subsequent flag in the message is set to 1, indicating that there is a subsequent file content request message, and the file to be sent has not been sent yet. In this embodiment, each file segment content can also be encoded by a preset algorithm, converted into a data stream suitable for transmission and then sent, which can achieve the purpose of compressing file size, encrypting files, and improving transmission rate. In other embodiments, the encoding process can also be performed without the algorithm.

[0038] The file content request processing flow chart in this embodiment is as follows Figure 4 As shown, if the number in the file content request message received by the receiving party is consistent with the number expected by the receiving party, the receiving party saves the file segment and sends a file content response message containing status information corresponding to successful transmission or status information corresponding to failed transmission accordingly; otherwise, the receiving party does not save the file segment and sends a file content response message containing status information corresponding to failed transmission; in this embodiment, the method for judging the file content request message received by the receiving party is specifically as follows: if the receiving party has not received the expected file content request message after a preset timeout period, it is determined that the receiving party has not received the file content request message, and a file content response message containing status information corresponding to failed transmission is sent to the sender; otherwise, it is determined that the receiving party has received the file content request message.

[0039] The method in which the receiving party saves the file segment and sends the corresponding file content response message includes: after the receiving party saves the file segment in the received file content request message, the receiving party determines whether the file segment is the last file segment based on the subsequent identification information in the file content request message received this time, and if not, sends a file content response message containing transmission success information; if it is the last file segment, verifies whether the transmitted file is accurate, and if the verification is successful, sends a file content response message containing transmission success information; if the verification fails, deletes the transmitted file and sends a file content response message containing transmission failure information.

[0040] In this embodiment, the method of verifying whether the transferred file is accurate is specifically: comparing whether the file size and the check code determined according to the actually stored file are consistent with the file size and the check code in the file transfer request message corresponding to the file.

[0041] In this embodiment, if the verification fails, the transfer file is deleted and a file content response message containing the transmission failure information is sent. Specifically, if the verification fails, the recipient deletes the transfer file and searches the database record for a file transfer record that is completely consistent with the sender's unique identifier and the file name, file size, and file verification code information in the file transfer request message. If so, the file transfer record is deleted, and then a file content response message containing the transmission failure information is sent.

[0042] If the verification is successful, the method of sending a file content response message containing successful transmission information includes: if the verification is successful, searching the database record for a file transfer record that is completely consistent with the sender's unique identifier and the file name, file size, and file verification code information in the file transfer request message, and if so, deleting the file transfer record, and then sending a file content response message containing successful transmission information. In other embodiments, after the verification is successful, if there is a file transfer record in the database record that is completely consistent with the sender's unique identifier and the file name, file size, and file verification code information in the file transfer request message, the file transfer record may not be deleted, and a file content response message containing successful transmission information is directly sent. When receiving the same file next time, after receiving the file transfer request message, a file transfer response message containing the status information corresponding to the successful request and the starting position information of this transmission is directly responded, and the starting position information (StartByte) of this transmission in the file transfer response message is the file size + 1, indicating that the file already exists and does not need to be transferred, and this file transfer ends.

[0043] In this embodiment, the receiving party saves the file segment in the following manner: based on the file content transmission request message and the unique identifier of the sender that sends the message, determine whether the receiving party has a file transfer record that is consistent with the file name, file size, file verification code information in the file content transmission request message and the unique identifier of the sender; if so, it means that the file corresponding to the file segment currently being transmitted is a file that is resumed from breakpoint, so the content of the file segment is saved in the existing file corresponding to the file transfer record; if not, it means that the file corresponding to the file segment currently being transmitted is a file that is not resumed from breakpoint, so the content of the file segment is saved in a newly created file, and the file transfer record containing the file name, file size, file verification code information in the file content transmission request message and the unique identifier of the sender is saved.

[0044] Reference Figure 3 As shown, the sender determines whether the receiver responds successfully based on the status information in the received file content response message. In this embodiment, the sender determines whether the receiver responds successfully based on the status information in the received file content response message in the following specific ways: if the status information in the file content response message is status information corresponding to successful transmission, then the receiver responds successfully; if the status information in the file content response message is status information corresponding to failed transmission, then the receiver responds unsuccessfully.

[0045] If successful, continue to read the next file segment of the file to be transferred and send a file content request message, otherwise end the file transfer. Among them, when the read file segment is the last file segment of the file, the subsequent identification information of the file content request message (corresponding to Figure 4 The subsequent identifier in the file content request message is set to 0; when the read file segment is not the last file segment of the file, the subsequent identifier information of the file content request message (corresponding to Figure 4 The subsequent flag in is set to 1.

[0046] Specifically, in this embodiment, the file transfer request message includes a file name (FileName), a file size (FileSize), a file check code (FileCrc), and a file command ID (FileId). The specific meaning of each field is shown in Table 1;

[0047] Table 1

[0048]

[0049] The file transfer response message includes the file command ID (FileId), status information (Status) (status information corresponding to a successful request or status information corresponding to a failed request), the starting position information of this transfer (StartByte), error code (ErrorCode), and notes (Note). The specific meaning of each field is shown in Table 2;

[0050] Table 2

[0051]

[0052]

[0053] The file content request message contains the file command ID (FileId), the file segment number (FileSeq), the file content (Content), and the subsequent identification information (Continue). The specific meaning of each field is shown in Table 3;

[0054] Table 3

[0055]

[0056] The file content response message includes the file command ID (FileId), the file segment number (FileSeq), the status information (Status) (status information corresponding to successful transmission or status information corresponding to failed transmission), the error code (ErrorCode), and the note (Note). The specific meaning of each field is shown in Table 4;

[0057] Table 4

[0058]

[0059]

[0060] It should be understood that the above specific embodiments of the present invention are only used to illustrate or explain the principles of the present invention, but do not constitute a limitation to the present invention.

Claims

1. A file transmission method between an edge IoT proxy device and an IoT master station, characterized in that: The edge IoT proxy device and the IoT master station send messages via the MQTT protocol; the sender of the file to be transferred sends a file transfer request message, and the receiver sends a file transfer response message containing status information corresponding to the request failure or a file transfer response message containing status information corresponding to the request success and the starting position information of this transmission according to the received file transfer request message; the sender determines whether the receiver responds successfully according to the status information in the received file transfer response message, and if successful, sends a file content request message containing the file segment in the file to be transferred read from the starting position of this transmission and the number of the file segment according to the starting position information of this transmission; if the number in the file content request message received by the receiver is consistent with the number expected by the receiver, the receiver saves the file segment and sends a file content response message containing status information corresponding to the successful transmission or the status information corresponding to the failed transmission accordingly, otherwise the receiver does not save the file segment and sends a file content response message containing status information corresponding to the failed transmission; The sender determines whether the receiver responds successfully based on the status information in the received file content response message. If successful, it continues to read the next file segment of the file to be transferred and sends a file content request message. Otherwise, the file transfer is terminated.

2. The file transmission method between the edge IoT proxy device and the IoT master station according to claim 1, characterized in that: The method of sending messages between an edge IoT proxy device and an IoT master station through the MQTT protocol includes: the edge IoT proxy device and the IoT master station both subscribe to a preset topic group of the MQTT protocol that contains a unique identifier of a sender of the two and a unique identifier of a receiver of the two and contains at least one preset topic; the sender sends a message to be sent to the receiver through the preset topic, the receiver receives the message sent to itself by the sender through the preset topic, and obtains the unique identifier of the sender of the message according to the preset topic.

3. The file transmission method between the edge IoT proxy device and the IoT master station according to claim 2, characterized in that: The file content request message also includes subsequent identification information; The method in which the receiving party saves the file segment and sends the corresponding file content response message includes: after the receiving party saves the file segment in the received file content request message, the receiving party determines whether the file segment is the last file segment according to the subsequent identification information in the file content request message received this time, and if not, sends a file content response message containing transmission success information; if it is the last file segment, verifies whether the transmitted file is accurate, and if the verification is successful, sends a file content response message containing transmission success information; if the verification fails, deletes the transmitted file and sends a file content response message containing transmission failure information.

4. The file transmission method between the edge IoT proxy device and the IoT master station according to claim 3, characterized in that: The file transfer request message includes the file name, file size and file check code information determined according to the file to be transferred; The receiving party saves the file segment in a manner including: judging whether the receiving party has a file transfer record that is consistent with the file name, file size, file checksum information in the file transfer request message and the unique identifier of the sender according to the file transfer request message and the unique identifier of the sender; if so, saving the content of the file segment into an existing file corresponding to the file transfer record; If it does not exist, the content of the file segment is saved in a newly created file, and a file transfer record including the file name, file size, file verification code information in the file transfer request message and the unique identifier of the sender is saved.

5. The file transmission method between the edge IoT proxy device and the IoT master station according to any one of claims 1 to 4, characterized in that: The method in which the sender determines whether the receiver responds successfully based on the status information in the received file transfer response message includes: if the status information in the file transfer response message is the status information corresponding to a successful request, then the receiver responds successfully; if the status information in the file transfer response message is the status information corresponding to a failed request, then the receiver responds unsuccessfully.

6. The file transmission method between the edge IoT proxy device and the IoT master station according to any one of claims 1 to 4, characterized in that: The sending party determines whether the receiving party has responded successfully based on the status information in the received file content response message. The method includes: if the status information in the file content response message is status information corresponding to successful transmission, then the receiving party is judged to have responded successfully; if the status information in the file content response message is status information corresponding to failed transmission, then the receiving party is judged to have responded unsuccessfully.

7. The file transmission method between the edge IoT proxy device and the IoT master station according to claim 4, characterized in that: The method for determining the starting position of this transmission includes: judging whether the receiving party has a file transfer record that is consistent with the file name, file size, file verification code information in the file transfer request message and the unique identifier of the sender according to the file transfer request message; if so, setting the starting position of this transmission to the next byte of the transmitted byte corresponding to the file transfer record; if not, setting the starting position of this transmission to the first byte.

8. The file transmission method between the edge IoT proxy device and the IoT master station according to claim 4, characterized in that: If the verification fails, the transfer file is deleted and a file content response message containing the transmission failure information is sent. The method includes: if the verification fails, the receiver deletes the transfer file and searches the database record for a file transfer record that is completely consistent with the sender's unique identifier and the file name, file size, and file verification code information in the file transfer request message. If so, the file transfer record is deleted, and then a file content response message containing the transmission failure information is sent.

9. The file transmission method between the edge IoT proxy device and the IoT master station according to claim 3 or 4, characterized in that: The method of verifying whether the transmitted file is accurate includes: comparing whether the file size and the check code determined according to the actually stored file are consistent with the file size and the check code in the file transmission request message corresponding to the file.

10. The file transmission method between the edge IoT proxy device and the IoT master station according to any one of claims 1 to 4, characterized in that: The method for judging whether the receiving party has received the file content request message includes: if the receiving party has not received the expected file content request message after a preset timeout period, it is judged that the receiving party has not received the file content request message, and a file content response message containing status information corresponding to the transmission failure is sent to the sending party; otherwise, it is judged that the receiving party has received the file content request message.

Citation Information

Patent Citations

  • File breakpoint continuously-transmitting method based on SIP (Session Initiation Protocol)

    CN101883144A

  • File transmission method and system supporting breakpoint resume

    CN110933159A

  • File transmission and video live broadcast method and system based on MQTT protocol

    CN116248666A

  • File transmission and equipment management method and system based on unified Internet of Things management platform

    CN116489140A

  • Data breakpoint resume control system method based on MQTT protocol

    CN117896367A