Application publishing method, system, storage medium and program product

CN122845574APending Publication Date: 2026-09-29ALIBABA CLOUD COMPUTING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510366390.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-26
Publication Date
2026-09-29

AI Technical Summary

Technical Problem

[0004]这种应用发布方式,需要两套部署环境资源的投入,成本高,而且,在两套环境切换过程中会产生服务中断,影响用户体验

Benefits of technology

[0029]本申请实施例提供的应用程序发布方案中,通过在负载均衡器中维护第一通信连接与第二通信连接的映射关系,为客户端与服务器之间后续的交互奠定了基础。其中,第一通信连接为客户端与负载均衡器之间已经建立的通信连接,第二通信连接为负载均衡器与服务器之间已经建立的通信连接。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122845574A_ABST
    Figure CN122845574A_ABST
Patent Text Reader

Abstract

This application provides an application deployment method, system, storage medium, and program product, relating to the field of computer technology. The method includes: receiving a first application access request forwarded from a client by a load balancer, the first application access request being sent to a server by the load balancer based on a mapping relationship between a first communication connection and a second communication connection; if the application is in a pending deployment state, determining a first flag indicating the closure of the first communication connection based on the pending deployment state; sending a first application access response back to the load balancer through the second communication connection, so that the load balancer sends the first application access response to the client through the first communication connection, the first flag causing the client to close the first communication connection; if it is determined that no application access request has been received through the second communication connection, then performing deployment processing on the application. This solution can reduce costs while avoiding service interruptions and ensuring a good user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to an application distribution method, system, storage medium, and program product. Background Technology

[0002] With the rapid development of cloud computing and microservice architectures, lossless deployment has become a core technical requirement for ensuring high availability and service continuity. Especially in high-concurrency scenarios, application version iterations must ensure zero service interruption and seamless user experience.

[0003] However, current solutions all have certain shortcomings when it comes to lossless application deployment. Take "blue-green deployment" as an example. Blue-green deployment is an application deployment strategy that primarily achieves application deployment through interaction between the client and two independent production environments (blue and green) maintained on the server. The blue environment runs the older version of the application and handles all user traffic, while the green environment deploys the new version. After testing is complete, traffic is switched from the blue to the green environment. If a problem occurs in the green environment during this process, the system can immediately switch back to the blue environment.

[0004] This application deployment method requires the investment of two deployment environment resources, which is costly. Moreover, the service interruption will occur during the switching between the two environments, affecting the user experience. Summary of the Invention

[0005] This application provides an application publishing method, system, storage medium, and program product to reduce costs, avoid service interruptions, and ensure user experience.

[0006] In a first aspect, embodiments of this application provide an application publishing method, the method being applied to a server running an application, the method comprising:

[0007] The server receives a first application access request forwarded from the client by the load balancer. The first application access request is sent to the server by the load balancer based on the mapping relationship between the first communication connection and the second communication connection. The first communication connection is the communication connection that has been established between the client and the load balancer, and the second communication connection is the communication connection that has been established between the load balancer and the server.

[0008] If the application is in a pending release state, then a first flag indicating the closure of the first communication connection is determined based on the pending release state;

[0009] The first application access response containing the first identifier bit is fed back to the load balancer through the second communication connection, so that the load balancer sends the first application access response to the client through the first communication connection, and the first identifier bit causes the client to close the first communication connection.

[0010] If it is determined that there are no application access requests received through the second communication connection, then the application is published.

[0011] Secondly, embodiments of this application provide an application publishing apparatus, the apparatus being applied to a server running an application, the apparatus comprising:

[0012] The receiving module is used to receive a first application access request forwarded by the load balancer from the client. The first application access request is sent by the load balancer to the server based on the mapping relationship between the first communication connection and the second communication connection. The first communication connection is the communication connection that has been established between the client and the load balancer, and the second communication connection is the communication connection that has been established between the load balancer and the server.

[0013] The determining module is configured to determine, based on the pending release state, a first identifier bit indicating the closure of the first communication connection if the application is in a pending release state;

[0014] The sending module is configured to send a first application access response containing the first identifier bit to the load balancer via the second communication connection, so that the load balancer sends the first application access response to the client via the first communication connection, and the first identifier bit causes the client to close the first communication connection.

[0015] The publishing module is used to publish the application if it is determined that there is no application access request received through the second communication connection.

[0016] Thirdly, embodiments of this application provide an application deployment method, the method being applied to a load balancer, the method comprising:

[0017] In response to a first application access request triggered by a client through an established first communication connection, the first application access request is forwarded to the first server through a second communication connection already established with the first server. The first communication connection and the second communication connection have a mapping relationship, and the application in the first server is in a pending release state. The system then receives a first application access response from the first server through the second communication connection. The first application access response contains a first flag indicating that the first communication connection should be closed. The first server determines the first flag based on the application being in a pending release state, and performs the application release process when it determines that no application access request is received through the second communication connection.

[0018] The first application access response is sent to the client through the first communication connection, so that the client closes the first communication connection according to the first identifier.

[0019] Fourthly, embodiments of this application provide an application deployment apparatus, which is applied to a load balancer, and the apparatus includes:

[0020] The response module is configured to respond to a first application access request triggered by a client through an established first communication connection, forward the first application access request to the first server through an established second communication connection with the first server, wherein the first communication connection and the second communication connection have a mapping relationship, and the application in the first server is in a pending release state; receive a first application access response from the first server through the second communication connection, wherein the first application access response includes a first flag indicating the closure of the first communication connection, wherein the first server determines the first flag based on the application being in a pending release state, and performs the application release process when it determines that no application access request is received through the second communication connection;

[0021] The sending module is configured to send the first application access response to the client via the first communication connection, so that the client closes the first communication connection according to the first identifier bit.

