Communication method and device of isolated network, electronic equipment and storage medium

By using a Redis cluster to store request messages and identifiers in the data exchange system, the problem of data inconsistency caused by node switching in virtual IP network communication is solved, and the stability and consistency of data communication in isolated networks are achieved.

CN117834277BActive Publication Date: 2026-02-13BEIJING WONDERSOFT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410014678.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-04
Publication Date
2026-02-13
Estimated Expiration
2044-01-04

AI Technical Summary

Technical Problem

When communicating over a network using a virtual IP, node switching can cause request and response messages to be on different nodes, leading to message aggregation failure and resulting in data loss or inconsistency.

Method used

By dividing the data exchange system into at least two networks, deploying at least two network exchange servers in each network, establishing communication connections using virtual IPs, and storing request messages and identifiers through a Redis cluster, it is ensured that request messages and response messages are added with corresponding identifiers, thereby achieving data consistency and a high success rate for message aggregation.

Benefits of technology

Even if the network exchange server changes, it can effectively ensure the consistency of the convergence of request and response messages, reduce the probability of data loss or data inconsistency, and improve the success rate of message aggregation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117834277B_ABST
    Figure CN117834277B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a communication method and device of an isolated network, electronic equipment and a storage medium, and relate to the technical field of network communication. The method comprises: a first network exchange server located in a first network generating a request message corresponding to a data sending request and a request identifier corresponding to the request message in response to the data sending request, and then storing the request message and the request identifier in a redis cluster; a second network exchange server located in a second network generating a response message for the request message and a response identifier corresponding to the response message by performing a data processing operation corresponding to a content parameter in response to receiving the request message; and if any target network exchange server located in the first network successfully acquires the response message based on the request identifier, recording a first log for the data sending request, and deleting the request message and the request identifier from the redis cluster, so as to ensure the success rate of message aggregation and reduce the probability of data loss or data inconsistency.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of network communication, in particular to a communication method of isolated network, a communication device of isolated network, an electronic device and a computer readable storage medium. BACKGROUND

[0002] The isolated network is a network security measure, which can divide the network into multiple isolated sub-networks through physical or logical means to prevent malicious behavior propagation, ensure sensitive data and reduce the risk of potential attacks. Among them, Virtual IP, that is, virtual IP, is a virtual IP address that does not exist in the network. It can provide an address for the corresponding program, the purpose is to improve the availability and load balancing capability of the service. In the corresponding business scenario, in order to ensure business load balancing and high availability, the corresponding program can realize business high availability through virtual IP. However, when communicating through virtual IP, the request message and the response message are not on the same node due to the switching of the node in the network communication process, resulting in message aggregation failure, thereby causing business exceptions, resulting in data loss or data inconsistency problems. SUMMARY

[0003] The embodiments of the present application provide a communication method, device, electronic device and computer readable storage medium of isolated network to solve or partially solve the problem of data loss or inconsistency in network communication.

[0004] The embodiments of the present application disclose a communication method of isolated network, applied to a data exchange system, the data exchange system divides a network environment into at least two networks, at least two network exchange servers are deployed in each network, and the network exchange servers in different networks establish corresponding communication connections through virtual IP, the method comprises:

[0005] The first network exchange server in the first network generates a request message corresponding to the data sending request and a request identifier corresponding to the request message in response to the data sending request, and the request message at least includes network parameters and content parameters corresponding to the data sending request;

[0006] The first network exchange server stores the request message and the request identifier into a redis cluster, and determines a second network exchange server corresponding to the network parameters, and sends the request message to the second network exchange server, wherein the second network exchange server and the first network exchange server are located in different networks;

[0007] The second network exchange server located in the second network performs a data processing operation corresponding to the content parameter in response to receiving the request message, and generates a response message corresponding to the request message and a response identification corresponding to the response message;

[0008] If any target network exchange server located in the first network successfully acquires the response message based on the request identification, a first log for the data sending request is recorded, and the request message and the request identification are deleted from the redis cluster.

[0009] In some possible embodiments, after the request message is sent to the second network exchange server, the method further includes:

[0010] The first network exchange server performs a blocking operation for a preset time period, and if the response message is not acquired within the preset time period, the request message is re-sent to the second network exchange server.

[0011] In some possible embodiments, after the request message is re-sent to the second network exchange server, the method further includes:

[0012] If the number of times that the first network exchange server re-sends the request message to the second network exchange server is greater than or equal to a preset threshold, the first network exchange server generates a second log for the request message, and deletes the request message and the request identification from the redis cluster.

[0013] In some possible embodiments, the request message corresponding to the data sending request and the request identification corresponding to the request message are generated in response to the data sending request, including:

[0014] In response to a data sending request, network parameters and content parameters corresponding to the data sending request and message types corresponding to the at least two networks are acquired, and a request identification corresponding to the data sending request is generated, wherein the content parameters at least include file content and file pre-message.

[0015] If the message type represents a connection between a first network and a second network, the network parameters, the file content, the file pre-message, and the request identification are encapsulated to obtain a request message corresponding to the data sending request.

[0016] In some possible embodiments, the network parameters include second IP information and a second network identification of a second network exchange server, and the second network exchange server corresponding to the network parameters is determined, including:

[0017] select a network exchange server corresponding to the second IP information and the second network identification from a connection pool of the data exchange system as a second network exchange server for data communication with the first network exchange server.

[0018] In some possible embodiments, the data processing operation corresponding to the content parameter is performed and a response message corresponding to the response identification is generated in response to receiving the request message, including:

[0019] In response to receiving the interaction message, if the interaction message is the request message, a message serial number corresponding to the request message is obtained, the request message is stored in a redis ordered set according to the message serial number, and the request message is parsed according to the message serial number to obtain the content parameter, the content parameter at least including file content and a file pre-message;

[0020] A data processing operation for the file content is performed based on the file pre-message;

[0021] If the data processing operation is successfully performed, a first response message corresponding to the request message and a response identification corresponding to the first response message are generated, the first response message being a message for notifying the first network exchange server that service processing corresponding to the request message is successful;

[0022] If the data processing operation fails, a second response message corresponding to the request message and a response identification corresponding to the second response message are generated, the second response message being a message for notifying the first network exchange server that service processing corresponding to the request message fails.

