CN114221945A - Communication method, communication device, computing equipment and computer-readable storage medium - Google Patents

Communication method, communication device, computing equipment and computer-readable storage medium Download PDF

Info

Publication number
CN114221945A
CN114221945A CN202111537670.3A CN202111537670A CN114221945A CN 114221945 A CN114221945 A CN 114221945A CN 202111537670 A CN202111537670 A CN 202111537670A CN 114221945 A CN114221945 A CN 114221945A
Authority
CN
China
Prior art keywords
http
server
client
request
subsystem
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111537670.3A
Other languages
Chinese (zh)
Inventor
李翰
包艳保
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
MIGU Culture Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
MIGU Culture Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, MIGU Culture Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202111537670.3A priority Critical patent/CN114221945A/en
Publication of CN114221945A publication Critical patent/CN114221945A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Abstract

The embodiment of the invention relates to the technical field of communication, and discloses a communication method, which is applied to a server subsystem and comprises the following steps: receiving an http request initiated by an http client; the http client and the server subsystem are arranged in first equipment; processing the http request into a request packet, and sending the request packet to a client subsystem in second equipment, wherein the request packet is used for sending the analysis data to a maven server in third equipment after the client subsystem analyzes the request packet into analysis data, so that the maven server performs http response according to the analysis data; and receiving a response message generated by the client subsystem according to the http response, and returning the response message to the http client. Through the mode, the embodiment of the invention realizes the effect of improving the communication efficiency.

Description