[0022] Fifthly, this application provides an application publishing system, the system comprising: a client, a load balancer, and a server cluster, wherein each server in the server cluster runs the same application, and the application in the first server is in a state of pending publication;

[0023] The client is configured to send a first application access request to the load balancer through an established first communication connection, and to receive a first application access response sent by the load balancer through the first communication connection, and to close the first communication connection according to a first identifier bit contained in the first application access response.

[0024] The load balancer is used to forward the first application access request to the first server through the second communication connection already established with the first server, and to send the first application access response to the client through the first communication connection, wherein the first communication connection and the second communication connection have a mapping relationship.

[0025] The first server is configured to receive the first application access request, determine a first identifier bit based on the application being in a pending release state, and send a first application access response containing the first identifier bit to the load balancer via the second communication connection, and execute the release process of the application when it is determined that there is no application access request received through the second communication connection, wherein the first identifier bit is used to indicate closing the first communication connection.

[0026] In a sixth aspect, embodiments of this application provide an electronic device, including: a memory, a processor, and a communication interface; wherein, the memory stores executable code, and when the executable code is executed by the processor, the processor performs the application publishing method as described in the first or third aspect.

[0027] In a seventh aspect, embodiments of this application provide a non-transitory machine-readable storage medium storing executable code, which, when executed by a processor of an electronic device, enables the processor to at least implement the application deployment method as described in the first or third aspect.

[0028] Eighthly, embodiments of this application provide a computer program product, the computer program product including a computer program, which, when executed by a processor, can implement the application deployment method as described in the first or third aspect.

[0029] In the application deployment scheme provided in this application embodiment, the mapping relationship between the first communication connection and the second communication connection is maintained in the load balancer, laying the foundation for subsequent interactions between the client and the server. The first communication connection is the established communication connection between the client and the load balancer, and the second communication connection is the established communication connection between the load balancer and the server.

[0030] In practical applications, if the application is in a pending deployment state, the server instructs the client to close the first communication connection by adding a first flag to the first application access response. This graceful shutdown allows the client to proactively close the first communication connection after receiving the first application access response, preventing sudden service interruptions and ensuring a good user experience. Afterward, if the server determines that there are no more application access requests from the load balancer, it proceeds with the application deployment. The entire process can be completed within a single environment, eliminating the need to deploy two environments, reducing resource investment and costs. Attached Figure Description

[0031] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0032] Figure 1 This application provides a schematic diagram of the structure of an application publishing system according to an embodiment of the present application.

[0033] Figure 2a This is a schematic diagram illustrating the application of the application publishing system provided in this application embodiment under the ECS architecture;

[0034] Figure 2b This is a schematic diagram illustrating the application deployment system provided in this application embodiment under the Kubernetes architecture.

[0035] Figure 3 An interactive flowchart of an application publishing method provided in this application embodiment;

[0036] Figure 4 An interactive flowchart of another application publishing method provided in this application embodiment;

[0037] Figure 5 An interactive flowchart illustrating yet another application publishing method provided in this application embodiment;

[0038] Figure 6 An interactive flowchart illustrating another application publishing method provided in an embodiment of this application;

[0039] Figure 7 A schematic diagram of the structure of an application publishing device provided in an embodiment of this application;

[0040] Figure 8 A schematic diagram of the structure of another application publishing device provided in this application embodiment;

[0041] Figure 9 This is a schematic diagram of the structure of an electronic device provided in this embodiment. Detailed Implementation

[0042] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. In addition, the timing of the steps in the following method embodiments is only an example and not a strict limitation.

[0043] It should be noted that, in the cases involving user information in the embodiments of this application, 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 the embodiments of this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse. In addition, the various models involved in this application (including but not limited to large language models or other models) comply with relevant laws and standards.

[0044] With the rapid development of cloud computing and microservice architectures, lossless deployment has become a core technical requirement for ensuring high availability and service continuity. However, current solutions all have certain shortcomings when it comes to lossless deployment of applications. Taking "blue-green deployment" as an example, it requires the investment of two deployment environment resources in practical applications, which is costly. Moreover, service interruptions will occur during the switching between the two environments, affecting the user experience.

[0045] In view of this, the embodiments of this application provide the following approach to solve the above problems: The load balancer maintains a mapping relationship between the first communication connection (i.e., the communication connection already established between the client and the load balancer) and the second communication connection (i.e., the communication connection already established between the load balancer and the server), so that the client and server can interact smoothly subsequently. In practical applications, if the application on the server is in a pending release state, it means that the application may need a version update. However, the application is still continuously receiving application access requests, which can easily lead to problems such as data confusion between old and new versions, application update failures, and inability to process application access requests normally. Therefore, gracefully disconnecting the communication connection between the client and the server is essential. The embodiments of this application instruct the client to close the first communication connection by adding a first flag bit to the first application access response. This allows the client to actively close the first communication connection after receiving the first application access response, avoiding sudden service interruptions and ensuring user experience. Afterwards, if the server determines that there are no more application access requests from the load balancer, it will release the application. The entire process can be completed in one environment, eliminating the need to deploy two environments, reducing resource investment and costs.

[0046] The application publishing scheme provided in the embodiments of this application will be described below.

[0047] Figure 1 This is a schematic diagram of the structure of an application publishing system provided in an embodiment of this application, such as... Figure 1 As shown, the system includes a client, a load balancer (LB), and a server cluster. The application on the first server in the server cluster is in a pending deployment state. The client sends a first application access request to the load balancer via an established first communication connection, and receives a first application access response from the load balancer via the same connection. The client then closes the first communication connection based on a first identifier bit included in the first application access response. The load balancer forwards the first application access request to the first server via a second communication connection established with the first server, and sends the first application access response to the client via the first communication connection. The first and second communication connections are mapped. The first server receives the first application access request, determines the first identifier bit based on the application being in a pending deployment state, sends a first application access response containing the first identifier bit to the load balancer via the second communication connection, and performs application deployment processing when no application access request is received via the second communication connection. The first identifier bit indicates the need to close the first communication connection.