[0023] In some possible embodiments, if any target network exchange server in the first network successfully obtains the response message based on the request identification, a first log for the data sending request is recorded, and the request message and the request identification are deleted from the redis cluster, including:

[0024] A target network exchange server in the first network stores the response message and the response identification into the redis cluster in response to receiving the response message and the response identification sent by the second network exchange server;

[0025] The target network exchange server obtains a response message corresponding to the response identification based on the request identification from the redis cluster;

[0026] If the response message is a first response message representing that the service processing is successful, the target network exchange server generates a service processing success log corresponding to the request message, and deletes the request message and the request identifier from the redis cluster;

[0027] If the response message is a second response message representing that the service processing is failed, the target network exchange server generates a service processing failure log corresponding to the request message, and deletes the request message and the request identifier from the redis cluster.

[0028] The embodiment of the application further discloses a communication device of an isolated network, applied to a data exchange system, wherein the data exchange system divides a network environment into at least two networks, at least two network exchange servers are arranged in each network, and the network exchange servers in different networks establish corresponding communication connections through virtual IP.

[0029] A request message determination module in a first network exchange server in a first network is configured to generate a request message corresponding to a data sending request and a request identifier corresponding to the request message in response to the data sending request, wherein the request message at least includes network parameters and content parameters corresponding to the data sending request;

[0030] A request message sending module in the first network exchange server is configured to store the request message and the request identifier into a redis cluster, and determine a second network exchange server corresponding to the network parameters, and send the request message to the second network exchange server, wherein the second network exchange server is located in a different network from the first network exchange server.

[0031] A response module in the second network exchange server in a second network is configured to execute a data processing operation corresponding to the content parameters in response to receiving the request message, and generate a response message corresponding to the request message and a response identifier corresponding to the response message.

[0032] A log generation module in a target network exchange server is configured to record a first log corresponding to the data sending request if any target network exchange server in the first network successfully acquires the response message based on the request identifier, and delete the request message and the request identifier from the redis cluster.

[0033] In some possible embodiments, the device further comprises:

[0034] A message retransmission module located at the first network exchange server is configured to perform a blocking operation for a preset time period, and if the response message is not obtained within the preset time period, the request message is retransmitted to the second network exchange server.

[0035] In some possible embodiments, the apparatus further includes:

[0036] An information deletion module located at the first network exchange server is configured to, if the number of times that the first network exchange server retransmits the request message to the second network exchange server is greater than or equal to a preset threshold, generate a second log for the request message, and delete the request message and the request identifier from the redis cluster.

[0037] In some possible embodiments, the request message determination module is specifically configured to:

[0038] In response to a data sending request, network parameters and content parameters corresponding to the data sending request, and message types corresponding to the at least two networks are obtained, and a request identifier corresponding to the data sending request is generated, wherein the content parameters at least include file content and file pre-message.

[0039] If the message type represents a connection between a first network and a second network, the network parameters, the file content, the file pre-message, and the request identifier are encapsulated to obtain a request message corresponding to the data sending request.

[0040] In some possible embodiments, the network parameters include second IP information and a second network identifier of a second network exchange server, and the request message sending module is specifically configured to:

[0041] The network exchange server corresponding to the second IP information and the second network identifier is selected from a connection pool of the data exchange system as a second network exchange server for data communication with the first network exchange server.

[0042] In some possible embodiments, the response module is specifically configured to:

[0043] In response to receiving an interaction message, if the interaction message is the request message, a message sequence number corresponding to the request message is obtained, the request message is stored in a redis ordered set according to the message sequence number, and the request message is parsed according to the message sequence number to obtain the content parameters, wherein the content parameters at least include file content and file pre-message.

[0044] A data processing operation for the file content is performed based on the file pre-message.

[0045] If the data processing operation is successfully performed, a first response message corresponding to the request message is generated, and a response identifier corresponding to the first response message is generated, wherein the first response message is a message for notifying the first network switching server that the service processing corresponding to the request message is successful;

[0046] If the data processing operation fails, a second response message corresponding to the request message is generated, and a response identifier corresponding to the second response message is generated, wherein the second response message is a message for notifying the first network switching server that the service processing corresponding to the request message fails.

[0047] In some possible embodiments, the log generation module is specifically configured to:

[0048] A target network switching server located in the first network stores the response message and the response identifier into the redis cluster in response to receiving the response message and the response identifier sent by the second network switching server;

[0049] The target network switching server queries the response identifier corresponding to the same identifier from the redis cluster based on the request identifier, and obtains the response message corresponding to the response identifier;

[0050] If the response message is a first response message indicating that the service processing is successful, the target network switching server generates a service processing success log corresponding to the request message, and deletes the request message and the request identifier from the redis cluster;

[0051] If the response message is a second response message indicating that the service processing is successful, the target network switching server generates a service processing failure log corresponding to the request message, and deletes the request message and the request identifier from the redis cluster.

[0052] An electronic device is also disclosed in the embodiments of the present application, which comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus;

[0053] The memory is used for storing a computer program;

[0054] The processor is used for executing the program stored on the memory, and realizes the method as described in the embodiments of the present application.

[0055] A computer readable storage medium is also disclosed in the embodiments of the present application, which stores instructions, and when executed by one or more processors, causes the processor to execute the method as described in the embodiments of the present application.

[0056] Embodiments of the present application include the following advantages:

[0057] In the embodiments of the present application, the data exchange system can be applied to divide a network environment into at least two networks, at least two network exchange servers are deployed in each network, the network exchange servers in different networks can establish corresponding communication connections through virtual IP, when data interaction occurs between two networks, the first network exchange server in the first network generates a request message corresponding to the data sending request and a request identifier corresponding to the request message in response to the data sending request, the request message at least includes network parameters and content parameters corresponding to the data sending request, and the request message and the request identifier are stored in the redis cluster, and the second network exchange server corresponding to the network parameters is determined, and the request message is sent to the second network exchange server, the second network exchange server in the second network generates a response message corresponding to the request message and a response identifier corresponding to the response message in response to receiving the request message, and performs a data processing operation corresponding to the content parameter, if any target network exchange server in the first network successfully obtains the response message based on the request identifier, a first log corresponding to the data sending request is recorded, and the request message and the request identifier are deleted from the redis cluster, so that when data communication is performed in the isolated network, the consistency of the request message and the response message is effectively ensured, the success rate of message aggregation is ensured, and the probability of data loss or data inconsistency is reduced. BRIEF DESCRIPTION OF DRAWINGS