Communication method, communication device, computing equipment and computer-readable storage medium
Technical Field
The embodiment of the invention relates to the technical field of communication, in particular to a communication method, a communication device, computing equipment and a computer readable storage medium.
Background
Currently, in a server room, due to the limitation of network policy, there are scenarios: a is a desktop computer based on a windows system, B is a development server based on a linux system, and C is a MAVEN private server of a company; the device A can remotely access the device B through SSH (otherwise, the device B cannot actively access the device A), meanwhile, the device A can remotely access the maven private server of the device C through http (otherwise, the device C cannot actively access the device A), the network policy between the device B and the device C is not passed, and the device B and the device C cannot access each other.
However, there is a need in the interaction of devices to: a user logs in a linux server B through ssh by using a desktop computer A, and hopes to initiate an HTTP request on the server B through an HTTP client to access a maven private server in the service C. Because the network of the device B and the device C is not connected, the requirement of the user cannot be met, and the communication efficiency is low.
Disclosure of Invention
In view of the foregoing problems, embodiments of the present invention provide a communication method, an apparatus, a computing device, and a computer-readable storage medium, which are used to solve the technical problem that in the prior art, communication efficiency is low because a plurality of devices cannot communicate with each other.
According to an aspect of the embodiments of the present invention, there is provided a communication method applied to a server subsystem, the method including:
receiving an http request initiated by an http client; the http client and the server subsystem are arranged in first equipment;
processing the http request into a request packet, and sending the request packet to a client subsystem in second equipment, wherein the request packet is used for sending the analysis data to a maven server in third equipment after the client subsystem analyzes the request packet into analysis data, so that the maven server performs http response according to the analysis data;
and receiving a response message generated by the client subsystem according to the http response, and returning the response message to the http client.
In an optional manner, the server subsystem includes a tcp server and an http server; the server subsystem processes the http request into a request packet and sends the request packet to a client subsystem in second equipment, and the method comprises the following steps: the http server receives the http request, processes the http request into a request packet and puts the request packet into a message queue; the http server is a proxy server of the maven server, and the message queue is used for interaction between the http server and a tcp server in first equipment; and after obtaining the request packet from the message queue, the tcp server sends the request packet to a tcp client in the second device.
In an optional manner, the receiving, by the http server, the http request, processing the http request into a request packet, and then placing the request packet into a message queue includes: putting a connection handle between the http client and the http server into a message thread; the http server analyzes the http request to obtain information in the http request; performing hash calculation according to the information in the http request to obtain a global ID; the global ID is used for uniquely identifying the request message; packaging the information in the http request and the global ID into a request packet; and putting the request packet into the message queue.
In an optional manner, after performing hash calculation according to information in the http request to obtain a global ID, the method includes: establishing a mapping relation between the global ID and the connection handle; and storing the mapping relation in a mapping table. In an optional manner, the response information includes the http response, information in the http request, and the global ID; the receiving the response information generated by the client subsystem according to the http response and returning the response information to the http client comprises: after the http server acquires the response information, analyzing the response information to obtain the http response, the information in the http request and the global ID; the http server determines the http client according to the information in the http request, the global ID and the mapping relation in the mapping table; and returning the http response to the http client.
According to another aspect of the embodiments of the present invention, there is provided a communication method applied to a client subsystem, the method including:
receiving a request packet; the request packet is generated by the server subsystem according to an http request initiated by an http client; the http client and the server subsystem are arranged in first equipment;
analyzing the request packet into analysis data;
sending the analysis data to a maven server in third equipment so that the maven server can perform http response according to the analysis data;
generating response information after responding according to the http, and sending the response information to the server subsystem; and the response information is used for the server subsystem to return the response information to the http client.
In an optional manner, the client subsystem includes a tcp client and a work queue pool; the client subsystem analyzes the request packet into analysis data, and sends the analysis data to a maven server in third equipment so that the maven server performs http response according to the analysis data, and the method comprises the following steps: the tcp client receives the request packet through the message queue; the tcp client analyzes the request packet to obtain information in the http request and the global ID; the tcp client acquires an idle work thread from the work queue pool; and the idle working thread initiates an http request to the maven server according to the information in the http request, so that the maven server performs an http response according to the analysis data.
In an optional manner, the generating response information according to the http response and sending the response information to the server subsystem includes: the idle working thread acquires the http response and packages the http response, the information in the http request and the global ID into response information; and the tcp client sends the response information to the tcp server.
According to another aspect of the embodiments of the present invention, there is provided a communication system, the apparatus including:
the http client is used for initiating an http request to the server subsystem; the http client and the server subsystem are arranged in first equipment;
the server subsystem is used for processing the http request into a request packet and then sending the request packet to a client subsystem in second equipment;
the client subsystem is used for analyzing the request packet into analysis data and sending the analysis data to a maven server in third equipment so that the maven server can perform http response according to the analysis data;
the client subsystem is further used for generating response information after responding according to the http and sending the response information to the server subsystem;
and the server subsystem is also used for returning the response information to the http client.
According to another aspect of embodiments of the present invention, there is provided a computing device including:
the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the operation of the communication method.
According to a further aspect of the embodiments of the present invention, there is provided a computer-readable storage medium having at least one executable instruction stored therein, which when executed on a computing device, causes the computing device to perform the operations of the communication method.
The embodiment of the invention initiates an http request to a server subsystem through an http client, the server subsystem processes the http request into a request packet and sends the request packet to a client subsystem in second equipment, the client subsystem analyzes the request packet into analytic data and sends the analytic data to a maven server in third equipment so that the maven server carries out http response according to the analytic data, the client subsystem generates response information according to the http response and sends the response information to the server subsystem, and the server subsystem returns the response information to the http client, so that the first equipment can directly remotely access the third equipment through http, and the communication efficiency is improved.
The foregoing description is only an overview of the technical solutions of the embodiments of the present invention, and the embodiments of the present invention can be implemented according to the content of the description in order to make the technical means of the embodiments of the present invention more clearly understood, and the detailed description of the present invention is provided below in order to make the foregoing and other objects, features, and advantages of the embodiments of the present invention more clearly understandable.
Drawings
The drawings are only for purposes of illustrating embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a schematic structural diagram of a communication system provided by an embodiment of the present invention;
fig. 2 is a schematic structural diagram of another embodiment of a communication system provided by the embodiment of the present invention;
fig. 3 is a flow chart of a communication method provided by an embodiment of the present invention;
fig. 4 is a flow chart illustrating a communication method according to another embodiment of the present invention;
fig. 5 is a schematic structural diagram of a computing device provided by an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein.
Currently, in a server room, due to the limitation of network policy, there are scenarios: a is a desktop computer based on a windows system, B is a development server based on a linux system, and C is a MAVEN private server of a company; the device A can remotely access the device B through SSH (otherwise, the device B cannot actively access the device A), meanwhile, the device A can remotely access the maven private server of the device C through http (otherwise, the device C cannot actively access the device A), the network policy between the device B and the device C is not passed, and the device B and the device C cannot access each other. There is a need, however: a user logs in a linux server B through ssh by using a desktop computer A, and hopes to initiate an HTTP request on the server B through an HTTP client to access a maven private server in the service C. Because the network of the device B and the device C is not connected, the user's requirement cannot be met.
The inventors of the present application found in the process of the real-time embodiment of the present invention that: in the existing scheme, an http proxy server (proxy) is started on a windows desktop computer A. The http client of the test equipment B firstly initiates an http request to proxy, the proxy forwards the http request to the equipment C, the equipment C responds an http response to the proxy, and the proxy forwards the http response equipment B. However, in this way, it is required that the device B must be able to actively request the device a, the device B must be able to actively establish an HTTP connection with the device a, and for the device B that cannot actively request the device a and actively establish an HTTP connection with the device a, the purpose of the device B accessing the device C through the device a cannot be solved.
Therefore, the application provides a communication method, so that the server A is communicated with the server B in a single direction and is communicated with the server C in a single direction, the indirect communication between the server A and the server B is equivalent to the indirect communication between the server B and the server C on a network, and the effect that the device B can directly and remotely access the device C through http is achieved by utilizing the indirect communication relation.
Fig. 1 shows a schematic structural diagram of a communication system according to an embodiment of the present invention. As shown in fig. 1, the apparatus 300 includes:
an http client 310, configured to initiate an http request to the server subsystem 320; the http client 310 and the server subsystem 320 are disposed in the first device 10;
the server subsystem 320 is configured to process the http request into a request packet, and send the request packet to the client subsystem 330 in the second device 20;
the client subsystem 330 is configured to parse the request packet into parsing data, and send the parsing data to a maven server 340 in the third device 30, so that the maven server 340 performs an http response according to the parsing data;
the client subsystem 330 is further configured to generate response information according to the http response, and send the response information to the server subsystem 320;
the server subsystem 320 is further configured to return the response information to the http client 310.
Fig. 2 shows an embodiment of the communication system, which is implemented by at least 3 computing devices, as shown in fig. 2, a first device 10, a second device 20, and a third device 30, wherein the first device 10 is provided with a server subsystem, the second device 20 is provided with a client subsystem, and the third device 3 is provided with a maven server. The working process of the communication system comprises the following steps:
first, the http client initiates an http request to the server subsystem.
In the embodiment of the invention, the http client and the server subsystem are operated in a first device based on a linux system. The http client in the first device is a maven client, and it needs to access a maven server in the third device through the second device based on the Windows system. The http request includes request information for a maven server in the third device. The tcp server is included in the second device based on the Windows system.
The server subsystem (server subsys) comprises a tcp server (tcp server), an http server (http server) and a message queue. And the tcp server (tcp server) and the http server (http server) interact through a message queue. The http server is used as a proxy server of the maven server in the third device, so that the maven client of the http protocol in the first device is communicated with the http server of the first device. Specifically, the address configuration of the maven repository in the maven client is modified in the first device, and the address of the maven repository is modified from the IP address of the maven server in the third device to its own address (127.0.0.1 or localhost), so that the maven client running in the first device can initiate a request to its own http server. The mvn command on the maven server in the third device can pull the dependent jar packet related to the java item through the http service of the http server. During first configuration, the tcp server in the second device, the tcp client and the http server in the first device need to be respectively started, and long connection between the tcp server and the tcp client is maintained, so that the configuration of the http server and the maven server is modified.
And then, the server subsystem processes the http request into a request packet and sends the request packet to a client subsystem in the second device.
And the http server receives the http request sent by the http client, processes the http request into a request packet and puts the request packet into a message queue. The message queue is used for interaction between the http server and a tcp server in the first device. Specifically, after receiving the http request, the http server does not immediately return a result to the http client, but performs the following operations:
1) and the http server puts a connection handle (handler0) between the http client and the http server into a message thread, wherein the message thread is an event loop. And the http server analyzes the http request to obtain information in the http request, wherein the information in the http request comprises header information (including url and the like), parameter information, a message body and the like of the http request, and the url is analyzed to be url _0, for example.
2) And performing hash calculation according to information (including header information, parameter information, a message body and the like) in the http request to obtain a global ID, for example, the calculated global ID is GID0, where the global ID is used to uniquely identify the request packet. The method can be characterized in that during hash operation, abstract operation is carried out according to the message body of an http request to obtain a global ID with equal length, the ID can uniquely identify the request message, if any difference exists between the two request messages, two IDs with equal length and different contents can be obtained, the ID value is embedded into the flow of the whole system, and the request message and the corresponding response message can be identified.
3) Packaging the information in the http request and the global ID into a request packet;
4) and putting the request packet into the message queue _ 0.
In the embodiment of the present invention, the http server further establishes a mapping relationship between the global ID (GID0) and the connection handle (handler0), and puts the mapping relationship between the connection handle handler0 and the global ID value GID0 into a mapping table.
5) And after obtaining the request packet from the message queue, the tcp server sends the request packet to a client subsystem in the second device through long connection.
And then, the client subsystem analyzes the request packet into analysis data, and sends the analysis data to a maven server in third equipment, so that the maven server performs http response according to the analysis data.
The client subsystem comprises a tcp client and a work queue pool. Specifically, the tcp client receives a request packet pushed by the tcp server through a long connection, and the tcp client analyzes the request packet to obtain information in the http request and the global ID (GID 0); the tcp client acquires an idle work thread (worker) from the work queue pool, and specifies the information in the analyzed http request for the idle work thread; and the idle working thread initiates an http request to the maven server in the third device according to the information (http header information, parameter information and message body) in the http request, so that the maven server (maven private server) performs http response (resp _0) according to the analysis data. And waiting for the maven server to perform http response according to the analysis data.
And then, the client subsystem generates response information according to the http response and sends the response information to the server subsystem.
After the idle work thread worker acquires the http response (resp _0) of the maven server, the http response resp _0 and the obtained GID0 are packaged to generate response information. And the tcp client sends the response information to the tcp server through long connection.
And finally, the server subsystem returns the response information to the http client.
In the embodiment of the invention, the response information is put into the message queue (message queue _1) by the tcp server, the http server obtains the response information from the message queue (message queue _1), analyzes the response information to obtain the http response and GID0 of the maven server, finds the http handle stored in the mapping table from the mapping table of the http handle and the GID through GID0, obtains the channel between the http server and the corresponding http client through the http handle, and returns the analyzed http response to the http client through the channel, so that the process that the http client in the first device based on the linux system communicates with the maven server in the third device through the second device based on the Windows system is completed, and the problem that the information interaction of the http client cannot be actively connected with the http proxy server under the condition of single-pass of the network is solved. And through the HTTP request analysis and response flow, the data of HTTP request and response stages are put into a message queue, and the flows are connected in series through GID, so that the consistency of the data is ensured.
The method comprises the steps that an http request is sent to a server subsystem through an http client, the server subsystem processes the http request into a request packet and sends the request packet to a client subsystem in second equipment, the client subsystem analyzes the request packet into analytic data and sends the analytic data to a maven server in third equipment so that the maven server carries out http response according to the analytic data, the client subsystem generates response information according to the http response and sends the response information to the server subsystem, and the server subsystem returns the response information to the http client, so that the first equipment can remotely access the third equipment directly through http.
The method comprises the steps that an http request is sent to a server subsystem through an http client, the server subsystem processes the http request into a request packet and sends the request packet to a client subsystem in second equipment, the client subsystem analyzes the request packet into analytic data and sends the analytic data to a maven server in third equipment so that the maven server carries out http response according to the analytic data, the client subsystem generates response information according to the http response and sends the response information to the server subsystem, and the server subsystem returns the response information to the http client, so that the first equipment can remotely access the third equipment directly through http.
Fig. 4 shows a communication method provided in another embodiment of the present invention, which is applied to a client subsystem, and includes:
step 210: receiving a request packet; the request packet is generated by the server subsystem according to an http request initiated by an http client; the http client and the server subsystem are arranged in first equipment.
Step 220: and analyzing the request packet into analysis data.
Step 230: and sending the analysis data to a maven server in third equipment so that the maven server performs http response according to the analysis data.
Step 240: generating response information after responding according to the http, and sending the response information to the server subsystem; and the response information is used for the server subsystem to return the response information to the http client.
The specific steps of the communication method in the embodiment of the present invention are substantially the same as the working process of the client subsystem in the communication system, and are not described herein again.
The method comprises the steps that an http request is sent to a server subsystem through an http client, the server subsystem processes the http request into a request packet and sends the request packet to a client subsystem in second equipment, the client subsystem analyzes the request packet into analytic data and sends the analytic data to a maven server in third equipment so that the maven server carries out http response according to the analytic data, the client subsystem generates response information according to the http response and sends the response information to the server subsystem, and the server subsystem returns the response information to the http client, so that the first equipment can remotely access the third equipment directly through http.
Fig. 5 is a schematic structural diagram of a computing device according to an embodiment of the present invention, and the specific embodiment of the present invention does not limit the specific implementation of the computing device.
As shown in fig. 5, the computing device may include: a processor (processor)402, a Communications Interface 404, a memory 406, and a Communications bus 408.
Wherein: the processor 402, communication interface 404, and memory 406 communicate with each other via a communication bus 408. A communication interface 404 for communicating with network elements of other devices, such as clients or other servers. The processor 402, configured to execute the program 410, may specifically perform the relevant steps described above for the communication method embodiment.
In particular, program 410 may include program code comprising computer-executable instructions.
The processor 402 may be a central processing unit CPU or an application Specific Integrated circuit asic or one or more Integrated circuits configured to implement embodiments of the present invention. The computing device includes one or more processors, which may be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
And a memory 406 for storing a program 410. Memory 406 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 410 may be specifically invoked by the processor 402 to cause the computing device to perform the following operations:
receiving an http request initiated by an http client; the http client and the server subsystem are arranged in first equipment;
processing the http request into a request packet, and sending the request packet to a client subsystem in second equipment, wherein the request packet is used for sending the analysis data to a maven server in third equipment after the client subsystem analyzes the request packet into analysis data, so that the maven server performs http response according to the analysis data;
receiving response information generated by the client subsystem according to the http response, and returning the response information to the http client;
or
Receiving a request packet; the request packet is generated by the server subsystem according to an http request initiated by an http client; the http client and the server subsystem are arranged in first equipment;
analyzing the request packet into analysis data;
sending the analysis data to a maven server in third equipment so that the maven server can perform http response according to the analysis data;
generating response information after responding according to the http, and sending the response information to the server subsystem; and the response information is used for the server subsystem to return the response information to the http client.
In an optional manner, the server subsystem includes a tcp server and an http server; the server subsystem processes the http request into a request packet and sends the request packet to a client subsystem in second equipment, and the method comprises the following steps: the http server receives the http request, processes the http request into a request packet and puts the request packet into a message queue; the http server is a proxy server of the maven server, and the message queue is used for interaction between the http server and a tcp server in first equipment; and after obtaining the request packet from the message queue, the tcp server sends the request packet to a tcp client in the second device.
In an optional manner, the receiving, by the http server, the http request, processing the http request into a request packet, and then placing the request packet into a message queue includes: putting a connection handle between the http client and the http server into a message thread; the http server analyzes the http request to obtain information in the http request; performing hash calculation according to the information in the http request to obtain a global ID; the global ID is used for uniquely identifying the request message; packaging the information in the http request and the global ID into a request packet; and putting the request packet into the message queue.
In an optional manner, the client subsystem includes a tcp client and a work queue pool; the client subsystem analyzes the request packet into analysis data, and sends the analysis data to a maven server in third equipment so that the maven server performs http response according to the analysis data, and the method comprises the following steps: the tcp client receives the request packet through the tcp server; the tcp client analyzes the request packet to obtain information in the http request and the global ID; the tcp client acquires an idle work thread from the work queue pool; and the idle working thread initiates an http request to the maven server according to the information in the http request, so that the maven server performs an http response according to the analysis data.
In an optional manner, the generating, by the client subsystem, response information according to the http response, and sending the response information to the server subsystem includes: the idle working thread acquires the http response and packages the http response, the information in the http request and the global ID into response information; and the tcp client sends the response information to the tcp server.
In an optional manner, after performing hash calculation according to information in the http request to obtain a global ID, the method includes: establishing a mapping relation between the global ID and the connection handle; and storing the mapping relation in a mapping table.
In an optional manner, the returning, by the server subsystem, the response information to the http client includes: after the http server acquires the response information, analyzing the response information to obtain the http response, the information in the http request and the global ID; the http server determines the http client according to the information in the http request, the global ID and the mapping relation in the mapping table; and returning the http response to the http client.
The method comprises the steps that an http request is sent to a server subsystem through an http client, the server subsystem processes the http request into a request packet and sends the request packet to a client subsystem in second equipment, the client subsystem analyzes the request packet into analytic data and sends the analytic data to a maven server in third equipment so that the maven server carries out http response according to the analytic data, the client subsystem generates response information according to the http response and sends the response information to the server subsystem, and the server subsystem returns the response information to the http client, so that the first equipment can remotely access the third equipment directly through http.
An embodiment of the present invention provides a computer-readable storage medium, where the storage medium stores at least one executable instruction, and when the executable instruction is executed on a computing device, the computing device is caused to execute a communication method in any of the above method embodiments.
The executable instructions may be specifically configured to cause the computing device to:
receiving an http request initiated by an http client; the http client and the server subsystem are arranged in first equipment;
processing the http request into a request packet, and sending the request packet to a client subsystem in second equipment, wherein the request packet is used for sending the analysis data to a maven server in third equipment after the client subsystem analyzes the request packet into analysis data, so that the maven server performs http response according to the analysis data;
receiving response information generated by the client subsystem according to the http response, and returning the response information to the http client;
or
Receiving a request packet; the request packet is generated by the server subsystem according to an http request initiated by an http client; the http client and the server subsystem are arranged in first equipment;
analyzing the request packet into analysis data;
sending the analysis data to a maven server in third equipment so that the maven server can perform http response according to the analysis data;
generating response information after responding according to the http, and sending the response information to the server subsystem; and the response information is used for the server subsystem to return the response information to the http client.
In an optional manner, the server subsystem includes a tcp server and an http server; the server subsystem processes the http request into a request packet and sends the request packet to a client subsystem in second equipment, and the method comprises the following steps: the http server receives the http request, processes the http request into a request packet and puts the request packet into a message queue; the http server is a proxy server of the maven server, and the message queue is used for interaction between the http server and a tcp server in first equipment; and after obtaining the request packet from the message queue, the tcp server sends the request packet to a tcp client in the second device.
In an optional manner, the receiving, by the http server, the http request, processing the http request into a request packet, and then placing the request packet into a message queue includes: putting a connection handle between the http client and the http server into a message thread; the http server analyzes the http request to obtain information in the http request; performing hash calculation according to the information in the http request to obtain a global ID; the global ID is used for uniquely identifying the request message; packaging the information in the http request and the global ID into a request packet; and putting the request packet into the message queue.
In an optional manner, the client subsystem includes a tcp client and a work queue pool; the client subsystem analyzes the request packet into analysis data, and sends the analysis data to a maven server in third equipment so that the maven server performs http response according to the analysis data, and the method comprises the following steps: the tcp client receives the request packet through the tcp server; the tcp client analyzes the request packet to obtain information in the http request and the global ID; the tcp client acquires an idle work thread from the work queue pool; and the idle working thread initiates an http request to the maven server according to the information in the http request, so that the maven server performs an http response according to the analysis data.
In an optional manner, the generating, by the client subsystem, response information according to the http response, and sending the response information to the server subsystem includes: the idle working thread acquires the http response and packages the http response, the information in the http request and the global ID into response information; and the tcp client sends the response information to the tcp server.
In an optional manner, after performing hash calculation according to information in the http request to obtain a global ID, the method includes: establishing a mapping relation between the global ID and the connection handle; and storing the mapping relation in a mapping table.
In an optional manner, the returning, by the server subsystem, the response information to the http client includes: after the http server acquires the response information, analyzing the response information to obtain the http response, the information in the http request and the global ID; the http server determines the http client according to the information in the http request, the global ID and the mapping relation in the mapping table; and returning the http response to the http client.
The method comprises the steps that an http request is sent to a server subsystem through an http client, the server subsystem processes the http request into a request packet and sends the request packet to a client subsystem in second equipment, the client subsystem analyzes the request packet into analytic data and sends the analytic data to a maven server in third equipment so that the maven server carries out http response according to the analytic data, the client subsystem generates response information according to the http response and sends the response information to the server subsystem, and the server subsystem returns the response information to the http client, so that the first equipment can remotely access the third equipment directly through http.
The embodiment of the invention provides a communication system, which is used for executing the communication method.
Embodiments of the present invention provide a computer program that can be invoked by a processor to cause a computing device to perform the communication method in any of the above method embodiments.
Embodiments of the present invention provide a computer program product comprising a computer program stored on a computer-readable storage medium, the computer program comprising program instructions which, when run on a computer, cause the computer to perform the communication method of any of the above-mentioned method embodiments.
The algorithms or displays presented herein are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. In addition, embodiments of the present invention are not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the embodiments of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the invention and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names. The steps in the above embodiments should not be construed as limiting the order of execution unless specified otherwise.

