Wide area network connection method and system of FTP (File Transfer Protocol)
By introducing FTP bridging system and intranet penetration system into the FTP system, the problem of difficulty in remote upgrading and operation and maintenance of FTP devices in the prior art is solved, cross-network FTP file transmission is realized, and operation and maintenance efficiency and security are improved.
Patent Information
- Application Number
- CN202411993949.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2044-12-31
AI Technical Summary
It is difficult for the existing technology to effectively upgrade and operate and maintain tools and terminal equipment that use the FTP protocol through remote means, and existing equipment cannot use the new protocol.
By deploying the FTP bridging system and the intranet penetration system, cross-network file transmission between the FTP client and the FTP server is realized, which is suitable for existing FTP devices.
Remote file transfer of FTP protocol is realized, operation and maintenance efficiency is improved, operation security of power equipment is enhanced, and compatibility issues are avoided.
Smart Images

Figure CN119922180A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Internet communication, and in particular to a wide area network connection method and system of FTP protocol. Background Art
[0002] The intranet penetration system is mainly composed of the intranet penetration client and the intranet penetration server. Usually, the server is deployed on a cloud server with a public IP address, and the client is deployed on the machine where the intranet service that needs to be penetrated is located. Since the intranet service lacks a public IP address, it cannot be directly accessed by non-LAN clients. However, the client can access the intranet penetration server, and the intranet penetration system will route the client request to the corresponding intranet machine according to the requested port or other information, thereby achieving communication.
[0003] FTP (File Transfer Protocol) is an application layer protocol for transferring files between a client and a server on a computer network. Unlike common application layer protocols (such as http) that only require one TCP connection, FTP requires two TCP connections to complete file transfer. One is called a control connection and the other is called a data connection. FTP supports active mode and passive mode. The active mode has great limitations and is not within the scope of this invention. The passive mode means that the client requests the server to execute the passive mode by sending a PASV instruction. The server will allocate a random port and respond to the port to the client. After the client receives the data connection port, it establishes a data connection to the server. It can be seen that in passive mode, both the control connection and the data connection are initiated by the client, and there will be no firewall problems. Therefore, passive mode is also a more commonly used mode for FTP.
[0004] FTP is still the main way to change the configuration and upgrade the firmware of many power terminal devices. For the on-site maintenance of current FTP devices, the following methods are usually used:
[0005] 1. Send the files that need to be updated to the on-site personnel, and then the on-site personnel download the files to the on-site FTP device through the LAN. The problem with this method is that file transfer requires manual transfer, which is inefficient.
[0006] 2. Expand the FTP protocol of the device to meet the requirements of intranet penetration. However, this method requires modifying the existing FTP server and client programs, and because of the addition of customized elements, it may cause some compatibility issues in the future.
[0007] 3. Replace the FTP protocol of the device with the SFTP protocol. This method can not only meet the requirements of intranet penetration, but also improve the security of transmission. However, the existing FTP devices cannot use this method.
[0008] In summary, these tools and terminal devices using the FTP protocol are difficult to upgrade and maintain remotely. Summary of the invention
[0009] The purpose of the present invention is to provide a wide area network connection method and system for the FTP protocol in view of the above-mentioned problems and shortcomings, and to realize remote file transfer of the standard FTP protocol by building a bridging system, so that it can be applicable to the current existing FTP devices.
[0010] The technical solution of the present invention is achieved in this way:
[0011] The WAN connection method of the FTP protocol described in the present invention is characterized by comprising the following steps:
[0012] Deploy an intranet penetration server and an FTP bridge server on a cloud server with a public IP; deploy two intranet penetration clients and an FTP bridge client on the intranet machine; start the FTP bridge client and establish a connection with the FTP bridge server, and request the remote control port, remote data port and remote control mapping port from the FTP bridge server; after receiving the request response, the FTP bridge client starts the first intranet penetration client according to the requested remote control port and establishes an FTP control connection tunnel; the FTP bridge server initiates an FTP control connection to the intranet penetration server to establish a control connection with the FTP server through intranet penetration; start the FTP client, the FTP client After startup, it initiates a connection to the control mapping port assigned by the FTP bridge server; the FTP bridge server monitors the interactive messages between the FTP client and the FTP server, intercepts the passive mode response message sent by the FTP server, records the randomly generated data service port in the response message, and sends the data service port information to the FTP bridge client; after modifying the IP address and data service port in the response message, the modified message is sent to the FTP client; the FTP bridge client starts the second intranet penetration client according to the data service port and the requested remote control port, establishes an FTP data connection tunnel, and realizes routing the data connection initiated by the FTP client to the FTP server.
[0013] In some embodiments, the steps of starting the FTP bridge client and establishing a connection with the FTP bridge server, and requesting the remote control port and the remote data port from the FTP bridge server include the following steps: after starting the FTP bridge client, the FTP bridge client initiates a connection to the FTP bridge server; after the connection is successful, the FTP bridge client requests the remote control port, the remote data port and the remote control mapping port from the FTP bridge server; the FTP bridge server determines whether there is an available remote port; if not, it returns an end instruction to the FTP bridge client; if so, it allocates a corresponding remote port response to the FTP bridge client.
[0014] In some embodiments, the FTP bridge server initiates a control connection to the intranet penetration server to establish a control connection with the FTP server through intranet penetration, including the following steps: the first intranet penetration client notifies the FTP bridge server after startup is completed; the FTP bridge server initiates an FTP control connection to the remote control port requested by the FTP bridge client; the intranet penetration system routes the FTP control connection to the FTP server, thereby establishing a control connection between the FTP bridge server and the FTP server.
[0015] In some embodiments, after the steps of starting the FTP bridge client and establishing a connection with the FTP bridge server, and requesting the remote control port, the remote data port and the remote control mapping port from the FTP bridge server, the following steps are also included: after the FTP bridge server responds to the requested remote control mapping port, the FTP bridge client displays the remote control mapping port on the interface.
[0016] Furthermore, the FTP client is started, and the step of initiating a connection to the control mapping port assigned by the FTP bridge server after the FTP client is started includes the following steps: the FTP bridge server starts to monitor the remote control mapping port after establishing a control connection with the FTP server; after the remote terminal obtains the remote control mapping port number, it starts the FTP client with the IP address of the cloud server and the remote control mapping port as configuration; after the FTP client is started, it initiates a connection to the control mapping port assigned by the FTP bridge server; after the connection is successful, the FTP protocol control message interaction begins.
[0017] In some embodiments, the FTP bridge server monitors the interactive messages between the FTP client and the FTP server, intercepts the passive mode response message sent by the FTP server, records the data service port in the response message, and sends the data service port information to the FTP bridge client. The steps include: the FTP bridge server continuously monitors the interactive messages between the FTP client and the FTP server; each time a passive mode request message from the FTP client is monitored, it is determined whether it is "PASV"; if not, the message is forwarded and returned to continue monitoring; if so, the passive mode response message sent by the FTP server is intercepted, the IP address in the response message and the data service port randomly assigned by the FTP server are extracted; the data service port in the response message is recorded, and the data service port information is sent to the FTP bridge client.
[0018] In some embodiments, after modifying the IP address and data service port in the message, the step of sending the modified message to the FTP client includes the following steps: modifying the IP address in the reply message to the public IP address of the cloud server; modifying the data service port number in the message to the remote data port allocated by the FTP bridge server to the FTP bridge client; and finally forwarding the modified message to the FTP client.
[0019] In some embodiments, the FTP bridge client starts a second intranet penetration client according to the data service port and the requested remote control port, establishes an FTP data connection tunnel, and implements the step of routing the data connection initiated by the FTP client to the FTP server, including the following steps: after the FTP bridge client receives the data service port sent by the FTP bridge server, it starts a second intranet penetration client with the data service port and the requested remote control port to establish an FTP data connection tunnel; after the control message interaction is completed, the FTP client initiates a data connection to the remote data port of the cloud server according to the modified message content; the intranet penetration system routes the data connection initiated by the FTP client to the FTP server, and the FTP data connection is now established.
[0020] The present invention also provides a wide area network connection system of FTP protocol, which is characterized by comprising: an FTP client, which is arranged on a remote terminal; an FTP server, which is deployed on a power terminal device and is used to send a passive mode response message and allocate a data service port; an FTP bridge server, which is deployed on a cloud server with a public network IP and is used to bridge the FTP client and establish a control connection with the FTP server through an intranet penetration method; an FTP bridge client, which is deployed on an intranet machine and is used to initiate a connection to the FTP bridge server and request a remote control port, a remote data port and a remote control mapping port from the FTP bridge server; a first intranet penetration client , deployed on the intranet machine, started with the remote control port requested by the FTP bridge client as the configuration, and established an FTP control connection tunnel; the intranet penetration server is deployed on a cloud server with a public IP. After the first intranet penetration client is started, the FTP bridge server initiates a control connection to the intranet penetration server; the second intranet penetration client is deployed on the intranet machine, started with the remote control port requested by the FTP bridge client and the data service port randomly generated in the passive mode response message of the FTP server as the configuration, and established an FTP data connection tunnel to realize routing of the data connection initiated by the FTP client to the FTP server.
[0021] In some embodiments, the FTP bridge server includes a port management module, a message interaction module and an FTP control message monitoring module; the port management module is used to allocate an available remote control port, a remote control mapping port and a remote data port to the FTP bridge client; the message interaction module is used to exchange information with the FTP client; the FTP message monitoring module is used to establish two connections with the FTP server and the FTP client respectively, and monitor and exchange request and response messages in the two connections in an intermediary manner, and is used to intercept passive mode response messages and modify the IP address and data service port in the message and then forward the modified response message to the FTP client; the FTP bridge client is divided into a port application module, a message transmission module and an intranet penetration control module; the message interaction module is used to establish a connection with the FTP server; the port application module requests a remote port from the FTP server through the message interaction module; the intranet penetration control module is used to start a first intranet penetration client and a second intranet penetration client.
[0022] The beneficial effects of the present invention are:
[0023] (1) The present invention deploys a set of FTP bridging system, and cooperates with the intranet penetration system to realize cross-network file transmission between the FTP client and the FTP server through the FTP protocol; therefore, the method can realize remote upgrade and operation and maintenance operations, which greatly improves efficiency.
[0024] (2) Through the wide area connection method of the present invention, the manufacturer no longer needs to disclose the login username and password of the FTP client of the equipment to the on-site operation and maintenance personnel, nor does it need to send the equipment firmware or configuration files to the on-site operation and maintenance personnel; the on-site operation and maintenance personnel only need to run the FTP bridge client, and the manufacturer's technicians can directly perform file operations on the on-site equipment with an FTP server through the FTP client, thereby greatly increasing the operating safety of the power equipment.
[0025] (3) The wide area connection method of the present invention does not require modification of the FTP protocol, so there is no compatibility problem. In addition, the wide area connection method of the present invention can be combined with other tools and methods to perform remote operation and maintenance on existing FTP devices, and has strong applicability.
[0026] The present invention will be further described below in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 The first embodiment of the WAN connection method of the FTP protocol of the present invention is a flow chart;
[0028] Figure 2 A flow chart of a second embodiment of the WAN connection method of the FTP protocol of the present invention;
[0029] Figure 3 The third embodiment of the WAN connection method of the FTP protocol of the present invention is a flow chart;
[0030] Figure 4 The fourth embodiment of the WAN connection method of the FTP protocol of the present invention is a flow chart;
[0031] Figure 5 The fifth embodiment of the WAN connection method of the FTP protocol of the present invention is a flow chart;
[0032] Figure 6 It is a structural block diagram of the wide area network connection system of the FTP protocol of the present invention;
[0033] Figure 7 It is a connection structure block diagram of the FTP bridge client and the FTP bridge server of the present invention. DETAILED DESCRIPTION
[0034] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0035] The terms "first", "second", "third", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described in the drawings. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0036] In the description of the present invention, unless otherwise specified, "plurality" means two or more.
[0037] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.
[0038] The present invention deploys a set of FTP bridging system and a set of intranet penetration system, which can realize cross-network file transmission between FTP client and FTP server through FTP protocol. Figure 6 As shown, a set of FTP bridging system of the present invention includes an FTP bridging client and an FTP bridging server, and a set of intranet penetration system of the present invention includes two intranet penetration clients and an intranet penetration server.
[0039] The WAN connection method and system of the FTP protocol of the present invention are described below in conjunction with the accompanying drawings. The description order of the following embodiments is not intended to limit the preferred order of the embodiments.
[0040] Embodiment 1
[0041] like Figure 1 As shown, Figure 1 The first embodiment of the WAN connection method of the FTP protocol of the present invention is a flow chart. The WAN connection method of the FTP protocol includes:
[0042] S101. Deploy an intranet penetration server and an FTP bridge server on a cloud server with a public IP.
[0043] Public IP refers to a unique identifier on the Internet, through which external networks can identify and communicate with the device. A cloud server with a public IP means that the cloud server is assigned a public IP address that can uniquely identify its location on the Internet, which allows external users to directly access the intranet penetration server and FTP bridge server on the cloud server through the IP address.
[0044] S102. Deploy two intranet penetration clients and an FTP bridge client on the intranet machine.
[0045] It can be understood that the intranet machine can be the FTP service device itself, as long as the FTP service device itself has certain computing power and operating system support to meet the needs of running the intranet penetration client and FTP bridge client software; the intranet machine can also be a terminal device such as a computer or tablet, which is connected to the FTP service device through a local area network or other means, and the intranet penetration client and FTP bridge client are installed on the terminal device.
[0046] The present invention deploys two intranet penetration clients in total, wherein the first intranet penetration client is responsible for opening the control connection, and the second intranet penetration client is responsible for the data connection. Since the port of the control connection is fixed (usually port 21), the configuration parameters of the intranet penetration client responsible for opening the control connection can be determined in advance. However, since the port of the data connection is negotiated through the FTP protocol after the control connection is successful, it is impossible to determine the configuration parameters in advance. Only when the FTP bridge service end monitors the port negotiation message and notifies the FTP bridge client of information such as the data service port, the FTP client can generate the intranet penetration configuration file of the data connection, and use this as a parameter to start the second intranet penetration client for remote data connection.
[0047] S103, starting the FTP bridge client and establishing a connection with the FTP bridge server, and requesting the FTP bridge server for a remote control port, a remote data port, and a remote control mapping port.
[0048] Understandably, the FTP bridge client can be started by the on-site personnel where the FTP service equipment is located, or it can be started by unattended self-testing. However, in the power field, general power equipment is not allowed to connect to the Internet, so it is usually started manually, such as the on-site personnel using the account and password to start the FTP bridge client. After starting the FTP bridge client, the FTP bridge client can connect to the FTP bridge server of the cloud server.
[0049] When the FTP bridge client sends a port request to the FTP bridge server, the FTP bridge server will determine whether it has an available remote port. If not, the FTP bridge server can either let the FTP bridge client continue to wait until an available remote port is available and then respond to the FTP bridge client, or directly return an end instruction to the FTP bridge client, informing the FTP bridge client that there is no available remote port and waiting for the next request from the FTP bridge client. If so, the corresponding number of remote ports will be allocated and then respond to the FTP bridge client.
[0050] There are three ports requested by the FTP bridge client. The requested remote control port is the port used to start the first intranet penetration client, the requested remote data port is the port used to start the second intranet penetration client, and the requested remote control mapping port is the port used to start the FTP client.
[0051] S104, after receiving the request response, the FTP bridge client starts the first intranet penetration client according to the requested remote control port and establishes an FTP control connection tunnel.
[0052] After receiving the port response from the FTP bridge server, the FTP bridge client will save these ports. The saving here is temporary, so that the FTP bridge client can display these ports, making it convenient for on-site personnel to obtain the port information and convey it to remote technicians, allowing remote technicians to log in to the on-site FTP device through the remote port.
[0053] Start the first intranet penetration client so that the FTP bridge server can connect to the FTP server through the remote control port, that is, a control connection tunnel is established. Its essence is that the intranet penetration system makes a port mapping from the public network to the intranet.
[0054] S105. The FTP bridging server initiates an FTP control connection to the intranet penetration server to establish a control connection with the FTP server via the intranet penetration method.
[0055] The timing for the FTP bridge server to initiate an FTP control connection to the intranet penetration server can be after a preset time interval after the FTP bridge client starts the first intranet penetration client; or it can be after receiving the notification that the first intranet penetration client has been started. This ensures that the first intranet penetration client has been started and the FTP control connection tunnel has been successfully established, and there will be no program error problem of initiating an FTP control connection again when the first intranet penetration client fails to start.
[0056] The FTP server of the present invention no longer directly establishes a control connection with the FTP client, but the FTP server is connected to the intranet penetration system. After the FTP control connection initiated by the FTP bridge server to the intranet penetration server is successful, an indirect control connection can be established between the FTP bridge server and the FTP server, that is, the control connection established by the FTP bridge server with the FTP server through the intranet penetration method.
[0057] S106, starting the FTP client, and after starting, initiating a connection to the control mapping port allocated by the FTP bridge server.
[0058] The FTP client is set on the remote terminal, that is, on the terminal device such as the computer or tablet of the manufacturer's technicians, so that the manufacturer's technicians can directly control the on-site FTP service equipment from the remote end to upgrade or maintain the FTP service equipment. With this design, the manufacturer does not need to disclose the login username and password of the FTP client of the equipment to the on-site personnel of the FTP service equipment, so the safety of the operation of the power equipment can be guaranteed.
[0059] The FTP client can be started by firstly informing the remote manufacturer's technician of the remote control mapping port number displayed on the interface of the FTP bridge client by the on-site personnel, and the manufacturer's technician uses the IP address of the cloud server and the remote control mapping port as the configuration, and then starts the FTP client, so that the manufacturer's technician can directly operate the files in the on-site FTP service device. Of course, the remote control mapping port number can also be encrypted and hidden (such as indicated by an asterisk), and then the on-site personnel sends the remote control mapping port number to the remote manufacturer's technician, and the terminal device of the manufacturer's technician displays the number of the remote control mapping port number after receiving the encrypted remote control mapping port number and decrypting it; it can also be prompted by an indicator button, that is, when the FTP bridge client receives the remote control mapping port response from the FTP bridge server, an indicator button will light up or flash, etc., and the on-site personnel only need to click the indicator button to send the remote control mapping port to the manufacturer's technician.
[0060] S107, the FTP bridge server monitors the interactive messages between the FTP client and the FTP server, intercepts the passive mode response message sent by the FTP server, records the randomly generated data service port in the response message, and sends the data service port information to the FTP bridge client.
[0061] There are many kinds of interactive messages between the FTP client and the FTP server, including control connection messages, data connection messages, and other messages in the interactive process (such as status messages, error messages, etc.). Among them, the control connection refers to the connection used to transmit control information (commands and responses) in the FTP session, which usually uses TCP port 21. Common control connection messages include USER, PASS, PORT, PASV, etc. In this embodiment, the request message that the FTP bridge server monitors from the FTP client is mainly a control connection message. When the FTP bridge server monitors the request message from the FTP client, it will determine whether it is "PASV", that is, whether it is a passive mode request. If so, the FTP bridge server intercepts the passive mode response message sent by the FTP server; if not, it returns to continue monitoring. If the message monitored by the FTP bridge server is a message other than the "passive mode response message", the FTP bridge server will act as an intermediary to forward these messages between the FTP client and the FTP server.
[0062] The reply message will be accompanied by a data service port, which is a local data port and is randomly generated. It is an arbitrary non-privileged port (usually P>1024) opened by the FTP server. Specifically, the FTP server will randomly generate a group of numbers based on its local IP as the port number, and then attach it to the reply message. For example: the local IP of the FTP server is 192.168.1.230, then the passive mode request reply message is: "227 Entering Passive Mode (192,168,1,230,169,71).\r\n". Among them, "169,71" means that the FTP server randomly assigns port 16971 as the data connection port.
[0063] S108: After modifying the IP address and data service port in the response message, send the modified message to the FTP client.
[0064] In addition to the data service port, the response message also contains the IP address of the FTP server.
[0065] The prior art is that after the FTP server opens the data service port, the data service port number is sent to the FTP client as part of the response message through the command link. The present invention, however, intercepts the response message through the FTP bridge server and obtains the IP address and the data service port, and then modifies the response message, modifies the IP address to the public IP address of the cloud server, and modifies the data service port number to the remote data port assigned by the FTP bridge server to the FTP bridge client. Specifically, the FTP bridge server parses the basic structure of the response message and finds the IP address and data service port in the response message; modifies all IP addresses found in the response message to the public IP address of the cloud server, and modifies all data service port numbers found in the response message to the remote data port number; generates a new FTP response message based on the modified fields; then verifies and ensures that the new response message contains the correct status code, message text, and the modified IP address and remote data port; and finally sends it to the FTP client.
[0066] S109, the FTP bridge client starts a second intranet penetration client according to the data service port and the requested remote control port, establishes an FTP data connection tunnel, and realizes routing the data connection initiated by the FTP client to the FTP server.
[0067] In order to ensure that the modified new message can be used by the FTP bridge client and successfully start the second intranet penetration client, the FTP bridge server can perform self-verification on the new response message before sending it after modification, as described in the previous step, to ensure that these changes will not conflict with other network configurations or security policies, and the modified configuration does not introduce new problems; or after the FTP bridge client receives the response message, it can verify the modified response message to verify whether it can correctly parse and identify the modified IP address and remote data port.
[0068] The routing here refers to the mapping relationship between a set of server (public network) ports and the above-mentioned public network IP + remote data port combination formed according to the configuration parameters after the second intranet penetration client establishes a connection with the intranet penetration server. When the FTP client initiates a data connection, the data packet will be forwarded to the IP and port specified in the intranet and transmitted to the FTP server according to the specified path. At this point, with the cooperation of the intranet penetration system, the FTP client and the FTP server can realize the WAN connection based on the FTP protocol to transfer files.
[0069] The method of this embodiment deploys a set of FTP bridge servers and FTP bridge clients, and cooperates with the intranet penetration system to achieve file transfer between the FTP client and the FTP server through the wide area network of the FTP protocol. Since the method does not require modification of the FTP server or the FTP client, any tool and terminal device using the FTP protocol can use this method to achieve remote connection of FTP. Therefore, it is suitable for existing FTP devices, and there is no need to modify the existing FTP devices, and there is no compatibility problem; and the method can realize remote upgrade and operation and maintenance operations, which greatly improves efficiency.
[0070] Embodiment 2
[0071] like Figure 2 As shown, Figure 2 1 is a flow chart of a second embodiment of the WAN connection method of the FTP protocol of the present invention. The WAN connection method of the FTP protocol includes:
[0072] S201. Deploy an intranet penetration server and an FTP bridge server on a cloud server with a public IP, and deploy an intranet penetration client and an FTP bridge client on an intranet machine.
[0073] S202: After the on-site personnel start the FTP bridge client, the FTP bridge client initiates a connection to the FTP bridge server.
[0074] The FTP bridge client of this embodiment is manually started by on-site personnel. After the FTP bridge client is started, the FTP bridge client automatically initiates a TCP / IP connection request to the FTP bridge server through the configured IP address and port; after receiving the connection request, the bridge server performs identity authentication and confirms the connection parameters; if the authentication passes and the parameters are correct, the FTP bridge server will accept the connection request and establish a TCP / IP connection; after the TCP / IP connection is established, the FTP bridge client and the FTP bridge server will negotiate to establish a virtual bridge.
[0075] S203: After the connection is successful, the FTP bridge client requests the remote control port, the remote data port and the remote control mapping port from the FTP bridge server.
[0076] The remote data port S204 and the FTP bridge server determine whether there is an available remote port.
[0077] In this embodiment, when the FTP bridge server has no available or insufficient available ports for request, it returns an end instruction to the FTP bridge client. The end instruction here means that the FTP bridge server directly ends the request of the FTP bridge client. When returning the end instruction, prompt information can be returned at the same time, such as: "Insufficient available ports, request terminated"; or "No available ports, request terminated"; or "Only XX available ports are left, request terminated".
[0078] If the available ports are sufficient, a corresponding number of remote ports are selected and then a response is given to the FTP bridge client, and the process proceeds to the next step S205.
[0079] S205. After receiving the request response, the FTP bridge client starts the first intranet penetration client according to the requested remote control port and establishes an FTP control connection tunnel.
[0080] S206: After the first intranet penetration client is started, the FTP bridge server initiates an FTP control connection to the remote control port requested by the FTP bridge client.
[0081] This embodiment sets up a pre-notification mechanism, that is, the FTP control connection is initiated only after receiving the notification that the first intranet penetration client is started successfully, so as to avoid the program error problem of initiating the FTP control connection again when the first intranet penetration client fails to start. This embodiment uses the remote control port requested by the FTP bridge client as the listening port to initiate the control connection request. After identity authentication, the intranet penetration server will accept the control connection request and establish an FTP control connection with the FTP bridge server.
[0082] S207: The intranet penetration system routes the FTP control connection to the FTP server, thereby establishing a control connection between the FTP bridge server and the FTP server.
[0083] After the first intranet penetration client establishes a connection with the intranet penetration server, this embodiment forms a mapping relationship between a set of server (public network) ports and a combination of public network IP + remote data port according to the configuration parameters. When the FTP bridge server initiates an FTP control connection, the data packet will be forwarded to the IP and the remote control port specified in the intranet, and transmitted to the FTP server according to the specified path, so as to realize the control connection between the FTP bridge server and the FTP server (through intranet penetration).
[0084] S208, start the FTP client, and after the FTP client starts, initiate a connection to the control mapping port assigned by the FTP bridge server. S209, the FTP bridge server monitors the interactive messages between the FTP client and the FTP server, intercepts the passive mode response message sent by the FTP server, records the randomly generated data service port in the response message, and sends the data service port information to the FTP bridge client.
[0085] S210: After modifying the IP address and the data service port in the response message, the modified message is sent to the FTP client.
[0086] S211, the FTP bridge client starts a second intranet penetration client according to the data service port and the requested remote control port, establishes an FTP data connection tunnel, and realizes routing the data connection initiated by the FTP client to the FTP server.
[0087] Based on the first embodiment, this embodiment describes in detail the process of the FTP bridge client requesting a remote port from the FTP bridge server, implements feedback on the failure of the port request, and makes the entire method more intelligent; and describes in detail the process of the FTP client and the FTP server implementing the remote control connection of the FTP protocol. Similarly, this method can realize the remote upgrade and operation and maintenance of the existing FTP equipment, which greatly improves the efficiency.
[0088] Embodiment 3
[0089] like Figure 3 As shown, Figure 3 1 is a flow chart of a third embodiment of the WAN connection method of the FTP protocol of the present invention. The WAN connection method of the FTP protocol includes:
[0090] S301. Deploy an intranet penetration server and an FTP bridge server on a cloud server with a public IP, and deploy an intranet penetration client and an FTP bridge client on an intranet machine.
[0091] S302, start the FTP bridge client and establish a connection with the FTP bridge server, and request the FTP bridge server for a remote control port, a remote data port and a remote control mapping port.
[0092] S303: After the FTP bridge client receives the request response, the FTP bridge client displays the remote control mapping port on the interface.
[0093] This embodiment adopts the method of directly displaying the remote control mapping port on the interface, where the interface refers to the display screen of the terminal device installed with the FTP bridge client program. On-site personnel can directly see the remote control mapping port number and then inform the remote manufacturer's technicians through telephone, chat tools, email, etc.
[0094] S304, the FTP bridge client starts the first intranet penetration client with the requested remote control port as configuration, and establishes an FTP control connection tunnel.
[0095] S305. After receiving the startup completion notification from the first intranet penetration client, the FTP bridge server initiates an FTP control connection to the intranet penetration server.
[0096] In order to avoid the situation where the FTP bridge server initiates an FTP control connection before the first intranet penetration client is started, which causes the control connection to fail, a notification step for the FTP bridge client is set. After the first intranet penetration client is started, the FTP bridge client will notify the FTP bridge server. The FTP bridge server will execute the FTP control connection only after receiving the notification.
[0097] If the first intranet penetration client fails to start, a display or sound prompt will be displayed or heard on the FTP bridge client to inform on-site personnel.
[0098] S306: After establishing a control connection with the FTP server, the FTP bridge server starts to monitor the remote control mapping port.
[0099] After the FTP bridge server establishes a control connection with the FTP server, the FTP bridge server will create a Socket object and bind the Socket object to the remote control mapping port by calling the bind() method. After binding the remote control mapping port, the FTP bridge server starts listening for connection requests from the FTP client by calling the listen() method. At this time, the FTP bridge server enters the listening state, waiting for the connection request from the FTP client.
[0100] S307: After obtaining the remote control mapping port number, the remote terminal starts the FTP client using the IP address of the cloud server and the remote control mapping port as configuration.
[0101] After receiving the remote control mapping port number from the on-site personnel, the manufacturer's technician opens the FTP client program on the manufacturer's terminal device, then enters the IP address of the cloud server and the remote control mapping port number in the program interface, and then clicks the connect button or executes the corresponding command to start the FTP client.
[0102] S308. After being started, the FTP client initiates a connection to the control mapping port allocated by the FTP bridge server.
[0103] After the FTP client is started, it will send a request to establish a connection to the FTP bridge server. When the FTP bridge server listens to the connection request of the FTP client, it accepts the connection by calling the accept() method. Once the connection is accepted, the FTP bridge server will return a new Socket object. The FTP bridge server interacts with the FTP client through the new Socket object, processes the request sent by the FTP client, and returns the corresponding response data.
[0104] S309: After the connection is successful, FTP protocol control message interaction begins.
[0105] There are many kinds of interactive messages between the FTP client and the FTP server, including control connection messages, data connection messages, and other messages in the interactive process (such as status messages, error messages, etc.). In this embodiment, identity authentication message interaction will be performed first, and message interaction will begin after the authentication is passed. During the message interaction process, the FTP client sends a command message to request the FTP server to perform a certain operation, such as downloading files, uploading files, listing directory contents, etc.; then the FTP server sends a response message to respond to the command of the FTP client. The response message contains a status code, which is used to indicate the result of the command execution, such as success, failure, or need for more information. The data transmission mode includes active mode (PORT) or passive mode (PASV). After selecting the transmission mode and determining the port for data transmission, data transmission can begin between the FTP client and the FTP server. Data transmission is usually carried out through a separate data connection, which is temporarily established when data needs to be transmitted and closed after the data transmission is completed.
[0106] S310, the FTP bridge server monitors the interactive messages between the FTP client and the FTP server, intercepts the passive mode response message sent by the FTP server, records the randomly generated data service port in the response message, and sends the data service port information to the FTP bridge client.
[0107] S311. After modifying the IP address and data service port in the response message, the modified message is sent to the FTP client.
[0108] S312, the FTP bridge client starts a second intranet penetration client according to the data service port and the requested remote control port, establishes an FTP data connection tunnel, and realizes routing the data connection initiated by the FTP client to the FTP server.
[0109] Based on the first embodiment, this embodiment describes in detail the transmission method of the remote control mapping port and the startup process of the FTP client, thereby further optimizing the connection method of the present invention and reducing the situation of program errors. Through the wide area connection method of the present invention, the manufacturer no longer needs to disclose the login username and password of the FTP client of the device to the on-site operation and maintenance personnel, nor does it need to send the device firmware or configuration file to the on-site operation and maintenance personnel; the on-site operation and maintenance personnel only need to run the FTP bridge client, and the manufacturer's technicians can directly perform file operations on the on-site device with the FTP server through the FTP client, thereby greatly increasing the operational safety of the power equipment; and remote upgrades and operation and maintenance operations can be realized, which greatly improves efficiency.
[0110] Embodiment 4
[0111] like Figure 4 As shown, Figure 4 4 is a flow chart of a fourth embodiment of the WAN connection method of the FTP protocol of the present invention. The WAN connection method of the FTP protocol includes:
[0112] S401. Deploy an intranet penetration server and an FTP bridge server on a cloud server with a public IP, and deploy an intranet penetration client and an FTP bridge client on an intranet machine.
[0113] S402: Start the FTP bridge client and establish a connection with the FTP bridge server, and request a remote control port and a remote data port from the FTP bridge server.
[0114] S403: After receiving the request response, the FTP bridge client starts the first intranet penetration client according to the requested remote control port to establish an FTP control connection tunnel.
[0115] S404, the FTP bridging server initiates an FTP control connection to the intranet penetration server, and bridges the control connection between the FTP client and the FTP server in an intranet penetration manner.
[0116] S405: The FTP bridge server continues to monitor the interaction messages between the FTP client and the FTP server.
[0117] As a transfer station between the FTP client and the FTP server, the FTP bridge server can be equipped with the function of capturing and parsing the messages on the control connection and data connection, or it can realize the capture function by writing a network monitoring program or using an existing network monitoring tool. After capturing the message from the FTP client or FTP server, the FTP bridge server parses and extracts the corresponding information, such as command type, file name, file size, transfer mode, etc., and then keeps, forwards, intercepts, and reminds of abnormalities as needed.
[0118] S406: Each time a request message from the FTP client is monitored, determine whether it is "PASV".
[0119] When the FTP bridge server monitors the interactive messages between the FTP client and the FTP server, it will parse and extract the corresponding information to determine whether the transmission mode is PASV mode, etc. If the interactive message is a passive mode (PASV) request message with the format of "PASV\r\n", it will start intercepting the FTP server's response message, and extract the IP address in the response message and the data service port randomly assigned by the FTP server after interception. If the interactive message is other than the PASV request message, the FTP bridge server will forward these messages between the FTP client and the FTP server as an intermediary, and then return to continue monitoring;
[0120] S407: Record the data service port in the response message, and send the data service port information to the FTP bridge client.
[0121] After intercepting the response message, the FTP bridge server will parse the port number in the response message, and then record the data service port number randomly generated by the FTP server, and then send it to the FTP bridge client through the TCP / IP protocol. Of course, you can also manually record the data service port number parsed by the FTP bridge server, and then manually inform the FTP bridge client.
[0122] S408. Modify the IP address in the response message to the public IP address of the cloud server, and modify the data service port number in the response message to the remote data port allocated by the FTP bridge server to the FTP bridge client.
[0123] The FTP bridge server of this embodiment will parse the basic structure of the response message and find the IP address and data service port in the response message; modify the IP address found in the response message to the public IP address of the cloud server, and modify the data service port number found in the response message to the remote data port number; generate a new FTP response message based on the modified fields.
[0124] S409: Finally, the modified response message is forwarded to the FTP client.
[0125] After modifying the response message, the FTP bridge server of this embodiment will first verify to ensure that the new response message contains the correct status code, message text, and the modified public IP address and remote data port; after ensuring that these changes will not conflict with other network configurations or security policies, it will be sent to the FTP client.
[0126] S410, the FTP bridge client starts a second intranet penetration client according to the data service port and the requested remote control port, establishes an FTP data connection tunnel, and realizes routing the data connection initiated by the FTP client to the FTP server.
[0127] Based on the first embodiment, this embodiment describes in detail the process of monitoring and forwarding the interactive message by the FTP bridge server. Through this method, the existing FTP passive mode can be changed to the remote transmission mode. Since there is no need to modify the FTP device, it is suitable for the existing FTP devices. Through this method, the remote upgrade and operation and maintenance of the existing FTP devices can be realized, which greatly improves the efficiency.
[0128] Embodiment 5
[0129] like Figure 5 As shown, Figure 5 4 is a flow chart of a fourth embodiment of the WAN connection method of the FTP protocol of the present invention. The WAN connection method of the FTP protocol includes:
[0130] S501, start the FTP bridge client.
[0131] S502: After starting the FTP bridge client, the FTP bridge client initiates a connection to the FTP bridge server.
[0132] S503: After the connection is successful, the FTP bridge client requests the remote control port, the remote data port and the remote control mapping port from the FTP bridge server.
[0133] S504: The FTP bridge server determines whether there is an available remote port.
[0134] If not, then return the end instruction to the FTP bridge client;
[0135] If so, go to step S505.
[0136] S505: Allocate three ports from the available port pool as a remote control port, a remote control mapping port, and a remote data port, and reply to the FTP bridge client.
[0137] S506: After receiving the request response, the FTP bridge client saves the three ports and displays the remote control mapping port on the interface.
[0138] S507: Generate a configuration file of the intranet penetration client according to the requested remote control port, then start the first intranet penetration client and establish an FTP control connection tunnel.
[0139] S508. After receiving the startup completion notification from the first intranet penetration client, the FTP bridge server initiates an FTP control connection to the intranet penetration server, establishes an FTC connection with the FTP server through the intranet penetration system, and starts monitoring the remote control mapping port.
[0140] S509: Start the FTP client using the IP address of the cloud server and the remote control mapping port displayed by the FTP bridge client as configuration.
[0141] S510: The FTP client establishes a control connection with the FTP bridge server according to the control mapping port displayed by the FTP bridge client, and starts message interaction of the FTP protocol.
[0142] S511: The FTP bridge server starts to continuously monitor the interaction messages between the FTP client and the FTP server.
[0143] S512: When the FTP bridge server monitors the request message from the FTP client, it determines whether it is "PASV".
[0144] If not, return to step S511;
[0145] If yes, proceed to the next step S513.
[0146] S513. The FTP bridge server intercepts the passive mode response message sent by the FTP server, and extracts the IP address and data service port in the response message.
[0147] S514. The FTP bridge server records the data service port in the response message, and sends the data service port information to the FTP bridge client.
[0148] S515. The FTP bridge client generates a new configuration file according to the data service port and the requested remote control port, and starts a second intranet penetration client to establish an FTP data connection tunnel.
[0149] S516. At the same time, the FTP bridge server modifies the IP address in the response message to the public IP address of the cloud server, modifies the data service port number in the response message to the remote data port allocated by the FTP bridge server to the FTP bridge client, and then forwards the modified response message to the FTP client.
[0150] S517. The FTP client uses the public network address IP and remote data port of the server in accordance with the FTP protocol to establish a data connection with the FTP server through the traditional system of the intranet to perform file transfer interaction.
[0151] This embodiment elaborates on the working steps between each server and client, and finally realizes file transfer between the FTP client and the FTP server through the wide area network of the FTP protocol. This method is applicable to existing FTP devices, and can realize remote upgrade and operation and maintenance operations without the need for staff to reach the FTP device site, which greatly improves efficiency and has high transmission security.
[0152] Based on the same inventive concept, the present invention also proposes a WAN connection system of FTP protocol, such as Figure 6 The structure diagram of the WAN connection system of the FTP protocol of the present invention is shown. The WAN connection system of the FTP protocol includes an FTP client, an FTP server, an FTP bridge system, which is composed of an FTP bridge server and an FTP bridge client, and an intranet penetration system, which is composed of an intranet penetration client and an intranet penetration server, and there are two intranet penetration clients.
[0153] Among them, the FTP client is set on a remote terminal, which can be a computer, tablet or other device used by manufacturer technicians. The FTP client can be a common FTP client currently on the market, such as FileZilla, WinSCP, Cyberduck, Transmit, etc.
[0154] The FTP server is deployed on the power terminal device, corresponding to the FTP client. The FTP server can be FileZilla Server, vsftpd, ProFTPD, Server-U, etc. Currently, the FTP server used on the power terminal is basically vsftpd. In the wide area network connection method of the present invention, the FTP server is mainly used to send a passive mode response message and allocate a data service port, and the data service port number is attached to the response message so that it can be obtained by the FTP bridge server.
[0155] The FTP bridge server is deployed on a cloud server with a public IP. The FTP bridge server mainly plays a bridging role, bridging the FTP client and establishing a control connection with the FTP server through intranet penetration.
[0156] The FTP bridge client is deployed on the intranet machine. The FTP bridge client is used to initiate a connection to the FTP bridge server to achieve the normal operation of the FTP bridge system. After the connection, it requests a remote port from the FTP bridge server as needed, and starts the intranet penetration client according to the requested remote port, so as to establish an FTP control connection tunnel and an FTP data connection tunnel. Figure 7As shown, the FTP bridge server of this embodiment includes a port management module, a message interaction module and an FTP control message monitoring module. The port management module is responsible for allocating available remote control ports, remote control mapping ports and remote data ports to the FTP bridge client, and reclaiming the ports after the FTP bridge client is offline; the message interaction module is responsible for information interaction with the FTP client, including responding to client requests and pushing information to the client in real time; the FTP message monitoring module is the core module, which is responsible for establishing two connections with the FTP server and the FTP client respectively, and monitoring and exchanging the request and response messages in the two connections in the form of an intermediary. When the request message of the FTP client is monitored as "PASV", the response message of the FTP server is intercepted, and the IP address and data service port in the message are extracted, and the data service port is pushed to the FTP bridge client through the message interaction module, and then the IP address in the message is replaced with the public network IP address of the cloud server, and the data service port is replaced with the remote data port, and finally the modified response message is forwarded to the FTP client.
[0157] The FTP bridge client is divided into a port application module, a message transmission module, and an intranet penetration control module. When the FTP bridge client is started, the message transmission module first establishes a connection with the FTP server, and then the port application module requests the remote port from the FTP server through the message transmission module. After receiving the remote port in response from the FTP server, the intranet penetration control module first starts the first intranet penetration client, which is used to establish an FTP control connection between the FTP bridge server and the FTP server; after the message transmission module receives the data port pushed by the FTP server, the intranet penetration module starts the second intranet penetration client, which is used to establish a data connection between the FTP client and the FTP server.
[0158] The intranet penetration client includes two, both of which are deployed on the intranet machine. The first intranet penetration client is started with the remote control port requested by the FTP bridge client as the configuration, and is used to establish an FTP control connection tunnel; the second intranet penetration client is started with the remote control port and data service port requested by the FTP bridge client as the configuration, and is used to establish an FTP data connection tunnel, so as to realize routing the data connection initiated by the FTP client to the FTP server.
[0159] The intranet penetration server is also deployed on a cloud server with a public IP. After the first intranet penetration client is started, the FTP bridge server initiates a control connection to the intranet penetration server, and then interacts with the first intranet penetration client through the intranet penetration server, thereby realizing the control connection between the FTP client and the FTP server through the intranet penetration system with the FTP bridge server as a bridge.
[0160] The various servers and clients of the WAN connection system of the FTP protocol cooperate with each other, so that the FTP client no longer directly establishes a connection with the FTP server, but after bridging the FTP client and the FTP server through the FTP bridge server, the passive mode response message of the FTP server is intercepted and tampered, and then in conjunction with the intranet penetration system, file transfer between the FTP client and the FTP server through the WAN of the FTP protocol can be realized. The specific method of the WAN connection of the FTP protocol is referred to the above embodiments 1 to 5, which will not be repeated.
[0161] It is understandable that in the embodiments provided by the present application, the disclosed methods and systems can also be implemented in other ways. The embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the architecture, functions and operations that may be implemented by the methods and systems according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical functions. It should be further noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should be further noted that each box in the block diagram and / or the flowchart, and the combination of boxes in the block diagram and / or the flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0162] The above are only preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
[0163] It will be apparent to those skilled in the art that the present application is not limited to the details of the exemplary embodiments described above, and that the present application can be implemented in other specific forms without departing from the spirit or essential features of the present application. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the present application is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims be included in the present application. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
Claims
1. A wide area network connection method of FTP protocol, characterized in that: The steps include: Deploy the intranet penetration server and FTP bridge server on the cloud server with a public IP; Deploy two intranet penetration clients and FTP bridge clients on the intranet machine; Start the FTP bridge client and establish a connection with the FTP bridge server, and request the remote control port, remote data port and remote control mapping port from the FTP bridge server; After receiving the request response, the FTP bridge client starts the first intranet penetration client according to the requested remote control port and establishes an FTP control connection tunnel; The FTP bridge server initiates an FTP control connection to the intranet penetration server to establish a control connection with the FTP server through intranet penetration; Start the FTP client, and after it starts, it initiates a connection to the control mapping port assigned by the FTP bridge server; The FTP bridge server monitors the interactive messages between the FTP client and the FTP server, intercepts the passive mode response message sent by the FTP server, records the randomly generated data service port in the response message, and sends the data service port information to the FTP bridge client; After modifying the IP address and data service port in the reply message, the modified message is sent to the FTP client; The FTP bridge client starts a second intranet penetration client according to the data service port and the requested remote control port, establishes an FTP data connection tunnel, and realizes routing the data connection initiated by the FTP client to the FTP server.
2. The WAN connection method of the FTP protocol according to claim 1, characterized in that: The steps of starting the FTP bridge client and establishing a connection with the FTP bridge server, and requesting a remote control port and a remote data port from the FTP bridge server include the following steps: After starting the FTP bridge client, the FTP bridge client initiates a connection to the FTP bridge server; After the connection is successful, the FTP bridge client requests the remote control port, remote data port, and remote control mapping port from the FTP bridge server; The FTP bridge server determines whether there is an available remote port; If not, then return the end instruction to the FTP bridge client; If yes, the corresponding remote port is assigned to respond to the FTP bridge client.
3. The WAN connection method of the FTP protocol according to claim 1, characterized in that: The FTP bridging server initiates a control connection to the intranet penetration server to establish a control connection with the FTP server in an intranet penetration manner, including the following steps: After the first intranet penetration client is started, it notifies the FTP bridge server; The FTP bridge server initiates an FTP control connection to the remote control port requested by the FTP bridge client; The intranet penetration system routes the FTP control connection to the FTP server, thereby establishing a control connection between the FTP bridge server and the FTP server.
4. The WAN connection method of the FTP protocol according to claim 1, characterized in that: After the steps of starting the FTP bridge client and establishing a connection with the FTP bridge server, and requesting the FTP bridge server for a remote control port, a remote data port, and a remote control mapping port, the following steps are also included: After the FTP bridge server responds to the requested remote control mapping port, the FTP bridge client displays the remote control mapping port on the interface.
5. The WAN connection method of FTP protocol according to claim 4, characterized in that: The step of starting the FTP client and initiating a connection to the control mapping port allocated by the FTP bridge server after the FTP client is started includes the following steps: After the FTP bridge server establishes a control connection with the FTP server, it starts to listen to the remote control mapping port; After obtaining the remote control mapping port number, the remote terminal starts the FTP client with the IP address of the cloud server and the remote control mapping port as configuration; After the FTP client is started, it initiates a connection to the control mapping port assigned by the FTP bridge server; After the connection is successful, FTP protocol control message interaction begins.
6. The WAN connection method of FTP protocol according to claim 1, characterized in that: The step of the FTP bridge server monitoring the interactive messages between the FTP client and the FTP server, intercepting the passive mode response message sent by the FTP server, recording the random data service port in the response message, and sending the random data service port information to the FTP bridge client comprises the following steps: The FTP bridge server continuously monitors the interactive messages between the FTP client and the FTP server; Every time a request message from an FTP client is monitored, determine whether it is "PASV"; If not, forward the message and return to continue monitoring; If yes, intercept the passive mode response message sent by the FTP server, extract the IP address in the response message and the data service port randomly assigned by the FTP server; The data service port in the response message is recorded, and the data service port information is sent to the FTP bridge client.
7. The WAN connection method of FTP protocol according to claim 1, characterized in that: After the IP address and the data service port in the response message are modified, the step of sending the modified message to the FTP client comprises the following steps: Change the IP address in the reply message to the public IP address of the cloud server; Modify the data service port number in the reply message to the remote data port assigned by the FTP bridge server to the FTP bridge client; Finally, the modified response message is forwarded to the FTP client.
8. The WAN connection method of FTP protocol according to claim 1, characterized in that: The FTP bridge client starts a second intranet penetration client according to the data service port and the requested remote control port, establishes an FTP data connection tunnel, and implements the step of routing the data connection initiated by the FTP client to the FTP server, including the following steps: After receiving the data service port sent by the FTP bridge server, the FTP bridge client starts the second intranet penetration client with the data service port and the requested remote control port to establish an FTP data connection tunnel; After the control message interaction is completed, the FTP client initiates a data connection to the remote data port of the cloud server based on the modified message content; The intranet penetration system routes the data connection initiated by the FTP client to the FTP server, and the FTP data connection is now established.
9. A wide area network connection system of FTP protocol, characterized in that: include: FTP client, set up on the remote terminal; FTP server, deployed on the power terminal equipment, is used to send passive mode response messages and allocate random data service ports; FTP bridge server, deployed on a cloud server with a public IP, is used to bridge the FTP client and the control connection established with the FTP server through intranet penetration; FTP bridge client, deployed on the intranet machine, is used to initiate a connection to the FTP bridge server and request the remote control port, remote data port, and remote control mapping port from the FTP bridge server; The first intranet penetration client is deployed on the intranet machine and is started with the remote control port requested by the FTP bridge client as the configuration to establish an FTP control connection tunnel; The intranet penetration server is deployed on a cloud server with a public IP. After the first intranet penetration client is started, the FTP bridge server initiates a control connection to the intranet penetration server. The second intranet penetration client is deployed on the intranet machine. It is started with the remote control port requested by the FTP bridge client and the randomly generated data service port in the passive mode response message of the FTP server as the configuration, and establishes an FTP data connection tunnel to route the data connection initiated by the FTP client to the FTP server.
10. The WAN connection system of FTP protocol according to claim 9, characterized in that: The FTP bridge server includes a port management module, a message interaction module and an FTP control message monitoring module; the port management module is used to allocate an available remote control port, a remote control mapping port and a remote data port to the FTP bridge client; the message interaction module is used to exchange information with the FTP client; the FTP message monitoring module is used to establish two connections with the FTP server and the FTP client respectively, and monitor and exchange request and response messages in the two connections in a mediator manner, and is used to intercept passive mode response messages and modify the IP address and data service port in the message before forwarding the modified response message to the FTP client; The FTP bridging client is divided into a port application module, a message transmission module and an intranet penetration control module; the message transmission module is used to establish a connection with the FTP server; the port application module requests a remote port from the FTP server through the message transmission module; the intranet penetration control module is used to start the first intranet penetration client and the second intranet penetration client.
Citation Information
Patent Citations
File transfer auditing system and method based on bastion machine
CN103747089A
Data storage system and method based on memory bridging, and computer equipment
CN113655963A
Intranet penetration system
CN116436891A
Intranet penetration system and method based on reverse transparent bridging
CN117439815A
Method for starting network traversal system, and message transceiving method and communication device
WO2024001753A1