[0058] Figure 1 is a step flow chart of a communication method of an isolated network provided in the embodiments of the present application;

[0059] Figure 2 is a structural schematic diagram of device communication provided in the embodiments of the present application;

[0060] Figure 3 is a flowchart of network communication in the embodiments of the present application;

[0061] Figure 4 is a structural block diagram of a communication device of an isolated network provided in the embodiments of the present application;

[0062] Figure 5 is a block diagram of an electronic device provided in the embodiments of the present application. DETAILED DESCRIPTION

[0063] In order to make the above objectives, characteristics and advantages of the present application more apparent, further specific embodiments will be described in detail with reference to the accompanying drawings and specific embodiments.

[0064] Correspondingly, in order to make the skilled in the art better understand the technical solutions in the embodiments of the present application, some technical features involved in the embodiments of the present application will be explained and described as follows:

[0065] VIP: full name Virtual IP, namely virtual IP. It is a virtual IP address, which does not exist in the network, is a keepalived program provided address, the purpose is to improve the service availability and load balancing capability.

[0066] keepalived: a high availability software, which realizes IP virtualization and service redundancy, guarantees the high availability of system or service. Among them, VIP is one of the core concepts of keepalived.

[0067] Data exchange system: a set of systems for internal and external network data exchange. From the topology, the network environment is divided into at least two areas, each area undertakes the corresponding security responsibility, and various different security technical means (identity authentication, access control, physical isolation) are organically composed together to accommodate all internal and external network exchange services of users, and the security protection ability of network boundary and the management ability of users are maximized.

[0068] Data exchange server: is deployed between different security level networks / security domains, and is specially used for data exchange between different networks. According to the different deployment positions, it undertakes the corresponding responsibilities and provides stable, safe and effective data exchange services for users.

[0069] As an example, in some business scenarios, data exchange system is often needed. In order to ensure business load balancing and high availability, keepalived program and other technologies can be used to build corresponding virtual IP, and multiple nodes can be combined to realize business high availability. However, in this process, when the virtual IP is used for message communication, if the back-end node of the virtual IP receives the message sent by the node initiating the request and returns the corresponding response message through the request end, after the virtual IP switching or the request node switching, the problem that the request message and the response message are not in the same node will occur, which will cause the problem that the messages cannot be aggregated, and further cause the problems of data loss or data inconsistency.

[0070] To this end, in the embodiment of the present application, the data exchange system is applied to divide the network environment into at least two networks, at least two network exchange servers are deployed in each network, the network exchange servers in different networks can establish corresponding communication connections through virtual IP, when data interaction occurs between two networks, the first network exchange server in the first network generates a request message corresponding to the data sending request and a request identifier corresponding to the request message in response to the data sending request, the request message at least includes network parameters and content parameters corresponding to the data sending request, and the request message and the request identifier are stored in the redis cluster, and the second network exchange server corresponding to the network parameters is determined, and the request message is sent to the second network exchange server, the second network exchange server in the second network executes a data processing operation corresponding to the content parameters in response to receiving the request message, and generates a response message for the request message and a response identifier corresponding to the response message, if any target network exchange server in the first network successfully obtains the response message based on the request identifier, a first log for the data sending request is recorded, and the request message and the request identifier are deleted from the redis cluster, so that when data communication is performed in the isolated network, the request message and the response message are added with corresponding identifiers, and based on the data storage mode of the redis cluster, even if the network exchange server sending the request message changes, the consistency of the request message and the response message can be effectively ensured, the success rate of message aggregation can be ensured, and the probability of data loss or data inconsistency can be reduced.

[0071] Referring to Figure 1 , a step flowchart of a communication method of an isolated network provided in the embodiment of the present application is shown, the data exchange system is applied to divide the network environment into at least two networks, at least two network exchange servers are deployed in each network, the network exchange servers in different networks establish corresponding communication connections through virtual IP, and the method can specifically include the following steps:

[0072] In step 101, the first network exchange server in the first network generates a request message corresponding to the data sending request and a request identifier corresponding to the request message in response to the data sending request, the request message at least includes network parameters and content parameters corresponding to the data sending request;

[0073] In the embodiment of the present application, the data exchange system can be applied to divide the network environment into at least two networks through the data exchange system, at least two network exchange servers can be deployed in each network, and the network exchange servers in different networks can establish corresponding communication connections through virtual IP.

[0074] The network exchange server can be connected with a node device (hereinafter referred to as a node) deployed in a corresponding network, and the network exchange servers in different networks can perform cross-network data interaction through a virtual IP. Optionally, the data exchange system divides the network environment into an external network and an internal network. The external network can be a network connected to the Internet, which is maintained and managed by various Internet service providers and communication providers. The external network can enable devices to be connected and communicate with each other globally, and provide the ability to access various resources and services on the Internet. The internal network can be a LAN in a specific organization, enterprise or family, or a smaller range such as an office or home network, which is used for resource sharing, file transfer, printer sharing, internal communication and other purposes within the organization.

[0075] In an example, referring to Figure 2 , a structure diagram of device communication provided in the embodiment of the application is shown. The network environment is divided into an external network and an internal network by the data exchange system. In the network environment of the external network data exchange, at least two data exchange servers can be included, each of which is in communication connection with a corresponding virtual IP-1 to communicate with the data exchange server in the internal network. Correspondingly, in the network environment of the internal network data exchange, at least two data exchange servers can also be included, each of which is in communication connection with a corresponding virtual IP-2 to communicate with the data exchange server in the external network. In addition, the external network and the internal network can be connected to the corresponding access switch to realize corresponding data exchange.

[0076] It should be noted that the network environment is divided into an external network environment and an internal network environment in the embodiment of the application, which is exemplarily described. It can be understood that other types of networks can also be divided, and the application does not limit this.

[0077] In the embodiment of the application, the first network exchange server in the first network can be in communication connection with the second network exchange server in the second network to realize corresponding service processing. For example, the first network exchange server can send a file to the second network exchange server, request a file, detect the connection state of the network, etc. In the above process, data communication between the network exchange servers in different networks is involved. For the communication process, the request message sent by the requester and the response message returned by the responder are aggregated to ensure data consistency and facilitate data backtracking.