Claims (11)

1. A communication method applied to a server subsystem, the method comprising:
receiving an http request initiated by an http client; the http client and the server subsystem are arranged in first equipment;
processing the http request into a request packet, and sending the request packet to a client subsystem in second equipment, wherein the request packet is used for sending the analysis data to a maven server in third equipment after the client subsystem analyzes the request packet into analysis data, so that the maven server performs http response according to the analysis data;
and receiving a response message generated by the client subsystem according to the http response, and returning the response message to the http client.
2. The method of claim 1, wherein the server subsystem comprises a tcp server and an http server; the server subsystem processes the http request into a request packet and sends the request packet to a client subsystem in second equipment, and the method comprises the following steps:
the http server receives the http request, processes the http request into a request packet and puts the request packet into a message queue; the http server is a proxy server of the maven server, and the message queue is used for interaction between the http server and a tcp server in first equipment;
and after obtaining the request packet from the message queue, the tcp server sends the request packet to a tcp client in the second device.
3. The method according to claim 2, wherein the http server receives the http request, processes the http request into a request packet, and places the request packet into a message queue, comprising:
putting a connection handle between the http client and the http server into a message thread;
the http server analyzes the http request to obtain information in the http request;
performing hash calculation according to the information in the http request to obtain a global ID; the global ID is used for uniquely identifying the request message;
packaging the information in the http request and the global ID into a request packet;
and putting the request packet into the message queue.
4. The method according to claim 3, wherein after performing the hash calculation according to the information in the http request to obtain the global ID, the method comprises:
establishing a mapping relation between the global ID and the connection handle;
and storing the mapping relation in a mapping table.
5. The method of claim 3, wherein the response information comprises the http response, information in the http request, and the global ID; the receiving the response information generated by the client subsystem according to the http response and returning the response information to the http client comprises:
after the http server acquires the response information, analyzing the response information to obtain the http response, the information in the http request and the global ID;
the http server determines the http client according to the information in the http request, the global ID and the mapping relation in the mapping table;
and returning the http response to the http client.
6. A method of communication, applied to a client subsystem, the method comprising:
receiving a request packet; the request packet is generated by the server subsystem according to an http request initiated by an http client; the http client and the server subsystem are arranged in first equipment;
analyzing the request packet into analysis data;
sending the analysis data to a maven server in third equipment so that the maven server can perform http response according to the analysis data;
generating response information after responding according to the http, and sending the response information to the server subsystem; and the response information is used for the server subsystem to return the response information to the http client.
7. The method of claim 6, wherein the client subsystem comprises a tcp client and a work queue pool; analyzing the request packet into analysis data, and sending the analysis data to a maven server in third equipment so that the maven server performs http response according to the analysis data, wherein the method comprises the following steps:
the tcp client receives a request packet through the tcp server;
the tcp client analyzes the request packet to obtain information in the http request and the global ID;
the tcp client acquires an idle work thread from the work queue pool;
and the idle working thread initiates an http request to the maven server according to the information in the http request, so that the maven server performs an http response according to the analysis data.
8. The method of claim 7, wherein generating response information according to the http response and sending the response information to the server subsystem comprises:
the idle working thread acquires the http response and packages the http response, the information in the http request and the global ID into response information;
and the tcp client sends the response information to the tcp server.
9. A communication system, the apparatus comprising:
the http client is used for initiating an http request to the server subsystem; the http client and the server subsystem are arranged in first equipment;
the server subsystem is used for processing the http request into a request packet and then sending the request packet to a client subsystem in second equipment;
the client subsystem is used for analyzing the request packet into analysis data and sending the analysis data to a maven server in third equipment so that the maven server can perform http response according to the analysis data;
the client subsystem is further used for generating response information after responding according to the http and sending the response information to the server subsystem;
and the server subsystem is also used for returning the response information to the http client.
10. A computing device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is configured to store at least one executable instruction that causes the processor to perform the operations of the communication method of any of claims 1-8.
11. A computer-readable storage medium having stored therein at least one executable instruction that, when executed on a computing device, causes the computing device to perform operations of a communication method according to any one of claims 1 to 8.
CN202111537670.3A 2021-12-15 2021-12-15 Communication method, communication device, computing equipment and computer-readable storage medium Pending CN114221945A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111537670.3A CN114221945A (en) 2021-12-15 2021-12-15 Communication method, communication device, computing equipment and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111537670.3A CN114221945A (en) 2021-12-15 2021-12-15 Communication method, communication device, computing equipment and computer-readable storage medium