[0048] It should be noted that the first communication connection refers to all communication connections established between at least one client and the load balancer before the application is deployed, not a single connection. Similarly, the second communication connection refers to all communication connections established between the load balancer and at least one server before the application is deployed, not a single connection. The communication protocols for the first and second communication connections can be Transmission Control Protocol (TCP), User Datagram Protocol (UDP), etc., and are not limited here.

[0049] For ease of description, Figure 1 The example only illustrates one client (which can be a laptop, tablet, mobile phone, or other terminal device). However, in practical applications, the number of clients is not limited. For example, suppose there are three clients: Client 1, Client 2, and Client 3. The communication connections established between Client 1 and the load balancer, Client 2 and the load balancer, and Client 3 and the load balancer can all be mapped to the communication connection established between the load balancer and the first server. That is, multiple communication connections between clients and the load balancer can be mapped to the communication connection between the load balancer and a single server. Furthermore, a client can have one or more application access requests with the load balancer; the specific number of application access requests can be determined based on the actual situation.

[0050] Furthermore, the aforementioned mapping relationship can be pre-established by the load balancer. In practical applications, when the load balancer receives the first application access request from a client, it can directly forward the request to the corresponding first server based on this mapping relationship. For example, regarding the creation process of this mapping relationship, suppose a client sends an application access request to the load balancer. After receiving the request, the load balancer can determine which server to route the request to based on the load of multiple servers in the server cluster. After determining the target server, the load balancer establishes a communication connection with the target server. It can be understood that the client also establishes a communication connection with the load balancer at this time. Under these circumstances, the mapping relationship between "the communication connection between the client and the load balancer" and "the communication connection between the load balancer and the target server" can be successfully established. In summary, this mapping relationship can be created based on the load balancer's own load balancing strategy.

[0051] In practical applications, if the application is in a pending deployment state, the server instructs the client to close the first communication connection by adding a first flag to the first application access response. This allows the client to proactively close the first communication connection upon receiving the current first application access response, preventing sudden service interruptions and ensuring a good user experience. Afterward, if the server determines that there are no more application access requests from the load balancer, it proceeds with the application deployment. The entire process can be completed within a single environment, eliminating the need to deploy two environments, reducing resource investment and lowering costs.

[0052] Optionally, the client is also configured to send a communication connection establishment request to the load balancer, and to send a second application access request to the load balancer via a third communication connection. The load balancer is further configured to determine that the application in the first server is in a deployment completion state, establish a third communication connection between the client and the load balancer based on the communication connection establishment request; determine that a fourth communication connection between the load balancer and the first server has a mapping relationship with the third communication connection; and based on the mapping relationship, forward the second application access request to the first server via the fourth communication connection; and send a second application access response to the client via the third communication connection. The first server is also configured to provide a second application access response via the fourth communication connection, the second application access response containing a second identifier bit indicating that the first server maintains the third communication connection according to the deployment completion state.

[0053] Optionally, the client is also configured to send a communication connection establishment request to the load balancer, and to send a third application access request to the load balancer via a fifth communication connection. The load balancer is also configured to receive the communication connection establishment request, determine that the application in the first server is in a pending deployment state; establish a fifth communication connection between the client and the load balancer; determine a second server, and determine that a sixth communication connection between the load balancer and the second server has a mapping relationship with the fifth communication connection; and based on the mapping relationship, forward the third application access request to the second server via the fifth communication connection. The second server and the first server are located in the same server cluster, and the application in the second server is in a non-deployed state.

[0054] For details on the specific application process of the above application publishing system, please refer to the following embodiments, which will not be described in detail here.

[0055] In practical applications, the above application deployment system can be applied to various architectures, for example:

[0056] As one implementation method, such as Figure 2aAs shown, this application deployment system can be applied to the Elastic Compute Service (ECS) architecture. This architecture includes clients, load balancers, gateways, and cloud service instances (also known as ECS instances). These cloud service instances can be virtual machines in the cloud, serving as the physical carriers of the applications, which run on these instances.

[0057] In practice, the client sends a first application access request to the load balancer. Based on the mapping relationship between the first communication connection (the established connection between the client and the load balancer) and the second communication connection (the established connection between the load balancer and the cloud service instance), the load balancer processes the first application access request through the gateway and then forwards it to the corresponding cloud service instance. Upon receiving the first application access request, the cloud service instance can send a corresponding first application access response back to the load balancer. During this process, the gateway handles: security verification (such as verifying the content of the application access request header and rejecting requests that do not meet security specifications), request routing (routing the application access request to the corresponding cloud service instance), and traffic control (determining whether to trigger rate limiting based on the current request volume of the cloud service instance), etc., which will not be listed here.

[0058] As another implementation method, such as Figure 2b As shown, this application deployment system can be applied to a Kubernetes (also known as k8s) architecture. This architecture includes a client, load balancer, kube-proxy (a network proxy component in the k8s cluster), gateway, and container pods. The application runs within a container pod.

[0059] In practice, the client sends a first application access request to the load balancer. Based on the mapping relationship between the first communication connection (the established connection between the client and the load balancer) and the second communication connection (the established connection between the load balancer and the cloud service instance), the load balancer sends the first application access request to the ingress node of the Kubernetes cluster. This ingress node, based on the domain name and path of the application access request, processes it sequentially through the network proxy component kube-proxy and the gateway before sending it to the corresponding container pod. Upon receiving the application access request, the container pod can send a corresponding application access response back to the load balancer. During this process, the network proxy component kube-proxy is responsible for distributing the application access request and maintaining network rules within the cluster. For example, it can map the virtual IP address and port of the first application access request to the actual IP address and port of the container pod. The gateway handles various aspects, including: security verification (such as verifying the content of the application access request header and rejecting requests that do not meet security standards), request routing (routing the application access request to the corresponding cloud service instance), and traffic control (determining whether to trigger rate limiting based on the current request volume of the cloud service instance), which will not be listed here.

