Method and system for implementing ftp client multi-file transfer based on libcurl and gateway device

By using libcurl and network gateway devices to build internal and external network data channels and utilizing thread pools to achieve multi-file transfer, the problems of high labor costs and low transmission efficiency under the traditional socket method are solved, and stable and efficient data transmission is achieved.

CN116708409BActive Publication Date: 2026-06-02BEIJING CHERILEAD TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING CHERILEAD TECH
Filing Date
2023-06-05
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing technologies use traditional sockets for FTP client file transfer in network gateway devices, resulting in high labor costs and the inability to transfer multiple files, which severely reduces data transfer efficiency and stability. Linux systems also lack standard technologies for batch transferring large files.

Method used

By using libcurl and a network gateway device, and by acquiring the server's communication protocol, an internal network data receiving channel and an external network data transmission channel are constructed. A thread pool is used to construct multi-file transfer tasks to achieve stable batch file transfer.

Benefits of technology

No need for manual socket creation, saving labor costs, enabling simultaneous transfer of multiple files, ensuring the security of the FTP server intranet, and improving data transmission efficiency and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116708409B_ABST
    Figure CN116708409B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on libcurl and gatekeeper equipment implementation ftp client multiple file transmission method and system, its method includes: obtaining the first communication protocol of the ftp server connected by target ftp client and the second communication protocol of data server to be received, data transmission request is sent to ftp server and data server to be received respectively based on the first communication protocol and second communication protocol by libcurl client, internal network data receiving channel and external network data transmission channel are constructed by gatekeeper equipment, multiple file transmission tasks are constructed using thread pool and call gatekeeper node receives batch files transmitted by target ftp client through internal network data receiving channel, and the batch files are uploaded to data server to be received through external network data transmission channel.The communication protocol of different servers can be used to realize the butt joint of server, and then lay the foundation for subsequent data transmission, without manual socket socket creation, greatly saving manpower cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data transmission technology, and in particular to a method and system for implementing multi-file transfer via FTP client based on libcurl and a network gateway device. Background Technology

[0002] Currently, in network gateway devices, traditional sockets can be used to implement FTP clients for file transfer. However, this method requires manual creation of sockets and data transmission, which not only incurs significant labor costs but also prevents the transfer of multiple files, severely reducing data transmission efficiency and stability. Furthermore, for network gateway devices, Linux systems lack a standard FTP client capable of batch transferring large files. Therefore, there is an urgent need for a method that enables fast and stable data transmission from FTP servers. Summary of the Invention

[0003] To address the problems mentioned above, this invention provides a method and system for implementing multi-file transfer on an FTP client based on libcurl and a network gateway device. This solves the problems mentioned in the background art, which not only greatly consume manpower but also cannot perform multi-file data transfer, severely reducing data transfer efficiency and stability.

[0004] A method for implementing multi-file transfer via FTP client based on libcurl and a network gateway device includes the following steps:

[0005] Obtain the first communication protocol of the FTP server to which the target FTP client is connected and the second communication protocol of the server from which the data to be received is received;

[0006] The libcurl client sends data transmission requests to the FTP server and the data server to be received based on the first and second communication protocols, respectively, and the network gateway device constructs an internal network data receiving channel and an external network data transmission channel.

[0007] A multi-file transfer task is constructed using a thread pool, and a network gateway node is invoked to receive batch files transferred by the target FTP client through the internal network data receiving channel;

[0008] The batch of files is uploaded to the data server to be received via an external network data transmission channel.

[0009] Preferably, the step of obtaining the first communication protocol of the FTP server to which the target FTP client is connected and the second communication protocol of the data server to be received includes:

[0010] Obtain the Dynamic Host Configuration Protocol (DHCP) of the FTP server to which the target FTP client is connected and the server to which the data is to be received, respectively;

[0011] Based on the dynamic host configuration protocol, a first preset communication protocol is determined, and a communication request is generated according to the first preset communication protocol and the communication request is sent to the data server to be received and the FTP server respectively.

[0012] The connection status of the data receiving server and the FTP server is detected. If the connection status of either server is online, the first preset communication protocol is confirmed as the first communication protocol or the second communication protocol.

[0013] If the connection status is offline, switch to the second preset communication protocol and reconnect until the connection status is confirmed to be online, then confirm the second preset communication protocol as the first communication protocol or the second communication protocol.

[0014] Preferably, the step of sending data transmission requests to the FTP server and the data receiving server respectively via the libcurl client based on the first and second communication protocols, and constructing an intranet data receiving channel and an extranet data transmission channel through the network gateway device, includes:

[0015] The libcurl client generates data transmission requests based on the first and second communication protocols and the protocol conversion file, and sends them to the FTP server and the data server to be received, respectively.

[0016] A data receiving webpage window is constructed based on the first communication protocol, and a data transmission webpage window is constructed based on the second communication protocol.

