Network data interaction method, system and electronic device
By establishing a file transfer network connection between the external network and the internal network, and utilizing the FTP protocol and the Kafka message queue system, data interoperability between the external network and the internal network was achieved, solving the security, speed, and stability issues in cross-network transmission.
Patent Information
- Application Number
- CN202310955295.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-01
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2043-08-01
AI Technical Summary
Existing network data transmission between intranets and extranets suffers from poor security, slow transmission speed, and low transmission stability.
By establishing a file transfer network connection and utilizing the connection between the external and internal FTP servers and message transfer servers, data can be exchanged between the external and internal networks. The FTP protocol and Kafka message queue system are used for data transmission and processing.
It improves the security and stability of network data transmission between the intranet and the extranet, increases transmission speed, and reduces costs.
Smart Images

Figure CN116896555B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data interaction technology, and in particular to a network data interaction method, system and electronic device. Background Technology
[0002] Cross-network data transmission involves data transfer between intranets and extranets. Data transmission across regions, organizations, enterprises, and in cloud computing scenarios requires the cross-network transmission of various types of network data. Due to the different network protocols involved and the complexity of usage scenarios during cross-network data transmission, existing methods generally suffer from poor security, slow transmission speeds, and low transmission stability during intranet-extranet cross-network data transmission. Summary of the Invention
[0003] In view of this, the purpose of the present invention is to provide a network data interaction method, system and electronic device. This solution uses a file transfer network to connect the external network and the internal network, and uses a corresponding message transmission server to realize the interconnection of network data between the external network and the internal network, thereby solving the above-mentioned problems existing in the prior art.
[0004] In a first aspect, embodiments of the present invention provide a network data interaction method, which is used for data interaction between an external network and an internal network, wherein the external network and the internal network are connected through a file transfer network; wherein a first message transmission server is set in the external network, a second message transmission server is set in the internal network, and an external network FTP server and an internal network FTP server are set in the file transfer network.
[0005] The method includes:
[0006] Establish a first connection between the external FTP server and the first message transmission server, a second connection between the internal FTP server and the second message transmission server, and a third connection between the external FTP server and the internal FTP server, respectively.
[0007] Push the first data source from the external network into the first event module corresponding to the first message transmission server;
[0008] Using the first connection to control the first message transmission server, the first data source in the first event module is pushed into the first folder corresponding to the external FTP server;
[0009] Using a third connection, the external FTP server is controlled to push the first data source into the corresponding second folder on the internal FTP server.
[0010] The second connection is used to control the intranet FTP server to push the first data source to the second event module corresponding to the second message transmission server;
[0011] The second message transmission server is controlled to interact with the first data source in the second event module and the corresponding target user.
[0012] In one implementation, the method further includes:
[0013] Push the second data source on the intranet into the third event module corresponding to the second message transmission server;
[0014] Using the second connection to control the second message transmission server, the second data source in the third event module is pushed into the third folder corresponding to the intranet FTP server.
[0015] Using a third connection, the internal FTP server is controlled to push the second data source into the corresponding fourth folder on the external FTP server.
[0016] The first connection is used to control the external FTP server to push the second data source into the fourth event module corresponding to the first message transmission server;
[0017] The first message transmission server is controlled to interact with the second data source in the fourth event module and the corresponding target user.
[0018] In one implementation, the step of using a first connection to control a first message transmission server to push a first data source in a first event module into a first folder corresponding to an external FTP server includes:
[0019] The first data source received in the first event module is received in real time using the first connection;
[0020] After processing the first data source according to the message processing strategy corresponding to the first message transmission server, the first configuration instruction corresponding to the first data source is obtained.
[0021] After the first data source is pushed to the external FTP server by the first connection control first message transmission server, the first data source is saved to the corresponding first folder by the first configuration command.
[0022] In one implementation, the step of using a third connection to control an external FTP server to push a first data source into a corresponding second folder on an internal FTP server includes:
[0023] Use a third connection to monitor the first data source received by the first folder in the external FTP server in real time.
[0024] The second configuration instruction for data transmission between the external FTP server and the internal FTP server is determined based on the file synchronization policy corresponding to the file transfer network; wherein, the second configuration instruction is used to transmit the first data source in the external FTP server to the internal FTP server;
[0025] After pushing the first data source to the internal FTP server using the third connection to control the external FTP server, the first data source is saved to the corresponding second folder using the second configuration command.
[0026] In one implementation, the step of using a second connection to control an intranet FTP server to push a first data source into a second event module corresponding to a second message transmission server includes:
[0027] The second connection is used to monitor the first data source received by the second folder in the intranet FTP server in real time.
[0028] After processing the first data source according to the message processing strategy corresponding to the second message transmission server, the third configuration instruction corresponding to the first data source is obtained.
[0029] After the first data source is pushed to the second message transmission server using the second connection control, the first data source is saved to the corresponding second event module using the third configuration instruction.
[0030] In one implementation, the step of using a second connection to control a second message transmission server to push a second data source in a third event module into a third folder corresponding to an intranet FTP server includes:
[0031] The second connection is used to receive the second data source received from the third event module in real time.
[0032] After processing the second data source according to the message processing strategy corresponding to the second message transmission server, the fourth configuration instruction corresponding to the second data source is obtained.
[0033] After the second data source is pushed to the intranet FTP server by the second connection control second message transmission server, the second data source is saved to the corresponding third folder by the fourth configuration command.
[0034] In one implementation, the step of using a third connection to control the internal network FTP server to push the second data source to the corresponding fourth folder on the external network FTP server includes:
[0035] Use a third connection to monitor in real time the second data source received by the third folder in the intranet FTP server;
[0036] The fifth configuration instruction for data transmission between the intranet FTP server and the extranet FTP server is determined based on the file synchronization policy corresponding to the file transfer network; wherein, the fifth configuration instruction is used to transfer the second data source in the intranet FTP server to the extranet FTP server;
[0037] After pushing the second data source to the external FTP server using the third connection control internal network FTP server, the second data source is saved to the corresponding fourth folder using the fifth configuration command.
[0038] In one implementation, the step of using the first connection to control the external network FTP server to push the second data source into the fourth event module corresponding to the first message transmission server includes:
[0039] The first connection is used to monitor in real time the second data source received by the fourth folder in the intranet FTP server.
[0040] After processing the second data source according to the message processing strategy corresponding to the first message transmission server, the sixth configuration instruction corresponding to the second data source is obtained;
[0041] After the second data is pushed into the first message transmission server by the first connection control, the second data source is saved to the corresponding first time module by the sixth configuration instruction.
[0042] Secondly, embodiments of the present invention provide a network data interaction system for data interaction between an external network and an internal network, wherein the external network and the internal network are connected through a file transfer network; wherein a first message transmission server is set up in the external network, a second message transmission server is set up in the internal network, and an external network FTP server and an internal network FTP server are set up in the file transfer network.
[0043] The system includes:
[0044] The first interaction module is used to establish a first connection between the external FTP server and the first message transmission server, a second connection between the internal FTP server and the second message transmission server, and a third connection between the external FTP server and the internal FTP server, respectively.
[0045] The second interaction module is used to push the first data source from the external network into the first event module corresponding to the first message transmission server;
[0046] The third interaction module is used to control the first message transmission server to push the first data source in the first event module into the first folder corresponding to the external FTP server using the first connection;
[0047] The fourth interaction module is used to control the external FTP server to push the first data source into the corresponding second folder of the internal FTP server using the third connection;
[0048] The fifth interaction module is used to control the intranet FTP server via the second connection to push the first data source into the second event module corresponding to the second message transmission server;
[0049] The sixth interaction module is used to control the second message transmission server to interact with the first data source in the second event module and the corresponding target user.
[0050] Thirdly, embodiments of the present invention also provide an electronic device, including a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the steps of the network data interaction method provided in the first aspect.
[0051] Fourthly, embodiments of the present invention also provide a storage medium storing computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the steps of the network data interaction method provided in the first aspect.
[0052] This invention provides a network data interaction method, system, and electronic device for data interaction between an external network and an internal network. The external network and internal network are connected via a file transfer network. The external network has a first message transmission server, and the internal network has a second message transmission server. The file transfer network includes an external FTP server and an internal FTP server. During network data interaction, a first connection is first established between the external FTP server and the first message transmission server; a second connection is established between the internal FTP server and the second message transmission server; and a third connection is established between the external FTP server and the internal FTP server. Then, a first data source from the external network is pushed into a first event module corresponding to the first message transmission server. Subsequently, the first connection controls the first message transmission server to push the first data source from the first event module into a first folder corresponding to the external FTP server. Then, the third connection controls the external FTP server to push the first data source into a second folder corresponding to the internal FTP server. Next, the second connection controls the internal FTP server to push the first data source into a second event module corresponding to the second message server. Finally, the second message server is controlled to interact with the first data source in the second event module and the corresponding target user. This solution utilizes a file transfer network to connect the external network and the internal network, and then uses a corresponding message transfer server to achieve data exchange between the two networks. This solves the problems of poor security, slow transmission speed, and low transmission stability that exist in the existing cross-network data transmission process between the internal and external networks.
[0053] Other features and advantages of the invention will be set forth in the description which follows, 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 are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.
[0054] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0055] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0056] Figure 1 A flowchart of a network data interaction method provided in an embodiment of the present invention;
[0057] Figure 2 A flowchart of another network data interaction method provided in an embodiment of the present invention;
[0058] Figure 3 A flowchart of step S103 in a network data interaction method provided in an embodiment of the present invention;
[0059] Figure 4 A flowchart of step S104 in a network data interaction method provided in an embodiment of the present invention;
[0060] Figure 5 A flowchart of step S105 in a network data interaction method provided in an embodiment of the present invention;
[0061] Figure 6 This is a flowchart of step S202 in a network data interaction method provided in an embodiment of the present invention;
[0062] Figure 7 A flowchart of step S203 in a network data interaction method provided in an embodiment of the present invention;
[0063] Figure 8 A flowchart of step S204 in a network data interaction method provided in an embodiment of the present invention;
[0064] Figure 9 This is a schematic diagram illustrating the establishment of a third connection between an external FTP server and an internal FTP server in a network data interaction method provided by an embodiment of the present invention.
[0065] Figure 10 This is a schematic diagram of data flow transmission for a network data interaction method provided in an embodiment of the present invention;
[0066] Figure 11This is a schematic diagram of the structure of a network data interaction system provided in an embodiment of the present invention;
[0067] Figure 12 This is a schematic diagram of another network data interaction system provided in an embodiment of the present invention;
[0068] Figure 13 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.
[0069] icon:
[0070] 1101 - First Interaction Module; 1102 - Second Interaction Module; 1103 - Third Interaction Module; 1104 - Fourth Interaction Module; 1105 - Fifth Interaction Module; 1106 - Sixth Interaction Module; 1107 - Seventh Interaction Module; 1108 - Eighth Interaction Module; 1109 - Ninth Interaction Module; 1110 - Tenth Interaction Module; 1111 - Eleventh Interaction Module;
[0071] 101 - Processor; 102 - Memory; 103 - Bus; 104 - Communication interface. Detailed Implementation
[0072] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0073] Cross-network data transmission involves data transfer between intranets and extranets. It requires the cross-network transmission of various types of data across regions, institutions, enterprises, and in cloud computing. For example, cross-regional data backup and recovery: enterprises need to back up and restore data across different regions to ensure data security and reliability. Cross-institutional data sharing: medical institutions, financial institutions, etc., need to share data between different institutions to improve work efficiency and service quality. Multinational corporations' data exchange: multinational corporations need to exchange data between different regions to coordinate global operations and management. Data transmission in research projects: research projects need to transfer large amounts of data between different institutions and teams to support research and discovery. Data transmission in cloud computing: cloud computing service providers need to transfer data between different data centers to support user applications and services.
[0074] Cross-network data transmission faces the following problems:
[0075] Security issues: Cross-network data transmission may face security threats such as data leakage, interception, and tampering. Slow transmission speed: Cross-network data transmission requires network transmission, and the transmission speed is affected by factors such as network bandwidth and network congestion, resulting in slow speeds. Poor transmission stability: Network transmission may encounter network failures, signal interference, and other problems, leading to unstable data transmission or even interruptions. High cost: Cross-network transmission requires the use of network equipment and resources, and incurs maintenance and operation costs for the network equipment, thus resulting in higher costs.
[0076] Due to the different network protocols and complex usage scenarios involved in cross-network data transmission, existing methods for transmitting network data between intranets and extranets generally suffer from poor security, slow transmission speeds, and low transmission stability. To address this, this invention provides a network data interaction method, system, and electronic device. By utilizing a file transfer network to connect the extranet and intranet, and then using a corresponding message transmission server, it achieves data interoperability between the two networks, thereby resolving the problems of poor security, slow transmission speeds, and low transmission stability in existing cross-network data transmission methods.
[0077] To facilitate understanding of this embodiment, a network data interaction method disclosed in this invention will first be described in detail. This method is used for data interaction between an external network and an internal network, which are connected via a file transfer network. Specifically, a first message transmission server is set up in the external network, a second message transmission server is set up in the internal network, and an external FTP server and an internal FTP server are set up in the file transfer network. Based on this, as follows... Figure 1 As shown, the method includes:
[0078] Step S101: Establish a first connection between the external FTP server and the first message transmission server, a second connection between the internal FTP server and the second message transmission server, and a third connection between the external FTP server and the internal FTP server.
[0079] First, establish connections between the external network and the internal network and the file transfer network. Specifically, establish a first connection between the external FTP server and the first message transmission server; establish a second connection between the internal FTP server and the second message transmission server; and establish a third connection between the external FTP server and the internal FTP server. In simpler terms, the external network and the file transfer network interact through the first connection; the external FTP server and the internal FTP server within the file transfer network interact through the third connection.
[0080] Step S102: Push the first data source from the external network into the first event module corresponding to the first message transmission server.
[0081] After the connection is established, the first message transmission server is started and the first event module corresponding to the first data source is created. Then, the first data source from the external network is pushed into the first event module for storage.
[0082] Step S103: Using the first connection to control the first message transmission server, push the first data source in the first event module into the first folder corresponding to the external FTP server.
[0083] The first data source stored in the first event module is transmitted to the external FTP server through the first connection using the corresponding information transmission scheme. Then, according to the data information of the first data source, it is transferred to the corresponding first folder in the external FTP server according to the corresponding format requirements.
[0084] Step S104: Use the third connection to control the external FTP server to push the first data source into the corresponding second folder of the internal FTP server.
[0085] The first data source is stored in the first folder corresponding to the external FTP server, indicating that the first data source has been pushed from the external network to the file transfer network. At this time, the third connection corresponding to the file transfer network is used to transfer the first data source from the external FTP server to the internal FTP server, and finally, according to the corresponding data information, the first data source is transferred to the second folder corresponding to the internal FTP server for storage.
[0086] Step S105: Use the second connection to control the intranet FTP server to push the first data source into the second event module corresponding to the second message transmission server.
[0087] The first data source is stored in the second folder corresponding to the intranet FTP server, indicating that the first data source is about to be transferred from the file transfer network to the intranet. At this time, the second message transfer server is started and a second event module corresponding to the first data source is created. Then, using the second connection between the intranet FTP server and the second message transfer server, the first data source is pushed to the second message transfer server, and the first data source is transferred to the second event module for storage according to the corresponding data information.
[0088] Step S106: Control the second message transmission server to interact with the first data source in the second event module and the corresponding target user.
[0089] At this point, the first data source has been sent to the intranet. The target user on the intranet, in a specific usage scenario, calls the second message transmission server to retrieve the first data source from the second event module, thus realizing the interaction process of network data from the external network to the intranet. Therefore, the above steps realize the transmission of the first data source from the external network to the intranet via a file transfer network, ultimately completing the interaction. The process of data transmission from the intranet to the external network can be found in [reference needed]. Figure 2 As shown, specifically, the method also includes:
[0090] Step S201: Push the second data source of the intranet into the third event module corresponding to the second message transmission server.
[0091] After obtaining the second data source from the intranet, start the second message transmission server and create the third event module corresponding to the second data source. Then, push the second data source from the intranet into the third event module for saving.
[0092] Step S202: Using the second connection to control the second message transmission server, push the second data source in the third event module into the third folder corresponding to the intranet FTP server.
[0093] The second data source stored in the third event module is transmitted to the intranet FTP server through the second connection using the corresponding information transmission scheme. Then, according to the data information of the second data source, it is transferred to the corresponding third folder in the intranet FTP server according to the corresponding format requirements.
[0094] Step S203: Use the third connection to control the internal FTP server to push the second data source into the corresponding fourth folder of the external FTP server.
[0095] The second data source is stored in the third folder corresponding to the intranet FTP server, indicating that the second data source has been pushed from the intranet to the file transfer network. At this time, the second data source is transferred from the intranet FTP server to the external FTP server using the third connection corresponding to the file transfer network, and finally transferred to the fourth folder corresponding to the external FTP server for storage according to the corresponding data information.
[0096] Step S204: Use the first connection to control the external FTP server to push the second data source into the fourth event module corresponding to the first message transmission server.
[0097] The second data source is stored in the fourth folder corresponding to the external FTP server, indicating that the second data source is about to be transferred from the file transfer network to the external network. At this time, the first message transfer server is started and the fourth event module corresponding to the second data source is created. Then, using the first connection between the external FTP server and the first message transfer server, the second data source is pushed to the first message transfer server, and the second data source is transferred to the first event module for storage according to the corresponding data information.
[0098] Step S205: Control the first message transmission server to interact with the second data source in the fourth event module and the corresponding target user.
[0099] At this point, the second data source has been sent to the external network. In specific usage scenarios, the target user on the external network calls the first message transmission server to access the second data source in the first practice module, thereby realizing the interaction process of network data from the internal network to the external network.
[0100] In practice, the server in the file transfer network uses the FTP protocol. FTP (File Transfer Protocol) has become a highly efficient data transfer protocol that enables secure data exchange. FTP ensures secure data transmission through encryption technologies such as SSL (Secure Sockets Layer) and TLS (Transport Layer Security). These encryption technologies can encrypt and decrypt data during transmission, thus protecting data from eavesdropping, tampering, or destruction. Furthermore, FTP supports authentication and authorization technologies, ensuring that only authorized users can access files. The FTP server can authenticate and authorize users to guarantee data security. Simultaneously, FTP supports multiple authentication methods, such as password-based authentication and key-based authentication, providing users with more flexible and secure authentication options.
[0101] The message transmission server can be built using Kafka. Kafka, as a distributed, high-throughput message queue system, is primarily used for handling real-time data streams and large-volume data transmissions. It employs a publish-subscribe model, dividing data into different topics. Producers publish messages to the corresponding topics, and consumers subscribe to those topics and receive messages. In Kafka, data is delivered in the form of messages, each containing a key and a value. Messages can be allocated to different partitions based on the key, and each partition can be distributed across different servers, achieving distributed data storage and processing. Furthermore, Kafka provides message persistence and reliability guarantees, ensuring that messages are not lost even in the event of server failure or network anomalies. Therefore, Kafka can be combined with FTP to achieve the aforementioned network data interaction process.
[0102] During the connection establishment process in step S101 above, the FTP protocols involved in the external and internal FTP servers can be configured to enable file transfer under the FTP protocol. In practical scenarios, corresponding firewalls can also be set up on the internal and external networks to improve the security of data transmission.
[0103] In one implementation, step S103, where the first data source in the first event module is pushed to the first folder corresponding to the external FTP server using the first connection control first message transmission server, is as follows: Figure 3 As shown, it includes:
[0104] Step S301: Receive the first data source received from the first event module in real time using the first connection;
[0105] Step S302: After processing the first data source according to the message processing strategy corresponding to the first message transmission server, obtain the first configuration instruction corresponding to the first data source.
[0106] Step S303: After pushing the first data source to the external FTP server using the first connection control first message transmission server, the first data source is saved to the corresponding first folder using the first configuration command.
[0107] In a Kafka environment, the first event module can be set to topic1. In this case, the first connection is used to receive the first data source from topic1 in real time. Then, according to Kafka's parallel consumption strategy, the first data source in topic1 is consumed in real time, and a first configuration command corresponding to the first data source is generated. After using the first connection to control Kafka to push the first data source to the external FTP server, the first configuration command is used to save the first data source to the corresponding first folder for automatic synchronization by the external FTP server.
[0108] In one implementation, step S104, where the first data source is pushed to the corresponding second folder on the internal FTP server using a third connection to control the external FTP server, is as follows: Figure 4 As shown, it includes:
[0109] Step S401: Use the third connection to monitor the first data source received by the first folder in the external FTP server in real time;
[0110] Step S402: Determine the second configuration instruction for data transmission between the external FTP server and the internal FTP server according to the file synchronization policy corresponding to the file transfer network; wherein, the second configuration instruction is used to transmit the first data source in the external FTP server to the internal FTP server;
[0111] Step S403: After pushing the first data source to the internal FTP server using the third connection control external network FTP server, the first data source is saved to the corresponding second folder using the second configuration command.
[0112] The system utilizes a third connection to monitor the first data source received by the first folder on the external FTP server in real time. The external FTP server, upon receiving the first data source, automatically transfers the data according to a second configuration command and ultimately saves the first data source to the corresponding second folder on the internal FTP server. Specifically, once the first data source is received in the first folder on the external FTP server, it is automatically synchronized to the corresponding second folder on the internal FTP server.
[0113] In one implementation, step S105 of the second event module corresponding to the second message transmission server is performed by using the second connection to control the intranet FTP server to push the first data source to the second message transmission server. Figure 5 As shown, it includes:
[0114] Step S501: Use the second connection to monitor the first data source received by the second folder in the intranet FTP server in real time;
[0115] Step S502: After processing the first data source according to the message processing strategy corresponding to the second message transmission server, obtain the third configuration instruction corresponding to the first data source.
[0116] Step S503: After pushing the first data source to the second message transmission server using the second connection control, the first data source is saved to the corresponding second event module using the third configuration instruction.
[0117] In a Kafka environment, the second event module can be set as topic2. In this case, the second connection is used to receive the first data source from topic2 in real time. Then, according to Kafka's parallel consumption strategy, the first data source in topic2 is consumed in real time, and a third configuration command corresponding to the first data source is generated. After using the second connection to control Kafka to push the first data source to the second message transmission server, the third configuration command is used to save the first data source to the second event module for use by target users on the intranet. In a practical scenario, a corresponding automated script can be set up to automatically save the first data source received from the second folder on the intranet FTP server to the second event module topic2.
[0118] In one implementation, step S202, where the second connection controls the second message transmission server to push the second data source in the third event module into the third folder corresponding to the intranet FTP server, is as follows: Figure 6 As shown, it includes:
[0119] Step S601: Receive the second data source received from the third event module in real time using the second connection;
[0120] Step S602: After processing the second data source according to the message processing strategy corresponding to the second message transmission server, obtain the fourth configuration instruction corresponding to the second data source.
[0121] In step S603, after the second data source is pushed to the intranet FTP server by the second connection control second message transmission server, the second data source is saved to the corresponding third folder by the fourth configuration command.
[0122] In a Kafka environment, the third event module can be set to topic3. In this case, the second connection is used to receive the second data source from topic3 in real time. Then, according to Kafka's parallel consumption strategy, the second data source in topic3 is consumed in real time, and a fourth configuration command corresponding to the second data source is generated. After using the second connection to control Kafka to push the second data source to the internal FTP server, the fourth configuration command is used to save the second data source to the corresponding third folder for automatic synchronization by the internal FTP server.
[0123] In one implementation, step S203, where the second data source is pushed to the corresponding fourth folder on the external FTP server using a third connection to control the internal FTP server, is as follows: Figure 7 As shown, it includes:
[0124] Step S701: Use the third connection to monitor the second data source received by the third folder in the intranet FTP server in real time;
[0125] Step S702: Determine the fifth configuration instruction for data transmission between the intranet FTP server and the external FTP server according to the file synchronization policy corresponding to the file transfer network; wherein, the fifth configuration instruction is used to transmit the second data source in the intranet FTP server to the external FTP server;
[0126] Step S703: After pushing the second data source to the external FTP server using the third connection control intranet FTP server, the second data source is saved to the corresponding fourth folder using the fifth configuration command.
[0127] The system utilizes a third connection to monitor the second data source received by the third folder on the internal FTP server in real time. The second data source received by the internal FTP server is automatically transferred according to the fifth configuration command, and ultimately saved to the corresponding fourth folder on the external FTP server. Specifically, once the third folder on the internal FTP server receives the second data source, it automatically synchronizes the second data source to the corresponding fourth folder on the external FTP server.
[0128] In one implementation, step S204 of the fourth event module corresponding to the first message transmission server is performed by using the first connection to control the external network FTP server to push the second data source to the first message transmission server. Figure 8 As shown, it includes:
[0129] Step S801: Use the first connection to monitor in real time the second data source received by the fourth folder in the intranet FTP server;
[0130] Step S802: After processing the second data source according to the message processing strategy corresponding to the first message transmission server, obtain the sixth configuration instruction corresponding to the second data source.
[0131] In step S803, after the second data is pushed into the first message transmission server by controlling the first connection, the second data source is saved to the corresponding first time module by using the sixth configuration instruction.
[0132] In a Kafka environment, the fourth event module can be set as topic4. In this case, the first connection is used to receive the second data source from topic4 in real time. Then, according to Kafka's parallel consumption strategy, the second data source in topic4 is consumed in real time, generating the sixth configuration command corresponding to the second data source. After using the first connection to control Kafka to push the second data source to the first message transmission server, the sixth configuration command is used to save the second data source to the fourth event module for use by target users on the external network. In a practical scenario, a corresponding automated script can be set up to automatically save the second data source received from the fourth folder on the external FTP server to the fourth event module topic4.
[0133] The process of establishing a third connection between an external FTP server and an internal FTP server is as follows: Figure 9 As shown. First, the external FTP server and the internal FTP server need to communicate via a network connection. This connection can be established using a VPN (Virtual Private Network) or other network connection methods. After the connection is established, the external FTP server sends a connection request to the internal FTP server. Upon receiving the request, the internal FTP server sends an acknowledgment signal to the external FTP server. After connection confirmation, the external FTP server sends a data request to the internal FTP server. Upon receiving the request, the internal FTP server sends the data from its designated folder to the designated folder on the external FTP server. During data transfer, encryption and authentication are performed between the external and internal FTP servers to ensure the security and integrity of the data transmission. Once the data transfer is complete, the external FTP server sends a disconnect request to the internal FTP server. Upon receiving the request, the internal FTP server sends an acknowledgment signal to the external FTP server and closes the connection.
[0134] The process of network data interaction between the intranet and the extranet can be referenced as follows: Figure 10 The diagram illustrates the data flow transmission of a network data interaction method. Specifically, in the data transmission link from the external network to the internal network, Python script 1 can be used to obtain data from the external network data source and store it in real time into topic 1 of the external Kafka. There are many types of external network data sources, and the methods for obtaining different external network data sources vary. The logic of Python script 1 is: to obtain external network data in real time and write it to topic 1 of the external Kafka. Python script 1 changes according to the data source and is not fixed.
[0135] This Python script uses a parallel consumption strategy to consume data from an external Kafka topic (topic 1) in real time and write it to a designated folder (folder 1) configured on an external FTP server. This allows for automatic synchronization with the internal FTP server after a connection is established. Specifically, the automatic synchronization function enables synchronization between FTP servers; when a folder on one FTP server has a new file, it is automatically synchronized to a folder on the other FTP server. The Python script's logic is to continuously retrieve data from topic 1 and write it to the designated folder (folder 1) on the external FTP server, ultimately monitoring the presence of data in folder 1 and automatically transferring it.
[0136] The internal FTP server establishes a connection with the external FTP server. Once it detects data in folder 1, it sends a file transfer command to the external FTP server. After receiving the command, the external FTP server begins to transfer the data from folder 1 to the specified folder 2 on the internal FTP server.
[0137] A Python script (Script 3) monitors the internal FTP server in real-time for data in a specified folder (folder 2). If data is found in folder 2, it is retrieved and written to topic 2 on the internal Kafka network. The logic of the Python script is as follows: monitor the data in folder 2 on the internal FTP server; if data is found, it is retrieved and written to topic 2 on the internal Kafka network. After the data is written to topic 2 on the internal Kafka network, user clients on the internal network can consume the data from topic 2 for specific application scenarios. For example, comments from users on external WeChat official accounts can be transmitted to the internal network so that account administrators can reply and provide feedback within the internal network.
[0138] In the data transmission link from the intranet to the external network, a Python script (4) can be used to write the acquired intranet data source to topic 3 of the intranet Kafka in real time. The logic of Python script 4 is: to acquire data in real time and write it to topic 3 of the intranet Kafka. Python script 4 is not fixed and varies depending on the data source.
[0139] This Python script (Python 5) uses Kafka's parallel consumption strategy to consume data from topic 3 on the internal Kafka network in real time and write it to a designated folder (folder 3) configured on the internal FTP server. This allows for automatic synchronization with the external FTP server after a connection is established. Specifically, the automatic synchronization function enables synchronization between FTP servers; when a folder on one FTP server has a new file, it is automatically synchronized to a folder on the other FTP server. The Python 5 script's logic is: to continuously retrieve data from topic 3 and write it to the designated folder (folder 3) on the internal FTP server, ultimately monitoring the presence of data in folder 3 and automatically transferring it.
[0140] The external FTP server establishes a connection with the internal FTP server. Once it detects data in folder 3, it sends a file transfer command to the internal FTP server. After receiving the command, the internal FTP server begins transferring the data from folder 3 to the specified folder 4 on the external FTP server.
[0141] This script (Python 6) monitors the data in a specified folder (folder 4) on an external FTP server in real time. If data is found in folder 4, it is retrieved and written to topic 4 on the external Kafka server. The logic of the Python script is as follows: monitor the data in folder 4 on the external FTP server; if data is found, it is retrieved and written to topic 4 on the external Kafka server. After the data is written to topic 4 on the external Kafka server, user clients on the external network can consume the data from topic 4 for specific application scenarios, such as administrators of internal WeChat official accounts publishing articles and replying to user comments on the internal network.
[0142] As can be seen from the network data interaction method mentioned in the above embodiments, this method uses a file transfer network to connect the external network and the internal network, and then uses a corresponding message transmission server to realize the interconnection of network data between the external network and the internal network, thereby solving the problems of poor security, slow transmission speed and low transmission stability in the cross-network transmission of existing network data between the internal network and the external network.
[0143] Regarding the network data interaction method provided in the foregoing embodiments, this invention provides a network data interaction system. This system is used for data interaction between an external network and an internal network, which are connected via a file transfer network. Specifically, a first message transmission server is configured on the external network, a second message transmission server is configured on the internal network, and an external FTP server and an internal FTP server are configured on the file transfer network. Based on this, as... Figure 11 As shown, the system includes:
[0144] The first interaction module 1101 is used to establish a first connection between the external FTP server and the first message transmission server, a second connection between the internal FTP server and the second message transmission server, and a third connection between the external FTP server and the internal FTP server, respectively.
[0145] The second interaction module 1102 is used to push the first data source from the external network into the first event module corresponding to the first message transmission server;
[0146] The third interaction module 1103 is used to control the first message transmission server to push the first data source in the first event module into the first folder corresponding to the external FTP server using the first connection;
[0147] The fourth interaction module 1104 is used to control the external FTP server via the third connection to push the first data source into the corresponding second folder of the internal FTP server;
[0148] The fifth interaction module 1105 is used to push the first data source into the second event module corresponding to the second message transmission server by using the second connection to control the intranet FTP server;
[0149] The sixth interaction module 1106 is used to control the second message transmission server to interact with the first data source in the second event module and the corresponding target user.
[0150] In one implementation, such as Figure 12 As shown, the network data interaction also includes:
[0151] The seventh interaction module 1107 is used to push the second data source of the intranet into the third event module corresponding to the second message transmission server;
[0152] The eighth interaction module 1108 is used to control the second message transmission server via the second connection to push the second data source in the third event module into the third folder corresponding to the intranet FTP server;
[0153] The ninth interactive module 1109 is used to control the internal network FTP server to push the second data source into the corresponding fourth folder of the external network FTP server using the third connection.
[0154] The tenth interaction module 1110 is used to control the external network FTP server through the first connection to push the second data source into the fourth event module corresponding to the first message transmission server;
[0155] The eleventh interaction module 1111 is used to control the first message transmission server to interact with the second data source in the fourth event module and the corresponding target user.
[0156] The network data interaction system provided in this invention can connect the external network and the internal network using a file transfer network, and then realize the interconnection of network data between the external network and the internal network using a corresponding message transmission server. This solves the problems of poor security, slow transmission speed and low transmission stability in the cross-network transmission of network data between the internal network and the external network.
[0157] The network data interaction system provided in this embodiment of the invention has the same implementation principle and technical effects as the aforementioned network data interaction method embodiment. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned method embodiment.
[0158] This embodiment also provides an electronic device, the structural schematic diagram of which is shown below. Figure 13 As shown, the device includes a processor 101 and a memory 102; wherein, the memory 102 is used to store one or more computer instructions, which are executed by the processor to implement the above-mentioned network data interaction method.
[0159] Figure 13 The electronic device shown also includes a bus 103 and a communication interface 104, with the processor 101, communication interface 104 and memory 102 connected via the bus 103.
[0160] The memory 102 may include high-speed random access memory (RAM), and may also include non-volatile memory, such as at least one disk storage device. The bus 103 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 13 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0161] The communication interface 104 is used to connect to at least one user terminal and other network units through a network interface, and to send encapsulated IPv4 packets or IPv4 packets to the user terminal through the network interface.
[0162] Processor 101 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 101 or by instructions in software form. The processor 101 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this disclosure. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this disclosure can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 102. The processor 101 reads the information in memory 102 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.
[0163] This invention also provides a storage medium storing a computer program, which, when executed by a processor, performs the steps of the network data interaction method described in the foregoing embodiments.
[0164] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the coupling or direct coupling or communication connection shown or discussed may be through some communication interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0165] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0166] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0167] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0168] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A network data interaction method, characterized in that, The method is used for data interaction between an external network and an internal network, which are connected via a file transfer network; wherein, a first message transmission server is set up in the external network, a second message transmission server is set up in the internal network, and an external FTP server and an internal FTP server are set up in the file transfer network. The method includes: A first connection is established between the external FTP server and the first message transmission server, a second connection is established between the internal FTP server and the second message transmission server, and a third connection is established between the external FTP server and the internal FTP server. The first data source from the external network is pushed into the first event module corresponding to the first message transmission server; Using the first connection, the first message transmission server is controlled to push the first data source in the first event module into the first folder corresponding to the external FTP server. Using the third connection, the external FTP server is controlled to push the first data source into the second folder corresponding to the internal FTP server; The second connection is used to control the intranet FTP server to push the first data source to the second event module corresponding to the second message transmission server; The second message transmission server is controlled to interact with the first data source in the second event module and the corresponding target user; The method further includes: The second data source of the intranet is pushed into the third event module corresponding to the second message transmission server; Using the second connection, the second message transmission server is controlled to push the second data source in the third event module into the third folder corresponding to the intranet FTP server; The third connection is used to control the intranet FTP server to push the second data source into the fourth folder corresponding to the extranet FTP server; Using the first connection, the external FTP server is controlled to push the second data source into the fourth event module corresponding to the first message transmission server; The first message transmission server is controlled to interact with the second data source in the fourth event module and the corresponding target user.
2. The network data interaction method according to claim 1, characterized in that, The step of using the first connection to control the first message transmission server to push the first data source in the first event module to the first folder corresponding to the external FTP server includes: The first data source received from the first event module is received in real time using the first connection; After processing the first data source according to the message processing strategy corresponding to the first message transmission server, the first configuration instruction corresponding to the first data source is obtained. After the first data source is pushed to the external FTP server by the first connection control first message transmission server, the first data source is saved to the corresponding first folder by the first configuration instruction.
3. The network data interaction method according to claim 1, characterized in that, The step of using the third connection to control the external FTP server to push the first data source to the corresponding second folder on the internal FTP server includes: The third connection is used to monitor in real time the first data source received by the first folder in the external FTP server; Based on the file synchronization policy corresponding to the file transfer network, a second configuration instruction for data transmission between the external FTP server and the internal FTP server is determined; wherein, the second configuration instruction is used to transmit the first data source in the external FTP server to the internal FTP server; After the first data source is pushed to the internal FTP server by the external network FTP server using the third connection, the first data source is saved to the corresponding second folder using the second configuration command.
4. The network data interaction method according to claim 1, characterized in that, The step of using the second connection to control the intranet FTP server to push the first data source to the second event module corresponding to the second message transmission server includes: The second connection is used to monitor in real time the first data source received by the second folder in the intranet FTP server; After processing the first data source according to the message processing strategy corresponding to the second message transmission server, the third configuration instruction corresponding to the first data source is obtained. After the first data source is pushed to the second message transmission server using the second connection control, the first data source is saved to the corresponding second event module using the third configuration instruction.
5. The network data interaction method according to claim 1, characterized in that, The step of using the second connection to control the second message transmission server to push the second data source in the third event module to the third folder corresponding to the intranet FTP server includes: The second connection is used to receive the second data source received in the third event module in real time; After processing the second data source according to the message processing strategy corresponding to the second message transmission server, the fourth configuration instruction corresponding to the second data source is obtained. After the second data source is pushed to the intranet FTP server by the second connection control second message transmission server, the second data source is saved to the corresponding third folder by the fourth configuration instruction.
6. The network data interaction method according to claim 1, characterized in that, The step of using the third connection to control the intranet FTP server to push the second data source to the corresponding fourth folder on the external FTP server includes: The third connection is used to monitor in real time the second data source received by the third folder in the intranet FTP server; A fifth configuration instruction for data transmission between the intranet FTP server and the extranet FTP server is determined based on the file synchronization policy corresponding to the file transfer network; wherein, the fifth configuration instruction is used to transmit the second data source in the intranet FTP server to the extranet FTP server; After the second data source is pushed to the external FTP server by the third connection, the second data source is saved to the corresponding fourth folder by the fifth configuration instruction.
7. The network data interaction method according to claim 1, characterized in that, The step of using the first connection to control the external FTP server to push the second data source into the fourth event module corresponding to the first message transmission server includes: The first connection is used to monitor in real time the second data source received by the fourth folder in the intranet FTP server; After processing the second data source according to the message processing strategy corresponding to the first message transmission server, the sixth configuration instruction corresponding to the second data source is obtained; After the first connection is used to control the first message transmission server to push the second data to the first message transmission server, the sixth configuration instruction is used to save the second data source to the corresponding first event module.
8. A network data interaction system, characterized in that, The system is used for data interaction between an external network and an internal network, which are connected via a file transfer network. The external network is equipped with a first message transmission server, the internal network is equipped with a second message transmission server, and the file transfer network is equipped with an external FTP server and an internal FTP server. The system includes: The first interaction module is used to establish a first connection between the external FTP server and the first message transmission server, a second connection between the internal FTP server and the second message transmission server, and a third connection between the external FTP server and the internal FTP server, respectively. The second interaction module is used to push the first data source of the external network into the first event module corresponding to the first message transmission server; The third interaction module is used to control the first message transmission server to push the first data source in the first event module into the first folder corresponding to the external FTP server using the first connection. The fourth interaction module is used to control the external FTP server to push the first data source into the second folder corresponding to the internal FTP server using the third connection; The fifth interaction module is used to control the intranet FTP server to push the first data source to the second event module corresponding to the second message transmission server using the second connection; The sixth interaction module is used to control the second message transmission server to interact with the first data source in the second event module and the corresponding target user; The seventh interaction module is used to push the second data source of the intranet into the third event module corresponding to the second message transmission server; control the second message transmission server to push the second data source in the third event module into the third folder corresponding to the intranet FTP server using the second connection; control the intranet FTP server to push the second data source into the fourth folder corresponding to the external FTP server using the third connection; control the external FTP server to push the second data source into the fourth event module corresponding to the first message transmission server using the first connection; and control the first message transmission server to interact with the second data source in the fourth event module with the corresponding target user.
9. An electronic device, characterized in that, include: Processors and storage devices; The storage device stores computer-executable instructions that can be executed by a processor, and the processor executes the computer-executable instructions to implement the steps of the network data interaction method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Private protocol file transfer system and method
CN106230870A
Information cross-network secure transmission system and method
CN116436662A
