Intranet and extranet communication method and system
By using JMS message queues to transmit data between internal and external network proxy servers, the problem of JDBC protocol limitation in the existing technology is solved, and more efficient internal and external network communication is achieved.
Patent Information
- Application Number
- CN202410964924.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-11-22
AI Technical Summary
The existing internal and external network communication methods have poor flexibility, slow response speed and low data transmission rate because the network security isolation device only supports the JDBC protocol.
By using JMS message queues for data transmission between the external network proxy server and the internal network proxy server, multiple data formats and protocols are supported, and the asynchronous communication capability of JMS allows the external network proxy server to send messages without waiting for an immediate response.
It improves the flexibility and response speed of internal and external network communication and improves data transmission efficiency.
Smart Images

Figure CN119011201A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of intranet and extranet communication, and in particular to an intranet and extranet communication method and system. Background Art
[0002] Intranet usually refers to a private network within an organization, such as a company or school network. The IP addresses of an intranet are usually private and not directly exposed to the Internet, so external users cannot directly access intranet resources. Extranet usually refers to a public network, the most typical of which is the Internet. The IP addresses of an extranet are public and can be accessed by anyone, so resources on the extranet can be accessed by users anywhere in the world.
[0003] In some cases, communication between the intranet and the extranet may be required for data exchange and information transfer.
[0004] At present, the communication method between the intranet and the extranet is mainly that the extranet server transfers the request data to the intranet database through the network security isolation device, and the intranet server transfers the response data to the extranet server through the network security isolation device, which relies on the ferrying function of the network security isolation device.
[0005] Since the network security isolation device only supports the JDBC protocol for data transmission, there are problems such as poor flexibility, slow response speed and low data transmission rate when using the network security isolation device for communication between the internal and external networks. Summary of the invention
[0006] The present application provides an intranet and extranet communication method and system to improve the flexibility of intranet and extranet communication, improve the response speed and improve the data transmission efficiency.
[0007] In a first aspect, the present application provides an intranet and extranet communication method, which is applied to an extranet proxy server, comprising:
[0008] Receive data sending request sent by external network server;
[0009] Parsing the data sending request to obtain data sending information; the data sending information includes the data items carried in the data sending request, the IP address and port number of the external network proxy server, and an identifier corresponding to the data sending request;
[0010] The data sending information is sent to the JMS message queue, so that the intranet proxy server obtains the data sending information in the JMS message queue.
[0011] Optionally, the method further includes:
[0012] When feedback information is detected in the JMS message queue, a thread in the external network proxy server that sends the data sending information to the JMS message queue is awakened, and the awakening of the thread is to convert the thread from a sleeping state to a working state;
[0013] When the thread is in a working state, the feedback information is obtained and sent to an external network server.
[0014] Optionally, before receiving the data sending request sent by the external network server, the method further includes:
[0015] According to the preset configuration file, configure the address of the JMS message queue, the JMS connection factory, and the address of the current external network proxy server.
[0016] Optionally, the data items include a request method, a request path, a request header, and a request body;
[0017] The sending of the data sending information to the JMS message queue comprises:
[0018] Encapsulate the request method, the request path, the request header, the request body, the IP address and port number of the external proxy server, and an identifier corresponding to the data sending request into an object;
[0019] A JMS message for the object is created, and the JMS message is sent through the JMS message queue.
[0020] Optionally, waking up the thread in the external network proxy server includes:
[0021] Determine whether the IP address and port number in the feedback information are consistent with the IP address and port number of the external network proxy server;
[0022] If they are consistent, the thread in the external network proxy server is awakened.
[0023] In a second aspect, the present application also provides an intranet and intranet communication method, which is applied to an intranet proxy server, and the method comprises:
[0024] When data sending information is detected in the JMS message queue of the external network proxy server, the data sending information is obtained and sent to the load server for data processing, wherein the data sending information includes the data items carried in the data sending request, the IP address and port number of the external network proxy server, and the identifier corresponding to the data sending request;
[0025] When the load server completes data processing, feedback information sent by the load server is received, and the feedback information is sent to the JMS queue, so that the external network proxy server obtains the feedback information in the JMS message queue.
[0026] Optionally, the receiving feedback information sent by the load server and sending the feedback information to a JMS queue includes:
[0027] Acquire feedback information from the URL object of the load server, the feedback information including feedback data, http response code, response header, IP address of the external network proxy server, port number and identifier corresponding to the data sending request; encapsulate the feedback information into a return object, create a JMS message of the return object, and send the JMS message through the JMS message queue.
[0028] Optionally, before acquiring the data sending information, the method further includes:
[0029] According to the preset configuration file, configure the address of the JMS message queue, configure the JMS connection factory, the address of the monitored target message queue, and the address of the load server.
[0030] In a third aspect, the present application further provides an intranet and extranet communication system, the system comprising:
[0031] The external network proxy server is used to receive data sending requests sent by the external network server;
[0032] Parsing the data sending request to obtain data sending information; the data sending information includes the data items carried in the data sending request, the IP address and port number of the external network proxy server, and an identifier corresponding to the data sending request;
[0033] The data sending information is sent to the JMS message queue.
[0034] The intranet proxy server is used to obtain the data sending information and send the data sending information to the load server for data processing when monitoring the data sending information in the JMS message queue, wherein the data sending information includes the data items carried in the data sending request, the IP address and port number of the external network proxy server, and the identifier corresponding to the data sending request;
[0035] When the load server completes data processing, feedback information sent by the load server is received, and the feedback information is sent to the JMS queue, so that the external network proxy server obtains the feedback information in the JMS message queue.
[0036] Optionally, the external network proxy server is further used to configure the address of the JMS message queue, the JMS connection factory and the address of the current external network proxy server according to a preset configuration file.
[0037] The intranet proxy server is also used to configure the address of the JMS message queue, the JMS connection factory, the address of the monitored target message queue, and the address of the load server according to a preset configuration file.
[0038] Optionally, the external network proxy server is further used to wake up a thread in the external network proxy server that sends data sending information to the JMS message queue when it monitors that there is feedback information in the JMS message queue, and waking up the thread is to convert the thread from a sleeping state to a working state;
[0039] When the thread is in working state, feedback information is obtained and sent to the external network server.
[0040] Optionally, the external network proxy server is specifically used to, when monitoring the existence of feedback information in the JMS message queue, determine whether the IP address and port number in the feedback information are consistent with the IP address and port number of the external network proxy server;
[0041] If they are consistent, the thread in the external network proxy server is awakened.
[0042] Optionally, the data items may include request method, request path, request header, and request body;
[0043] The external network proxy server is specifically used to encapsulate the request method, the request path, the request header, the request body, the IP address of the external network proxy server, the port number, and the identifier corresponding to the data sending request into an object;
[0044] Create a JMS message for the object and send the JMS message through the JMS message queue.
[0045] Optionally, the intranet proxy server is specifically used to obtain feedback information from the URL object of the load server, wherein the feedback information may include feedback data, http response code, response header, IP address and port number of the external network proxy server, and an identifier corresponding to the data sending request;
[0046] The feedback information is encapsulated into a return object, a JMS message of the return object is created, and the JMS message is sent through a JMS message queue.
[0047] In a fourth aspect, an embodiment of the present application provides a device, comprising a memory and a processor, wherein the memory is used to store instructions or codes, and the processor is used to execute the instructions or codes so that the device executes any method described in the first aspect.
[0048] In a fifth aspect, an embodiment of the present application provides a computer storage medium, in which a code is stored. When the code is executed, a device executing the code implements the method described in any one of the first aspects above.
[0049] Compared with the prior art, this application has the following beneficial effects:
[0050] In the present application, the external network proxy server can receive the data sending request sent by the external network server, and then parse the data sending request to obtain data sending information, wherein the data sending information may include the data items carried in the data sending request, the IP address of the external network proxy server, the port number and the identifier corresponding to the data sending request. Then the external network proxy server can send the data sending information to the JMS message queue so that the internal network proxy server obtains the data sending information in the JMS message queue. In this way, the external network proxy server can use the JMS message queue to transmit the data sending information to the internal network proxy server, thereby enabling the internal network and the external network to communicate through the JMS message queue. The JMS message queue supports multiple data formats and protocols, and is not limited to one protocol, thereby using JMS communication between the internal and external networks to improve the flexibility of communication. And JMS provides asynchronous communication capabilities, allowing the external network proxy server to send messages without having to wait for an immediate response, thereby improving the response speed and data transmission efficiency of internal and external network communications. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions in this embodiment or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0052] Figure 1 A flowchart of an intranet and extranet communication method provided in an embodiment of the present application;
[0053] Figure 2 A flowchart of another intranet and extranet communication method provided in an embodiment of the present application;
[0054] Figure 3 A flowchart of another intranet and extranet communication method provided in an embodiment of the present application;
[0055] Figure 4 A structural diagram of a specific implementation of an intranet and extranet communication system provided in this application. DETAILED DESCRIPTION
[0056] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0057] It should be noted that the intranet and extranet communication method and system provided by the present application are used in the field of intranet and extranet communication technology. The above is only an example and does not limit the application field of the method and system provided by the present application.
[0058] Intranet usually refers to a private network within an organization, such as a company or school network. The IP addresses of an intranet are usually private and not directly exposed to the Internet, so external users cannot directly access intranet resources. Extranet usually refers to a public network, the most typical of which is the Internet. The IP addresses of an extranet are public and can be accessed by anyone, so resources on the extranet can be accessed by users anywhere in the world.
[0059] In some cases, communication between the intranet and the extranet may be required for data exchange and information transfer.
[0060] At present, the communication method between the intranet and the extranet is mainly that the extranet server transfers the request data to the intranet database through the network security isolation device, and the intranet server transfers the response data to the extranet server through the network security isolation device, which relies on the ferrying function of the network security isolation device.
[0061] Since the network security isolation device only supports JDBC protocol for data transmission, and JDBC is mainly used for database query and operation, there is a problem of poor flexibility when using the network security isolation device for communication between the internal and external networks. In addition, JDBC is usually used for synchronous operations and cannot support asynchronous data transmission between the internal and external networks, so there are problems such as slow response speed and low data transmission rate.
[0062] The inventor has proposed the technical solution of the present application after research. In the present application, the external network proxy server can receive the data sending request sent by the external network server, and then parse the data sending request to obtain data sending information, wherein the data sending information can include the data items carried in the data sending request, the IP address of the external network proxy server, the port number and the identifier corresponding to the data sending request. Then the external network proxy server can send the data sending information to the JMS message queue so that the internal network proxy server can obtain the data sending information in the JMS message queue. In this way, the external network proxy server can use the JMS message queue to transmit the data sending information to the internal network proxy server, thereby enabling the internal network and the external network to communicate through the JMS message queue. The JMS message queue supports multiple data formats and protocols, and is not limited to one protocol, thereby using JMS communication between the internal and external networks to improve the flexibility of communication. In addition, JMS provides asynchronous communication capabilities, allowing the external network proxy server to send messages without having to wait for an immediate response, thereby improving the response speed and data transmission efficiency of internal and external network communications.
[0063] In order to make the technical personnel in this field better understand the present application, the present application is further described in detail below in combination with the accompanying drawings and specific implementation methods. The following is an example of the method provided in the present application embodiment being applied to an external network proxy server.
[0064] Figure 1 A flowchart of an intranet and extranet communication method provided in an embodiment of the present application. Figure 1 As shown, the method includes:
[0065] S101: receiving a data sending request sent by an external network server.
[0066] The external network proxy server can receive a data transmission request sent by an external network server, wherein the external network proxy server generally refers to a proxy server located on the public Internet, which allows users to access other websites or services through the proxy server. S102: Parse the data transmission request to obtain data transmission information.
[0067] After receiving the data sending request sent by the external network server, the external network proxy server can use the processing request function Headers to parse the HttpExchange object of the data sending request to obtain data sending information, where the HttpExchange object is a class in the java.net package, which can represent an HTTP transaction, and can include HTTP requests and HTTP responses, etc. The data sending information may include some data items carried in the sending request, the IP address and port number of the external network proxy server, and the identifier UUID corresponding to the data sending request (UUID is a standard computer system method for generating unique digital identifiers. A UUID is a 128-bit long number, usually represented by 32 hexadecimal digits, and generated by a specific algorithm to ensure the global uniqueness of each UUID).
[0068] Exemplarily, the data items may include request method, request path, request header, request body (the request body is generally of InputStream type and can be converted to byte[] so that it can be serialized and written to the JMS queue), so that other servers can generate corresponding responses based on this information.
[0069] The request method defines the operation to be performed on the requested resource, which may include GET, POST, PUT, DELETE, etc.
[0070] The request path refers to the URI (Uniform Resource Identifier) that specifies the resource on the server, which is used to indicate the resource that the server wants to access.
[0071] The request header contains additional information about the HTTP request, such as:
[0072] Host: The domain name of the requested server. User-Agent: The client software information that makes the request.
[0073] Content-Type: The media type of the request body.
[0074] Content-Length: The length of the request body.
[0075] Accept: The media types that the client can process.
[0076] The request body refers to a part of the HTTP request, which may include data sent by the external server to the external proxy service. It should be noted that not all types of HTTP requests contain a request body, for example, a GET request usually does not contain a request body.
[0077] In some possible implementations, the data transmission information may also include a request timeout, etc. The request timeout refers to the maximum waiting time for the external proxy server to wait for a response. If no response is returned within this time limit, the request may be considered to have failed.
[0078] S103: Send the data sending information to the JMS message queue, so that the intranet proxy server obtains the data sending information in the JMS message queue.
[0079] In some possible implementations, the external proxy server can configure the address of the JMS message queue (for example, java.naming.provider.url=t3: / / 192.168.1.204:9202,192.168.1.205:9201), configure the JMS connection factory (for example, diff.jms.jmsConnectionFactory=ConnectionFactory-wtproxy0) and the address of the current external proxy server (for example, proxy.server.ip=192.168.1.203) according to the configuration file set.
[0080] In addition, JMS message queues can be divided into JMS message request queues (used to write data sending information) and JMS message feedback queues (used to write feedback information). The external network proxy server can also configure the JMS message request queue (for example, it can be diff.jms.requestQueueJNDI=requestQueueJNDI) and JMS message feedback queues (diff.jms.replyQueueJNDI=replyQueueJNDI) according to the set configuration file. It can also configure the addresses of each external network proxy server, the proxy listening port of the external network proxy server, and the proxy listening context path, etc.
[0081] When the external network server is configured and the external network proxy server obtains the data sending information, the data sending information can be sent to the JMS message queue, so that the external network proxy server and the internal network proxy server obtain the data sending information in the JMS message queue, wherein the Java Message Service (Java Message Service, JMS) is an API for creating, sending, receiving and reading messages in the Java platform. It can allow application components or servers to communicate through message passing without direct interaction, so that applications or servers in a distributed system can exchange data asynchronously.
[0082] Specifically, the data sending information includes some data items carried in the sending request, the IP address and port number of the external proxy server, and the uuid corresponding to the data sending request, and the data items include the request method, request path, request header, and request body.
[0083] The external network proxy server can encapsulate the request method, request path, request header, request body, IP address of the external network proxy server, port number and identifier corresponding to the data sending request into an object, and then create a JMS message of the object, and send the JMS message through the JMS message queue, thereby writing the JMS message into the JMS message queue, that is, writing the JMS message into the JMS message request queue.
[0084] In some possible implementations, after writing the JMS message into the JMS message queue, the external network proxy server may monitor the JMS message queue, that is, monitor the JMS message feedback queue, and when feedback information is detected in the JMS message feedback queue, wake up the thread in the external network proxy server that sends the data sending information to the JMS message queue, wherein the waking up of the thread is to convert the thread from the sleep state to the working state;
[0085] When the thread is in a working state, feedback information is obtained and sent to an external network server, so that the external network server returns the feedback information to the real caller (such as a browser).
[0086] When no feedback information is detected in the JMS message feedback queue, the thread waits (the longest waiting time is the timeout time). If the waiting time exceeds the timeout time, an exception value may be returned.
[0087] In some possible implementations, after writing the JMS message into the JMS message queue, the external network proxy server may store the uuid corresponding to the data sending request, and then read the uuid to see whether there is corresponding feedback information.
[0088] Exemplarily, the external network proxy server may store the uuid corresponding to the data sending request in the static ConcurrentHashMap object of the ReplyData class, and may use the synchronized function to read the feedback information of the corresponding uuid in the ReplyData.map.
[0089] When the external proxy server monitors the feedback information in the JMS message queue, it can determine whether the IP address and port number in the feedback information are consistent with the IP address and port number of the current external proxy server. If they are consistent, the thread in the current external proxy server that sends information to the JMS message queue is awakened. If they are inconsistent, the feedback information needs to be forwarded to the external proxy server with the IP address and port number for processing.
[0090] In this embodiment, the external network proxy server can receive the data transmission request sent by the external network server, and then parse the data transmission request to obtain data transmission information, wherein the data transmission information can include the data items carried in the data transmission request, the IP address of the external network proxy server, the port number and the identifier corresponding to the data transmission request. Then the external network proxy server can send the data transmission information to the JMS message queue so that the internal network proxy server obtains the data transmission information in the JMS message queue. In this embodiment, the external network proxy server can use the JMS message queue to transmit the data transmission information to the internal network proxy server, thereby enabling the internal network and the external network to communicate through the JMS message queue. The JMS message queue supports multiple data formats and protocols, and is not limited to one protocol, thereby using JMS communication between the internal and external networks to improve the flexibility of communication. In addition, JMS provides asynchronous communication capabilities, allowing the external network proxy server to send messages without having to wait for an immediate response, thereby improving the response speed and data transmission efficiency of internal and external network communications.
[0091] The above embodiment can be referred to as embodiment 1. In addition to the above embodiment, the present application also provides another embodiment, which is referred to as specific implementation method 2. The following is an example of applying the method provided in this embodiment to an intranet proxy server.
[0092] Figure 2 A flowchart of another intranet and extranet communication method provided in an embodiment of the present application. Figure 2 As shown, the method includes:
[0093] S201: When data sending information is detected in the JMS message queue in the external network proxy server, the data sending information is obtained and sent to the load server for data processing.
[0094] When the intranet proxy server monitors that there is data sending information in the JMS message queue in the external network proxy server, it can obtain the data sending information from the JMS message queue and send the data sending information to the load server for data processing. The intranet proxy server is a proxy server located in the organization's internal network (intranet) and is used to control and manage data traffic between the intranet and the external network (such as the Internet).
[0095] Specifically, the intranet proxy server can parse the data sending information in the JMS message queue to obtain the request method, request path, request header, request body (the request body here is generally of byte[] type and needs to be converted to OutputStream for output), the IP address and port number of the external network proxy server, and the uuid corresponding to the data sending request.
[0096] Therefore, after parsing the data transmission information, the intranet proxy server can create an HttpURLConnection object to forward to the load server, and then set the URL (target application address + request path), request method, return timeout, etc. of the HttpURLConnection object. If the request body is not empty, the getOutputStream method of the HttpURLConnection object can be called to stream the request body content to the load server (also called the target application) according to the set URL, request method, return timeout, etc., so that the load server can process the received data transmission information.
[0097] In some possible implementations, before obtaining data sending information, this embodiment can also: configure the address of the JMS message queue, configure the JMS connection factory (for example, it can be diff.jms.jmsConnectionFactory=ConnectionFacto ry-wtproxy0), the address of the monitored target message queue (for example, it can be name.destination.requestQueue=requestQueueJNDI) and the address of the load server (for example, it can be proxy.target.url=http: / / 192.168.1.204) according to a preset configuration file.
[0098] S202: When the load server completes data processing, feedback information sent by the load server is received, and the feedback information is sent to the JMS queue, so that the external network proxy server obtains the feedback information in the JMS message queue.
[0099] When the load server completes data processing, the receiving intranet proxy server receives feedback information sent by the load server and sends the feedback information to the JMS queue, so that the external network proxy server obtains the feedback information in the JMS message queue.
[0100] Specifically, the intranet proxy server can obtain feedback information from the URL object of the load server, wherein the feedback information may include feedback data, http response code, response header, IP address and port number of the external proxy server, and identifier uuid corresponding to the data sending request.
[0101] The intranet proxy server can encapsulate the feedback information into a return object, create a JMS message of the return object, and send the JMS message through the JMS message queue, thereby writing the JMS message into the JMS message queue, that is, writing the JMS message into the JMS message feedback queue. In this way, the external network proxy server can obtain feedback information from the JMS message feedback queue.
[0102] In this embodiment, when the intranet proxy server monitors that there is data sending information in the JMS message queue in the external network proxy server, the data sending information is obtained and sent to the load server for data processing. When the load server completes the data processing, the feedback information sent by the load server is received, and the feedback information is sent to the JMS queue, so that the external network proxy server obtains the feedback information in the JMS message queue. In this embodiment, the intranet proxy server can use the JMS message queue to transmit the feedback information to the external network proxy server, thereby enabling the intranet and the external network to communicate through the JMS message queue. The JMS message queue supports multiple data formats and protocols, and is not limited to one protocol, thereby using JMS communication between the internal and external networks to improve the flexibility of communication. In addition, JMS provides asynchronous communication capabilities, allowing the external network proxy server to send messages without having to wait for an immediate response, thereby improving the response speed and data transmission efficiency of internal and external network communications.
[0103] The above embodiment can be referred to as Embodiment 2. In addition to the above embodiment, this application also provides another embodiment. It is referred to as Specific Implementation Method 3. Figure 3 A flowchart of another intranet and extranet communication method provided in the embodiment of the present application. Figure 3 As shown, the method includes:
[0104] S301: The external network proxy server receives a data sending request sent by the external network server.
[0105] S302: The external network proxy server analyzes the data sending request and obtains data sending information
[0106] S303: The external network proxy server encapsulates the data sending information into an object, creates a JMS message of the object, and sends the JMS message through the JMS message queue.
[0107] Steps S301-S303 are similar to the corresponding implementation methods and principles of steps S101-S103 in the first embodiment. For details, please refer to the introduction in the first embodiment, and no redundant description is given here.
[0108] S304: When the intranet proxy server monitors that there is data sending information in the JMS message queue in the extranet proxy server, the data sending information is obtained.
[0109] S305: The intranet proxy server sends the data sending information to the load server for data processing.
[0110] S306: When the load server completes data processing, the intranet proxy server receives feedback information sent by the load server.
[0111] S307: The intranet proxy server encapsulates the feedback information into a return object, creates a JMS message of the return object, and sends the JMS message through the JMS message queue.
[0112] Steps S304-S307 are similar to the corresponding implementation methods and principles of steps S201-S202 in the second embodiment. For details, please refer to the introduction in the second embodiment, and no redundant description is given here.
[0113] S308: After writing the JMS message into the JMS message queue, the external network proxy server monitors the JMS message queue.
[0114] S309: When no feedback information is detected in the JMS message feedback queue, the thread waits.
[0115] S310: When feedback information is detected in the JMS message queue, it is determined whether the IP address and port number in the feedback information are consistent with the IP address and port number of the current external network proxy server.
[0116] S311: If they are consistent, wake up the thread in the current external network proxy server that sends information to the JMS message queue.
[0117] S312: If they are inconsistent, the feedback information needs to be forwarded to an external proxy server with an IP address and a port number for processing.
[0118] Steps S308-S312 are similar to the corresponding implementation methods and principles of steps S101-S103 in the first embodiment. For details, please refer to the introduction in the first embodiment, and no redundant description is given here.
[0119] The above are some specific implementations of the intranet and extranet communication methods provided by the embodiments of the present application. Based on this, the present application also provides a corresponding system. The system provided by the embodiments of the present application will be introduced from the perspective of functional modularization. The system and the intranet and extranet communication methods described above can be referenced to each other.
[0120] Figure 4 The structural block diagram of the intranet communication system provided by the embodiment of the present invention is referred to as the specific implementation mode 4. Figure 4 The system may include: an external network proxy server 400 and an internal network proxy server 410. The external network proxy server 400 is used to receive a data transmission request sent by the external network server;
[0121] Parsing the data sending request to obtain data sending information; the data sending information includes the data items carried in the data sending request, the IP address and port number of the external network proxy server, and an identifier corresponding to the data sending request;
[0122] The data sending information is sent to the JMS message queue.
[0123] The intranet proxy server 410 is used to obtain the data sending information and send the data sending information to the load server for data processing when monitoring the data sending information in the JMS message queue, wherein the data sending information includes the data items carried in the data sending request, the IP address and port number of the external network proxy server, and the identifier corresponding to the data sending request;
[0124] When the load server completes data processing, feedback information sent by the load server is received, and the feedback information is sent to the JMS queue, so that the external network proxy server obtains the feedback information in the JMS message queue.
[0125] Optionally, the external network proxy server is further used to configure the address of the JMS message queue, the JMS connection factory and the address of the current external network proxy server according to a preset configuration file.
[0126] The intranet proxy server is also used to configure the address of the JMS message queue, the JMS connection factory, the address of the monitored target message queue, and the address of the load server according to a preset configuration file.
[0127] Optionally, the external network proxy server is further used to wake up a thread in the external network proxy server that sends data sending information to the JMS message queue when it monitors that there is feedback information in the JMS message queue, and waking up the thread is to convert the thread from a sleeping state to a working state;
[0128] When the thread is in working state, feedback information is obtained and sent to the external network server.
[0129] Optionally, the external network proxy server is specifically used to, when monitoring the existence of feedback information in the JMS message queue, determine whether the IP address and port number in the feedback information are consistent with the IP address and port number of the external network proxy server;
[0130] If they are consistent, the thread in the external network proxy server is awakened.
[0131] Optionally, the data items may include request method, request path, request header, and request body;
[0132] The external network proxy server is specifically used to encapsulate the request method, the request path, the request header, the request body, the IP address of the external network proxy server, the port number, and the identifier corresponding to the data sending request into an object;
[0133] Create a JMS message for the object and send the JMS message through the JMS message queue.
[0134] Optionally, the intranet proxy server is specifically used to obtain feedback information from the URL object of the load server, wherein the feedback information may include feedback data, http response code, response header, IP address and port number of the external network proxy server, and an identifier corresponding to the data sending request;
[0135] The feedback information is encapsulated into a return object, a JMS message of the return object is created, and the JMS message is sent through a JMS message queue.
[0136] It should be noted that the implementation method and principle of the intranet and extranet communication in this embodiment are similar to those in the first embodiment, the second embodiment and the third embodiment, and no redundant description is given here.
[0137] The embodiments of the present application also provide corresponding devices and computer storage media for implementing the solutions provided by the embodiments of the present application.
[0138] The device includes a memory and a processor, the memory is used to store instructions or codes, and the processor is used to execute the instructions or codes so that the device executes the method described in any embodiment of the present application.
[0139] The computer storage medium stores codes, and when the codes are executed, a device executing the codes implements the method described in any embodiment of the present application.
[0140] The "first" and "second" in the names such as "first" and "second" (if any) mentioned in the embodiments of the present application are only used as name identifiers and do not represent the first or second in order.
[0141] Through the description of the above implementation methods, it can be known that those skilled in the art can clearly understand that all or part of the steps in the above-mentioned embodiment method can be implemented by means of software plus a general hardware platform. Based on such an understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a storage medium, such as a read-only memory (ROM) / RAM, a magnetic disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network communication device such as a router) to execute the methods described in each embodiment of the present application or some parts of the embodiments.
[0142] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0143] The above description is merely an exemplary embodiment of the present application and is not intended to limit the protection scope of the present application.
Claims
1. A method for communication between an intranet and an extranet, It is characterized in that Applicable to external network proxy servers, including: Receive data sending request sent by external network server; Parsing the data sending request to obtain data sending information; the data sending information includes the data items carried in the data sending request, the IP address and port number of the external network proxy server, and an identifier corresponding to the data sending request; The data sending information is sent to the JMS message queue, so that the intranet proxy server obtains the data sending information in the JMS message queue.
2. The method according to claim 1, It is characterized in that The method further comprises: When feedback information is detected in the JMS message queue, a thread in the external network proxy server that sends the data sending information to the JMS message queue is awakened, and the awakening of the thread is to convert the thread from a sleeping state to a working state; When the thread is in a working state, the feedback information is obtained and sent to an external network server.
3. The method according to claim 1, It is characterized in that Before receiving the data sending request sent by the external network server, the method further includes: According to the preset configuration file, configure the address of the JMS message queue, the JMS connection factory, and the address of the current external network proxy server.
4. The method according to claim 1, It is characterized in that The data items include request method, request path, request header and request body; The sending of the data sending information to the JMS message queue comprises: Encapsulate the request method, the request path, the request header, the request body, the IP address and port number of the external proxy server, and an identifier corresponding to the data sending request into an object; A JMS message for the object is created, and the JMS message is sent through the JMS message queue.
5. The method according to claim 2, It is characterized in that Waking up the thread in the external network proxy server includes: Determine whether the IP address and port number in the feedback information are consistent with the IP address and port number of the external network proxy server; If they are consistent, the thread in the external network proxy server is awakened.
6. A method for communication between an intranet and an extranet, It is characterized in that Applicable to intranet proxy servers, including: When data sending information is detected in the JMS message queue of the external network proxy server, the data sending information is obtained and sent to the load server for data processing, wherein the data sending information includes the data items carried in the data sending request, the IP address and port number of the external network proxy server, and the identifier corresponding to the data sending request; When the load server completes data processing, feedback information sent by the load server is received, and the feedback information is sent to the JMS queue, so that the external network proxy server obtains the feedback information in the JMS message queue.
7. The method according to claim 6, It is characterized in that The receiving feedback information sent by the load server and sending the feedback information to the JMS queue includes: Acquire feedback information from the URL object of the load server, the feedback information including feedback data, http response code, response header, IP address of the external network proxy server, port number and identifier corresponding to the data sending request; encapsulate the feedback information into a return object, create a JMS message of the return object, and send the JMS message through the JMS message queue.
8. The method according to claim 6, It is characterized in that Before acquiring the data sending information, the method further includes: According to the preset configuration file, configure the address of the JMS message queue, configure the JMS connection factory, the address of the monitored target message queue, and the address of the load server.
9. An intranet and extranet communication system, It is characterized in that Including external proxy servers and internal proxy servers; The external network proxy server is used to receive a data sending request sent by the external network server; Parsing the data sending request to obtain data sending information; the data sending information includes the data items carried in the data sending request, the IP address and port number of the external network proxy server, and an identifier corresponding to the data sending request; Send the data sending information to the JMS message queue; The intranet proxy server is used to obtain the data sending information and send the data sending information to the load server for data processing when monitoring the data sending information in the JMS message queue, wherein the data sending information includes the data items carried in the data sending request, the IP address and port number of the external network proxy server, and the identifier corresponding to the data sending request; When the load server completes data processing, feedback information sent by the load server is received, and the feedback information is sent to the JMS queue, so that the external network proxy server obtains the feedback information in the JMS message queue.
10. The system according to claim 9, wherein the external network proxy server is further used to configure the address of the JMS message queue, the JMS connection factory and the address of the current external network proxy server according to a preset configuration file; The intranet proxy server is also used to configure the address of the JMS message queue, the JMS connection factory, the address of the monitored target message queue and the address of the load server according to a preset configuration file.