[0017] The network gateway device intercepts the internal network signal of the FTP server and the external network signal of the server receiving the data.

[0018] Based on the intercepted intranet network signals, an intranet data receiving channel is constructed in the data receiving webpage window;

[0019] An external network data transmission channel is constructed in the data transmission webpage window based on the intercepted external network signals.

[0020] Preferably, the step of constructing a multi-file transfer task using a thread pool and calling the network gateway node to receive batch files transferred by the target FTP client through the intranet data receiving channel includes:

[0021] The thread pool is used to construct a multi-file transfer task sequence based on the multi-task transfer requests sent by the target FTP client;

[0022] The target gateway node corresponding to each file transfer task sequence is determined based on the correspondence between the transmission service node, the task data transmission requirement data, and the transmission destination address data.

[0023] Deploy the intranet data receiving channel and target gateway node to each file transfer task sequence;

[0024] Receive batches of multi-type files from the target FTP client based on the deployed file transfer task sequence.

[0025] Preferably, uploading the batch files to the receiving data server via an external network data transmission channel includes:

[0026] Upload the batch files to the data cache of the external network data transmission channel;

[0027] Obtain the cached data of batch files from the data cache terminal and generate multiple upstream business data packets based on the cached data;

[0028] Obtain the data characteristics of each uplink service data packet, and generate a test file for the uplink service data packet based on the data characteristics;

[0029] The link quality of the external network data transmission channel is tested using the test file of each uplink service data packet, and the test results are obtained.

[0030] Based on the test results, the transmission parameters of the external network data transmission channel are optimized, and multiple uplink business data packets are uploaded to the data server to be received using the optimized external network data transmission channel.

[0031] A multi-file transfer system for FTP clients based on libcurl and a network gateway device, the system comprising:

[0032] The acquisition module is used to acquire the first communication protocol of the FTP server to which the target FTP client is connected and the second communication protocol of the server to which the data to be received is obtained.

[0033] The module is used to send data transmission requests to the FTP server and the data receiving server respectively through the libcurl client based on the first communication protocol and the second communication protocol, and to build an intranet data receiving channel and an extranet data transmission channel through the network gateway device;

[0034] The receiving module is used to construct multi-file transfer tasks using a thread pool and call the network gateway node to receive batch files transferred by the target FTP client through the intranet data receiving channel;

[0035] The upload module is used to upload the batch of files to the data server to be received via an external network data transmission channel.

[0036] Preferably, the acquisition module includes:

[0037] The first acquisition submodule is used to acquire the Dynamic Host Configuration Protocol (DHCP) of the FTP server to which the target FTP client is connected and the server to which the data is to be received, respectively.

[0038] The first generation submodule is used to determine a first preset communication protocol based on the dynamic host configuration protocol, generate a communication request according to the first preset communication protocol, and send the communication request to the data server to be received and the FTP server respectively.

[0039] The first confirmation submodule is used to detect the connection status of the data server to be received and the FTP server respectively. If the connection status of either server is online, the first preset communication protocol is confirmed as the first communication protocol or the second communication protocol.

[0040] The second confirmation submodule is used to switch to the second preset communication protocol and reconnect if the connection status is offline until the connection status is confirmed to be online, and to confirm the second preset communication protocol as the first communication protocol or the second communication protocol.

[0041] Preferably, the building module includes:

[0042] The second generation submodule is used to generate data transmission requests based on the first and second communication protocols and the protocol conversion file through the libcurl client and send them to the FTP server and the data server to be received, respectively.

[0043] The first construction submodule is used to construct a data receiving webpage window based on the first communication protocol, and at the same time, construct a data transmission webpage window based on the second communication protocol;

[0044] The interception submodule is used to intercept the internal network signal of the FTP server and the external network signal of the data server to be received through the network gateway device;

[0045] The second construction submodule is used to construct an intranet data receiving channel in the data receiving webpage window based on the intercepted intranet network signals.

[0046] The third submodule is used to build an external network data transmission channel in the data transmission webpage window based on the intercepted external network signals.

[0047] Preferably, the receiving module includes:

[0048] The fourth construction submodule is used to construct a multi-file transfer task sequence based on the multi-task transfer requests sent by the target FTP client using the thread pool;

[0049] The determination submodule is used to determine the target gateway node corresponding to each file transfer task sequence based on the correspondence between the transmission service node, task data transmission requirement data, and transmission destination address data.

[0050] The deployment submodule is used to deploy the intranet data receiving channel and the target network gateway node to each file transfer task sequence;

[0051] The receiving submodule is used to receive batches of multi-type files transmitted by the target FTP client according to the deployed file transfer task sequence.

[0052] Preferably, the upload module includes:

[0053] The first upload submodule is used to upload the batch files to the data cache end of the external network data transmission channel;