[0060] The following section provides a detailed explanation of the working process of the different components of the aforementioned application publishing system.

[0061] Figure 3 This is an interactive flowchart illustrating an application publishing method provided in an embodiment of this application. Figure 3 As shown, the method may include the following steps:

[0062] 301. The client sends the first application access request to the load balancer through the established first communication connection.

[0063] 302. In response to the first application access request, the load balancer forwards the first application access request to the first server through the second communication connection that has been established with the first server.

[0064] The first communication connection and the second communication connection have a mapping relationship.

[0065] 303. If the application is in a pending release state, the first server determines the first flag bit that indicates the closure of the first communication connection based on the pending release state.

[0066] 304. The first server sends a first application access response containing a first identifier bit to the load balancer through the second communication connection.

[0067] 305. The load balancer sends the received first application access response to the client through the first communication connection.

[0068] 306. The client closes the first communication connection based on the first identifier bit in the first application access response.

[0069] 307. If the first server determines that there is no application access request received through the second communication connection, it will proceed with the application release process.

[0070] It should be noted that the first server is one of the servers in the server cluster. The first application access request can be a Hypertext Transfer Protocol (HTTP) request. Using HTTP makes this solution highly versatile, and any application implemented based on HTTP can use it. It is understood that HTTP is independent of deployment architecture and technology stack, and its standardized nature enables broad compatibility. In addition, the first application access request can also be a full-duplex communication protocol (WebSocket) request, a high-performance remote procedure call protocol (Google Remote Procedure Call, gRPC) request, etc., without limitation.

[0071] In practical applications, the client and the load balancer establish a first communication connection beforehand, and the load balancer and the first server establish a second communication connection beforehand. The load balancer maintains a mapping relationship between the first and second communication connections. Specifically, the client sends a first application access request (such as a resource acquisition request, resource update request, resource deletion request, etc., not listed here) to the load balancer through the established first communication connection. Upon receiving the first application access request, the load balancer, according to the aforementioned mapping relationship, forwards the first application access request to the first server through the second communication connection.

[0072] After receiving the first application access request, the first server needs to send a first application access response to the client based on the request. It should be noted that, under normal circumstances, the first application access response includes an initial flag (i.e., the second flag in subsequent embodiments), such as "connection: keep-a live". This initial flag is used by default to indicate maintaining the communication connection. However, when the first server determines that the application is in a pre-release state, it needs to disconnect the communication connection with the client. At this time, the first server modifies the initial flag to a first flag indicating closing the first communication connection (e.g., connection: close), and sends the first application access response containing the first flag to the load balancer through the second communication connection. The load balancer then sends the received first application access response to the client through the first communication connection, causing the client to close the first communication connection based on the first flag.

[0073] Subsequently, if the first server determines that no application access request was received through the second communication connection, it will proceed with the application release process. Specifically:

[0074] As one implementation approach, if the first server determines that all established communication connections with the load balancer have been closed, it will proceed with the application deployment.

[0075] In practical implementation, for example, assume that the client and the load balancer have established two communication connections: communication connection 1 and communication connection 2. In actual applications, two scenarios are possible: Scenario 1: The client continuously sends application access requests to the load balancer through communication connection 1 until it receives an application access response containing the first identifier. At this point, communication connection 1 with the load balancer is disconnected. It should be understood that the communication connection established between the load balancer and the first server is also closed at this time. Scenario 2: The client only establishes communication connection 2 with the load balancer but never sends an application access request to the load balancer through communication connection 2. In this case, the client will determine whether it has sent an application access request to the load balancer through communication connection 2 within a set time period after establishing communication connection 2. If it has not, it will disconnect communication connection 2 with the load balancer. When both scenarios 1 and 2 are satisfied, it can be determined that all established communication connections between the first server and the load balancer are closed. At this point, the application can be deployed.

[0076] By deploying the application after confirming that all communication connections established between the first server and the load balancer are closed, the problem of application access requests being unable to be processed due to the need for forced interruption when communication connections still exist between the first server and the load balancer is avoided, thus ensuring that the application can be deployed smoothly.

[0077] As another implementation, if the first server determines that it will not receive any more application access requests within a set period of time after the application is in the pending release state, then by default, all communication connections established between the first server and the load balancer are closed, and the application is released directly.

[0078] In practice, after the first server determines that the application is in a pending deployment state, it can start timing. If no application access requests are received within the set time period, the application is directly deployed. For example, if the first server does not receive any application access requests from the load balancer within 120 seconds after the application enters the pending deployment state, it is assumed that the communication connection established between the first server and the load balancer has been closed. At this time, the first server can directly deploy the application. Specifically, the application can be deployed through a configured application deployment system. It should be noted that, in order to improve resource utilization and avoid resource redundancy, this embodiment adopts a batch deployment method to deploy the application to each server in the server cluster. For example, assuming there are 20 servers in the server cluster, the application can be deployed in 5 batches, with 4 servers' applications deployed in each batch.

[0079] By introducing the concept of a set time period based on the application being in a state of readiness for release, it is ensured that in actual application, there is no need to wait for all communication connections to close naturally. The release operation can be triggered directly after the set time period is reached, resulting in a faster release speed.

[0080] Based on the above, the application publishing method provided in this application embodiment, when the application is in a pending publishing state, can instruct the client to close the first communication connection by adding a first identifier bit to the first application access response. This allows the client to proactively close the first communication connection upon receiving the first application access response, avoiding sudden interruptions to the client service and ensuring a seamless user experience. Afterwards, if the server determines that there are no more application access requests from the load balancer, it can proceed with the application publishing process. The entire process can be completed within a single environment, eliminating the need to deploy two environments, reducing resource investment and lowering costs.