[0078] In a specific implementation, the first network exchange server located in the first network can generate a request message corresponding to the data sending request and a request identifier corresponding to the request message in response to the data sending request, the request message comprising at least network parameters and content parameters corresponding to the data sending request. The network parameters can be used to determine the sender of the request message and the receiver of the request message, and the content parameters can be parameters related to the data involved in the data communication process, such as file content, file preface information, file name, etc., which are not limited by the present application.

[0079] In some possible implementations, the first network exchange server can obtain network parameters and content parameters corresponding to the data sending request and message types corresponding to at least two networks in response to the data sending request, and generate a request identifier corresponding to the data sending request. The content parameters comprise at least file content and file preface information. If the message type represents the connection between the first network and the second network, the network parameters, the file content, the file preface information and the request identifier are encapsulated to obtain a request message corresponding to the data sending request. The message type can be a heartbeat between different networks, used to represent the connection state between different networks. If the opposite end continuously receives the heartbeat signal, it represents that the two networks are in a connected state. If the opposite end does not receive the heartbeat signal for a certain period of time, it represents that the two networks are in a disconnected or offline state. The file preface information can be a message informing the receiver of the memory size of the file content, the file name and other file information.

[0080] In a specific implementation, the first network exchange server can generate a unique request identifier corresponding to the request message after encapsulating the corresponding request message, so as to mark the request message through the request identifier, facilitating subsequent query of the request message.

[0081] Step 102, the first network exchange server stores the request message and the request identifier into the redis cluster, and determines a second network exchange server corresponding to the network parameters, and sends the request message to the second network exchange server, the second network exchange server being located in a different network from the first network exchange server.

[0082] In the embodiment of the present application, when the first network exchange server generates a request message and a request identifier corresponding to the request message, the request message and the request identifier can be stored in the corresponding redis cluster, so as to persist the request message and query the request message through the request identifier, thereby avoiding the problem that when the network exchange server changes, the corresponding message cannot be queried, and ensuring the consistency of data. The redis cluster can be a cluster composed of multiple redis nodes, which is used to provide a solution for high availability and performance expansion. In the present application, the request message can be stored through the redis cluster, so as to trace the data interaction process of the network exchange server.

[0083] Correspondingly, after the first network exchange server stores the request message and the request identifier in the redis cluster, the corresponding second network exchange server can be determined based on the network parameters, and the request message can be sent to the second network exchange server. In a specific implementation, the network parameters include second IP information and a second network identifier of the second network exchange server, and then the first network exchange server can select the network exchange server corresponding to the second IP information and the second network identifier from the connection pool of the data exchange system as the second network exchange server for data communication with the first network exchange server.

[0084] It should be noted that the network parameters can include first IP information and a first network identifier of the first network exchange server, and second IP information and a second network identifier of the second network exchange server of the receiver of the request message, wherein the IP information can be the IP address of the network exchange server, and the network identifier can be the identifier of the network where the network exchange server is located, such as an external network identifier, an internal network identifier, etc. Specifically, the connection pool can include network exchange servers in the data exchange system that use virtual IP for network communication, for example: external network-network exchange server ①, external network-network exchange server ②, internal network-network exchange server ③, external network-network exchange server ④, internal network-network exchange server ⑤, and internal network-network exchange server ⑥, etc. Then, the first network exchange server can select the corresponding second network exchange server from the connection pool based on the second IP information and the second network identifier, so as to send the request message to the corresponding second network exchange server.

[0085] In some optional implementation manners, after the first network exchange server sends the request message to the second network exchange server, it can also perform a blocking operation for a preset time period. If the response message is not obtained within the preset time period, the first network exchange server re-sends the request message to the second network exchange server. By performing the corresponding blocking operation, the first network exchange server can temporarily stop performing other operations to wait for the second network exchange server to process the request message, so as to query the response message returned by the second network exchange server and the corresponding processing result.

[0086] In addition, in the process that the first network exchange server sends the request message to the second network exchange server, if the sending fails, the first network exchange server can resend the request message to the second network exchange server and record the corresponding sending times, if the number of times that the first network exchange server resends the request message to the second network exchange server is greater than or equal to a preset threshold, the first network exchange server generates a second log for the request message, and deletes the request message and the request identifier from the redis cluster. The second log can be a log of the sending failure of the request message, and by recording the corresponding log, the data can be traced. For example, the preset threshold can be set to 3, that is, when the first network exchange server sends more than 3 request messages to the second network exchange server, the first network exchange server can generate a log of the sending failure of the corresponding request message, and delete the request message and the request identifier from the redis cluster, so as to reduce the occupation of the memory space.

[0087] In step 103, the second network exchange server located in the second network responds to receiving the request message, performs a data processing operation corresponding to the content parameter, and generates a response message corresponding to the request message and a response identifier corresponding to the response message.

[0088] In the embodiment of the application, the second network exchange server located in the second network responds to receiving the request message, performs a data processing operation corresponding to the content parameter, and generates a response message corresponding to the request message and a response identifier corresponding to the response message. The first IP information and the first network identifier of the first network exchange server can also be included in the request message, so that the second network exchange server determines the sender of the request message based on the first IP information and the first network identifier.

[0089] In a specific implementation, for the second network exchange server, it can respond to receiving the interaction message, then identify the type of the interaction message, if the interaction message is a request message, it can obtain the message sequence number corresponding to the request message, and store the request message into the redis ordered set according to the message sequence number, and parse the request message according to the message sequence number to obtain the content parameter, the content parameter at least includes the file content and the file pre-message, then execute the data processing operation for the file content based on the file pre-message, if the data processing operation is successfully executed, generate the first response message for the request message and the response identifier corresponding to the first response message, the first response message is the message for notifying the first network exchange server that the service processing corresponding to the request message is successful; if the data processing operation fails, generate the second response message for the request message and the response identifier corresponding to the second response message, the second response message is the message for notifying the first network exchange server that the service processing corresponding to the request message fails.

