Service two-way synchronous access method and system crossing one-way network security domain
By establishing a two-way access method of TCP long connection under a one-way network security domain, the problem of synchronous access in the existing technology is solved, the development cost is reduced, the performance and stability is improved, the security requirements are met, and the high concurrency is high Efficient service forwarding is achieved in scenarios.
Patent Information
- Application Number
- CN202411264315.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2024-12-06
AI Technical Summary
The prior art increases the complexity of service publishers, the difficulty of client call processing and security risks in the one-way network security domain, and cannot achieve synchronous access, resulting in high development costs and low performance.
By establishing a TCP long connection based on one-way security policy, bidirectional synchronous access on the application side is realized, allowing external applications to respond synchronously through inward-outward security policies, and using NIO/AIO technology to perform non-blocking network communication in high concurrency scenarios .
It reduces the transformation cost of external units' access development, eliminates the cache comparison process, improves the system docking efficiency and performance, meets strict security requirements, and realizes forwarding of multiple services in a single connection in network programming.
Smart Images

Figure CN119094585A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a method for bidirectional synchronous access to services across a unidirectional network security domain and a system for bidirectional synchronous access to services across a unidirectional network security domain. Background Art
[0002] Under the current international situation and data security situation, in order to ensure data security, most of them adopt the method of dividing network security domains, that is: the core business database and applications of the unit are deployed in the network domain with the highest confidentiality level - generally called "business-specific network domain", while public services, e-government and inter-departmental interconnection and other application services are deployed in separately divided network domains - generally called "horizontal networking domains" or "extranet security domains". In some departments that have built large-scale engineering systems, the network area division is more complicated.
[0003] Between different network security domains, dedicated firewalls or network gate devices are used to implement network security policy restrictions in the form of whitelists. The security policy only allows the "business-specific network domain" to actively initiate access to the "extranet security domain", and does not allow access from outside to inside. In other words, when the business system of the business-specific network domain needs to provide services to the outside, access can only be achieved through request + callback.
[0004] Take the scenario of "external unit C0 system initiates a business request to the unit S system" as an example. According to the existing technology, the following steps are required, such as Figure 1 As shown:
[0005] (1) External application C0 calls access application S1-1 in the extranet security domain and records the request ID;
[0006] (2) S1-1 responds to the request and caches it in the message middleware S1-2 in this area;
[0007] (3) The ferry application S2-1 in the business-specific network domain monitors and obtains messages from the message middleware S1-2;
[0008] (4) S2-1 calls the business service interface S to obtain the business request result;
[0009] (5) S2-1 calls the forwarding interface of S1-1 and sends the service request result;
[0010] (6) S1-1 synchronously forwards the service request result to the result receiving application C1 provided by unit C;
[0011] (7) C1 associates the received request result with the request ID recorded by C0 to obtain a request-response matching relationship;
[0012] (8) The external application continues subsequent business processing.
[0013] The above prior art has several problems:
[0014] First, it increases the complexity of the service publisher. Due to the access restrictions at the network level, the originally simple Https interface needs to add message queues in the two-layer network and asynchronously implement the result return.
[0015] Second, it increases the difficulty of client call processing. Since it is impossible to synchronously obtain the return results of the server, it is necessary to cache the requests, develop result receiving services, and then correspond to the cached requests after receiving the results.
[0016] Third, security risks are increased. The increase in message cache may increase the risk of data exposure.
[0017] How to meet the security requirements of one-way access while achieving the safe exposure of business-specific network domain application services is an urgent problem to be solved. Summary of the invention
[0018] In view of the above problems, the present invention provides a method and system for bidirectional synchronous access to services across a unidirectional network security domain, which realizes bidirectional synchronous mutual access on the application side through a TCP long connection. It only needs to open an outbound security policy from the inside to the outside to achieve the goal of synchronous response to external application requests, solves the problem of double returns under a unidirectional network, greatly reduces the transformation cost of external unit access development, eliminates the cache comparison process, improves system docking efficiency, improves performance and stability, and can realize multiple service forwarding in a single connection with a slight adaptation in network programming.
[0019] To achieve the above object, the present invention provides a method for bidirectional synchronous access to services across a unidirectional network security domain, comprising:
[0020] Establishing a two-way access application based on a one-way security policy, the two-way access application comprising a server deployed in an extranet security domain and a client deployed in a business private network domain;
[0021] Establishing a TCP persistent connection between the client and the server, and implementing network traffic forwarding of the upper layer protocol based on the connection;
[0022] The external application calls the two-way access application to make a service access request, and the server forwards the service access request to the client through the TCP long connection;
[0023] The client calls the business service interface according to the received business access request to obtain the business request result;
[0024] The client returns the service request result to the server through the TCP long connection, and the two-way access application responds to the external application with the service request result.
[0025] In the above technical solution, preferably, based on the TCP long connection, the client and the server provide message receiving endpoints for other applications in the extranet security domain and the business-specific network domain respectively.
[0026] In the above technical solution, preferably, the client is unaware of the external application and the server during the process of returning the service request result to the server through the TCP long connection.
[0027] In the above technical solution, preferably, in a high concurrency scenario, NIO / AIO technology is used to implement non-blocking, highly scalable network communication for service access requests.
[0028] The present invention also proposes a service bidirectional synchronous access system across a unidirectional network security domain, which applies a service bidirectional synchronous access method across a unidirectional network security domain as disclosed in any one of the above technical solutions, including:
[0029] An application deployment module, used to establish a two-way access application based on a one-way security policy, wherein the two-way access application includes a server deployed in an extranet security domain and a client deployed in a business private network domain;
[0030] A communication connection module, used to establish a TCP persistent connection between the client and the server, and implement network traffic forwarding of the upper layer protocol based on the connection;
[0031] An access request module, configured to forward the service access request from the server to the client through the TCP long connection when an external application calls the bidirectional access application to make a service access request;
[0032] An interface calling module, configured to allow the client to call a business service interface according to the received business access request to obtain a business request result;
[0033] The result returning module is used for the client to return the service request result to the server through the TCP long connection, and the two-way access application responds the service request result to the external application.
[0034] In the above technical solution, preferably, based on the TCP long connection, the communication connection module provides message receiving endpoints for other applications in the extranet security domain and the business-specific network domain at the client and the server respectively.
[0035] In the above technical solution, preferably, the result returning module returns the business request result to the server through the TCP long connection without being affected by the external application and the server.
[0036] In the above technical solution, preferably, in a high concurrency scenario, NIO / AIO technology is used to implement non-blocking, highly scalable network communication for service access requests.
[0037] Compared with the prior art, the beneficial effects of the present invention are as follows: bidirectional synchronous mutual access on the application side is realized through TCP long connection, and the goal of synchronous response to external application requests can be achieved by only opening the outbound security policy from the inside to the outside, solving the problem of double returns under a one-way network, greatly reducing the transformation cost of external unit access development, eliminating the cache comparison process, improving system docking efficiency, and improving performance and stability. A slight adaptation in network programming can realize the forwarding of multiple services in a single connection. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A schematic diagram of a process of initiating a service request from an external unit C0 system to the unit S system disclosed in an embodiment of the prior art;
[0039] Figure 2 The present invention is a flowchart of a method for bidirectional synchronous access to services across a unidirectional network security domain disclosed in an embodiment of the present invention. DETAILED DESCRIPTION
[0040] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0041] The present invention is further described in detail below in conjunction with the accompanying drawings:
[0042] like Figure 2 As shown, a method for bidirectional synchronous access to services across a unidirectional network security domain provided by the present invention includes:
[0043] Establish a two-way access application S1 based on a one-way security policy, wherein the two-way access application S1 includes a server SS1 deployed in an extranet security domain and a client SC1 deployed in a business private network domain;
[0044] Establish a TCP persistent connection between the client SC1 and the server SS1, and implement network traffic forwarding of the upper layer protocol based on the connection;
[0045] The external application C0 calls the bidirectional access application S1 to make a service access request, and the server SS1 forwards the service access request to the client SC1 through a TCP long connection;
[0046] The client SC1 calls the business service interface S according to the received business access request and obtains the business request result;
[0047] The client SC1 returns the service request result to the server SS1 through a TCP long connection, and the bidirectional access application S1 responds to the service request result to the external application C0.
[0048] In this implementation, bidirectional synchronous mutual access is achieved on the application side through TCP long connection. The goal of synchronous response to external application requests can be achieved by simply opening the outbound security policy from the inside to the outside, solving the problem of double returns in a one-way network, greatly reducing the transformation cost of external unit access development, eliminating the cache comparison process, improving system docking efficiency, and improving performance and stability. A slight adaptation in network programming can realize the forwarding of multiple services in a single connection.
[0049] Specifically, in terms of security, the present invention fully meets the strict requirements of from inside to outside, and with a little adaptation in network programming, it can realize the forwarding of multiple services in a single connection. If an external application needs to access multiple services in a business-specific network domain, it only needs to open a security policy from a business-specific network domain to the extranet security domain, which will reduce the difficulty of configuration management and monitoring work from the network side and facilitate security management.
[0050] In terms of performance, compared with the prior art, the present invention transforms the two returns of the polling method into synchronous call responses, and its performance (including various indicators such as the throughput and latency of the entire system) is bound to far exceed the prior art.
[0051] Due to the significant performance advantages, the above method of the present invention will have to consider the actual carrying capacity of application services in the business-specific network domain, monitor the application service load and implement functions such as "fuse" and "downgrade" in two-way access applications.
[0052] In the above implementation, preferably, based on the TCP long connection, the client SC1 and the server SS1 provide message receiving endpoints for other applications in the extranet security domain and the business private network domain respectively.
[0053] In the above implementation, preferably, during the process in which the client SC1 returns the service request result to the server SS1 through a TCP persistent connection, the external application C0 and the server SS1 are unaware.
[0054] In the above implementation, preferably, in a high concurrency scenario, NIO / AIO technology is used to implement non-blocking, highly scalable network communication for service access requests. Since frequent TCP handshakes are reduced and mature technologies such as "zero copy" can be fully utilized, its performance and stability advantages will be more obvious.
[0055] In addition, it should be noted that the penetration and forwarding of the method of the present invention are significantly different from reverse proxy (such as nginx), which relies on direct access of the proxy machine to the target service, which is precisely a condition that is impossible to meet in the scenario to which the present invention belongs.
[0056] The present invention further proposes a service bidirectional synchronous access system across a unidirectional network security domain, which applies a service bidirectional synchronous access method across a unidirectional network security domain as disclosed in any one of the above embodiments, including:
[0057] An application deployment module, used to establish a bidirectional access application S1 based on a unidirectional security policy, wherein the bidirectional access application S1 includes a server SS1 deployed in an extranet security domain and a client SC1 deployed in a business private network domain;
[0058] The communication connection module is used to establish a TCP persistent connection between the client SC1 and the server SS1, and implement network traffic forwarding of the upper layer protocol based on the connection;
[0059] The access request module is used for forwarding the service access request from the server SS1 to the client SC1 through a TCP long connection when the external application C0 calls the bidirectional access application S1 to make a service access request;
[0060] The interface calling module is used for the client SC1 to call the business service interface according to the received business access request to obtain the business request result;
[0061] The result return module is used for the client SC1 to return the service request result to the server SS1 through a TCP long connection, and the two-way access application S1 responds to the service request result to the external application C0.
[0062] In the above implementation, preferably, based on the TCP long connection, the communication connection module provides message receiving endpoints for other applications in the extranet security domain and the business private network domain at the client SC1 and the server SS1 respectively.
[0063] In the above implementation, preferably, the result returning module returns the service request result to the server SS1 through a TCP long connection without affecting the external application C0 and the server SS1.
[0064] In the above implementation, preferably, in a high concurrency scenario, NIO / AIO technology is used to implement non-blocking, highly scalable network communication for service access requests.
[0065] According to the service bidirectional synchronous access system across unidirectional network security domains disclosed in the above-mentioned implementation mode, the functions to be implemented by each module thereof correspond to the steps of the service bidirectional synchronous access method across unidirectional network security domains disclosed in the above-mentioned implementation mode. During the implementation process, operations are performed with reference to the above-mentioned implementation mode, which will not be repeated here.
[0066] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for bidirectional synchronous access to services across a unidirectional network security domain, characterized in that: include: Establishing a two-way access application based on a one-way security policy, the two-way access application comprising a server deployed in an extranet security domain and a client deployed in a business private network domain; Establishing a TCP persistent connection between the client and the server, and implementing network traffic forwarding of the upper layer protocol based on the connection; The external application calls the two-way access application to make a service access request, and the server forwards the service access request to the client through the TCP long connection; The client calls the business service interface according to the received business access request to obtain the business request result; The client returns the service request result to the server through the TCP long connection, and the two-way access application responds to the external application with the service request result.
2. The method for bidirectional synchronous access to services across a unidirectional network security domain according to claim 1, characterized in that: Based on the TCP long connection, the client and the server provide message receiving endpoints for other applications in the extranet security domain and the business-specific network domain respectively.
3. The method for bidirectional synchronous access to services across a unidirectional network security domain according to claim 1, characterized in that: The client returns the service request result to the server through the TCP long connection without being affected by the external application and the server.
4. The method for bidirectional synchronous access to services across a unidirectional network security domain according to claim 1, characterized in that: In high-concurrency scenarios, NIO / AIO technology is used to implement non-blocking, highly scalable network communications for business access requests.
5. A service bidirectional synchronous access system across a unidirectional network security domain, characterized in that: The method for bidirectional synchronous access to services across a unidirectional network security domain according to any one of claims 1 to 4 is applied, comprising: An application deployment module, used to establish a two-way access application based on a one-way security policy, wherein the two-way access application includes a server deployed in an extranet security domain and a client deployed in a business private network domain; A communication connection module, used to establish a TCP persistent connection between the client and the server, and implement network traffic forwarding of the upper layer protocol based on the connection; An access request module, configured to forward the service access request from the server to the client through the TCP long connection when an external application calls the bidirectional access application to make a service access request; An interface calling module, configured to allow the client to call a business service interface according to the received business access request to obtain a business request result; The result returning module is used for the client to return the service request result to the server through the TCP long connection, and the two-way access application responds the service request result to the external application.
6. The service bidirectional synchronous access system across a unidirectional network security domain according to claim 5, characterized in that: Based on the TCP long connection, the communication connection module provides message receiving endpoints for other applications in the extranet security domain and the business-specific network domain on the client and the server respectively.
7. The service bidirectional synchronous access system across a unidirectional network security domain according to claim 5, characterized in that: The result returning module returns the service request result to the server through the TCP long connection without being affected by the external application and the server.
8. The service bidirectional synchronous access system across a unidirectional network security domain according to claim 5, characterized in that: In high-concurrency scenarios, NIO / AIO technology is used to implement non-blocking, highly scalable network communications for business access requests.