[0054] The second acquisition submodule is used to acquire the cached data of batch files from the data cache end and generate multiple uplink business data packets based on the cached data.

[0055] The third acquisition submodule is used to acquire the data characteristics of each uplink service data packet and generate a test file for the uplink service data packet based on the data characteristics.

[0056] The testing submodule is used to perform link quality tests on the external network data transmission channel using the test files of each uplink service data packet and obtain the test results;

[0057] The second upload submodule is used to optimize the transmission parameters of the external network data transmission channel based on the test results, and use the optimized external network data transmission channel to upload multiple uplink business data packets to the data server to be received.

[0058] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description and the accompanying drawings.

[0059] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0060] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof.

[0061] Figure 1 The flowchart illustrates the process of implementing a multi-file transfer method for FTP clients based on libcurl and a network gateway device, as provided in this invention.

[0062] Figure 2 Another flowchart of the method for implementing multi-file transfer of FTP clients based on libcurl and network gateway devices provided by the present invention;

[0063] Figure 3 This is a schematic diagram of the structure of the FTP client multi-file transfer system based on libcurl and a network gateway device provided by the present invention;

[0064] Figure 4 This is a schematic diagram of the acquisition module in the FTP client multi-file transfer system based on libcurl and network gateway devices provided by the present invention. Detailed Implementation

[0065] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0066] Currently, in network gateway devices, traditional sockets can be used to implement FTP client file transfer. However, this method requires manual creation of sockets for data transmission, which not only incurs significant labor costs but also prevents the transfer of multiple files, severely reducing data transmission efficiency and stability. Furthermore, for network gateway devices, Linux systems lack a standard FTP client capable of batch transferring large files. Therefore, a fast and stable data transmission method for FTP servers is urgently needed. To address these issues, this embodiment discloses a method for implementing multi-file transfer via FTP client using libcurl and network gateway devices.

[0067] A method for implementing multi-file transfer via FTP client based on libcurl and network gateway device, such as... Figure 1 As shown, it includes the following steps:

[0068] Step S101: Obtain the first communication protocol of the FTP server to which the target FTP client is connected and the second communication protocol of the server to which the data to be received is received;

[0069] Step S102: Send data transmission requests to the FTP server and the data server to be received respectively through the libcurl client based on the first communication protocol and the second communication protocol, and build an intranet data receiving channel and an extranet data transmission channel through the network gateway device;

[0070] Step S103: Use a thread pool to construct a multi-file transfer task and call the network gateway node to receive the batch files transferred by the target FTP client through the intranet data receiving channel;

[0071] Step S104: Upload the batch of files to the data server to be received via the external network data transmission channel.

[0072] In this embodiment, the target FTP client refers to a software client that performs operations such as downloading and uploading to the FTP server;

[0073] In this embodiment, the first communication protocol refers to the data communication protocol of the target FTP client;

[0074] In this embodiment, a data transmission request is defined as a request to transmit intranet data from the FTP server to the data server to be received.

[0075] In this embodiment, the intranet data receiving channel refers to a network channel for receiving data through the dedicated intranet of the FTP server;

[0076] In this embodiment, the external network data transmission channel refers to a network channel for data transmission via the external network;

[0077] In this embodiment, a multi-file transfer task is represented as a task pool that synchronously transfers multiple files simultaneously.

[0078] The working principle of the above technical solution is as follows: obtain the first communication protocol of the FTP server connected to the target FTP client and the second communication protocol of the data server to be received; send data transmission requests to the FTP server and the data server to be received respectively through the libcurl client based on the first and second communication protocols; construct an internal network data receiving channel and an external network data transmission channel through a network gateway device; construct a multi-file transfer task using a thread pool and call the network gateway node to receive the batch files transmitted by the target FTP client through the internal network data receiving channel; and upload the batch files to the data server to be received through the external network data transmission channel.

[0079] The beneficial effects of the above technical solution are as follows: By utilizing libcurl technology, server docking can be achieved according to the communication protocols of different servers, thus laying the foundation for subsequent data transmission. There is no need for manual socket creation, which greatly saves manpower costs. Furthermore, by constructing a multi-file transfer task to perform real-time data transmission through the intranet data receiving channel and the external network data transmission channel, multiple files can be transmitted simultaneously while ensuring the security of the FTP server's intranet. Stable data transmission is achieved without involving protocol interaction, improving data transmission efficiency and stability. This solves the problem in existing technologies that not only greatly consume manpower costs but also cannot perform multi-file data transmission, seriously reducing data transmission efficiency and stability.

[0080] In one embodiment, such as Figure 2 As shown, the step of obtaining the first communication protocol of the FTP server to which the target FTP client is connected and the second communication protocol of the data server to be received includes:

[0081] Step S201: Obtain the Dynamic Host Configuration Protocol (DHCP) of the FTP server connected to the target FTP client and the server receiving the data, respectively.

[0082] Step S202: Determine a first preset communication protocol based on the dynamic host configuration protocol, generate a communication request according to the first preset communication protocol, and send the communication request to the data server to be received and the FTP server respectively;

[0083] Step S203: Detect the connection status of the data receiving server and the FTP server respectively. If the connection status of either server is online, confirm the first preset communication protocol as the first communication protocol or the second communication protocol.

[0084] Step S204: If the connection status is offline, switch to the second preset communication protocol and reconnect until the connection status is confirmed to be online. Then, confirm the second preset communication protocol as the first communication protocol or the second communication protocol.

[0085] In this embodiment, the Dynamic Host Configuration Protocol (DIP) is represented by the dynamic network communication configuration protocols of the FTP server and the server receiving the data, respectively.

[0086] In this embodiment, the communication request is represented as a connection request to connect the data server to be received and the FTP server via a first communication protocol.

[0087] The beneficial effects of the above technical solution are as follows: by determining the preset communication protocol based on the dynamic host configuration protocol of the FTP server and the server receiving the data, the test protocol can meet the basic requirements of the two servers, improving adaptability. Furthermore, by determining the communication protocol of the two servers based on the connection status, the communication protocols of the two servers can be obtained quickly and intuitively, improving work efficiency.

[0088] In one embodiment, the step of sending data transmission requests to the FTP server and the data receiving server respectively via the libcurl client based on the first and second communication protocols, and constructing an intranet data receiving channel and an extranet data transmission channel through a network gateway device, includes:

[0089] The libcurl client generates data transmission requests based on the first and second communication protocols and the protocol conversion file, and sends them to the FTP server and the data server to be received, respectively.

[0090] A data receiving webpage window is constructed based on the first communication protocol, and a data transmission webpage window is constructed based on the second communication protocol.

[0091] The network gateway device intercepts the internal network signal of the FTP server and the external network signal of the server receiving the data.

[0092] Based on the intercepted intranet network signals, an intranet data receiving channel is constructed in the data receiving webpage window;

[0093] An external network data transmission channel is constructed in the data transmission webpage window based on the intercepted external network signals.

[0094] In this embodiment, the protocol conversion file is a configuration file that converts the first communication protocol and the second communication protocol into the same communication protocol.

[0095] In this embodiment, the data receiving webpage window is represented as a webpage display window for receiving data.

[0096] The beneficial effects of the above technical solution are as follows: by constructing separate data receiving web page windows and data transmission web page windows, it can be further ensured that the two servers do not need to directly connect to each other when interacting with data, thus ensuring network security and improving stability. Furthermore, by constructing data transmission channels and receiving channels, data receiving and transmission can be carried out more stably, further improving the stability, reliability, and practicality of data transmission.

[0097] In this embodiment, a data receiving webpage window is constructed based on the first communication protocol, and a data transmission webpage window is constructed based on the second communication protocol, including:

[0098] Load two initial interface windows for web page creation in the browser. Configure the data receiving function options and related web page parameters in one of the first initial interface windows, and configure the data transmission function options and related web page parameters in the other second initial interface window.

[0099] Select web page elements and their corresponding attribute information based on the configuration results;

[0100] Based on the web page elements and their corresponding attribute information, generate the window source data corresponding to the data receiving web page window and the data transmitting web page window, respectively.

[0101] The source data of the data receiving webpage window and the data transmitting webpage window are used to generate the webpage source code.

[0102] The network source code is encoded, and the encoding result is used to render the first initial interface window and the second initial interface window to generate an initial data receiving webpage window and an initial data transmission webpage window.

[0103] Obtain the IP addresses corresponding to the target FTP client and the data server to be received, respectively, and configure the data source hyperlink parameters of the initial data receiving webpage window and the initial data transmission webpage window according to the IP addresses, the first communication protocol and the second communication protocol;

[0104] After configuration, run the initial data receiving webpage window and the initial data transmission webpage window, and obtain their respective main processes during runtime;

[0105] Determine the current operation interface architecture of the main process of the initial data receiving web page window and the initial data transmission web page window during runtime;

[0106] Configure strings related to resource location parameters and resource call parameters for the current operation interface architecture;

[0107] Generate a target data receiving webpage window and a target data transmission webpage window based on the configured current user interface architecture.

[0108] The beneficial effects of the above technical solution are as follows: by configuring various parameters of the webpage window, it can ensure stable data transmission while accurately locating and connecting to the data source, thus improving the stability and reliability of data transmission. Furthermore, by configuring resource location parameters and resource call parameters related to the current operation interface architecture, the stability of the created webpage window during operation can be guaranteed, further improving its practicality.