[0081] Figure 4 An interactive flowchart illustrating another application publishing method provided in this application embodiment. Figure 4 As shown, the method may include the following steps:

[0082] 401. The client sends the first application access request to the load balancer through the established first communication connection.

[0083] 402. In response to the first application access request, the load balancer forwards the first application access request to the first server through the second communication connection that has been established with the first server.

[0084] The first communication connection and the second communication connection have a mapping relationship.

[0085] 403. If the application is in a pending release state, the first server determines the first flag bit that indicates the closure of the first communication connection based on the pending release state.

[0086] 404. The first server sends a first application access response containing a first identifier bit to the load balancer via the second communication connection.

[0087] 405. The load balancer sends the received first application access response to the client through the first communication connection.

[0088] 406. The client closes the first communication connection based on the first identifier bit in the first application access response.

[0089] 407. If the first server determines that there is no application access request received through the second communication connection, it will proceed with the application release process.

[0090] 408. The first server responds to the completion of the application's release, and the modified application is now in the release-completed state.

[0091] 409. The load balancer determines that the application on the first server is in the published state.

[0092] 410. The client sends a communication connection establishment request to the load balancer.

[0093] 411. In response to the communication connection establishment request, the load balancer establishes a third communication connection between the client and the load balancer, and determines that the fourth communication connection between the load balancer and the first server has a mapping relationship with the third communication connection.

[0094] 412. The client sends a second application access request to the load balancer through a third communication connection.

[0095] 413. In response to the second application access request, the load balancer forwards the second application access request to the first server through the fourth communication connection based on the mapping relationship.

[0096] 414. The first server determines the second identifier bit to maintain the third communication connection based on the publication completion status.

[0097] 415. The first server sends a second application access response containing the second identifier bit to the load balancer via the fourth communication connection.

[0098] 416. The load balancer sends the second application access response to the client through a third communication connection.

[0099] In practical applications, the specific execution process of steps 401-407 can be found in the above embodiments, and will not be repeated here.

[0100] After the application is deployed based on steps 401-407, the first server, in response to the completion of the application deployment, can modify the application to be in a deployed state by writing a script. At this time, the load balancer can determine the deployment status of the application on the first server by periodically sending health probe requests. The specific execution process of "periodically sending health probe requests" can be found in the following embodiment, which will not be described in detail here.

[0101] In practice, the client sends a communication connection establishment request to the load balancer. In response, the load balancer establishes a third communication connection between the client and the load balancer, and a fourth communication connection between the load balancer and the first server. This fourth communication connection can be either newly established or previously established.

[0102] Specifically, in the first scenario, it's understood that the second communication connection between the load balancer and the first server was broken before the application was deployed. Therefore, a new communication connection (i.e., the fourth communication connection) needs to be established between the load balancer and the first server. In the second scenario, other clients may have already established communication connections with the first server through the load balancer, meaning a fourth communication connection has already been established between the load balancer and the first server. In this case, the mapping relationship between the third and fourth communication connections can be created through the load balancer.

[0103] Subsequently, the client sends a second application access request to the load balancer via the third communication connection. Upon receiving this request, the load balancer, based on the aforementioned mapping relationship, forwards the request to the first server via the fourth communication connection. This allows the first server to determine a second flag indicating whether to maintain the third communication connection based on the deployment completion status, and then sends a second application access response containing the second flag back to the load balancer via the fourth communication connection. The second flag can be understood as an initial default flag carried in the application access response, used to indicate whether to maintain the communication connection. Upon receiving this second application access response, the load balancer simply forwards it to the client via the third communication connection.

[0104] After the application is deployed on the first server, a third communication connection is established between the client and the load balancer. A fourth communication connection between the load balancer and the first server is established, mapping to the third connection, laying the foundation for subsequent client-server interaction. When the first server receives a second application access request forwarded by the client through the load balancer, it maintains the session with the load balancer by sending a second application access response with a second identifier, ensuring zero service interruption. Furthermore, this process can be completed within a single environment, eliminating the need for resource investment in two deployment environments, resulting in lower costs.

[0105] Furthermore, it should be noted that if the application in the first server is in a pending-deployment state and receives a communication connection establishment request forwarded by the client through the load balancer, it may cause subsequent application access requests from new communication connections to be unable to be processed, or even affect the normal deployment of the application. Therefore, in this embodiment of the application, when the load balancer determines that the application in the first server is in a pending-deployment state, it is necessary to prevent the first server from receiving new communication connection establishment requests. In view of this:

[0106] As one way of implementation, Figure 5 This is an interactive flowchart illustrating another application publishing method provided in an embodiment of this application. Figure 5 As shown, the method may include the following steps:

[0107] 501. The load balancer periodically sends health probe requests to the first server.

[0108] 502. Based on the received health probe request, the first server sends a health probe response to the load balancer, indicating that the application is in a state of pending release.

[0109] 503. Upon receiving a health probe response, the load balancer determines that the application on the first server is in a pending deployment state and marks the first server as unreachable.

[0110] It should be noted that the load balancer maintains a status table that records the connectability status of all servers.

[0111] In practical applications, the load balancer periodically (e.g., every 10 seconds, 20 seconds, etc.) sends health probe requests to the first server. Upon receiving the health probe request, the first server responds accordingly based on the application's status. For example, it might send a health probe response to the load balancer indicating that the application is in a pending deployment state. Upon receiving this health probe response, the load balancer can determine that the application on the first server is in a pending deployment state. At this point, it can mark the first server as unreachable in the status table using a script, or simply delete the first server from the status table. This means that subsequent new communication connection establishment requests will not be sent to the first server; however, the first server can still continue to process application access requests from existing communication connections.

