Communication method, system, computer device and storage medium
By introducing proxy servers and mapping tables in the cloud computing environment, the problem of duplication of network communication addresses of tenants on the cloud is solved, and unique identification of clients and reliable transmission of communication data is realized, ensuring the security and reliability of network communication.
Patent Information
- Application Number
- CN202111579304.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-22
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2041-12-22
AI Technical Summary
In a cloud computing environment, when a traditional system is migrated to the cloud, the communication address of the tenant network may be duplicated, resulting in the inability to meet the uniqueness requirements of the communication address, protocol, and port of the TCP protocol, which in turn affects the communication reliability.
By introducing a proxy server in the tenant network, using a mapping table of preset communication addresses and client identification, the unique identity of the client is determined, and message forwarding is carried out through the backend server, ensuring that the communication data of each client can be correctly identified and processed. .
Even if there are multiple clients with the same communication address, the backend server can identify and communicate based on the unique client identification, effectively utilize the secure communication settings on the cloud to ensure the security and reliability of network communication.
Smart Images

Figure CN114363331B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a communication method, apparatus, computer equipment and storage medium. Background Art
[0002] Cloud computing environment is an enterprise-level application that is becoming more and more popular. Many systems and applications are gradually migrating to the cloud environment, using the cloud environment to provide application services. But at the same time, many traditional systems do not take into account the needs of the cloud and face many challenges when migrating to the cloud.
[0003] The cloud environment is a widely used deployment model for software application systems, and the network allocation is also very different from that of traditional data centers. Since the cloud environment is a software-defined service model, it is different from the traditional data center's planning-based network allocation method. In other words, each tenant can define the CIDR (Classless Inter-Domain Routing) of his own network, so that the network communication addresses obtained by different virtual machines are completely set according to the tenant network's own service requirements, which is likely to lead to duplication of communication addresses. Since the duplication of communication addresses of multiple tenant networks does not meet the uniqueness requirements of the TCP protocol (Transmission Control Protocol) for the communication address, protocol, and port triple, communication is impossible. Summary of the invention
[0004] Based on this, it is necessary to provide a communication method, system, computer device, computer-readable storage medium and computer program product that can improve communication reliability in response to the above technical problems.
[0005] In a first aspect, the present application provides a communication method for a proxy server corresponding to a tenant network in a communication system. The method comprises:
[0006] Receiving a first communication message sent by a client in the tenant network, wherein the first communication message includes a communication address and communication data of the client;
[0007] Determine the client identifier corresponding to the communication address of the client according to a preset mapping table of communication addresses and client identifiers;
[0008] Generate a first message packet according to the client identifier and the first communication message;
[0009] The first message is forwarded to the backend server.
[0010] In one embodiment, the method further comprises:
[0011] Receiving a second message packet sent by the background server, wherein the second message packet includes response data corresponding to the communication data and the client identifier;
[0012] According to a preset mapping table of communication addresses and client identifiers, the communication address of the client corresponding to the client identifier is determined, and based on the communication address, the response data in the second message packet is sent to the client.
[0013] In one embodiment, the method further comprises:
[0014] Receive first registration information sent by the client, where the first registration information includes a communication address of the client and tenant ID information of a tenant network where the client is located;
[0015] Obtaining the communication address of the proxy server;
[0016] According to the first registration information and the communication address of the proxy server, the second registration information is obtained, and the second registration information is forwarded to the backend server.
[0017] In one embodiment, the method further comprises:
[0018] Receiving a preset client identification table sent by the backend server, wherein the preset client identification table includes the client identification, the communication address of the client, and the communication address of the proxy server;
[0019] Based on the preset client identification table, a mapping table of communication addresses and client identifications is generated.
[0020] In one embodiment, the method further comprises:
[0021] When receiving a deletion instruction, parsing the deletion instruction to obtain a target client;
[0022] The client identifier corresponding to the target client is deleted from the preset client identifier table.
[0023] In a second aspect, the present application provides a communication method, which is applied to a background server in a communication system, comprising:
[0024] Receiving a first message packet sent by a proxy server in the communication system, wherein the first message packet includes a client identifier and a first communication message;
[0025] Processing the first message to obtain response data;
[0026] Determine the client corresponding to the client identifier included in the first message according to a preset client identifier table, wherein the preset client identifier table includes the client identifier, the communication address of the client, and the communication address of the proxy server;
[0027] Generate a second message according to the response data and the client identifier;
[0028] The second message packet is sent to the proxy server corresponding to the client.
[0029] In one embodiment, the method further comprises:
[0030] receiving second registration information sent by the proxy server, the second registration information including the first registration information and the communication address of the proxy server, the first registration information including the communication address of the client and the tenant ID information of the tenant network where the client is located;
[0031] Generate a client identifier corresponding to the second registration information by using a preset global random client identifier generation algorithm;
[0032] Adding the client identifier, the communication address of the client, and the communication address of the proxy server to a preset client identifier table;
[0033] The preset client identification table is synchronized to the proxy server.
[0034] In a third aspect, the present application provides a communication system, the communication system comprising at least one tenant network, at least one proxy server, and at least one background server; wherein the tenant network includes at least one client, and the tenant network corresponds to the proxy server one by one, wherein:
[0035] The client is used to transmit a first communication message to the proxy server, wherein the first communication message includes a communication address of the client and first communication data;
[0036] The proxy server is used to determine the client identifier corresponding to the communication address of the client according to a preset mapping table of communication addresses and client identifiers; generate a first message packet according to the client identifier and the first communication message, and forward the first message packet to the background server;
[0037] The backend server is used to process the first communication data in the first message message to obtain response data; determine the client corresponding to the client identifier contained in the first message message according to a preset client identifier table; generate a second message message according to the response data and the client identifier, and forward the second message message to the proxy server corresponding to the client;
[0038] The proxy server is further used to determine the communication address of the client corresponding to the client identifier in the second message according to a preset mapping table of communication addresses and client identifiers, and return the response data in the second message to the client corresponding to the communication address.
[0039] In one embodiment, the system further comprises:
[0040] The client is further configured to send first registration information to a proxy server, the proxy server corresponding to the tenant network where the client is located, the first registration information including the communication address of the client and the tenant ID information of the tenant network where the client is located;
[0041] The proxy server is used to obtain second registration information according to the first registration information and the communication address of the proxy server, and forward the second registration information to the backend server;
[0042] The backend server is used to generate a client identifier corresponding to the second registration information through a preset global random identifier generation algorithm, and add the client identifier, the communication address of the client, and the communication address of the proxy server to a preset client identifier table;
[0043] The backend server is further used to synchronize the preset client identification table to the proxy server.
[0044] In a fourth aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0045] Receiving a first communication message sent by a client in the tenant network, wherein the first communication message includes a communication address and communication data of the client;
[0046] Determine the client identifier corresponding to the communication address of the client according to a preset mapping table of communication addresses and client identifiers;
[0047] Generate a first message packet according to the client identifier and the first communication message;
[0048] The first message is forwarded to the backend server.
[0049] In a fifth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0050] Receiving a first communication message sent by a client in the tenant network, wherein the first communication message includes a communication address and communication data of the client;
[0051] Determine the client identifier corresponding to the communication address of the client according to a preset mapping table of communication addresses and client identifiers;
[0052] Generate a first message packet according to the client identifier and the first communication message;
[0053] The first message is forwarded to the backend server.
[0054] In a sixth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0055] Receiving a first communication message sent by a client in the tenant network, wherein the first communication message includes a communication address and communication data of the client;
[0056] Determine the client identifier corresponding to the communication address of the client according to a preset mapping table of communication addresses and client identifiers;
[0057] Generate a first message packet according to the client identifier and the first communication message;
[0058] The first message is forwarded to the backend server.
[0059] The above communication method, system, computer device and storage medium can receive a first communication message including a communication address of a client and first communication data through a proxy server as an intermediary between a client and a background server, and determine a client identifier corresponding to the communication address of the client according to a preset mapping table of communication addresses and client identifiers, and forward it to the background server. Through the method provided by the present disclosure, even when there are multiple clients with the same communication address, the background server can identify each client based on the unique client identifier of each client to complete data communication, and can effectively utilize various secure communication settings on the cloud, thereby ensuring the security and reliability of network communications. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1is a schematic diagram of a communication system in one embodiment;
[0061] Figure 2 is a flow chart of a communication method in one embodiment;
[0062] Figure 3 A schematic diagram of a flow chart of a step in which a proxy server forwards a second message packet to a client in an embodiment;
[0063] Figure 4 A schematic diagram of a process of forwarding first registration information by a proxy server in one embodiment;
[0064] Figure 5 A schematic flow chart of a step in which a proxy server receives a preset client identification table in one embodiment;
[0065] Figure 6 A schematic diagram of a process for deleting a client in one embodiment;
[0066] Figure 7 A schematic diagram of a flow chart of steps for a backend server to process a first message packet in an embodiment;
[0067] Figure 8 A schematic diagram of a process of a backend server receiving second registration information in an embodiment;
[0068] Fig. 9 is a flow chart of a communication method in another embodiment;
[0069] Fig.10 A schematic diagram of registration and deregistration of a proxy server in one embodiment;
[0070] Fig.11 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0071] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0072] Cloud computing environment is an enterprise-level application that is becoming more and more popular. Many systems and applications are gradually migrating to the cloud environment, using the cloud environment to provide application services. But at the same time, many traditional systems do not take into account the needs of the cloud and face many challenges when migrating to the cloud.
[0073] In the process of migrating application systems to cloud environments, application system managers will find that the system's network service model is very different from the environment in traditional data centers. In a cloud environment, the network is managed based on tenants, and this tenant network is inherently isolated and cannot communicate directly; if communication is required, it is generally necessary to use netpeering (network peering), load balancing (load balancing), net gateway (network gateway), VPN (virtual private network) and other models to achieve it, and the above service methods each have their own usage characteristics:
[0074] 1. Net peering: This mode is a two-way network peering mode. By modifying the route, direct communication can be achieved. By modifying the route, this method lacks effective security restrictions.
[0075] 2. Load balancing: This mode uses load balancing communication to hide the service provision logic behind it and is suitable for one-way network communication mode.
[0076] 3. Net gateway: This mode transforms all data packets into a specific routing network. This method lacks effective security mechanisms.
[0077] 4. VPN: This mode modifies specific routes and conducts two-way communication through data tunnels, which requires setting relevant configurations.
[0078] Another thing to consider about the cloud network is that the network conditions of various tenants may overlap, that is, the IP addresses (Internet Protocol Address) of the networks where different application systems are located may be repeated. If normal network communication is to be carried out, it is necessary to ensure the uniqueness of the triplet of IP, protocol, and port of the network communication protocol.
[0079] The communication method provided in the embodiment of the present application can be applied to Figure 1 The communication system in the application environment shown. The communication system includes two tenant networks and a service network, namely tenant network 1 and tenant network 2. Tenant network 1 includes two clients, and tenant network 2 includes two clients. Each tenant network corresponds to a proxy server. The client in the tenant network communicates with the server through the proxy server corresponding to the tenant network. The server is the background server.
[0080] In one embodiment, Figure 2 As shown, a communication method is provided. This embodiment takes the method applied to a proxy server in a communication system as an example. The communication method includes the following steps:
[0081] Step 102: Receive a first communication message sent by a client in the tenant network.
[0082] The first communication message includes the communication address and communication data of the client.
[0083] Specifically, the client in the tenant network sends the first communication message to the proxy server, which is the proxy server corresponding to the tenant network where the client is located. The proxy server receives the first communication message sent by the client in the tenant network, and parses the first communication message to obtain the communication address and communication data of the client. The communication address of the client can be an IP address, etc., and the communication data can be the data to be processed by the background server generated by the client.
[0084] Step 104: Determine the client identifier corresponding to the client's communication address according to a preset mapping table of communication addresses and client identifiers.
[0085] Specifically, the client identifier is identification information used to distinguish the client in the communication system, and is a globally unique quantity. That is to say, in this communication system, the client identifiers of different clients in different tenant networks are different, and the client identifiers of different clients in the same tenant network are also different. The preset mapping table of communication addresses and client identifiers can be a correspondence table between the communication addresses of the clients and the client identifiers in each tenant network. The client identifier can be a uuid (Universally Unique Identifier).
[0086] Optionally, the proxy server determines the client identifier corresponding to the communication address of the client according to a pre-configured mapping table of communication addresses and client identifiers.
[0087] Step 106: Generate a first message packet according to the client identifier and the first communication message.
[0088] Specifically, after the proxy server finds the client identifier corresponding to the communication address according to the preset mapping table of communication addresses and client identifiers, it encodes the client identifier and the first communication message, that is, encapsulates the client identifier and the first communication message to obtain the first message packet.
[0089] Step 108: forward the first message to the backend server.
[0090] Specifically, the proxy server forwards the generated first message packet to a background server in the communication system.
[0091] Optionally, the proxy server may further include a forwarding processing device, a receiving queue facing the client, a sending queue facing the client, a sending queue facing the background server, and a receiving queue facing the background server.
[0092] In this way, the client sends the first communication message to the proxy server, and the proxy server writes the first communication message into the receiving queue facing the client in sequence. The receiving queue facing the client is a first-in-first-out queue. The forwarding processing device can read the first communication message in the receiving queue facing the client in sequence, and determine the client identifier corresponding to the communication address of the client according to the mapping table of the preset communication address and the client identifier; encode the client identifier and the first communication message, generate a first message message, and write the first message message into the sending queue facing the background server; the sending queue facing the background server can forward the first message message to the background server.
[0093] In the above communication method, the proxy server is used as an intermediary between the client and the background server, and a first communication message including the communication address of the client and the first communication data can be received, and the client identification corresponding to the communication address of the client can be determined according to a preset mapping table of the communication address and the client identification, and forwarded to the background server. Through the method provided by the present disclosure, even in the case of multiple clients with the same communication address, the background server can identify each client based on the unique client identification of each client, complete data communication, and can effectively utilize various secure communication settings on the cloud, thereby ensuring the security and reliability of network communication.
[0094] In one embodiment, Figure 3 As shown, the communication method also includes:
[0095] Step 202: Receive a second message sent by the background server.
[0096] The second message packet includes response data corresponding to the communication data and a client identifier.
[0097] Specifically, the proxy server receives the second message packet returned by the background server, and the second message packet returned by the background server includes response data corresponding to the communication data in the first communication message and a client identifier corresponding to the client sending the first communication message.
[0098] Step 204: determine the communication address of the client corresponding to the client identifier according to a preset mapping table of communication addresses and client identifiers, and send the response data in the second message to the client based on the communication address.
[0099] Specifically, after receiving the second message, the proxy server will parse the second message to obtain response data and a client identifier corresponding to the communication data. The proxy server can determine the communication address of the client corresponding to the client identifier in the second message according to a pre-configured mapping table of communication addresses and client identifiers, and based on the communication address, return the parsed response data to the client corresponding to the client identifier.
[0100] Optionally, the communication data may be data to be processed, so that the response data corresponding to the communication data may be processed data; the communication data may also be data to be responded to, so that the response data corresponding to the communication data may be response data after responding to the data to be responded to.
[0101] In one embodiment, Figure 4 As shown, the communication method also includes:
[0102] Step 302: Receive first registration information sent by the client.
[0103] The first registration information includes the communication address of the client and the tenant ID information of the tenant network where the client is located.
[0104] Specifically, a client in a tenant network sends first registration information to a proxy server corresponding to the tenant network. The first registration information is used for the client to register on the proxy server. The first registration information includes the communication address of the client and the tenant ID information of the tenant network where the client is located. The tenant ID information may be identification information for distinguishing different tenant networks in the same communication system.
[0105] Step 304, obtaining the communication address of the proxy server.
[0106] Specifically, the proxy server needs to obtain its own communication address, which may be the IP address of the proxy server. Optionally, the communication address may also be a MAC address (Media Access Control Address).
[0107] Step 306: Obtain second registration information according to the first registration information and the communication address of the proxy server, and forward the second registration information to the backend server.
[0108] Specifically, the proxy server combines the first registration information and the communication address of the proxy server itself to generate second registration information. The second registration information is used for the tenant network and each client in the tenant network to register on the background server.
[0109] In one embodiment, Figure 5 As shown, the communication method also includes:
[0110] Step 402: Receive a preset client identification table sent by a backend server.
[0111] The preset client identification table includes the client identification, the communication address of the client and the communication address of the proxy server.
[0112] Specifically, the proxy server receives a preset client identification table sent by the backend server, wherein the preset client identification table includes a plurality of pairs of correspondences, which are correspondences between the client identification, the communication address of the client, and the communication address of the proxy server.
[0113] Step 404: Generate a mapping table of communication addresses and client identifiers based on a preset client identifier table.
[0114] Specifically, the proxy server may extract the correspondence between the client identifier (uuid) and the communication address of the client contained in the preset client identifier table based on the preset client identifier table, and generate a mapping table of the preset communication address and the client identifier.
[0115] In one embodiment, Figure 6 As shown, the communication method also includes:
[0116] Step 502: When a deletion instruction is received, the deletion instruction is parsed to obtain a target client.
[0117] Specifically, the deletion instruction may be sent by the client. The proxy server receives the deletion instruction sent by the client for the target client and may parse the deletion instruction to obtain the target client to be deleted.
[0118] Optionally, the proxy server can parse the deletion instruction to obtain the communication address of the target server. In this way, the proxy server can determine the client identifier of the target client based on a preset mapping table of communication addresses and client identifiers.
[0119] Step 504: Delete the client identifier corresponding to the target client in the preset client identifier table.
[0120] Specifically, the proxy server can send the client identifier of the target client to the background server, and the background server can delete the client identifier of the target client in the client identifier table and synchronize it to the proxy server, so that the proxy server can delete the correspondence between the client identifier and the communication address of the target client in the preset mapping table of communication address and client identifier.
[0121] Optionally, when the client needs to be deleted, the proxy server needs to sense the deletion of the client. That is, the backend server (server) needs to delete the corresponding client identifier in the preset client identifier table, and delete the corresponding relationship between the corresponding client identifier and the communication address in the preset mapping table of the proxy server between the communication address and the client identifier.
[0122] Optionally, when the entire tenant network service needs to be deleted, the background server may delete the uuid of the corresponding tenant network and the uuids of all clients in the tenant network from the preset client identification table.
[0123] In one embodiment, Figure 7 As shown, a communication method is provided. This embodiment is illustrated by applying the method to a background server in a communication system. The communication method includes the following steps:
[0124] Step 602: Receive a first message sent by a proxy server in the communication system.
[0125] The first message packet includes a client identifier and a first communication message.
[0126] Specifically, a client in a tenant network in a communication system sends a first communication message to a proxy server corresponding to the tenant network. After determining the client identifier of the client that sends the first communication message, the proxy server generates a first message message according to the client identifier and the first communication message. The proxy server in the communication system sends the first message message to a background server in a service network. After receiving the first message message, the background server parses the first message message to obtain the client identifier (the uuid of the client) and the first communication message.
[0127] Step 604: Process the first message to obtain response data.
[0128] Specifically, the background server will parse the first message packet to obtain the client identifier (the client's uuid) and the first communication message. The background server determines the client that sends the first communication message according to the preset client identifier table. In this way, the background server can process the first communication message in the first message packet when identifying the client that sends the first communication message, and obtain response data corresponding to the communication data in the first communication message.
[0129] Step 606: Determine the client corresponding to the client identifier included in the first message according to a preset client identifier table.
[0130] The preset client identification table includes the client identification, the communication address of the client and the communication address of the proxy server.
[0131] Step 608: Generate a second message according to the response data and the client identifier.
[0132] Specifically, the background server encapsulates the response data and the client identifier to obtain a second message packet.
[0133] Step 610: Send the second message to the proxy server corresponding to the client.
[0134] Specifically, based on the communication address of the proxy server, the background server will forward the second message packet to the proxy server corresponding to the client.
[0135] In one embodiment, Figure 8 As shown, the communication method also includes:
[0136] Step 702: Receive second registration information sent by the proxy server.
[0137] The second registration information includes the first registration information and the communication address of the proxy server, and the first registration information includes the communication address of the client and the tenant ID information of the tenant network where the client is located.
[0138] Specifically, the client in the tenant network sends the client communication address and the tenant ID information of the tenant network where the client is located as the first registration information to the proxy server corresponding to the tenant network. The proxy server generates the second registration information based on the first registration information and the communication address of the proxy server itself, and sends the second registration information to the background server. The background server receives the second registration information sent by the proxy server.
[0139] Step 704: Generate a client identifier corresponding to the second registration information by using a preset global random client identifier generation algorithm.
[0140] Specifically, the backend server generates a unique client identifier, ie, the client identifier corresponding to the second registration information, based on a preset global random client identifier generation algorithm and according to the communication address of the client and the tenant ID information of the tenant network where the client is located.
[0141] Step 706: Add the client identifier, the communication address of the client, and the communication address of the proxy server to a preset client identifier table.
[0142] Step 708: Synchronize the preset client identification table to the proxy server.
[0143] Optionally, the background server includes a proxy processing device, a first receiving queue and a first sending queue. Among them: the background server can write the first message message into the first receiving queue. The proxy processing device reads the first message message in the first receiving queue, and determines the target client corresponding to the client identifier contained in the first message message and the communication address of the proxy server corresponding to the target client according to a preset client identifier table. The first communication data is processed to obtain response data. A second message message is generated according to the response data and the client identifier, and the second message message is written into the first sending queue. The first sending queue forwards the second message message to the proxy server corresponding to the client according to the communication address of the proxy server corresponding to the target client.
[0144] In one embodiment, the proxy server includes a first network card and a second network card; the method also includes: setting the first subnet segment information corresponding to the communication address of each client to the communication address segment of the first network card, and setting the second subnet segment information corresponding to the communication address of the background server to the communication address segment of the second network card.
[0145] The communication method provided by the present invention can adopt the starting point of separating the tenant network and the service network, and is applicable to the cloud environment to build a fast adaptive and optimized proxy architecture system. It is applicable to traditional proxy systems or similar systems that require two-way network communication, and can be quickly converted to complex network environments on the cloud. With the help of the separation of the tenant network and the service network, various security communication settings on the cloud can be effectively utilized, thereby ensuring the security and reliability of network communications.
[0146] In the following, in conjunction with a specific implementation, the registration process of the client on the proxy server and the registration process of the proxy server on the background server (server) in the above communication method are described in detail.
[0147] Step 1. Proxy server setup and registration: This process requires setting up dual network cards for the proxy server, ensuring that the tenant network and server network can communicate normally by modifying the default route, and complying with relevant network security routing requirements; the proxy server also needs to be registered on the server side to ensure that the server side recognizes the tenant network ID and allocates the proxy server UUID as the basis for subsequent communication.
[0148] Step 2, the client registers through the proxy server: the process of the client connecting to the server is now also implemented with the help of the proxy server, and the process of establishing communication is transformed into a registration process in the proxy server: the client connects to the proxy server, and the proxy server connects to the server. Based on the ID information of the tenant network and the IP address of the client, the client identifier, that is, the client's uuid, is generated, which can ensure the uniqueness of the client identifier in the communication system. The proxy server maintains a mapping table to record the mapping relationship between the IP address and uuid (client identifier) of each client in the tenant network of the service, to facilitate the following communication.
[0149] Step 3, the client communicates through the proxy server: the client's communication process is implemented with the help of the proxy server. With the help of the local uuid and ip mapping table of the proxy server, the information is forwarded to the server, and the server also recognizes this uuid and performs appropriate processing; the processed information is then forwarded to the client with the help of the proxy service to complete the entire communication process.
[0150] Step 4: Deletion of the client: Fig. 9 As shown, when the client needs to be deleted, the proxy system needs to perceive the deletion of the client, delete the uuid of the server, and notify the corresponding proxy server to delete the connection mapping.
[0151] Step 5, Deletion of the proxy server: When the entire tenant network service needs to be deleted, the proxy system needs to be aware of such deletion operations and needs to delete the proxy server uuid and associated client uuid on the server side.
[0152] In the method provided in this embodiment, the client and the server (backend server) communicate through the proxy server, thereby smoothly ensuring the service effectiveness of the client.
[0153] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0154] Based on the same inventive concept, the embodiment of the present application also provides a communication system for implementing the communication method involved above. The implementation scheme for solving the problem provided by the system is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more communication system embodiments provided below can refer to the limitations on the communication method above, and will not be repeated here.
[0155] In one embodiment, Figure 1 As shown, a communication system is provided, the communication system includes at least one tenant network, at least one proxy server, and at least one backend server. The tenant network includes at least one client, and the tenant network corresponds to the proxy server one by one, wherein:
[0156] The client is used to transmit a first communication message to the proxy server, where the first communication message includes a communication address of the client and first communication data.
[0157] The proxy server is used to determine the client identifier corresponding to the communication address of the client according to a preset mapping table of communication addresses and client identifiers; generate a first message packet according to the client identifier and the first communication message, and forward the first message packet to the background server;
[0158] The backend server is used to process the first communication data in the first message message to obtain response data; determine the client corresponding to the client identifier contained in the first message message according to a preset client identifier table; generate a second message message according to the response data and the client identifier, and forward the second message message to the proxy server corresponding to the client;
[0159] The proxy server is further used to determine the communication address of the client corresponding to the client identifier in the second message according to a preset mapping table of communication addresses and client identifiers, and return the response data in the second message to the client corresponding to the communication address.
[0160] In one embodiment, the communication system further comprises:
[0161] The client is further used to send first registration information to the proxy server, the proxy server corresponds to the tenant network where the client is located, and the first registration information includes the communication address of the client and the tenant ID information of the tenant network where the client is located;
[0162] The proxy server is used to obtain the second registration information according to the first registration information and the communication address of the proxy server, and forward the second registration information to the backend server;
[0163] The backend server is used to generate a client identifier corresponding to the second registration information through a preset global random identifier generation algorithm, and add the client identifier, the communication address of the client, and the communication address of the proxy server to a preset client identifier table;
[0164] The backend server is also used to synchronize the preset client identification table to the proxy server.
[0165] like Fig.10 As shown, the embodiment of the present invention describes in detail the specific process of the communication system performing communication:
[0166] A client environment may include multiple clients, and the client combines the IP address of the client with the communication data into a first communication message through the proxy port of the client, and sends it to the proxy server. The proxy server may include a forwarding processing device, a receiving queue facing the client (client receiving MQ), a sending queue facing the client (client sending MQ), a sending queue facing the backend server (server sending MQ) and a receiving queue facing the backend server (server receiving MQ), and a mapping table of communication addresses and client identifiers is also pre-stored in the proxy server.
[0167] The proxy server is located in a proxy service environment, and the proxy server writes the first communication message into a receiving queue facing the client in sequence. The receiving queue facing the client is a first-in-first-out queue. The forwarding processing device can read the first communication message in the receiving queue facing the client in sequence, and determine the client identifier corresponding to the communication address of the client according to the mapping table of the preset communication address and the client identifier; encode the client identifier, the first communication message and the IP address of the proxy server, generate a first message packet, and write the first message packet into the sending queue facing the background server; the sending queue facing the background server can forward the first message packet to the background server.
[0168] The background server includes a proxy processing device, a first receiving queue (receiving MQ) and a first sending queue (sending MQ). Among them: the background server can write the first message message into the first receiving queue. The proxy processing device reads the first message message in the first receiving queue, and determines the target client corresponding to the client identifier contained in the first message message and the communication address of the proxy server corresponding to the target client according to the preset client identification table (uuid management). The first communication data is processed to obtain response data. According to the response data and the client identifier, a second message message is generated, and the second message message is written into the first sending queue. The first sending queue forwards the second message message to the proxy server corresponding to the client according to the communication address of the proxy server corresponding to the target client. The process of the proxy server receiving the second message message and forwarding it to the corresponding client is similar to the above-mentioned communication process, which will not be repeated here.
[0169] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.11 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store communication data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a communication method is implemented.
[0170] Those skilled in the art will understand that Fig.11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0171] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0172] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0173] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0174] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0175] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0176] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0177] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A communication method, characterized in that: The proxy server corresponding to the tenant network in the communication system includes: Receiving a first communication message sent by a client in the tenant network, wherein the first communication message includes a communication address and communication data of the client; According to a preset mapping table of communication addresses and client identifiers, determine the client identifier corresponding to the communication address of the client, wherein the client identifier is identification information used to distinguish the client in the communication system and is a globally unique quantity, the client identifier is uuid, and the communication data is the data to be processed by the background server generated by the client; Generate a first message packet according to the client identifier and the first communication message; The first message is forwarded to the backend server.
2. The method according to claim 1, characterized in that The method further comprises: Receiving a second message packet sent by the background server, wherein the second message packet includes response data corresponding to the communication data and the client identifier; According to a preset mapping table of communication addresses and client identifiers, the communication address of the client corresponding to the client identifier is determined, and based on the communication address, the response data in the second message packet is sent to the client.
3. The method according to claim 1, characterized in that The method further comprises: Receive first registration information sent by the client, where the first registration information includes a communication address of the client and tenant ID information of a tenant network where the client is located; Obtaining the communication address of the proxy server; According to the first registration information and the communication address of the proxy server, the second registration information is obtained, and the second registration information is forwarded to the backend server.
4. The method according to claim 3, characterized in that The method further comprises: Receiving a preset client identification table sent by the backend server, wherein the preset client identification table includes the client identification, the communication address of the client, and the communication address of the proxy server; Based on the preset client identification table, a mapping table of communication addresses and client identifications is generated.
5. The method according to claim 4, characterized in that The method further comprises: When receiving a deletion instruction, parsing the deletion instruction to obtain a target client; The client identifier corresponding to the target client is deleted from the preset client identifier table.
6. A communication method, characterized in that: Backend servers used in communication systems include: Receive a first message packet sent by a proxy server in the communication system, the first message packet including a client identifier and a first communication message, the client identifier being an identifier corresponding to the communication address of the client determined by the proxy server based on a preset mapping table of communication addresses and client identifiers; the client identifier is identification information used to distinguish clients in the communication system, which is a globally unique quantity, and the client identifier is uuid; the first communication message includes the communication address and communication data of the client, and the communication data is data to be processed generated by the client and processed by a background server; Processing the first message to obtain response data; Determine the client corresponding to the client identifier included in the first message according to a preset client identifier table, wherein the preset client identifier table includes the client identifier, the communication address of the client, and the communication address of the proxy server; Generate a second message according to the response data and the client identifier; The second message packet is sent to the proxy server corresponding to the client.
7. The method according to claim 6, characterized in that The method further comprises: receiving second registration information sent by the proxy server, the second registration information including the first registration information and the communication address of the proxy server, the first registration information including the communication address of the client and the tenant ID information of the tenant network where the client is located; Generate a client identifier corresponding to the second registration information by using a preset global random client identifier generation algorithm; Adding the client identifier, the communication address of the client, and the communication address of the proxy server to a preset client identifier table; The preset client identification table is synchronized to the proxy server.
8. A communication system, characterized in that: The communication system includes at least one tenant network, at least one proxy server, and at least one backend server; wherein the tenant network includes at least one client, and the tenant network corresponds to the proxy server one by one, wherein: The client is used to transmit a first communication message to the proxy server, wherein the first communication message includes a communication address and communication data of the client; The proxy server is used to determine the client identifier corresponding to the communication address of the client according to a preset mapping table of communication addresses and client identifiers; generate a first message packet according to the client identifier and the first communication message, and forward the first message packet to the background server, the client identifier is identification information used to distinguish the client in the communication system, which is a globally unique quantity, the client identifier is uuid, and the communication data is the data to be processed by the background server generated by the client; The backend server is used to process the communication data in the first message message to obtain response data; determine the client corresponding to the client identifier contained in the first message message according to a preset client identifier table; generate a second message message according to the response data and the client identifier, and forward the second message message to the proxy server corresponding to the client; The proxy server is further used to determine the communication address of the client corresponding to the client identifier in the second message according to a preset mapping table of communication addresses and client identifiers, and return the response data in the second message to the client corresponding to the communication address.
9. The system according to claim 8, characterized in that The system further comprises: The client is further configured to send first registration information to a proxy server, the proxy server corresponding to the tenant network where the client is located, the first registration information including the communication address of the client and the tenant ID information of the tenant network where the client is located; The proxy server is used to obtain second registration information according to the first registration information and the communication address of the proxy server, and forward the second registration information to the backend server; The backend server is used to generate a client identifier corresponding to the second registration information through a preset global random identifier generation algorithm, and add the client identifier, the communication address of the client, and the communication address of the proxy server to a preset client identifier table; The backend server is further used to synchronize the preset client identification table to the proxy server.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