[0109] In this embodiment, after establishing the intranet data receiving channel and the extranet data transmission channel, the following is also included:

[0110] Receive test data packets sent by the target FTP client and detect the total data volume of the test data packets;

[0111] The preset operating parameters of the intranet data receiving channel and the extranet data transmission channel are obtained respectively, and the data transmission efficiency and data transmission volume per unit time of the intranet data receiving channel and the extranet data transmission channel are determined according to the preset operating parameters.

[0112] The test data packets are transmitted through the intranet data receiving channel and the extranet data transmission channel respectively, and the transmission time of the test data packets in the intranet data receiving channel and the extranet data transmission channel is obtained respectively.

[0113] The data throughput of the internal network data receiving channel and the external network data transmission channel is calculated based on the transmission time of the test data packets in the internal network data receiving channel and the external network data transmission channel, the data transmission efficiency and data transmission volume per unit time of the internal network data receiving channel and the external network data transmission channel, and the total data volume of the test data packets.

[0114] ;

[0115] ;

[0116] in, This represents the data throughput of the intranet data receiving channel, and s represents the total data volume of the test data packets. This represents the amount of data transmitted per unit time in the intranet data receiving channel. This represents the transmission time of the test data packet in the intranet data receiving channel. This is represented as the first weighting factor, with a value of 0.6. This represents the data transmission efficiency of the intranet data receiving channel. This represents the data transmission gain coefficient of the intranet data receiving channel in its current startup state, which includes: slow startup state and fast startup state. This represents the delay coefficient of the intranet data receiving channel in unidirectional transmission mode. This is represented as the second weighting factor, with a value of 0.4. This represents the data throughput of the external network data transmission channel. This represents the amount of data transmitted per unit time through the external network data transmission channel. This represents the transmission time of the test data packet on the external network data transmission channel. This represents the data transmission efficiency of the external network data receiving channel. This represents the data transmission gain coefficient of the external network data receiving channel in its current startup state. The current startup state includes: slow startup state and fast startup state. This represents the delay coefficient of the external network data receiving channel in unidirectional transmission mode;

[0117] The probability of packet loss events for data transmission between the internal network data receiving channel and the external network data transmission channel is determined based on their respective data throughput.

[0118] The data transmission loss probability of the internal network data receiving channel and the external network data transmission channel is optimized based on their respective data transmission loss probability.

[0119] The beneficial effects of the above technical solution are as follows: by calculating the data throughput of the intranet data receiving channel and the extranet data transmission channel, the efficiency and stability of the two during data transmission can be intuitively evaluated. In this way, the two can be precisely optimized to ensure the stability, reliability and integrity of data transmission, thereby further improving practicality.

[0120] In one embodiment, the step of constructing a multi-file transfer task using a thread pool and calling a network gateway node to receive batch files transferred by the target FTP client through the internal network data receiving channel includes:

[0121] The thread pool is used to construct a multi-file transfer task sequence based on the multi-task transfer requests sent by the target FTP client;

[0122] The target gateway node corresponding to each file transfer task sequence is determined based on the correspondence between the transmission service node, the task data transmission requirement data, and the transmission destination address data.

[0123] Deploy the intranet data receiving channel and target gateway node to each file transfer task sequence;

[0124] Receive batches of multi-type files from the target FTP client based on the deployed file transfer task sequence.

[0125] In this embodiment, the multi-file transfer task sequence is represented as a sequence of task threads that transfer multiple files simultaneously;

[0126] In this embodiment, the transmission service node refers to the data transmission related working network node of the target FTP client and the data receiving backbone working node of the data receiving server;

[0127] In this embodiment, the task data transmission requirement data is represented as the network resource data, such as system resources, required to transmit a batch of files;

[0128] In this embodiment, the destination address data is represented as the IP address data of the intermediate data receiving station;

[0129] In this embodiment, the target gateway node refers to any one of the multiple data receiving nodes of the gateway device.

[0130] The beneficial effects of the above technical solution are as follows: by selecting a suitable network gateway node, the optimal network gateway node can be quickly determined according to the data type to be transmitted and the destination address data, thereby ensuring the stability and efficiency of data transmission and further improving practicality.

[0131] In one embodiment, uploading the batch of files to the receiving data server via an external network data transmission channel includes:

[0132] Upload the batch files to the data cache of the external network data transmission channel;

[0133] Obtain the cached data of batch files from the data cache terminal and generate multiple upstream business data packets based on the cached data;

[0134] Obtain the data characteristics of each uplink service data packet, and generate a test file for the uplink service data packet based on the data characteristics;

[0135] The link quality of the external network data transmission channel is tested using the test file of each uplink service data packet, and the test results are obtained.

[0136] Based on the test results, the transmission parameters of the external network data transmission channel are optimized, and multiple uplink business data packets are uploaded to the data server to be received using the optimized external network data transmission channel.