[0090] Among them, the redis ordered set can be a corresponding data structure, which can be used to store different elements and assign a corresponding score to each element, and then sort based on the assigned score, so as to facilitate processing the request message according to the order. Specifically, the message sequence number can be the sequence number marked when the first network exchange server generates the request message, which can be the corresponding generation time when the request message is generated, then based on the message sequence number, the second network exchange server can store each request message into the corresponding redis ordered set in the order of the message sequence number, so as to process each request message in the order of the message sequence number, for example, the request messages stored in the redis ordered set include:

[0091] Request message A-11:02:15

[0092] Request message B-11:04:10

[0093] Request message C-11:07:20

[0094] Request message D-11:10:57

[0095]

[0096] The second network switching server can process the request message A, the request message B, the request message C and the request message D in sequence based on the corresponding time sequence, assuming that the request message A is a message for sending data to the second network switching server, the second network switching server can store the file content sent by the first network switching server and the like; assuming that the request message B is a message for requesting data from the second network switching server, the second network switching server can determine the target data requested by the request message, and then return the target data to the first network switching server; assuming that the request message C is for detecting whether the external network and the internal network are connected, the second network switching server sends a corresponding confirmation message to the first network switching server when detecting that the external network and the internal network are connected, and the like, and can also perform other data processing operations, which are not limited by the application.

[0097] When the second network switching server performs corresponding service processing based on the request message, a corresponding response message can be generated, if the service execution is successful, a first response message for notifying the first network switching server that the service processing corresponding to the request message is successful is generated, if the service execution fails, a second response message for notifying the first network switching server that the service processing corresponding to the request message fails is generated, and a corresponding response identifier is generated for the generated response message. Optionally, the response identifier can be the same identifier as the request identifier, so that the subsequent sender can query whether there is a corresponding response message based on the same identifier, and then confirm whether the initiated service request is executed, and the same identifier can be used to realize data aggregation, thereby reducing the probability of data loss or inconsistency.

[0098] In step 104, if any target network switching server located in the first network successfully acquires the response message based on the request identifier, a first log for the data sending request is recorded, and the request message and the request identifier are deleted from the redis cluster.

[0099] In the embodiment of the application, after the second network switching server returns the corresponding response message and the response identifier, any target network switching server located in the first network can query whether there is a corresponding response identifier based on the corresponding request identifier from the redis cluster, if the response message is successfully acquired based on the request identifier, the corresponding network switching server can record a first log for the data sending request, and delete the request message and the request identifier from the redis cluster, so that when data communication is performed in the isolated network, by adding corresponding identifiers to the request message and the response message, and based on the data storage mode of the redis cluster, even if the network switching server sending the request message changes, the consistency of the request message and the response message can be effectively ensured, the success rate of message aggregation can be ensured, and the probability of data loss or data inconsistency can be reduced.

[0100] It should be noted that for the target network exchange server, in the process that the first network exchange server waits for the second network exchange server to respond to the request message, if the first network exchange server does not switch, the target network exchange server can be the first network exchange server; if the first network exchange server switches to the third network exchange server due to network anomalies, device anomalies or other reasons, the target network exchange server can be the third network exchange server, so that the same identifier can be used to query the response message corresponding to the request message from the redis cluster, regardless of whether the request party changes, the consistency of the convergence of the request message and the response message is effectively ensured, the success rate of message aggregation is ensured, and the probability of data loss or data inconsistency is reduced.

[0101] In some optional embodiments, the target network exchange server located in the first network stores the response message and the response identifier into the redis cluster in response to receiving the response message and the response identifier sent by the second network exchange server, then the response message corresponding to the response identifier is obtained based on the response identifier with the same identifier being queried from the redis cluster, if the response message is the first response message indicating that the business processing is successful, the target network exchange server generates a business processing success log corresponding to the request message, and deletes the request message and the request identifier from the redis cluster; if the response message is the second response message indicating that the business processing is successful, the target network exchange server generates a business processing failure log corresponding to the request message, and deletes the request message and the request identifier from the redis cluster, so that when data communication is performed in the isolated network, by adding corresponding identifiers to the request message and the response message, and based on the data storage mode of the redis cluster, even if the network exchange server sending the request message changes, the consistency of the convergence of the request message and the response message can be effectively ensured, the success rate of message aggregation is ensured, and the probability of data loss or data inconsistency is reduced.

[0102] It should be noted that the embodiments of the present application include but are not limited to the above examples, and it can be understood that those skilled in the art can also set according to actual needs under the guidance of the idea of the embodiments of the present application, and the present application does not limit this.

[0103] In the embodiment of the present application, it can be applied to a data exchange system, through which a network environment is divided into at least two networks, at least two network exchange servers are deployed in each network, network exchange servers located in different networks can establish corresponding communication connections through virtual IP, when data interaction occurs between two networks, a first network exchange server located in a first network generates a request message corresponding to a data sending request and a request identifier corresponding to the request message in response to the data sending request, the request message at least includes network parameters and content parameters corresponding to the data sending request, and the request message and the request identifier are stored in a redis cluster, and a second network exchange server corresponding to the network parameters is determined, and the request message is sent to the second network exchange server, a second network exchange server located in a second network executes a data processing operation corresponding to the content parameters in response to receiving the request message, and generates a response message for the request message and a response identifier corresponding to the response message, if any target network exchange server located in the first network successfully obtains the response message based on the request identifier, a first log for the data sending request is recorded, and the request message and the request identifier are deleted from the redis cluster, so that when data communication is performed in an isolated network, by adding corresponding identifiers to the request message and the response message, and based on the data storage mode of the redis cluster, even if the network exchange server sending the request message changes, the consistency of the request message and the response message can be effectively guaranteed, the success rate of message aggregation can be guaranteed, and the probability of data loss or data inconsistency can be reduced.

[0104] In order for those skilled in the art to better understand the technical solutions in the embodiments of the present application, the following will be exemplarily described through corresponding examples:

[0105] Referring to Figure 3 , a flowchart of network communication in the embodiment of the present application is shown, which can specifically include the following processes:

[0106] ①Each node of the data exchange system enables a message listening port, and simultaneously establishes a communication connection of a peer based on a virtual IP (VIP).

[0107] ②The data exchange server of an external network needs to send a message, a message listening thread performs internal communication message consumption, and performs message packaging based on current network information, target network information, message type, message unique identifier, file preposition message, file sending message, etc.