Publications (1)

Publication Number Publication Date
CN114221945A true CN114221945A (en) 2022-03-22

Family

ID=80702619

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111537670.3A Pending CN114221945A (en) 2021-12-15 2021-12-15 Communication method, communication device, computing equipment and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN114221945A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020112085A1 (en) * 2000-12-21 2002-08-15 Berg Mitchell T. Method and system for communicating an information packet through multiple networks
WO2004095796A1 (en) * 2003-04-17 2004-11-04 Visto Corporation A data access, replication or communication system comprising a message queuing communications platform
US20060095573A1 (en) * 2004-11-01 2006-05-04 Microsoft Corporation Delayed HTTP response
CN101523865A (en) * 2006-08-03 2009-09-02 思杰系统有限公司 Systems and methods for using an HTTP-aware client agent
US20120066291A1 (en) * 2010-09-15 2012-03-15 Slavomir Grigorov Remote method invocation tunneling over hypertext transfer protocol
CN107508839A (en) * 2017-09-28 2017-12-22 中国银联股份有限公司 A kind of method and apparatus for controlling web system unauthorized access
CN109769012A (en) * 2018-12-12 2019-05-17 视联动力信息技术股份有限公司 A kind of access method and device of Web server
US10505985B1 (en) * 2016-04-13 2019-12-10 Palo Alto Networks, Inc. Hostname validation and policy evasion prevention

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020112085A1 (en) * 2000-12-21 2002-08-15 Berg Mitchell T. Method and system for communicating an information packet through multiple networks
WO2004095796A1 (en) * 2003-04-17 2004-11-04 Visto Corporation A data access, replication or communication system comprising a message queuing communications platform
US20060095573A1 (en) * 2004-11-01 2006-05-04 Microsoft Corporation Delayed HTTP response
CN101523865A (en) * 2006-08-03 2009-09-02 思杰系统有限公司 Systems and methods for using an HTTP-aware client agent
US20120066291A1 (en) * 2010-09-15 2012-03-15 Slavomir Grigorov Remote method invocation tunneling over hypertext transfer protocol
US10505985B1 (en) * 2016-04-13 2019-12-10 Palo Alto Networks, Inc. Hostname validation and policy evasion prevention
CN107508839A (en) * 2017-09-28 2017-12-22 中国银联股份有限公司 A kind of method and apparatus for controlling web system unauthorized access
CN109769012A (en) * 2018-12-12 2019-05-17 视联动力信息技术股份有限公司 A kind of access method and device of Web server

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王良;徐军明;吴红生;: "基于IOCP模型的楼宇灯控制系统服务器的设计", 机电工程, no. 11 *