[0112] By having the load balancer periodically send health probe requests to the primary server, changes in the application's status on that server can be quickly detected, ensuring the accuracy of the primary server's connection status. In this process, the load balancer can automatically detect changes in the application's status on the primary server without manual intervention, improving efficiency while ensuring the accuracy of the primary server's connection status.

[0113] As another implementation, when an application is deployed under the Kubernetes architecture, if the application in a container pod is in a pending release state, the Kubernetes architecture will natively put the container pod into a "termining" state (also known as a terminated state). At this time, the network proxy component kube-proxy will not send the received communication connection establishment requests to the container pod.

[0114] Figure 6 This is an interactive flowchart illustrating another application publishing method provided in an embodiment of this application. Figure 6 As shown, the method may include the following steps:

[0115] 601. The client sends a communication connection establishment request to the load balancer.

[0116] 602. In response to the communication connection establishment request, the load balancer determines that the application in the first server is in a pending deployment state and establishes a fifth communication connection between the client and the load balancer; determines the second server, and determines the mapping relationship between the sixth communication connection between the load balancer and the second server and the fifth communication connection.

[0117] The second server is located in the same server cluster as the first server, and the application on the second server is in a non-published state.

[0118] 603. The client sends a third application access request to the load balancer through the fifth communication connection.

[0119] 604. In response to a third application access request, the load balancer forwards the third application access request to the second server through the sixth communication connection based on the mapping relationship.

[0120] In practical applications, a client sends a connection establishment request to the load balancer, wanting to establish a communication connection with a server in the server cluster. At this point, the load balancer can establish a fifth communication connection between the client and the load balancer, and determine the status of the application on the first server based on its own maintained status table (which records the connectability status of all servers) or the application access response previously sent by the first server. If the application is determined to be in a pending deployment state, the first server is marked as unconnectable. It should be noted that although the load balancer marks the first server as unconnectable, it still retains the communication connection mapping related to the first server for a certain period after marking it as unconnectable. Clients that have already established a communication connection with the first server through the load balancer can still continue to send application access requests to the first server.

[0121] Subsequently, the load balancer can determine a second server (where the application is in a non-published state) in the server cluster based on the configured load balancing strategy, and establish a sixth communication connection between the load balancer and the second server, creating a mapping relationship between this sixth communication connection and the fifth communication connection. In practice, the client can send a third application access request to the load balancer through the fifth communication connection. Upon receiving this request, the load balancer, based on the mapping relationship between the sixth and fifth communication connections, forwards the request to the second server through the sixth communication connection. It should be noted that the sixth communication connection can be temporarily established or pre-established; this is not limited here.

[0122] By switching servers based on the application's release status, two advantages are made. First, when the application is in a "pending release" state, the first server can only process application access requests sent through established communication connections, avoiding data inconsistencies between old and new versions. Second, when the application is in a "pending release" state on the first server, communication connection establishment requests can be sent to the server hosting the application (which is not yet released). This not only avoids affecting the application's release on the first server but also quickly finds a more suitable server for new communication connection establishment requests, ensuring that subsequent application access requests from clients based on newly established communication connections are processed quickly and accurately.

[0123] Figure 7 This is a schematic diagram of an application publishing device provided in an embodiment of this application. The device is applied to a server running an application, such as... Figure 7 As shown, the device includes: a receiving module 71, a determining module 72, a sending module 73, and a publishing module 74.

[0124] The receiving module 71 is used to receive a first application access request forwarded from the client by the load balancer. The first application access request is sent to the server by the load balancer based on the mapping relationship between the first communication connection and the second communication connection. The first communication connection is a communication connection that has been established between the client and the load balancer, and the second communication connection is a communication connection that has been established between the load balancer and the server.

[0125] The determining module 72 is used to determine a first identifier bit indicating the closure of the first communication connection based on the pending release state if the application is in a pending release state.

[0126] The sending module 73 is used to send a first application access response containing the first identifier bit to the load balancer through the second communication connection, so that the load balancer sends the first application access response to the client through the first communication connection, and the first identifier bit causes the client to close the first communication connection.

[0127] The publishing module 74 is used to publish the application if it is determined that there is no application access request received through the second communication connection.

[0128] Optionally, the receiving module 71 is further configured to: receive a health probe request sent by the load balancer; and based on the health probe request, send a health probe response to the load balancer indicating that the application is in a pending deployment state, so that when the load balancer determines that the application is in a pending deployment state, it marks the server as unconnectable.

[0129] Optionally, the sending module 73 is further configured to: in response to the completion of the application's release, modify the application to be in a release-completed state; receive a second application access request forwarded from the client by the load balancer, wherein the second application access request is sent to the server by the load balancer based on the mapping relationship between a third communication connection and a fourth communication connection, wherein the third communication connection is a newly established communication connection by the load balancer based on the client's communication connection establishment request, and the fourth communication connection is a newly established communication connection between the load balancer and the server, and determine that the third communication connection and the fourth communication connection have a mapping relationship; determine a second identifier bit indicating to maintain the third communication connection according to the release-completed state; and send a second application access response containing the second identifier bit back to the load balancer through the fourth communication connection, so that the load balancer sends the second application access response to the client through the third communication connection.

[0130] Optionally, the publishing module 74 is specifically used to: if it is determined that all communication connections established with the load balancer have been closed, or if it is determined that no application access requests will be received within a set time period after the application is in the pending publishing state, then the application will be published.

[0131] Optionally, the first application access request is a Hypertext Transfer Protocol request.

[0132] Figure 7 The apparatus shown can perform the steps in the application publishing method in the foregoing embodiments. For detailed execution process and technical effects, please refer to the description in the foregoing embodiments, which will not be repeated here.