[0108] ③Message packaging is completed based on message routing, it is judged that the network needs to be forwarded, a connection is obtained through a connection pool, message sending is performed, a response message is obtained through redis query based on a unique identifier, and is blocked for 60 seconds, and returns failure if it is timed out.

[0109] IV. The data exchange server of the inner network receives the message, performs message analysis, judges that it is a request message, stores in the redis ordered set based on the message identifier, the message type, the network information to which the message belongs and the serial number, realizes automatic sorting of the message by using the redis ordered set, performs business processing, obtains a business processing result, encapsulates and returns the result in combination with the message unique identifier.

[0110] V. The data exchange server of the outer network receives the message, performs analysis and judges that it is a response message to obtain a unique identifier, stores in the redis, and sets a message timeout time to avoid deletion of the message and occupation of space.

[0111] VI. The data exchange service node of the outer network obtains the redis response information based on the message unique identifier, deletes the stored data in the redis, and based on the business result, records a log if successful, retries if failed, and records a log if the number of retries exceeds 3.

[0112] VII. The process is repeated every second.

[0113] Through the above process, when data communication is performed in the isolated network, the request message and the response message are added with corresponding identifiers, and the data storage mode based on the redis cluster is used, so that even if the network exchange server that sends the request message is changed, the consistency of the request message and the response message can be effectively ensured, the success rate of message aggregation can be ensured, and the probability of data loss or data inconsistency can be reduced.

[0114] It should be noted that, for the method embodiments, in order to simply describe, they are all described as a series of action combinations, but those skilled in the art should know that the embodiments of the present application are not limited to the action sequence described, because according to the embodiments of the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions involved are not necessarily necessary for the embodiments of the present application.

[0115] Referring to Figure 4 , a structural block diagram of a communication device of an isolated network provided in an embodiment of the present application is shown, which is applied to a data exchange system, the data exchange system divides a network environment into at least two networks, at least two network exchange servers are deployed in each network, the network exchange servers in different networks establish corresponding communication connections through virtual IP, and specifically can include the following modules:

[0116] A request message determination module 401 in a first network exchange server in a first network is configured to, in response to a data sending request, generate a request message corresponding to the data sending request and a request identifier corresponding to the request message, wherein the request message comprises at least a network parameter and a content parameter corresponding to the data sending request;

[0117] A request message sending module 402 in the first network exchange server is configured to store the request message and the request identifier into a redis cluster, and determine a second network exchange server corresponding to the network parameter, and send the request message to the second network exchange server, wherein the second network exchange server is located in a different network from the first network exchange server.

[0118] A response module 403 in the second network exchange server in a second network is configured to, in response to receiving the request message, perform a data processing operation corresponding to the content parameter, and generate a response message corresponding to the request message and a response identifier corresponding to the response message.

[0119] A log generation module 404 in a target network exchange server is configured to, if any target network exchange server in the first network successfully acquires the response message based on the request identifier, record a first log for the data sending request, and delete the request message and the request identifier from the redis cluster.

[0120] In some possible embodiments, the apparatus further comprises:

[0121] A message resending module in the first network exchange server is configured to perform a blocking operation for a preset time length, and if the response message is not acquired within the preset time length, resend the request message to the second network exchange server.

[0122] In some possible embodiments, the apparatus further comprises:

[0123] An information deletion module in the first network exchange server is configured to, if the number of times that the first network exchange server resends the request message to the second network exchange server is greater than or equal to a preset threshold, generate a second log for the request message, and delete the request message and the request identifier from the redis cluster.

[0124] In some possible embodiments, the request message determination module 401 is specifically configured to:

[0125] In response to the data sending request, network parameters and content parameters corresponding to the data sending request and message types corresponding to the at least two networks are acquired, and a request identifier corresponding to the data sending request is generated, wherein the content parameters at least include file content and a file pre-message;

[0126] If the message type represents interconnection between the first network and the second network, the network parameters, the file content, the file pre-message, and the request identifier are encapsulated to obtain a request message corresponding to the data sending request.

[0127] In some possible embodiments, the network parameters include second IP information and a second network identifier of a second network exchange server, and the request message sending module 402 is specifically configured to:

[0128] A network exchange server corresponding to the second IP information and the second network identifier is selected from a connection pool of the data exchange system as a second network exchange server for data communication with the first network exchange server.

[0129] In some possible embodiments, the response module 403 is specifically configured to:

[0130] In response to receiving an interaction message, if the interaction message is the request message, a message serial number corresponding to the request message is acquired, the request message is stored in a redis ordered set according to the message serial number, and the request message is parsed according to the message serial number to obtain the content parameters, wherein the content parameters at least include file content and a file pre-message.

[0131] A data processing operation for the file content is performed based on the file pre-message.

[0132] If the data processing operation is successfully performed, a first response message for the request message and a response identifier corresponding to the first response message are generated, wherein the first response message is a message for notifying the first network exchange server that service processing corresponding to the request message is successful.

[0133] If the data processing operation fails, a second response message for the request message and a response identifier corresponding to the second response message are generated, wherein the second response message is a message for notifying the first network exchange server that service processing corresponding to the request message fails.

[0134] In some possible embodiments, the log generation module 404 is specifically configured to:

[0135] A target network exchange server located in the first network stores the response message and the response identifier into the redis cluster in response to receiving the response message and the response identifier sent by the second network exchange server;

[0136] The target network exchange server queries the response identifier with the same identifier from the redis cluster based on the request identifier, and obtains a response message corresponding to the response identifier;

[0137] If the response message is a first response message representing a successful service processing, the target network exchange server generates a service processing success log corresponding to the request message, and deletes the request message and the request identifier from the redis cluster;

[0138] If the response message is a second response message representing a service processing failure, the target network exchange server generates a service processing failure log corresponding to the request message, and deletes the request message and the request identifier from the redis cluster.

[0139] For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the related parts refer to the part of the method embodiment.

[0140] In addition, the embodiment of the present application further provides an electronic device, which comprises a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program is executed by the processor to implement each process of the communication method of the isolated network and achieve the same technical effects, and details are not repeated here to avoid repetition.

[0141] The embodiment of the present application further provides a computer readable storage medium, and the computer readable storage medium stores a computer program, wherein the computer program is executed by the processor to implement each process of the communication method of the isolated network and achieve the same technical effects, and details are not repeated here to avoid repetition. The computer readable storage medium includes a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0142] Figure 5 A hardware structure schematic diagram of an electronic device for implementing the embodiment of the present application.