[0137] In this embodiment, the data cache end refers to the device end that caches batch files.

[0138] The beneficial effects of the above technical solution are as follows: by generating multiple uplink business data packets, batch files can be uploaded stably and orderly, further improving the stability of data transmission. Furthermore, by testing and optimizing the external network data transmission channel, it can be ensured that data will not be lost during transmission, thus improving the stability and reliability of data transmission.

[0139] This embodiment also discloses an FTP client multi-file transfer system based on libcurl and a network gateway device, such as... Figure 3 As shown, the system includes:

[0140] The acquisition module 301 is used to acquire the first communication protocol of the FTP server to which the target FTP client is connected and the second communication protocol of the data server to be received;

[0141] Module 302 is used to send data transmission requests to the FTP server and the data receiving server respectively through the libcurl client based on the first communication protocol and the second communication protocol, and to build an intranet data receiving channel and an extranet data transmission channel through the network gateway device;

[0142] The receiving module 303 is used to construct a multi-file transfer task using a thread pool and call the network gateway node to receive batch files transmitted by the target FTP client through the intranet data receiving channel;

[0143] The upload module 304 is used to upload the batch of files to the data server to be received via an external network data transmission channel.

[0144] The working principle of the above technical solution is as follows: First, the acquisition module obtains the first communication protocol of the FTP server connected to the target FTP client and the second communication protocol of the data server to be received. Then, the construction module uses the libcurl client to send a data receiving request based on the first communication protocol and builds an external network data transmission channel through the network gateway device. At the same time, an external network data transmission channel is built based on the second communication protocol and the network gateway device. Then, the receiving module uses a thread pool to build a multi-file transfer task and calls the network gateway node to receive the batch files transmitted by the target FTP client through the internal network data receiving channel. Finally, the upload module uploads the batch files to the data server to be received through the external network data transmission channel.

[0145] The beneficial effects of the above technical solution are as follows: By utilizing libcurl technology, server docking can be achieved according to the communication protocols of different servers, thus laying the foundation for subsequent data transmission. There is no need for manual socket creation, which greatly saves manpower costs. Furthermore, by constructing a multi-file transfer task to perform real-time data transmission through the intranet data receiving channel and the external network data transmission channel, multiple files can be transmitted simultaneously while ensuring the security of the FTP server's intranet. Stable data transmission is achieved without involving protocol interaction, improving data transmission efficiency and stability. This solves the problem in existing technologies that not only greatly consume manpower costs but also cannot perform multi-file data transmission, seriously reducing data transmission efficiency and stability.

[0146] In one embodiment, such as Figure 4 As shown, the acquisition module 301 includes:

[0147] The first acquisition submodule 3011 is used to acquire the Dynamic Host Configuration Protocol (DHCP) of the FTP server connected to the target FTP client and the data server to be received, respectively.

[0148] The first generation submodule 3012 is used to determine a first preset communication protocol based on the dynamic host configuration protocol, generate a communication request according to the first preset communication protocol, and send the communication request to the data server to be received and the FTP server respectively.

[0149] The first confirmation submodule 3013 is used to detect the connection status of the data server to be received and the FTP server respectively. If the connection status of either server is online, the first preset communication protocol is confirmed as the first communication protocol or the second communication protocol.

[0150] The second confirmation submodule 3014 is used to switch to the second preset communication protocol and reconnect if the connection status is offline until the connection status is confirmed to be online, and to confirm the second preset communication protocol as the first communication protocol or the second communication protocol.

[0151] The beneficial effects of the above technical solution are as follows: by determining the preset communication protocol based on the dynamic host configuration protocol of the FTP server and the server receiving the data, the test protocol can meet the basic requirements of the two servers, improving adaptability. Furthermore, by determining the communication protocol of the two servers based on the connection status, the communication protocols of the two servers can be obtained quickly and intuitively, improving work efficiency.

[0152] In one embodiment, the building module includes:

[0153] The second generation submodule is used to generate data transmission requests based on the first and second communication protocols and the protocol conversion file through the libcurl client and send them to the FTP server and the data server to be received, respectively.

[0154] The first construction submodule is used to construct a data receiving webpage window based on the first communication protocol, and at the same time, construct a data transmission webpage window based on the second communication protocol;

[0155] The interception submodule is used to intercept the internal network signal of the FTP server and the external network signal of the data server to be received through the network gateway device;

[0156] The second construction submodule is used to construct an intranet data receiving channel in the data receiving webpage window based on the intercepted intranet network signals.

[0157] The third submodule is used to build an external network data transmission channel in the data transmission webpage window based on the intercepted external network signals.

[0158] The beneficial effects of the above technical solution are as follows: by constructing separate data receiving web page windows and data transmission web page windows, it can be further ensured that the two servers do not need to directly connect to each other when interacting with data, thus ensuring network security and improving stability. Furthermore, by constructing data transmission channels and receiving channels, data receiving and transmission can be carried out more stably, further improving the stability, reliability, and practicality of data transmission.

[0159] In one embodiment, the receiving module includes:

[0160] The fourth construction submodule is used to construct a multi-file transfer task sequence based on the multi-task transfer requests sent by the target FTP client using the thread pool;

[0161] The determination submodule is used to determine the target gateway node corresponding to each file transfer task sequence based on the correspondence between the transmission service node, task data transmission requirement data, and transmission destination address data.

[0162] The deployment submodule is used to deploy the intranet data receiving channel and the target network gateway node to each file transfer task sequence;

[0163] The receiving submodule is used to receive batches of multi-type files transmitted by the target FTP client according to the deployed file transfer task sequence.

[0164] The beneficial effects of the above technical solution are as follows: by selecting a suitable network gateway node, the optimal network gateway node can be quickly determined according to the data type to be transmitted and the destination address data, thereby ensuring the stability and efficiency of data transmission and further improving practicality.

[0165] In one embodiment, the upload module includes:

[0166] The first upload submodule is used to upload the batch files to the data cache end of the external network data transmission channel;

[0167] The second acquisition submodule is used to acquire the cached data of batch files from the data cache end and generate multiple uplink business data packets based on the cached data.

[0168] The third acquisition submodule is used to acquire the data characteristics of each uplink service data packet and generate a test file for the uplink service data packet based on the data characteristics.

[0169] The testing submodule is used to perform link quality tests on the external network data transmission channel using the test files of each uplink service data packet and obtain the test results;

[0170] The second upload submodule is used to optimize the transmission parameters of the external network data transmission channel based on the test results, and use the optimized external network data transmission channel to upload multiple uplink business data packets to the data server to be received.

[0171] The beneficial effects of the above technical solution are as follows: by generating multiple uplink business data packets, batch files can be uploaded stably and orderly, further improving the stability of data transmission. Furthermore, by testing and optimizing the external network data transmission channel, it can be ensured that data will not be lost during transmission, thus improving the stability and reliability of data transmission.

[0172] Those skilled in the art should understand that the "first" and "second" in this invention simply refer to different application stages.

[0173] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0174] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A method for implementing multi-file transfer via FTP client based on libcurl and a network gateway device, characterized in that, Includes the following steps: Obtain the first communication protocol of the FTP server to which the target FTP client is connected and the second communication protocol of the server from which the data to be received is received; The libcurl client sends data transmission requests to the FTP server and the data server to be received based on the first and second communication protocols, respectively, and the network gateway device constructs an internal network data receiving channel and an external network data transmission channel. A multi-file transfer task is constructed using a thread pool, and a network gateway node is invoked to receive batch files transferred by the target FTP client through the internal network data receiving channel; The batch of files is uploaded to the data server to be received via an external network data transmission channel; The step of sending data transmission requests to the FTP server and the data receiving server respectively via the libcurl client based on the first and second communication protocols, and constructing an internal network data receiving channel and an external network data transmission channel through a network gateway device, includes: The libcurl client generates data transmission requests based on the first and second communication protocols and the protocol conversion file, and sends them to the FTP server and the data server to be received, respectively. A data receiving webpage window is constructed based on the first communication protocol, and a data transmission webpage window is constructed based on the second communication protocol. The network gateway device intercepts the internal network signal of the FTP server and the external network signal of the server receiving the data. Based on the intercepted intranet network signals, an intranet data receiving channel is constructed in the data receiving webpage window; An external network data transmission channel is constructed in the data transmission webpage window based on the intercepted external network signals.

2. The method for implementing multi-file transfer of FTP clients based on libcurl and network gateway devices according to claim 1, characterized in that, The process of obtaining the first communication protocol of the FTP server to which the target FTP client is connected and the second communication protocol of the server to which the data to be received includes: Obtain the dynamic network configuration information of the FTP server to which the target FTP client is connected and the server to which the data is to be received, respectively; Based on the dynamic network configuration information, a first preset communication protocol is determined, and a communication request is generated according to the first preset communication protocol. The communication request is then sent to the data server to be received and the FTP server respectively. The connection status of the data receiving server and the FTP server is detected. If the connection status of either server is online, the first preset communication protocol is confirmed as the first communication protocol or the second communication protocol. If the connection status is offline, switch to the second preset communication protocol and reconnect until the connection status is confirmed to be online, then confirm the second preset communication protocol as the first communication protocol or the second communication protocol.

3. The method for implementing multi-file transfer of FTP clients based on libcurl and network gateway devices according to claim 1, characterized in that, The process of constructing a multi-file transfer task using a thread pool and calling the network gateway node to receive batch files transferred by the target FTP client through the internal network data receiving channel includes: The thread pool is used to construct a multi-file transfer task sequence based on the multi-task transfer requests sent by the target FTP client; The target gateway node corresponding to each file transfer task sequence is determined based on the correspondence between the transmission service node, the task data transmission requirement data, and the transmission destination address data. Deploy the intranet data receiving channel and target gateway node to each file transfer task sequence; Receive batches of multi-type files from the target FTP client based on the deployed file transfer task sequence.

4. The method for implementing multi-file transfer of FTP clients based on libcurl and network gateway devices according to claim 1, characterized in that, The step of uploading the batch files to the receiving data server via an external network data transmission channel includes: Upload the batch files to the data cache of the external network data transmission channel; Obtain the cached data of batch files from the data cache terminal and generate multiple upstream business data packets based on the cached data; Obtain the data characteristics of each uplink service data packet, and generate a test file for the uplink service data packet based on the data characteristics; The link quality of the external network data transmission channel is tested using the test file of each uplink service data packet, and the test results are obtained. Based on the test results, the transmission parameters of the external network data transmission channel are optimized, and multiple uplink business data packets are uploaded to the data server to be received using the optimized external network data transmission channel.

5. A multi-file transfer system for FTP clients based on libcurl and a network gateway device, characterized in that, The system includes: The acquisition module is used to acquire the first communication protocol of the FTP server to which the target FTP client is connected and the second communication protocol of the server to which the data to be received is obtained. The module is used to send data transmission requests to the FTP server and the data receiving server respectively through the libcurl client based on the first communication protocol and the second communication protocol, and to build an intranet data receiving channel and an extranet data transmission channel through the network gateway device; The receiving module is used to construct multi-file transfer tasks using a thread pool and call the network gateway node to receive batch files transferred by the target FTP client through the intranet data receiving channel; The upload module is used to upload the batch files to the data server to be received via an external network data transmission channel. The building module includes: The second generation submodule is used to generate data transmission requests based on the first and second communication protocols and the protocol conversion file through the libcurl client and send them to the FTP server and the data server to be received, respectively. The first construction submodule is used to construct a data receiving webpage window based on the first communication protocol, and at the same time, construct a data transmission webpage window based on the second communication protocol; The interception submodule is used to intercept the internal network signal of the FTP server and the external network signal of the data server to be received through the network gateway device; The second construction submodule is used to construct an intranet data receiving channel in the data receiving webpage window based on the intercepted intranet network signals. The third submodule is used to build an external network data transmission channel in the data transmission webpage window based on the intercepted external network signals.

6. The FTP client multi-file transfer system based on libcurl and network gateway device as described in claim 5, characterized in that, The acquisition module includes: The first acquisition submodule is used to acquire the dynamic network configuration information of the FTP server to which the target FTP client is connected and the data server to which the data is to be received, respectively. The first generation submodule is used to determine a first preset communication protocol based on the dynamic network configuration information, generate a communication request according to the first preset communication protocol, and send the communication request to the data server to be received and the FTP server respectively. The first confirmation submodule is used to detect the connection status of the data server to be received and the FTP server respectively. If the connection status of either server is online, the first preset communication protocol is confirmed as the first communication protocol or the second communication protocol. The second confirmation submodule is used to switch to the second preset communication protocol and reconnect if the connection status is offline until the connection status is confirmed to be online, and to confirm the second preset communication protocol as the first communication protocol or the second communication protocol.

7. The FTP client multi-file transfer system based on libcurl and network gateway device as described in claim 5, characterized in that, The receiving module includes: The fourth construction submodule is used to construct a multi-file transfer task sequence based on the multi-task transfer requests sent by the target FTP client using the thread pool; The determination submodule is used to determine the target gateway node corresponding to each file transfer task sequence based on the correspondence between the transmission service node, task data transmission requirement data, and transmission destination address data. The deployment submodule is used to deploy the intranet data receiving channel and the target network gateway node to each file transfer task sequence; The receiving submodule is used to receive batches of multi-type files transmitted by the target FTP client according to the deployed file transfer task sequence.

8. The FTP client multi-file transfer system based on libcurl and network gateway device as described in claim 5, characterized in that, The upload module includes: The first upload submodule is used to upload the batch files to the data cache end of the external network data transmission channel; The second acquisition submodule is used to acquire the cached data of batch files from the data cache end and generate multiple uplink business data packets based on the cached data. The third acquisition submodule is used to acquire the data characteristics of each uplink service data packet and generate a test file for the uplink service data packet based on the data characteristics. The testing submodule is used to perform link quality tests on the external network data transmission channel using the test files of each uplink service data packet and obtain the test results; The second upload submodule is used to optimize the transmission parameters of the external network data transmission channel based on the test results, and use the optimized external network data transmission channel to upload multiple uplink business data packets to the data server to be received.