[0133] Figure 8 This is a schematic diagram of another application publishing device provided in an embodiment of this application. The device is applied to a load balancer and includes a response module 81 and a sending module 82.

[0134] The response module 81 is configured to respond to a first application access request triggered by a client through an established first communication connection, forward the first application access request to the first server through an established second communication connection with the first server, wherein the first communication connection and the second communication connection have a mapping relationship, and the application in the first server is in a pending release state; receive a first application access response from the first server through the second communication connection, wherein the first application access response includes a first flag indicating the closure of the first communication connection, wherein the first server determines the first flag based on the application being in a pending release state, and performs the application release process when it determines that no application access request is received through the second communication connection.

[0135] The sending module 82 is used to send the first application access response to the client through the first communication connection, so that the client closes the first communication connection according to the first identifier bit.

[0136] Optionally, the sending module 82 is further configured to: determine that the application in the first server is in a published state; in response to the client's communication connection establishment request, establish a third communication connection between the client and the load balancer; determine that a fourth communication connection between the load balancer and the first server has a mapping relationship with the third communication connection; in response to a second application access request triggered by the client through the third communication connection, forward the second application access request to the first server through the fourth communication connection based on the mapping relationship; receive a second application access response from the first server through the fourth communication connection, wherein the second application access response contains an indication determined by the first server according to the published state to maintain a second identifier bit of the third communication connection; and send the second application access response to the client through the third communication connection.

[0137] Optionally, the response module 81 is specifically configured to: periodically send health probe requests to the first server; and in response to receiving a health probe response from the first server indicating that the application is in a pending release state, determine that the application is in a pending release state in the first server.

[0138] Optionally, the response module 81 is specifically configured to: in response to the client's communication connection establishment request, determine that the application in the first server is in a pending deployment state; establish a fifth communication connection between the client and the load balancer; determine a second server, wherein the second server and the first server are located in the same server cluster, and the application in the second server is in a non-deployment state; determine that a sixth communication connection between the load balancer and the second server has a mapping relationship with the fifth communication connection; and in response to a third application access request triggered by the client through the fifth communication connection, forward the third application access request to the second server through the sixth communication connection based on the mapping relationship.

[0139] Figure 8 The apparatus shown can perform the steps in the application publishing method in the foregoing embodiments. For detailed execution process and technical effects, please refer to the description in the foregoing embodiments, which will not be repeated here.

[0140] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, such as... Figure 9As shown, in practice, this electronic device includes a memory 91 and a processor 92.

[0141] Memory 91 is used to store computer programs and can be configured to store various other data to support operation on the electronic device. Examples of this data include instructions for any application or method used to operate on the electronic device, data structures, contact data, phone book data, messages, pictures, videos, etc.

[0142] The processor 92, coupled to the memory 91, is used to execute computer programs in the memory 91 to implement the application publishing method provided in the foregoing embodiments.

[0143] Furthermore, such as Figure 9 As shown, the electronic device also includes other components such as a communication component 93, a display 94, a power supply component 95, and an audio component 96. Figure 9 The diagram only shows some components and does not mean that the electronic device includes only these components. Figure 9 The components shown are as follows. The electronic device in this embodiment can be a terminal device such as a desktop computer, laptop computer, smartphone, or IoT device, or a server device such as a conventional server, cloud server, or server array.

[0144] The aforementioned memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random-Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0145] The aforementioned communication component is configured to facilitate wired or wireless communication between the device containing the communication component and other devices. The device containing the communication component can access wireless networks based on communication standards, such as 2G, 3G, 4G / LTE, 5G, or combinations thereof. In one exemplary embodiment, the communication component receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel.

[0146] The aforementioned display includes a screen, which may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation.

[0147] The aforementioned power supply components provide power to various components within the device in which they reside. These power supply components may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to the device in which they reside.

[0148] The aforementioned audio component can be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC) configured to receive external audio signals when the device containing the audio component is in an operating mode, such as call mode, recording mode, or voice recognition mode. The received audio signals can be further stored in memory or transmitted via a communication component. In some embodiments, the audio component also includes a speaker for outputting audio signals.

[0149] Accordingly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to implement the steps in the above-described method embodiments. The computer-readable storage medium includes volatile or non-volatile or a combination thereof, and can be removable or non-removable. Examples of computer-readable storage media include, but are not limited to, phase-change random access memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random-access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), flash memory or other memory technologies, CD-ROM, digital video disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium.

[0150] Accordingly, this application also provides a computer program product, which includes a computer program or instructions that, when executed by a processor, cause the processor to implement the steps in the above method embodiments. It should be understood that each step or combination of steps in the above method flow can be implemented by the computer program or instructions. Furthermore, these computer programs or instructions can be applied to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device, enabling the processor of the general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to function as an apparatus for implementing the corresponding functions in the above method embodiments.

[0151] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. An application publishing method, characterized in that, Applied to a server running an application, the method includes: The server receives a first application access request forwarded from the client by the load balancer. The first application access request is sent to the server by the load balancer based on the mapping relationship between the first communication connection and the second communication connection. The first communication connection is the communication connection that has been established between the client and the load balancer, and the second communication connection is the communication connection that has been established between the load balancer and the server. If the application is in a pending release state, then a first flag indicating the closure of the first communication connection is determined based on the pending release state; The first application access response containing the first identifier bit is fed back to the load balancer through the second communication connection, so that the load balancer sends the first application access response to the client through the first communication connection, and the first identifier bit causes the client to close the first communication connection. If it is determined that there are no application access requests received through the second communication connection, then the application is published.

2. The method according to claim 1, characterized in that, Also includes: Receive a health probe request sent by the load balancer; Based on the health probe request, a health probe response indicating that the application is in a pre-deployment state is sent back to the load balancer, so that when the load balancer determines that the application is in a pre-deployment state, it marks the server as unreachable.

3. The method according to claim 1, characterized in that, After the application is published, the method further includes: In response to the completion of the application's release, the application is modified to be in the release complete state; The system receives a second application access request forwarded from a client by the load balancer. This second application access request is sent to the server by the load balancer based on a mapping relationship between a third communication connection and a fourth communication connection. The third communication connection is a newly established communication connection by the load balancer based on the client's communication connection establishment request, and the fourth communication connection is a newly established communication connection between the load balancer and the server. The system also determines that the third communication connection and the fourth communication connection have a mapping relationship. Based on the published completion status, determine a second identifier bit indicating that the third communication connection should be maintained; The load balancer is fed back a second application access response containing the second identifier bit through the fourth communication connection, so that the load balancer sends the second application access response to the client through the third communication connection.

4. The method according to claim 1, characterized in that, The step of determining that no application access request was received through the second communication connection, and then performing the application release process, includes: If it is determined that all established communication connections with the load balancer have been closed, or if it is determined that no application access requests will be received within a set period of time after the application is in the pending release state, then the application will be released.

5. The method according to any one of claims 1-4, characterized in that, The first application access request is a Hypertext Transfer Protocol request.

6. An application publishing method, characterized in that, Applied to load balancers, the method includes: In response to a first application access request triggered by a client through an established first communication connection, the first application access request is forwarded to the first server through a second communication connection already established with the first server. The first communication connection and the second communication connection have a mapping relationship, and the application in the first server is in a pending release state. The system then receives a first application access response from the first server through the second communication connection. The first application access response contains a first flag indicating that the first communication connection should be closed. The first server determines the first flag based on the application being in a pending release state, and performs the application release process when it determines that no application access request is received through the second communication connection. The first application access response is sent to the client through the first communication connection, so that the client closes the first communication connection according to the first identifier.

7. The method according to claim 6, characterized in that, Also includes: Determine that the application in the first server is in a published-complete state; In response to the client's request to establish a communication connection, a third communication connection is established between the client and the load balancer; It is determined that the fourth communication connection between the load balancer and the first server has a mapping relationship with the third communication connection; In response to a second application access request triggered by the client through the third communication connection, the second application access request is forwarded to the first server through the fourth communication connection based on the mapping relationship; The system receives a second application access response from the first server via the fourth communication connection. The second application access response includes an indication from the first server, determined based on the publication completion status, to maintain a second identifier bit of the third communication connection. The second application access response is sent to the client via the third communication connection.

8. The method according to claim 6, characterized in that, Also includes: Periodically send health probe requests to the first server; In response to receiving a health probe response from the first server indicating that the application is in a pre-release state, it is determined that the application is in a pre-release state in the first server.

9. The method according to claim 8, characterized in that, Also includes: In response to the client's request to establish a communication connection, it is determined that the application in the first server is in a state awaiting release; Establish a fifth communication connection between the client and the load balancer; A second server is identified, which is located in the same server cluster as the first server, and the application on the second server is in a non-published state. It is determined that the sixth communication connection between the load balancer and the second server has a mapping relationship with the fifth communication connection; In response to a third application access request triggered by the client through the fifth communication connection, the third application access request is forwarded to the second server through the sixth communication connection based on the mapping relationship.

10. An application publishing system, characterized in that, include: The application includes a client, a load balancer, and a server cluster, where each server in the server cluster runs the same application, and the application in the first server is in a state of pending release. The client is configured to send a first application access request to the load balancer through an established first communication connection, and to receive a first application access response sent by the load balancer through the first communication connection, and to close the first communication connection according to a first identifier bit contained in the first application access response. The load balancer is used to forward the first application access request to the first server through the second communication connection already established with the first server, and to send the first application access response to the client through the first communication connection, wherein the first communication connection and the second communication connection have a mapping relationship. The first server is configured to receive the first application access request, determine a first identifier bit based on the application being in a pending release state, and send a first application access response containing the first identifier bit to the load balancer via the second communication connection, and execute the release process of the application when it is determined that there is no application access request received through the second communication connection, wherein the first identifier bit is used to indicate closing the first communication connection.

11. The system according to claim 10, characterized in that, The client is also used to send a communication connection establishment request to the load balancer, and to send a second application access request to the load balancer through a third communication connection. The load balancer is further configured to: determine that the application in the first server is in a published state; establish a third communication connection between the client and the load balancer based on the communication connection establishment request; determine that a fourth communication connection between the load balancer and the first server has a mapping relationship with the third communication connection; and based on the mapping relationship, forward the second application access request to the first server through the fourth communication connection; and send the second application access response to the client through the third communication connection. The first server is also configured to provide a second application access response via the fourth communication connection, wherein the second application access response includes an indication determined by the first server based on the publication completion status to maintain a second identifier bit of the third communication connection.

12. The system according to claim 10, characterized in that, The client is also used to send a communication connection establishment request to the load balancer, and to send a third application access request to the load balancer through a fifth communication connection. The load balancer is also configured to receive the communication connection establishment request, determine that the application in the first server is in a state of pending release, and establish a fifth communication connection between the client and the load balancer. A second server is identified, and a mapping relationship is determined between the sixth communication connection between the load balancer and the second server and the fifth communication connection. Based on the mapping relationship, the third application access request is forwarded to the second server through the sixth communication connection. The second server and the first server are located in the same server cluster, and the application in the second server is in a non-published state.

13. A non-transitory machine-readable storage medium, characterized in that, The non-transitory machine-readable storage medium stores executable code that, when executed by a processor of an electronic device, causes the processor to perform the method as claimed in any one of claims 1 to 5, or claims 6 to 9.

14. A computer program product, characterized in that, include: A computer program, when executed by a processor of an electronic device, causes the processor to perform the method as claimed in any one of claims 1 to 5, or claims 6 to 9.