Similar Documents

Publication Publication Date Title
US10432704B2 (en) Translation of messages using sensor-specific and unified protocols
US10824537B2 (en) Method, device, and computer readable medium for tracing computing system
EP3343364A1 (en) Accelerator virtualization method and apparatus, and centralized resource manager
US10191760B2 (en) Proxy response program, proxy response device and proxy response method
US20150319221A1 (en) Tracing business transactions based on application frameworks
US20190026131A1 (en) Redirection Method and Apparatus, and System
CN113835911B (en) Intranet penetration agent method, system, host and computer readable storage medium
CN113342503B (en) Real-time progress feedback method, device, equipment and storage medium
CN112199621B (en) Method and device for quickly generating poster and computer equipment
CN106412079B (en) Request processing method and system
CN113890879B (en) Load balancing method and device for data access, computer equipment and medium
US20210334185A1 (en) Task based service management platform
US20180167464A1 (en) Systems and methods to anonymize web browsing
US9686175B2 (en) Methods, systems, and computer readable media for testing network devices using simulated application traffic
CN110572394B (en) Access control method and device
CN114221945A (en) Communication method, communication device, computing equipment and computer-readable storage medium
US8433824B2 (en) Thread timeout coordination method and system
CN111177717A (en) Malicious process identification method and device, electronic device and storage medium
CN110933121A (en) Connection establishing method, communication processing method and device and communication equipment
CN106648610B (en) Method and device for remotely calling and responding functional interface
CN113596170A (en) Load balancing equipment-based shutdown processing method, device, medium and equipment
CN114356713A (en) Thread pool monitoring method and device, electronic equipment and storage medium
CN109460215B (en) Application control method and device
US10623523B2 (en) Distributed communication and task handling to facilitate operations of application system
CN111488223A (en) Container-based data processing method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination