Proxy connection method, device and related equipment
By using the proxy connection method in a serverless architecture to generate and update network channels, the problem of connection stability between the client and the computing node is solved, and real-time response to changes in the computing node and stable connection are achieved.
Patent Information
- Application Number
- CN202410571740.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-10
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-05-10
AI Technical Summary
In a serverless architecture, the long connection between the client and the computing node causes changes in the computing node to be unable to be updated in real time, affecting connection stability.
Through the proxy connection method, the client's proxy creation request is received, a first network channel and a plurality of second network channels are generated, and these channels are updated when the computing node is updated to ensure that the client maintains a communication connection with the latest computing node.
Improves the stability of client connections to computing nodes and avoids connection interruptions and frequent reconnections caused by changes in computing nodes.
Smart Images

Figure CN118175202B
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of cloud computing, and in particular to a proxy connection method, apparatus, and related equipment. Background Art
[0002] Serverless architecture is an architectural concept. The core idea is to abstract the infrastructure that provides service resources into various services, and scale cluster resources according to user usage. Currently, when connecting to clients through serverless architecture, clients usually use a reconnection mechanism to obtain new nodes. In serverless architecture scenarios, server changes are relatively frequent. Since the connection between the client and the server is a long connection, the startup and use of the network channel are sensitive to changes in computing nodes, which results in the inability to update changes in computing nodes in real time, which affects the stability of client connections to computing nodes. Summary of the invention
[0003] The embodiment of the present application provides a proxy connection and related equipment to solve the problem of stability of client connection to computing node in the prior art.
[0004] To solve the above problems, this application is implemented as follows:
[0005] In a first aspect, an embodiment of the present application provides a proxy connection method, which is applied to a proxy layer, and the method includes:
[0006] Receiving a proxy creation request sent by a client, wherein the proxy creation request is used to establish a proxy connection between the client and a plurality of first computing nodes;
[0007] Generate a first network channel and a plurality of second network channels based on the proxy creation request, wherein the first network channel is used to communicate with the client, and the plurality of second network channels are used to communicate with the plurality of first computing nodes;
[0008] In a case where the plurality of first computing nodes are updated to a plurality of second computing nodes, receiving an update request sent by the client based on the first network channel, the update request being used to request connection with the plurality of second computing nodes;
[0009] The plurality of second network channels are updated in response to the update request to obtain a plurality of third network channels, where the plurality of third network channels are used to establish communication connections with the plurality of second computing nodes.
[0010] Optionally, updating the plurality of second network channels in response to the update request to obtain a plurality of third network channels includes:
[0011] storing the update request in a request cache queue, wherein the request cache queue is used to store the received update request;
[0012] Determining a target update request in the request cache queue according to a preset scheduling condition, the target update request being an update request that meets the preset scheduling condition;
[0013] The plurality of second network channels are updated according to the target update request to obtain the plurality of third network channels.
[0014] Optionally, after the multiple second network channels are updated according to the target update request to obtain the multiple third network channels, the method further includes:
[0015] Establishing a communication connection with the plurality of second computing nodes based on the plurality of third network channels;
[0016] Generate update completion information, where the update completion information is used to indicate that the plurality of third network channels have established communication connections with the plurality of second computing nodes;
[0017] The update completion information is sent to the client based on the first network channel.
[0018] Optionally, after updating the plurality of second network channels in response to the update request to obtain a plurality of third network channels, the method further includes:
[0019] Acquire a monitoring request sent by the client, wherein the monitoring request includes address information and storage information of the client;
[0020] The plurality of second computing nodes are detected based on the monitoring request to generate a detection result, where the detection result is used to indicate the working status of the plurality of second computing nodes.
[0021] Optionally, after detecting the plurality of second computing nodes based on the monitoring request and generating a detection result, the method further includes:
[0022] generating fault information when the detection result indicates that a first target computing node has failed, the first target computing node being any one of the plurality of second computing nodes;
[0023] Determine a first target network channel according to the fault information, where the first target network channel is a network channel among the plurality of third network channels that is communicatively connected to the first target computing node;
[0024] The communication connection between the first target network channel and the first target computing node is disconnected, and the first target network channel is closed.
[0025] Optionally, after detecting the plurality of second computing nodes based on the monitoring request and generating a detection result, the method further includes:
[0026] If the detection result indicates that there is a newly added second target computing node in the server cluster to which the plurality of second computing nodes belong, generating new information, the second target computing node being another second computing node other than the plurality of second computing nodes;
[0027] Generate a second target network channel according to the newly added information, where the second target network channel is used to establish a communication connection with the second target computing node;
[0028] A communication connection is established with the second target computing node based on the second target network channel.
[0029] In a second aspect, an embodiment of the present application further provides a proxy connection device, which is applied to a proxy layer, and the device includes:
[0030] A first receiving module, configured to receive a proxy creation request sent by a client, wherein the proxy creation request is used to establish a proxy connection between the client and a plurality of first computing nodes;
[0031] A generating module, configured to generate a first network channel and a plurality of second network channels based on the proxy creation request, wherein the first network channel is used to communicate with the client, and the plurality of second network channels are used to communicate with the plurality of first computing nodes;
[0032] A second receiving module, configured to receive, based on the first network channel, an update request sent by the client when the plurality of first computing nodes are updated to a plurality of second computing nodes, the update request being used to request connection with the plurality of second computing nodes;
[0033] An update module is used to update the multiple second network channels in response to the update request to obtain multiple third network channels, and the multiple third network channels are used to communicate with the multiple second computing nodes.
[0034] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a transceiver, a memory, a processor, and a program stored in the memory and executable on the processor; the processor is used to read the program in the memory to implement the steps of the method described in the first aspect above.
[0035] In a fourth aspect, an embodiment of the present application further provides a readable storage medium for storing a program, which, when executed by a processor, implements the steps in the method described in the first aspect above.
[0036] In a fifth aspect, an embodiment of the present application further provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the steps in the method described in the first aspect.
[0037] The present application provides a proxy connection method, device and related equipment, which are applied to the proxy layer, and the method includes: receiving a proxy creation request sent by a client, the proxy creation request is used to establish a proxy connection between the client and multiple first computing nodes; generating a first network channel and multiple second network channels based on the proxy creation request, the first network channel is used to communicate with the client, and the multiple second network channels are used to communicate with the multiple first computing nodes; when the multiple first computing nodes are updated to multiple second computing nodes, receiving an update request sent by the client based on the first network channel, the update request is used to request to connect with the multiple second computing nodes; in response to the update request, the multiple second network channels are updated to obtain multiple third network channels, and the multiple third network channels are used to communicate with the multiple second computing nodes. After receiving the proxy creation request from the client, the present application generates a first network channel and multiple second network channels, thereby communicating with the client and multiple computing nodes respectively. When multiple computing nodes are updated, multiple second network channels can be updated at the same time, thereby improving the stability of the client connecting to the computing nodes. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0039] Figure 1 It is a flowchart of the proxy connection method provided in the embodiment of the present application;
[0040] Figure 2 is a schematic diagram of the structure of a proxy connection device provided in an embodiment of the present application;
[0041] Figure 3 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0042] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0043] The terms "first", "second" etc. in the embodiments of the present application are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. In addition, the terms "include" and "have" and any variation thereof are intended to cover non-exclusive inclusions, for example, the process, method, system, product or equipment comprising a series of steps or units need not be limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment. In addition, "and / or" is used in the present application to represent at least one of connected objects, such as A and / or B and / or C, representing the inclusion of separate A, separate B, separate C, and A and B all exist, B and C all exist, A and C all exist, and 7 situations in which A, B and C all exist.
[0044] See also Figure 1 , Figure 1 is a flow chart of the proxy connection method provided in the embodiment of the present application, such as Figure 1 As shown, the proxy connection method is applied to the proxy layer and may include the following steps:
[0045] Step 101: Receive a proxy creation request sent by a client, where the proxy creation request is used to establish a proxy connection between the client and a plurality of first computing nodes.
[0046] In this embodiment, the client is connected to the multiple computing nodes through the proxy layer, wherein the client sends a proxy creation request to the proxy service, requesting a proxy connection between the client and the multiple first computing nodes.
[0047] It should be noted that in the prior art, the client generally directly connects to multiple computing nodes. Therefore, when the computing node changes, the client usually uses a reconnection mechanism to obtain the new node. In the serverless architecture scenario, the server changes relatively frequently. Since the connection between the client and the server is a long connection, the client needs to access multiple partitions of Topic1, and it will create multiple network channels with the relevant computing nodes. The startup and use of the network channel is sensitive to the changes in the computing nodes, which affects the stability of the business.
[0048] Step 102: Generate a first network channel and multiple second network channels based on the proxy creation request, wherein the first network channel is used to communicate with the client, and the multiple second network channels are used to communicate with the multiple first computing nodes.
[0049] In this embodiment, the client sends a request to the proxy service, and the proxy service creates an "incoming network channel" or a first network channel for the client. The first network channel is used to receive the client's request and put it into the request cache queue to ensure that the request will be forwarded to the server.
[0050] A request scheduler is also provided in the proxy layer. The request scheduler obtains unprocessed requests from the request cache queue and sends them to the "outgoing network channel", that is, multiple second network channels, by the request router. The metadata of the server node and the "outgoing network channel" is maintained in the proxy layer. The request router finds the outgoing network channel corresponding to the server node according to the request and sends the request to the network channel.
[0051] Step 103: When the plurality of first computing nodes are updated to a plurality of second computing nodes, an update request sent by the client is received based on the first network channel, where the update request is used to request connection with the plurality of second computing nodes.
[0052] In this embodiment, when multiple first computing nodes are updated, the multiple first computing nodes are updated to multiple second computing nodes, and thus the proxy layer re-establishes communication connection with the multiple second computing nodes according to the update request sent by the client.
[0053] It should be noted that the multiple second computing nodes may be computing nodes obtained by adding or deleting multiple first computing nodes. When the number of computing nodes is changed, the multiple second network channels also need to change accordingly.
[0054] In addition, the number of second computing nodes and second network channels may be in a one-to-one correspondence, or a one-to-many or many-to-one relationship, which is not specifically limited in this embodiment.
[0055] Step 104: In response to the update request, the plurality of second network channels are updated to obtain a plurality of third network channels, where the plurality of third network channels are used to establish communication connections with the plurality of second computing nodes.
[0056] In this embodiment, multiple second network channels are updated through update requests to obtain multiple third network channels, and communication connections are respectively established with the updated multiple second computing nodes through the multiple third network channels.
[0057] The present application provides a proxy connection method, device and related equipment, which are applied to the proxy layer, and the method includes: receiving a proxy creation request sent by a client, the proxy creation request is used to establish a proxy connection between the client and multiple first computing nodes; generating a first network channel and multiple second network channels based on the proxy creation request, the first network channel is used to communicate with the client, and the multiple second network channels are used to communicate with the multiple first computing nodes; when the multiple first computing nodes are updated to multiple second computing nodes, receiving an update request sent by the client based on the first network channel, the update request is used to request to connect with the multiple second computing nodes; in response to the update request, the multiple second network channels are updated to obtain multiple third network channels, and the multiple third network channels are used to communicate with the multiple second computing nodes. After receiving the proxy creation request from the client, the present application generates a first network channel and multiple second network channels, thereby communicating with the client and multiple computing nodes respectively. When multiple computing nodes are updated, multiple second network channels can be updated at the same time, thereby improving the stability of the client connecting to the computing nodes.
[0058] In some feasible implementation manners, optionally, updating the plurality of second network channels in response to the update request to obtain a plurality of third network channels includes:
[0059] storing the update request in a request cache queue, wherein the request cache queue is used to store the received update request;
[0060] Determining a target update request in the request cache queue according to a preset scheduling condition, the target update request being an update request that meets the preset scheduling condition;
[0061] The plurality of second network channels are updated according to the target update request to obtain the plurality of third network channels.
[0062] In this embodiment, in the message middleware of the serverless architecture, the computing nodes will be frequently expanded and reduced based on the user's usage. Creating a long connection between the client and the server is not suitable for the serverless architecture system. Therefore, a proxy layer is introduced between the client and the server. In this embodiment, the proxy layer includes a request cache queue. In the serverless framework, the server is changing, so the client request under the traditional architecture will fail. Therefore, the request is cached by the cache request queue and then scheduled to avoid the client's overhead in dealing with this situation. The scheduling mechanism is implemented by an event scheduler (EventLoop).
[0063] Specifically, the request queue only stores requests that have not been forwarded to the server. After the forwarding is successful, the request is removed from the queue, and the specific processing of the request begins on the server. In order to avoid the situation where client requests are discarded due to server expansion and contraction, a request queue is added to the proxy layer as a cache mechanism. During operation, the request scheduler sends the request to the request router for forwarding based on the first-in-first-out principle.
[0064] Optionally, after the multiple second network channels are updated according to the target update request to obtain the multiple third network channels, the method further includes:
[0065] Establishing a communication connection with the plurality of second computing nodes based on the plurality of third network channels;
[0066] Generate update completion information, where the update completion information is used to indicate that the plurality of third network channels have established communication connections with the plurality of second computing nodes;
[0067] The update completion information is sent to the client based on the first network channel.
[0068] In this embodiment, after the update of multiple second network channels is completed and multiple third network channels are obtained, update completion information will be generated. The information is used to indicate that the multiple third network channels have established communication connections with multiple second computing nodes. The update completion information will be sent to the client to summarize and inform the client that the update has been completed.
[0069] After the client connects to the proxy layer, it will create a corresponding long-connected first network channel, receive the client's request and return the response value to the client. In order to achieve fast connection and switching of the serverless architecture service layer, a network connection pool is introduced. In the connection pool, multiple third network channels are created for each server process. These multiple third network channels are used to communicate with the server and obtain the client's request responder.
[0070] Optionally, after updating the plurality of second network channels in response to the update request to obtain a plurality of third network channels, the method further includes:
[0071] Acquire a monitoring request sent by the client, wherein the monitoring request includes address information and storage information of the client;
[0072] The plurality of second computing nodes are detected based on the monitoring request to generate a detection result, where the detection result is used to indicate the working status of the plurality of second computing nodes.
[0073] In this embodiment, the computing nodes of the message middleware server will change frequently in the serverless architecture. In order to cope with the changes, the following monitoring is performed, wherein a metadata discovery component is added to the proxy layer. This component perceives the changes of the cluster nodes in real time and updates the metadata correspondence between the computing nodes in the cluster and the data they manage. In the serverless architecture, the server nodes will add and reduce nodes according to resource usage, and will manage the corresponding outbound network channels after metadata discovery.
[0074] Optionally, after detecting the plurality of second computing nodes based on the monitoring request and generating a detection result, the method further includes:
[0075] generating fault information when the detection result indicates that a first target computing node has failed, the first target computing node being any one of the plurality of second computing nodes;
[0076] Determine a first target network channel according to the fault information, where the first target network channel is a network channel among the plurality of third network channels that is communicatively connected to the first target computing node;
[0077] The communication connection between the first target network channel and the first target computing node is disconnected, and the first target network channel is closed.
[0078] In this embodiment, when a first target computing node fails among multiple computing nodes, fault information is generated, and the first target network channel is re-determined through the fault information. The first target network channel is a network channel connected to the first target computing node, so it needs to be disconnected and closed.
[0079] Specifically, after receiving the client request, the request forwarder obtains the computing node to which the accessed request should be sent from the metadata, and then completes the interaction process through the network channel corresponding to the node. The metadata of the proxy layer manages the triple mapping relationship between the resources accessed by the client and the outgoing network channel: (topic, computing node, network channel).
[0080] Therefore, in the cluster, the server will dynamically migrate topics to nodes with lower loads according to the load of each node. When the metadata discovery component finds the change in the carrying relationship, it will update the mapping.
[0081] Optionally, after detecting the plurality of second computing nodes based on the monitoring request and generating a detection result, the method further includes:
[0082] If the detection result indicates that there is a newly added second target computing node in the server cluster to which the plurality of second computing nodes belong, generating new information, the second target computing node being another second computing node other than the plurality of second computing nodes;
[0083] Generate a second target network channel according to the newly added information, where the second target network channel is used to establish a communication connection with the second target computing node;
[0084] A communication connection is established with the second target computing node based on the second target network channel.
[0085] In this embodiment, when there is a new computing node among multiple computing nodes, new information needs to be generated, and a new second target network channel is allocated to the second target computing node through the new information, and a communication connection is established with the second target computing node through the second target network channel.
[0086] Specifically, after receiving the client request, the request response processor will process the result through the request response processor. For example, the computing node where the client queries the topic is converted by the request response processor and the node is replaced with the proxy node, so that the client will send the next request to the proxy node.
[0087] In this application, the connection created by the client will not be unstable due to the frequent changes of the connection caused by the expansion and contraction of the message middleware computing node. Request queues and response queues are added to the proxy layer to temporarily place requests that cannot be processed due to connection anomalies, and resend requests when they are restored.
[0088] In addition, this application belongs to the message queue Pulsar and message queue Kafka projects. The relevance is to enhance the operational stability of the product. By adding a proxy layer on the service side, through the request forwarding and service resource automatic discovery mechanism in the proxy layer, in order to cope with the network channel management mechanism that causes the connection to be unavailable due to the frequent expansion and contraction of the underlying computing resources, the client's connection availability is guaranteed, and the request caching mechanism is used to ensure that the client's request can be processed normally, solving the problem of unstable client programs caused by the expansion and contraction of the underlying computing resources. This application uses a metadata discovery mechanism to perceive changes in underlying resources in real time. These underlying resources are not limited to computing nodes, but also include metadata such as Topics managed by computing nodes. In this mechanism, changes in the server can be obtained in a timely manner, and requests can be forwarded and network channels updated according to changes in metadata.
[0089] After receiving a proxy creation request from the client, the present application generates a first network channel and multiple second network channels, thereby communicating with the client and multiple computing nodes respectively. When multiple computing nodes are updated, multiple second network channels can be updated at the same time, thereby improving the stability of the client connecting to the computing nodes.
[0090] See also Figure 2 , Figure 2 is a structural diagram of the proxy connection device provided in the embodiment of the present application. Figure 2 As shown, the proxy connection device 200 includes:
[0091] A first receiving module 210, configured to receive a proxy creation request sent by a client, wherein the proxy creation request is used to establish a proxy connection between the client and a plurality of first computing nodes;
[0092] A generating module 220, configured to generate a first network channel and a plurality of second network channels based on the proxy creation request, wherein the first network channel is used to communicate with the client, and the plurality of second network channels are used to communicate with the plurality of first computing nodes;
[0093] A second receiving module 230 is used to receive, based on the first network channel, an update request sent by the client when the multiple first computing nodes are updated to multiple second computing nodes, wherein the update request is used to request to connect to the multiple second computing nodes;
[0094] The updating module 240 is used to update the multiple second network channels in response to the update request to obtain multiple third network channels, and the multiple third network channels are used to communicate with the multiple second computing nodes.
[0095] Optionally, the updating module 240 includes:
[0096] A storage submodule, used to store the update request in a request cache queue, wherein the request cache queue is used to store the received update request;
[0097] A determination submodule, configured to determine a target update request in the request cache queue according to a preset scheduling condition, wherein the target update request is an update request that meets the preset scheduling condition;
[0098] An updating submodule is used to update the plurality of second network channels according to the target update request to obtain the plurality of third network channels.
[0099] Optionally, also include:
[0100] A connection submodule, configured to establish a communication connection with the plurality of second computing nodes based on the plurality of third network channels;
[0101] A generating submodule, used for generating update completion information, wherein the update completion information is used for indicating that the plurality of third network channels have established communication connections with the plurality of second computing nodes;
[0102] A sending submodule is used to send the update completion information to the client based on the first network channel.
[0103] Optionally, also include:
[0104] An acquisition module, used for acquiring a monitoring request sent by the client, wherein the monitoring request includes address information and storage information of the client;
[0105] A detection module is used to detect the multiple second computing nodes based on the monitoring request and generate a detection result, wherein the detection result is used to indicate the working status of the multiple second computing nodes.
[0106] Optionally, also include:
[0107] a fault generating module, configured to generate fault information when the detection result indicates that a first target computing node has a fault, wherein the first target computing node is any one of the plurality of second computing nodes;
[0108] a fault determination module, configured to determine a first target network channel according to the fault information, wherein the first target network channel is a network channel among the plurality of third network channels that is communicatively connected to the first target computing node;
[0109] A disconnection module is used to disconnect the communication connection between the first target network channel and the first target computing node, and close the first target network channel.
[0110] Optionally, also include:
[0111] A newly added determination module is used to generate new information when the detection result indicates that there is a newly added second target computing node in the server cluster to which the multiple second computing nodes belong, and the second target computing node is another second computing node other than the multiple second computing nodes;
[0112] A newly added generation module is used to generate a second target network channel according to the newly added information, and the second target network channel is used to communicate with the second target computing node;
[0113] A connection module is used to establish a communication connection with the second target computing node based on the second target network channel.
[0114] After receiving a proxy creation request from the client, the present application generates a first network channel and multiple second network channels, thereby communicating with the client and multiple computing nodes respectively. When multiple computing nodes are updated, multiple second network channels can be updated at the same time, thereby improving the stability of the client connecting to the computing nodes.
[0115] The present application also provides an electronic device. Figure 3 , the electronic device may include a processor 301, a memory 302, and a program 3021 stored in the memory 302 and executable on the processor 301.
[0116] When the program 3021 is executed by the processor 301, it can achieve Figure 1 Any step in the corresponding method embodiment:
[0117] Receiving a proxy creation request sent by a client, wherein the proxy creation request is used to establish a proxy connection between the client and a plurality of first computing nodes;
[0118] Generate a first network channel and a plurality of second network channels based on the proxy creation request, wherein the first network channel is used to communicate with the client, and the plurality of second network channels are used to communicate with the plurality of first computing nodes;
[0119] In a case where the plurality of first computing nodes are updated to a plurality of second computing nodes, receiving an update request sent by the client based on the first network channel, the update request being used to request connection with the plurality of second computing nodes;
[0120] The plurality of second network channels are updated in response to the update request to obtain a plurality of third network channels, where the plurality of third network channels are used to establish communication connections with the plurality of second computing nodes.
[0121] Optionally, updating the plurality of second network channels in response to the update request to obtain a plurality of third network channels includes:
[0122] storing the update request in a request cache queue, wherein the request cache queue is used to store the received update request;
[0123] Determining a target update request in the request cache queue according to a preset scheduling condition, the target update request being an update request that meets the preset scheduling condition;
[0124] The plurality of second network channels are updated according to the target update request to obtain the plurality of third network channels.
[0125] Optionally, after the multiple second network channels are updated according to the target update request to obtain the multiple third network channels, the method further includes:
[0126] Establishing a communication connection with the plurality of second computing nodes based on the plurality of third network channels;
[0127] Generate update completion information, where the update completion information is used to indicate that the plurality of third network channels have established communication connections with the plurality of second computing nodes;
[0128] The update completion information is sent to the client based on the first network channel.
[0129] Optionally, after updating the plurality of second network channels in response to the update request to obtain a plurality of third network channels, the method further includes:
[0130] Acquire a monitoring request sent by the client, wherein the monitoring request includes address information and storage information of the client;
[0131] The plurality of second computing nodes are detected based on the monitoring request to generate a detection result, where the detection result is used to indicate the working status of the plurality of second computing nodes.
[0132] Optionally, after detecting the plurality of second computing nodes based on the monitoring request and generating a detection result, the method further includes:
[0133] generating fault information when the detection result indicates that a first target computing node has failed, the first target computing node being any one of the plurality of second computing nodes;
[0134] Determine a first target network channel according to the fault information, where the first target network channel is a network channel among the plurality of third network channels that is communicatively connected to the first target computing node;
[0135] The communication connection between the first target network channel and the first target computing node is disconnected, and the first target network channel is closed.
[0136] Optionally, after detecting the plurality of second computing nodes based on the monitoring request and generating a detection result, the method further includes:
[0137] If the detection result indicates that there is a newly added second target computing node in the server cluster to which the plurality of second computing nodes belong, generating new information, the second target computing node being another second computing node other than the plurality of second computing nodes;
[0138] Generate a second target network channel according to the newly added information, where the second target network channel is used to establish a communication connection with the second target computing node;
[0139] A communication connection is established with the second target computing node based on the second target network channel.
[0140] After receiving a proxy creation request from the client, the present application generates a first network channel and multiple second network channels, thereby communicating with the client and multiple computing nodes respectively. When multiple computing nodes are updated, multiple second network channels can be updated at the same time, thereby improving the stability of the client connecting to the computing nodes.
[0141] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above-mentioned proxy connection method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0142] The embodiment of the present application further provides a computer program product, which is stored in a storage medium. The computer program product is executed by at least one processor to implement the various processes of the above-mentioned proxy connection method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0143] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0144] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0145] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A proxy connection method, characterized in that: Applied to the proxy layer, the method includes: Receiving a proxy creation request sent by a client, wherein the proxy creation request is used to establish a proxy connection between the client and a plurality of first computing nodes; Generate a first network channel and a plurality of second network channels based on the proxy creation request, wherein the first network channel is used to communicate with the client, and the plurality of second network channels are used to communicate with the plurality of first computing nodes; In a case where the plurality of first computing nodes are updated to a plurality of second computing nodes, receiving an update request sent by the client based on the first network channel, the update request being used to request connection with the plurality of second computing nodes; In response to the update request, the multiple second network channels are updated to obtain multiple third network channels, and the multiple third network channels are used to communicate with the multiple second computing nodes. The multiple second network channels are updated in response to the update request to obtain multiple third network channels, including: storing the update request in a request cache queue, and the request cache queue is used to store received update requests; determining a target update request in the request cache queue according to a preset scheduling condition, and the target update request is an update request that meets the preset scheduling condition; and updating the multiple second network channels according to the target update request to obtain the multiple third network channels.
2. The method according to claim 1, characterized in that After the plurality of second network channels are updated according to the target update request to obtain the plurality of third network channels, the method further includes: Establishing a communication connection with the plurality of second computing nodes based on the plurality of third network channels; Generate update completion information, where the update completion information is used to indicate that the plurality of third network channels have established communication connections with the plurality of second computing nodes; The update completion information is sent to the client based on the first network channel.
3. The method according to claim 1, characterized in that After the plurality of second network channels are updated in response to the update request to obtain a plurality of third network channels, the method further includes: Acquire a monitoring request sent by the client, wherein the monitoring request includes address information and storage information of the client; The plurality of second computing nodes are detected based on the monitoring request to generate a detection result, where the detection result is used to indicate the working status of the plurality of second computing nodes.
4. The method according to claim 3, characterized in that After detecting the plurality of second computing nodes based on the monitoring request and generating a detection result, the method further includes: generating fault information when the detection result indicates that a first target computing node has failed, the first target computing node being any one of the plurality of second computing nodes; Determine a first target network channel according to the fault information, where the first target network channel is a network channel among the plurality of third network channels that is communicatively connected to the first target computing node; The communication connection between the first target network channel and the first target computing node is disconnected, and the first target network channel is closed.
5. The method according to claim 3, characterized in that: After detecting the plurality of second computing nodes based on the monitoring request and generating a detection result, the method further includes: If the detection result indicates that there is a newly added second target computing node in the server cluster to which the plurality of second computing nodes belong, generating new information, the second target computing node being another second computing node other than the plurality of second computing nodes; Generate a second target network channel according to the newly added information, where the second target network channel is used to establish a communication connection with the second target computing node; A communication connection is established with the second target computing node based on the second target network channel.
6. A proxy connection device, characterized in that: Applied to the proxy layer, the device comprises: A first receiving module, configured to receive a proxy creation request sent by a client, wherein the proxy creation request is used to establish a proxy connection between the client and a plurality of first computing nodes; A generating module, configured to generate a first network channel and a plurality of second network channels based on the proxy creation request, wherein the first network channel is used to communicate with the client, and the plurality of second network channels are used to communicate with the plurality of first computing nodes; A second receiving module, configured to receive, based on the first network channel, an update request sent by the client when the plurality of first computing nodes are updated to a plurality of second computing nodes, the update request being used to request connection with the plurality of second computing nodes; An update module is used to update the multiple second network channels in response to the update request to obtain multiple third network channels, and the multiple third network channels are used to communicate with the multiple second computing nodes. The update module includes: a storage submodule, used to store the update request in a request cache queue, and the request cache queue is used to store received update requests; a determination submodule, used to determine a target update request in the request cache queue according to a preset scheduling condition, and the target update request is an update request that meets the preset scheduling condition; an update submodule, used to update the multiple second network channels according to the target update request to obtain the multiple third network channels.
7. An electronic device comprising: A memory, a processor, and a program stored in the memory and executable on the processor; wherein the processor is used to read the program in the memory to implement the steps in the proxy connection method as described in any one of claims 1 to 5.
8. A readable storage medium for storing a program, characterized in that: When the program is executed by a processor, the steps in the proxy connection method according to any one of claims 1 to 5 are implemented.
9. A computer program product, characterized in that The computer program product is stored in a storage medium, and the computer program product is executed by at least one processor to implement the steps in the proxy connection method according to any one of claims 1 to 5.