[0143] The electronic device 500 includes, but is not limited to, a radio frequency unit 501, a network module 502, an audio output unit 503, an input unit 504, a sensor 505, a display unit 506, a user input unit 507, an interface unit 508, a memory 509, a processor 510, and a power supply 511, etc. Those skilled in the art can understand that the electronic device structure involved in the embodiments of the present application does not constitute a limitation on the electronic device, and the electronic device can include more or less components than the illustration, or combine certain components, or different component arrangements. In the embodiments of the present application, the electronic device includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle terminal, a wearable device, and a pedometer, etc.

[0144] It should be understood that in the embodiments of the present application, the radio frequency unit 501 can be used for receiving and transmitting signals in the process of information or call, specifically, receiving downlink data from the base station for the processor 510 to process, and transmitting uplink data to the base station. Generally, the radio frequency unit 501 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, etc. In addition, the radio frequency unit 501 can also communicate with the network and other devices through a wireless communication system.

[0145] The electronic device provides wireless broadband Internet access for users through the network module 502, such as helping users to send and receive emails, browse web pages, and access streaming media, etc.

[0146] The audio output unit 503 can convert audio data received by the radio frequency unit 501 or the network module 502 or stored in the memory 509 into an audio signal and output as a sound. Moreover, the audio output unit 503 can also provide audio output related to a specific function performed by the electronic device 500 (e.g., a call signal receiving sound, a message receiving sound, etc.). The audio output unit 503 includes a speaker, a buzzer, and a receiver, etc.

[0147] The input unit 504 is configured to receive audio or video signals. The input unit 504 can include a graphics processor (GPU) 5041 and a microphone 5042. The graphics processor 5041 processes image data of a still picture or a video obtained by an image capture device (e.g., a camera) in a video capture mode or an image capture mode. Processed image frames can be displayed on the display unit 506. Processed image frames can be stored in the memory 509 (or other storage medium) or transmitted via the radio frequency unit 501 or the network module 502. The microphone 5042 can receive sound and can process such sound as audio data. Processed audio data can be converted into a format that can be transmitted to a mobile communication base station via the radio frequency unit 501 in a telephone call mode.

[0148] The electronic device 500 further includes at least one sensor 505, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 5061 according to the brightness of ambient light, and the proximity sensor can turn off the display panel 5061 and / or the backlight when the electronic device 500 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when at rest, and can be used to identify the electronic device posture (such as screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, knock), and the like. The sensor 505 can also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, and the like, which will not be described here.

[0149] The display unit 506 is configured to display information input by a user or information provided to the user. The display unit 506 can include a display panel 5061, which can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0150] The user input unit 507 can be used to receive inputted digital or character information, and to generate key signal input related to user settings of the electronic device and function control. Specifically, the user input unit 507 includes a touch panel 5071 and other input devices 5072. The touch panel 5071, also called a touch screen, can collect a user's touch operation (such as a user's operation on or near the touch panel 5071 using a finger, a stylus, or any suitable object or accessory) on or near it. The touch panel 5071 can include two parts, a touch detection device and a touch controller. The touch detection device detects the user's touch position and detects a signal caused by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into touch coordinates, and sends it to the processor 510, receives commands from the processor 510 and executes them. In addition, the touch panel 5071 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 5071, the user input unit 507 can also include other input devices 5072. Specifically, the other input devices 5072 can include, but are not limited to, a physical keyboard, function keys (such as volume control buttons, on / off buttons, etc.), trackballs, mice, joysticks, and the like, which will not be described here.

[0151] Further, the touch panel 5071 can be overlaid on the display panel 5061, and when the touch panel 5071 detects a touch operation on or near it, it transmits to the processor 510 to determine the type of touch event, and then the processor 510 provides corresponding visual output on the display panel 5061 according to the type of touch event. It can be understood that in one embodiment, the touch panel 5071 and the display panel 5061 are implemented as two independent components to realize the input and output functions of the electronic device, but in some embodiments, the touch panel 5071 and the display panel 5061 can be integrated to realize the input and output functions of the electronic device, which is not limited here.

[0152] The interface unit 508 is an interface for connecting external devices to the electronic device 500. For example, the external devices can include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input / output (I / O) port, a video I / O port, an earphone port, and the like. The interface unit 508 can be used to receive input (e.g., data information, power, etc.) from external devices and transmit the received input to one or more elements within the electronic device 500 or can be used to transmit data between the electronic device 500 and external devices.

[0153] The memory 509 can be used to store software programs and various data. The memory 509 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; and the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), and the like. In addition, the memory 509 can include a high-speed random access memory, and can also include a nonvolatile memory, for example, at least one magnetic disk storage device, a flash memory device, or other volatile solid-state memory device.

[0154] The processor 510 is the control center of the electronic device, connects all parts of the electronic device through various interfaces and lines, executes various functions of the electronic device and processes data by running or executing software programs and / or modules stored in the memory 509 and calling data stored in the memory 509, and thus monitors the whole electronic device. The processor 510 can include one or more processing units; preferably, the processor 510 can integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the like, and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor can also not be integrated into the processor 510.

[0155] The electronic device 500 can also include a power supply 511 (such as a battery) for supplying power to various components; preferably, the power supply 511 can be logically connected to the processor 510 through a power management system, so as to realize the functions of managing charging, discharging, and power consumption management, and the like through the power management system.

[0156] In addition, the electronic device 500 includes some functional modules that are not shown, which will not be described here.

[0157] It should be noted that in this document, the term "comprising" or "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article, or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such a process, method, article, or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of another identical element in the process, method, article, or device including the element.

[0158] Those skilled in the art can clearly understand that the above-mentioned embodiment method can be realized by means of software and necessary general hardware platform, of course, it can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes a plurality of instructions for making a terminal (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) execute the method described in each embodiment of the present application.

[0159] The embodiments of the present application are described above with reference to the accompanying drawings, but the present application is not limited to the above-mentioned specific embodiments, and the above-mentioned specific embodiments are only illustrative, not restrictive. Those skilled in the art can make many forms without departing from the purpose of the present application and the scope protected by the claims under the inspiration of the present application, which all belong to the protection of the present application.

[0160] Those skilled in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in the embodiments of the present application can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solutions. Professional technicians can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0161] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-mentioned system, device and unit can refer to the corresponding process in the foregoing method embodiments, which will not be repeated here.

[0162] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed ones can be indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0163] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed on multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.

[0164] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present alone, or two or more units can be integrated in one unit.

[0165] If the functions are realized in the form of software functional units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the part of the prior art that essentially contributes or the part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The foregoing storage medium includes: U disk, mobile hard disk, ROM, RAM, magnetic disk or optical disk and various program code storage media.

[0166] The above is only a specific embodiment of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A communication method of an isolated network, characterized by, The application is applied to a data exchange system, which divides a network environment into at least two networks, each of which is provided with at least two network exchange servers, and the network exchange servers in different networks establish corresponding communication connections through virtual IP, and the method comprises: A first network exchange server in a first network generates a request message corresponding to a data sending request and a request identifier corresponding to the request message in response to the data sending request, wherein the request message at least includes network parameters and content parameters corresponding to the data sending request; The first network exchange server stores the request message and the request identifier into a redis cluster, determines a second network exchange server corresponding to the network parameters, and sends the request message to the second network exchange server, wherein the second network exchange server is located in a different network from the first network exchange server; The second network exchange server in the second network generates a response message for the request message and a response identifier corresponding to the response message in response to receiving the request message, and performs a data processing operation corresponding to the content parameters; If any target network exchange server in the first network successfully acquires the response message based on the request identifier, a first log for the data sending request is recorded, and the request message and the request identifier are deleted from the redis cluster.

2. The method of claim 1, wherein, After the request message is sent to the second network exchange server, the method further comprises: The first network exchange server performs a blocking operation for a preset time length, and if the response message is not acquired within the preset time length, the first network exchange server re-sends the request message to the second network exchange server.

3. The method of claim 2, wherein, After the request message is re-sent to the second network exchange server, the method further comprises: If the number of times that the first network exchange server re-sends the request message to the second network exchange server is greater than or equal to a preset threshold, the first network exchange server generates a second log for the request message, and deletes the request message and the request identifier from the redis cluster.

4. The method of claim 1, wherein, In response to the data sending request, the request message corresponding to the data sending request and the request identifier corresponding to the request message are generated, comprising: In response to the data sending request, the network parameters and the content parameters corresponding to the data sending request, and the message types corresponding to the at least two networks are acquired, and the request identifier corresponding to the data sending request is generated, wherein the content parameters at least include file content and file pre-message; If the message type represents the connection between the first network and the second network, the network parameters, the file content, the file pre-message and the request identifier are encapsulated to obtain the request message corresponding to the data sending request.

5. The method of claim 4, wherein, The network parameters include second IP information and second network identifier of the second network exchange server, and the second network exchange server corresponding to the network parameters is determined, comprising: select a network exchange server corresponding to the second IP information and the second network identification from a connection pool of the data exchange system as a second network exchange server for data communication with the first network exchange server.

6. The method of claim 1, wherein, The data processing operation corresponding to the content parameter is performed and a response message corresponding to the response message is generated in response to receiving the request message, and the response message includes: In response to receiving the interaction message, if the interaction message is the request message, the message sequence number corresponding to the request message is obtained, the request message is stored in the redis ordered set according to the message sequence number, and the request message is parsed according to the message sequence number to obtain the content parameter, the content parameter at least including file content and file pre-message; The data processing operation for the file content is performed based on the file pre-message; If the data processing operation is successfully performed, a first response message corresponding to the request message and a response identification corresponding to the first response message are generated, and the first response message is a message for notifying the first network exchange server that the service processing corresponding to the request message is successful; If the data processing operation fails, a second response message corresponding to the request message and a response identification corresponding to the second response message are generated, and the second response message is a message for notifying the first network exchange server that the service processing corresponding to the request message fails.

7. The method of claim 1, wherein, If any target network exchange server in the first network successfully obtains the response message based on the request identification, a first log corresponding to the data sending request is recorded, and the request message and the request identification are deleted from the redis cluster, including: The target network exchange server in the first network stores the response message and the response identification in the redis cluster in response to receiving the response message and the response identification sent by the second network exchange server; The target network exchange server queries the response identification corresponding to the response identification from the redis cluster based on the request identification; If the response message is a first response message indicating that the service processing is successful, the target network exchange server generates a service processing success log corresponding to the request message and deletes the request message and the request identification from the redis cluster; If the response message is a second response message indicating that the service processing is successful, the target network exchange server generates a service processing failure log corresponding to the request message and deletes the request message and the request identification from the redis cluster.

8. A communication apparatus for isolating a network, characterized by The application is applied to a data exchange system, the data exchange system divides a network environment into at least two networks, at least two network exchange servers are arranged in each network, network exchange servers in different networks establish corresponding communication connections through virtual IP, and the device comprises: A request message determination module in a first network exchange server in a first network, configured to generate a request message corresponding to a data sending request and a request identifier corresponding to the request message in response to the data sending request, the request message comprising at least a network parameter and a content parameter corresponding to the data sending request; A request message sending module in the first network exchange server, configured to store the request message and the request identifier into a redis cluster, and determine a second network exchange server corresponding to the network parameter, and send the request message to the second network exchange server, the second network exchange server being located in a different network from the first network exchange server; A response module in the second network exchange server in a second network, configured to execute a data processing operation corresponding to the content parameter in response to receiving the request message, and generate a response message corresponding to the request message and a response identifier corresponding to the response message; A log generation module in a target network exchange server, configured to record a first log for the data sending request if any target network exchange server in the first network successfully acquires the response message based on the request identifier, and delete the request message and the request identifier from the redis cluster.

9. An electronic device, comprising: A computer device comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus; The memory is used for storing a computer program; The processor is used for executing the program stored on the memory, and implements the method in any one of claims 1-7. 10.A computer readable storage medium having instructions stored thereon, the instructions, when executed by one or more processors, cause the processors to perform the method in any one of claims 1-7.

Citation Information

Patent Citations

  • Inter-network data communication method and device and data communication system

    CN110830527A

  • Request processing method and device, traffic agent side, equipment and readable storage medium

    CN114024741A