A ftp communication method applied to a low version VxWorks

By intelligently identifying file lists, asynchronous folder downloads, and addressing transmission time delays and disconnection reconnection mechanisms, the system resolves the issues of incompatible file list formats and transmission interruptions in FTP communication in older versions of VxWorks, thus achieving reliable file transfer.

CN115941668BActive Publication Date: 2026-05-12HAIYING ENTERPRISE GROUP
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HAIYING ENTERPRISE GROUP
Filing Date
2022-11-15
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing technologies cannot effectively achieve FTP communication with older versions of VxWorks systems, especially due to incompatible file list formats and transmission reliability issues.

Method used

It employs intelligent file list recognition, asynchronous folder download, transmission time delay, and disconnection reconnection mechanisms to ensure the reliability of file transmission.

Benefits of technology

It enables reliable FTP communication with older versions of VxWorks systems, resolves issues of incompatible file list formats and transmission interruptions, and ensures the integrity and reliability of file transfers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115941668B_ABST
    Figure CN115941668B_ABST
Patent Text Reader

Abstract

The application relates to an ftp communication method applied to a low version VxWorks, which adopts intelligent identification file list, asynchronous folder downloading, transmission time delay and a broken line reconnection mechanism to ensure the reliability of communication with a device and file transmission, and comprises the following steps: extracting and rearranging a file name, a file creation time, a file size and a folder identification; a file transmission thread is used to circularly synchronize the instruction response of an ftp server; a broken line reconnection mechanism, wherein a timer is started after a file is successfully received, the transmission of the next file is started again after the timer ends, otherwise, the current state is saved and the ftp server is reconnected, the file transmission is continued, and the timer time is increased. The communication method is compatible with the ftp protocol communication of an old version device to ensure the reliability of communication with the device and file transmission, and the problem of folder downloading is solved due to the adoption of the designed asynchronous process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to sonar information processing equipment technology, and in particular to an FTP communication method applied to an older version of VxWorks. Background Technology

[0002] As time goes by, modern equipment becomes increasingly sophisticated, highlighting the design flaws of older devices, such as the lack of data transmission capabilities. With many older devices already in use, modifications to the devices themselves are not feasible; the only option is to use external devices to transfer data via the FTP protocol.

[0003] In actual use, most FTP transfer software on the market does not have the ability to communicate with versions of VxWorks prior to 5.5. During the process of writing the program, it was found that the main problem that it could not communicate was that the file list format transferred by the earlier versions of VxWorks (prior to 5.5) was not the current common file format. Therefore, it was considered to modify the Qt source code to solve the communication problem. Summary of the Invention

[0004] To address the aforementioned technical problems, this invention provides an FTP communication method for older versions of VxWorks. This method employs mechanisms such as intelligent file list identification, asynchronous folder downloading, transmission time delay, and reconnection after disconnection to ensure reliable communication with the device and file transfer. The method includes the following steps:

[0005] Step S1: Determine and locate the file creation time information, and determine the folder flag bit;

[0006] Step S2: Locate the file size information and find the file name;

[0007] Step S3: Rearrange the searched information according to the general FTP list format and send it to the FTP receiving program for recognition;

[0008] Step S4: Simultaneously, a file transfer thread is set up to cyclically synchronize the command responses of the FTP server;

[0009] Step S5: A disconnection reconnection mechanism is provided, in which a timer is started after a file is successfully received, and the transfer of the next file is started again after the timer expires; otherwise, the current state is saved and the FTP server is reconnected to continue the file transfer, and the timer time is increased.

[0010] In one embodiment of the present invention, the time information in step S1 is divided into two columns: date and time. The date is expressed using the regular expression \\d\\d-\\d\\d-\\d\\d\\d?\\d?, while the time is expressed using the regular expression \\d?\\d:\\d?\\d.

[0011] In one embodiment of the invention, the folder identifier is a fixed string DIR, but the information returned by older versions of VxWorks is DIR, a number, or plain characters, using regular expressions: <dir>|\\d+.

[0012] In one embodiment of the present invention, the filename in step S2 uses the regular expression: \\S.*.

[0013] In one embodiment of the present invention, the FTP list in step S3 is formatted as time-folder identifier|file size-file name, which constitutes the list information.

[0014] In one embodiment of the present invention, the process of the file transfer thread in step S4 includes traversal and comparison.

[0015] In one embodiment of the present invention, the timer time t in step S4 is equal to the buffer size M / the file size m. If the file transfer still exceeds the sending buffer size due to network delay, a disconnection and reconnection mechanism is implemented.

[0016] Compared with the prior art, the above-mentioned technical solution of the present invention has the following advantages: The FTP communication method for low-version VxWorks described in the present invention adopts intelligent file list identification, asynchronous folder download, transmission time delay, and disconnection reconnection mechanism, which can be compatible with FTP protocol communication for older devices to ensure the reliability of communication with devices and file transfer. At the same time, because the asynchronous processing of the FTP protocol is designed, the download folder function (or batch download file function) on the server side also needs to adopt an asynchronous method, thus solving the problem of folder download. Attached Figure Description

[0017] To make the content of this invention easier to understand, the invention will be further described in detail below with reference to specific embodiments and accompanying drawings.

[0018] Figure 1 This is a flowchart of the intelligent file list recognition process described in this invention;

[0019] Figure 2 This is a flowchart of the folder download function described in this invention;

[0020] Figure 3 This is a flowchart of the file transfer thread described in this invention;

[0021] Figure 4 This is a flowchart of the transmission time delay and disconnection reconnection mechanism described in this invention. Detailed Implementation

[0022] This embodiment provides an FTP communication method for older versions of VxWorks. The method employs mechanisms such as intelligent file list identification, asynchronous folder download, transmission time delay, and reconnection after disconnection to ensure reliable communication with the device and file transfer. The method includes the following steps:

[0023] Step S1: Determine and locate the file creation time information, and determine the folder flag bit;

[0024] Step S2: Locate the file size information and find the file name;

[0025] Step S3: Rearrange the searched information according to the general FTP list format and send it to the FTP receiving program for recognition;

[0026] Step S4: Simultaneously, a file transfer thread is set up to cyclically synchronize the command responses of the FTP server;

[0027] Step S5: A disconnection reconnection mechanism is provided, in which a timer is started after a file is successfully received, and the transfer of the next file is started again after the timer expires; otherwise, the current state is saved and the FTP server is reconnected to continue the file transfer, and the timer time is increased.

[0028] like Figure 1 The flowchart shown illustrates the intelligent file list recognition process. Currently, the common FTP list order is: (file creation time, folder identifier / file size, filename). However, older versions (before VxWorks 5.5) have different file list formats and varying orderes, making it impossible to use a single regular expression for identification. Therefore, a method for intelligent recognition is needed. After collecting all file lists, we divide them into several columns based on spaces, each column representing one piece of information. We need to extract four columns from these columns: filename, file creation time, file size, and folder identifier.

[0029] In steps S1-S2, the time information is the easiest to determine. However, because the list is separated by spaces, the time is mostly divided into two columns: date and time. The date format is basically fixed: (10-31-2022) or (10-31-22). We can use the regular expression (\\d\\d-\\d\\d-\\d\\d\\d?\\d?) to determine which column is the date. The time format is (15:38:16) or (03:38PM), etc., but the basic (hour:minute) is fixed. So we still use the regular expression (\\d?\\d:\\d?\\d) to determine the time column. In this way, we obtain the file creation time information.

[0030] Simultaneously, check the folder identifier, which is a fixed character (DIR). The presence of this character indicates that the file in that line is a folder. There are two possibilities: in some versions, this column might contain either (DIR) or a number, or it might be a plain string (DIR). Use regular expressions to check this. <dir>|\\d+) finds a column containing the (DIR) character, which is the folder identifier column.

[0031] To find the file size, we need to make a judgment first: if the folder identifier column found in the second step contains numbers, then this column is also the file size column; if it does not contain numbers, then find the column with only numbers, and this column is the folder size column.

[0032] Find the filename. All files will look like this: (filename).(file extension). If it's a folder, it will look like this: (folder name). You can then use the regular expression (\\S.*) to identify it.

[0033] Furthermore, when developing the batch file download (folder download) code, it was discovered that the FTP download process is asynchronous. This means that while your next command might have already been sent, the FTP server might still be executing the previous or even the command from before. Therefore, a sub-thread, the file transfer thread, was designed to synchronize the FTP server's command responses. Its flowchart is as follows... Figure 2 , 3 As shown.

[0034] In actual use, it was found that FTP disconnections occurred when transferring large amounts of files without delay. Research revealed this was due to an insufficiently small send buffer on the FTP server. However, reinstalling the FTP server on the actual equipment was difficult. Therefore, a file delay function was designed to limit the sending speed. After successfully receiving a file, a timer is started, with the timer duration t = buffer size M / file size m. After the timer expires, the next file transfer begins. If, due to network latency, the file transfer still exceeds the send buffer size, a reconnection mechanism is implemented: the current state is saved, the FTP server is reconnected, file transfer continues, and the timer duration is appropriately increased. The flowchart is as follows: Figure 4 As shown.

[0035] Obviously, the above embodiments are merely illustrative examples for clear explanation and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations here. However, obvious variations or modifications derived therefrom are still within the scope of protection of this invention.< / dir> < / dir>

Claims

1. An FTP communication method for low-version VxWorks, wherein the method employs mechanisms such as intelligent file list identification, asynchronous folder download, transmission time delay, and disconnection reconnection to ensure the reliability of communication with the device and file transfer, characterized in that... Includes the following steps: Step S1: Determine and search for the file creation time information, and determine the folder flag, where the folder flag is determined using a regular expression: <dir> |\\d+, the time information is divided into two columns: date and time. The date uses the regular expression \\d\\d-\\d\\d-\\d\\d\\d?\\d?, while the time also uses the regular expression \\d?\\d:\\d?\\d;< / dir> Step S2: Locate the file size information and the filename, where the filename uses the regular expression: \\S.*; Step S3: Rearrange the information found above into a list according to the general FTP list format and send it to the FTP receiving program for recognition. The FTP list format is composed of time-folder identifier|file size-filename. Step S4: Simultaneously, a file transfer thread is set up to cyclically synchronize the command responses of the FTP server; after successfully receiving a file, a timer is started, and the delay time t of the timer is calculated based on the send buffer size M of the VxWorks FTP server and the size m of the current file being transferred, where t = M / m; Step S5: A disconnection reconnection mechanism is provided, in which a timer is started after a file is successfully received, and the transfer of the next file is started again after the timer expires; otherwise, the current state is saved and the FTP server is reconnected to continue the file transfer, and the timer time is increased.

2. The FTP communication method for low-version VxWorks according to claim 1, characterized in that: The folder identifier is a fixed string DIR, but older versions of VxWorks send back information that is DIR, numbers, or plain characters.

3. The FTP communication method for low-version VxWorks according to claim 1, characterized in that: The process of the file transfer thread in step S4 includes traversal and comparison.

4. The FTP communication method for low-version VxWorks according to claim 1, characterized in that: If, in step S4, the file transfer still exceeds the sending buffer size during the transmission process due to network latency, a disconnection and reconnection mechanism will be implemented.