Full-link application updating method and electronic equipment

By starting the updated version of the microservice during the application update process and using the traffic allocation strategy to process the request, the problems of low application update efficiency and poor user experience in the existing technology are solved, and efficient and stable application updates are achieved.

CN120234018APending Publication Date: 2025-07-01QINGDAO HISENSE TRANS TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311771691.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-21
Publication Date
2025-07-01

AI Technical Summary

Technical Problem

The application update method in the prior art leads to unavailability of the application, low efficiency, poor user experience, and a risk of production accidents.

Method used

By starting the updated version of the microservice, using the preset traffic allocation strategy to determine the version of the target microservice, traverse and process application requests according to priority level, ensuring that the application remains available during the update process.

Benefits of technology

Improves the efficiency of application updates, improves user experience, and reduces the risk of production accidents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120234018A_ABST
    Figure CN120234018A_ABST
Patent Text Reader

Abstract

The invention provides a full-link application updating method and electronic equipment. And the updating efficiency of the full-link application is improved. Comprising the steps of starting a micro-service of an updated version for any micro-service in any application needing to be updated; based on an application request sent by a user, determining at least one target micro-service corresponding to the application request; traversing each target micro-service in sequence according to the priority of each target micro-service; for any traversed target micro-service, a target version corresponding to the target micro-service is determined by using a preset flow distribution strategy, and the target version of any target micro-service is an updated version or a non-updated version; sending the application request to a target micro-service of the target version to execute an operation corresponding to the target micro-service; and when it is determined that the target micro-service of the target version executes the corresponding operation, returning to the step of traversing each target micro-service according to the priority of each target micro-service until the traversal is finished, and completing the response to the application request.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] With the popularization of agile development of domestic software systems, application version releases are becoming more and more frequent. How to ensure application stability and reduce the probability of production accidents during frequent version updates without affecting user experience has become an important issue that needs to be solved urgently.

[0003] The existing application update method is to stop the old version of each microservice corresponding to the application, replace it with the new version of the microservice software package and then start it. Figure 1 As shown, taking microservice 1 in the application as an example, first, the non-updated version of microservice 1 is stopped, then the updated version of microservice 1 is used to replace the previous non-updated microservice 1, and finally the updated version of microservice 1 is started to complete the update of microservice 1 in the application. However, such an update method will not only cause the application to be unavailable during the release process, but also lead to low efficiency of application update and reduce user experience. Summary of the invention

[0004] In an exemplary embodiment of the present disclosure, a full-link application update method is provided to improve the efficiency of application update and improve user experience.

[0005] A first aspect of the present disclosure provides a method for updating a full-link application, the method comprising:

[0006] For any microservice in any application that needs to be updated, start the updated version of the microservice corresponding to the microservice;

[0007] After receiving an application request sent by a user, determining at least one target microservice corresponding to the application request based on the application request;

[0008] According to the preset priorities of each target microservice, traverse the target microservices in turn;

[0009] For any traversed target microservice, a pre-configured traffic distribution strategy is used to determine a target version corresponding to the target microservice, wherein the target version of any target microservice is an updated version or a non-updated version; and,

[0010] Sending the application request to the target microservice of the target version to perform an operation corresponding to the target microservice;

[0011] When it is determined that the target microservice of the target version has completed the corresponding operation, the step of traversing each target microservice according to the priority of each target microservice is returned until the traversal of each target microservice is completed, and the response to the application request is completed.

[0012] In this embodiment, for any microservice in any application that needs to be updated, the microservice of the corresponding updated version is started. After receiving an application request sent by a user, based on the application request, at least one target microservice corresponding to the application request is determined. According to the preset priorities of the target microservices, each target microservice is traversed in sequence; for any traversed target microservice, using the pre-configured traffic allocation policy, the target version corresponding to the target microservice is determined, and the application request is sent to the target microservice of the target version to execute the operation corresponding to the target microservice; when it is determined that the target microservice of the target version has completed the corresponding operation, then return to the step of traversing each target microservice according to the priorities of the target microservices until the traversal of each target microservice is completed, and then the response to the application request is completed. Thus, in the process of application update in the embodiment of the present application, the corresponding service can be normally provided for users, and it is not necessary to stop the application first and wait until the update is completed before it can be used. Therefore, the efficiency of application update is improved and the user experience is improved. And in the embodiment of the present application, the characteristics of each microservice of the updated version can also be verified during the update process to avoid production accidents and reduce the release risk.

[0013] In one embodiment, the traffic allocation policy includes a weight allocation policy, a request header allocation policy, and a cookie allocation policy;

[0014] The using the pre-configured traffic allocation policy to determine the target version corresponding to the target microservice includes:

[0015] If the traffic allocation policy is the weight allocation policy, then using the first weight of the target microservice of the corresponding updated version of the target microservice and the second weight of the target microservice of the corresponding non-updated version of the target microservice that are pre-set, the target version corresponding to the target microservice is obtained; or,

[0016] If the traffic allocation policy is the request header allocation policy, then based on the target parameter value in the request header of the application request, the target version corresponding to the target microservice is determined; or,

[0017] If the traffic allocation policy is the cookie allocation policy, then based on the cookie in the application request, the target version corresponding to the target microservice is determined.

[0018] In this embodiment, multiple traffic allocation policies are used to allocate application requests to determine the target versions of each application request. The smooth upgrade of the old and new versions of the application is realized, and the user experience is improved.

[0019] In one embodiment, obtaining a target version corresponding to the target microservice by using a first weight of the target microservice of the updated version corresponding to the preset target microservice and a second weight of the target microservice of the non-updated version corresponding to the target microservice includes:

[0020] Based on the first weight, obtaining a first target request count; and obtaining a second target request count according to the second weight; wherein the first target request count is the maximum request count of the target microservice of the updated version in the specified request count, and the second target request count is the maximum request count of the target microservice of the non-updated version in the specified request count, and the specified request count is the sum of the first target request count and the second target request count; and,

[0021] Obtaining the current usage count of the target microservice of the updated version and the current usage count of the target microservice of the non-updated version;

[0022] Determining a target version corresponding to the target microservice according to the current usage count of the target microservice of the updated version, the current usage count of the target microservice of the non-updated version, the first target request count, and the second target request count.

[0023] In one embodiment, the obtaining a first target request count based on the first weight includes:

[0024] Multiplying the first weight by the specified request count to obtain the first target request count;

[0025] The obtaining a second target request count according to the second weight includes:

[0026] Multiplying the second weight by the second target request count to obtain the second target request count.

[0027] In one embodiment, the determining a target version corresponding to the target microservice according to the current usage count of the target microservice of the updated version, the current usage count of the target microservice of the non-updated version, the first target request count, and the second target request count includes:

[0028] If the current usage count of the target microservice of the updated version is less than the first target request count, and the current usage count of the target microservice of the non-updated version is less than the second target request count, then determining the target version as the updated version or the non-updated version; or,

[0029] If the current usage times of the target microservice of the updated version is less than the first target request times, and the current usage times of the target microservice of the non-updated version is not less than the second target request times, then determine that the target version is the updated version; or,

[0030] If the current usage times of the target microservice of the updated version is not less than the first target request times, and the current usage times of the target microservice of the non-updated version is less than the second target request times, then determine that the target version is the non-updated version.

[0031] In one embodiment, before determining the target version corresponding to the target microservice according to the current usage times of the target microservice of the updated version, the current usage times of the target microservice of the non-updated version, the first target request times, and the second target request times, the method further includes:

[0032] Determine that the total number of received application requests is not greater than the specified request times.

[0033] In one embodiment, the method further includes:

[0034] If it is determined that the total number of received application requests is greater than the specified request times, then reset the total number of application requests, the current usage times of the target microservice of the updated version, and the current usage times of the target microservice of the non-updated version.

[0035] In one embodiment, determining the target version corresponding to the target microservice based on the target parameter value in the request header of the application request includes:

[0036] If the target parameter value is the first specified parameter value, then determine that the target version is the updated version;

[0037] If the target parameter value is the second specified parameter value, then determine that the target version is the non-updated version.

[0038] In one embodiment, determining the target version corresponding to the target microservice based on the cookie in the application request includes:

[0039] If the parameter value corresponding to the specified field in the cookie is the third specified parameter value, then determine that the target version is the updated version; or,

[0040] If the parameter value corresponding to the specified field in the cookie is the fourth specified parameter value, then determine that the target version is the non-updated version.

[0041] A second aspect of the present disclosure provides an electronic device, including a processor and a memory, where the processor and the memory are connected through a bus;

[0042] A computer program is stored in the memory, and the processor is configured to perform the following operations based on the computer program:

[0043] For any microservice in any application that needs to be updated, start the microservice of the updated version corresponding to the microservice;

[0044] After receiving an application request sent by a user, based on the application request, determine at least one target microservice corresponding to the application request;

[0045] Traverse each of the target microservices in sequence according to the preset priorities of the target microservices;

[0046] For any traversed target microservice, use a pre-configured traffic allocation policy to determine the target version corresponding to the target microservice, where the target version of any target microservice is an updated version or an un-updated version; and,

[0047] Send the application request to the target microservice of the target version to execute the operation corresponding to the target microservice;

[0048] When it is determined that the target microservice of the target version has completed the corresponding operation, return to the step of traversing each of the target microservices according to the priorities of the target microservices until the traversal of each of the target microservices is completed, then complete the response to the application request.

[0049] In one embodiment, the traffic allocation policy includes a weight allocation policy, a request header allocation policy, and a cookie allocation policy;

[0050] When the processor executes the use of the pre-configured traffic allocation policy to determine the target version corresponding to the target microservice, it is specifically configured as:

[0051] If the traffic allocation policy is the weight allocation policy, use the first weight of the target microservice of the updated version corresponding to the target microservice and the second weight of the target microservice of the un-updated version corresponding to the target microservice that are pre-set to obtain the target version corresponding to the target microservice; or,

[0052] If the traffic allocation policy is the request header allocation policy, determine the target version corresponding to the target microservice based on the target parameter value in the request header of the application request; or,

[0053] If the traffic allocation policy is the cookie allocation policy, determine the target version corresponding to the target microservice based on the cookie in the application request.

[0054] In one embodiment, the processor executes to obtain the target version corresponding to the target microservice by using the first weight of the target microservice of the updated version corresponding to the preset target microservice and the second weight of the target microservice of the non-updated version corresponding to the target microservice, and is specifically configured as follows:

[0055] Based on the first weight, obtain the first target request count; and obtain the second target request count according to the second weight; wherein, the first target request count is the maximum request count of the target microservice of the updated version in the specified request count, and the second target request count is the maximum request count of the target microservice of the non-updated version in the specified request count, and the specified request count is the sum of the first target request count and the second target request count; and,

[0056] Obtain the current usage count of the target microservice of the updated version and the current usage count of the target microservice of the non-updated version;

[0057] Determine the target version corresponding to the target microservice according to the current usage count of the target microservice of the updated version, the current usage count of the target microservice of the non-updated version, the first target request count, and the second target request count.

[0058] In one embodiment, the processor executes to obtain the first target request count based on the first weight, and is specifically configured as follows:

[0059] Multiply the first weight by the specified request count to obtain the first target request count;

[0060] The processor executes to obtain the second target request count according to the second weight, and is specifically configured as follows:

[0061] Multiply the second weight by the second target request count to obtain the second target request count.

[0062] In one embodiment, the processor executes to determine the target version corresponding to the target microservice according to the current usage count of the target microservice of the updated version, the current usage count of the target microservice of the non-updated version, the first target request count, and the second target request count, and is specifically configured as follows:

[0063] If the current usage times of the target microservice of the updated version are less than the first target request times, and the current usage times of the target microservice of the non-updated version are less than the second target request times, then determine that the target version is the updated version or the non-updated version; or,

[0064] If the current usage times of the target microservice of the updated version are less than the first target request times, and the current usage times of the target microservice of the non-updated version are not less than the second target request times, then determine that the target version is the updated version; or,

[0065] If the current usage times of the target microservice of the updated version are not less than the first target request times, and the current usage times of the target microservice of the non-updated version are less than the second target request times, then determine that the target version is the non-updated version.

[0066] In one embodiment, the processor is further configured to:

[0067] Before determining the target version corresponding to the target microservice according to the current usage times of the target microservice of the updated version, the current usage times of the target microservice of the non-updated version, the first target request times, and the second target request times, determine that the total number of received application requests does not exceed the specified request times.

[0068] In one embodiment, the processor is further configured to:

[0069] If it is determined that the total number of received application requests is greater than the specified request times, then reset the total number of application requests, the current usage times of the target microservice of the updated version, and the current usage times of the target microservice of the non-updated version.

[0070] In one embodiment, when the processor executes to determine the target version corresponding to the target microservice based on the target parameter value in the request header of the application request, it is specifically configured to:

[0071] If the target parameter value is the first specified parameter value, then determine that the target version is the updated version;

[0072] If the target parameter value is the second specified parameter value, then determine that the target version is the non-updated version.

[0073] In one embodiment, when the processor executes to determine the target version corresponding to the target microservice based on the cookie in the application request, it is specifically configured to:

[0074] If the parameter value corresponding to the specified field in the cookie is the third specified parameter value, determine that the target version is the updated version; or,

[0075] If the parameter value corresponding to the specified field in the cookie is the fourth specified parameter value, determine that the target version is the non-updated version.

[0076] According to a third aspect provided by the embodiments of the present disclosure, there is provided a computer storage medium storing a computer program for executing the method as described in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0077] To more clearly illustrate the technical solutions in the embodiments of the present disclosure, the following briefly introduces the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present disclosure, and those of ordinary skill in the art can also obtain other drawings based on these drawings without creative efforts.

[0078] Figure 1 FIG. is a schematic diagram of the update of the full-link application in the prior art according to an embodiment of the present disclosure;

[0079] Figure 2 FIG. is a schematic diagram of an applicable scenario according to an embodiment of the present disclosure;

[0080] Figure 3 FIG. is one of the schematic flowcharts of the method for updating a full-link application according to an embodiment of the present disclosure;

[0081] Figure 4 FIG. is a schematic diagram of the priorities of each microservice in an application according to an embodiment of the present disclosure;

[0082] Figure 5 FIG. is a schematic flowchart of determining the target version corresponding to the target microservice according to an embodiment of the present disclosure;

[0083] Figure 6 FIG. is a schematic diagram of the interface for setting weights according to an embodiment of the present disclosure;

[0084] Figure 7 FIG. is a schematic diagram of the interface for the target parameter value according to an embodiment of the present disclosure;

[0085] Figure 8 FIG. is a schematic diagram of the slave container of the microservice according to an embodiment of the present disclosure;

[0086] Figure 9 FIG. is a schematic diagram of the method for updating a full-link application according to an embodiment of the present disclosure;

[0087] Figure 10 Schematic diagram of an update device for a full-link application according to the present disclosure;

[0088] Figure 11 Schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure. Detailed implementation manners

[0089] To make the objectives, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure. Apparently, the described embodiments are only a part rather than all of the embodiments of the present disclosure. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present disclosure without creative efforts shall fall within the scope of protection of the present disclosure.

[0090] The term "and / or" in the embodiments of the present disclosure describes the association relationship of associated objects and indicates that three relationships may exist. For example, A and / or B may represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.

[0091] The application scenarios described in the embodiments of the present disclosure are used to more clearly illustrate the technical solutions of the embodiments of the present disclosure and do not constitute a limitation on the technical solutions provided by the embodiments of the present disclosure. As those of ordinary skill in the art know, with the emergence of new application scenarios, the technical solutions provided by the embodiments of the present disclosure are equally applicable to similar technical problems. Among them, in the description of the present disclosure, unless otherwise specified, the meaning of "a plurality" is two or more.

[0092] In the existing application update method, the old version of the application is stopped, and after replacing the software package of the new version, it is started. This not only causes the application to be unavailable during the release process, resulting in low efficiency of application update and reducing the user experience.

[0093] Therefore, the present disclosure provides an update method for a full-link application. For any microservice in any application that needs to be updated, a microservice of the corresponding updated version is started. After receiving an application request sent by a user, at least one target microservice corresponding to the application request is determined based on the application request. Then, according to the preset priorities of the target microservices, each target microservice is traversed in sequence. For any traversed target microservice, a target version corresponding to the target microservice is determined by using a pre-configured traffic allocation policy. The application request is sent to the target microservice of the target version to execute the operation corresponding to the target microservice. When it is determined that the target microservice of the target version has completed the corresponding operation, the step of traversing each target microservice according to the priorities of the target microservices is returned until the traversal of each target microservice is completed, and then the response to the application request is completed. Thus, in the embodiment of the present application, the corresponding service can be normally provided to the user during the application update process without having to stop the application first and wait until the update is completed before it can be used. Therefore, the efficiency of the application update is improved and the user experience is enhanced. Moreover, in the embodiment of the present application, the characteristics of each microservice of the updated version can also be verified during the update process to avoid production accidents and reduce the release risk. Next, the solution of the present disclosure will be introduced in detail with reference to the accompanying drawings.

[0094] As Figure 2 shown, an application scenario of an update method for a full-link application, which includes a server 220 and a terminal device 210 in this application scenario.

[0095] In a possible application scenario, for any microservice in any application that needs to be updated, the server 220 starts a microservice of the corresponding updated version; and after the server 220 receives an application request sent by a user, at least one target microservice corresponding to the application request is determined based on the application request. Then, the server 220 traverses each target microservice in sequence according to the preset priorities of the target microservices. For any traversed target microservice, a target version corresponding to the target microservice is determined by using a pre-configured traffic allocation policy, where the target version of any target microservice is an updated version or an un-updated version; and the application request is sent to the target microservice of the target version to execute the operation corresponding to the target microservice. Finally, when the server determines that the target microservice of the target version has completed the corresponding operation, the step of traversing each target microservice according to the priorities of the target microservices is returned until the traversal of each target microservice is completed, and then the response to the application request is completed, and the operation corresponding to the application request is displayed through the terminal device 210.

[0096] Among them, Figure 2Information interaction can be carried out between the server 220 and the terminal device 210 through a communication network. Among them, the communication method adopted by the communication network can be divided into a wireless communication method or a wired communication method.

[0097] Exemplarily, the server 220 can access the network through cellular mobile communication technology and communicate with the terminal device 210. Among them, the cellular mobile communication technology, for example, includes the fifth-generation mobile communication (5th Generation Mobile Networks, 5G) technology.

[0098] Optionally, the server 220 can access the network through a short-range wireless communication method and communicate with the terminal device 210 respectively. Among them, the short-range wireless communication method, for example, includes wireless fidelity (Wi-Fi) technology.

[0099] Among them, in the description of this application, only a single server 220 and a single terminal device 210 are described in detail. However, those skilled in the art should understand that the shown server 220 and terminal device 210 are intended to represent the operations of the server 220 and terminal device 210 involved in the technical solution of this application. It does not imply any limitation on the number, type, or location of the server 220 and terminal device 210. It should be noted that if additional modules are added to or individual modules are removed from the illustrated environment, the underlying concept of the exemplary embodiments of this application will not be changed.

[0100] It should be noted that the update method for the full-link application proposed in this application is not only applicable to Figure 2 the application scenarios shown, but also applicable to any update device for full-link applications.

[0101] Next, in combination with the above-described application scenarios, the update method for the full-link application in the exemplary embodiments of this application will be described with reference to the accompanying drawings. It should be noted that the above application scenarios are only shown for the convenience of understanding the method and principle of this application, and the embodiments of this application are not limited in this regard.

[0102] As Figure 3 shown, it is a schematic flowchart of the update method for the full-link application of the present disclosure, which may include the following steps:

[0103] Step 301: For any microservice in any application that needs to be updated, start the microservice corresponding to the updated version of the microservice;

[0104] The application in the embodiments of the present application is a full-link application, and the full-link application in the embodiments of the present application is an application including multiple microservices. Each updated version of each microservice in the application in the embodiments of the present application has a corresponding container, and the container is started. The container is labeled with a corresponding label to indicate that the version of the microservice corresponding to the container is the updated version.

[0105] Step 302: When an application request sent by a user is received, based on the application request, determine at least one target microservice corresponding to the application request;

[0106] In one embodiment, use the pre-set corresponding relationship between the application request and the microservice to determine the target microservice corresponding to the application request sent by the user. Among them, the corresponding relationship between the application request and the microservice is shown in Table 1:

[0107] Application Request Microservice Application Request 1 Microservice a, Microservice b… Application Request 2 Microservice m, Microservice n… … …

[0108] Table 1

[0109] Step 303: Traverse each of the target microservices in sequence according to the preset priorities of the target microservices;

[0110] As Figure 4 shown, it is a schematic diagram of the priorities of each microservice in the application. It can be seen from Figure 4 that the priorities of each microservice in Application A are: microservice a > microservice b > microservice c > microservice d > microservice m > microservice n.

[0111] Step 304: For any traversed target microservice, use the pre-configured traffic allocation policy to determine the target version corresponding to the target microservice, where the target version of any target microservice is an updated version or an un-updated version;

[0112] The traffic allocation policy in the embodiments of the present application includes a weight allocation policy, a request header allocation policy, and a cookie allocation policy.

[0113] In one embodiment, step 304 can be specifically implemented in one of the following three ways:

[0114] Way 1: If the traffic allocation policy is the weight allocation policy, use the first weight of the target microservice corresponding to the updated version of the target microservice and the second weight of the target microservice corresponding to the un-updated version of the target microservice that are pre-set to obtain the target version corresponding to the target microservice.

[0115] As Figure 5 shown, it is a schematic flowchart of determining the target version corresponding to the target microservice in the embodiments of the present application, which may include the following steps:

[0116] Step 501: Obtain a first target request count based on the first weight; and obtain a second target request count according to the second weight; wherein, the first target request count is the maximum request count of the target microservice of the updated version within the specified request count, and the second target request count is the maximum request count of the target microservice of the non-updated version within the specified request count, and the specified request count is the sum of the first target request count and the second target request count, and the sum of the first weight and the second weight is a fixed value;

[0117] It should be noted that: The first weight and the second weight in the embodiments of the present application can be set according to actual needs. For example, when the microservice of the updated version is just launched, the first weight can be set to be less than the second weight. Then, as time goes by, the value of the first weight can be increased, and the value of the second weight can be decreased. Finally, when the microservice of the updated version can be launched, the first weight can be set to 1 and the second weight can be set to 0. As Figure 6 shown, it is a schematic diagram of the interface for setting weights. As can be seen from Figure 6 this, the staff can set the first weight of the microservice of the updated version. Since the sum of the first weight and the second weight is 1, after the first weight is set, the second weight is also known.

[0118] In one embodiment, step 501 can be specifically implemented as: Multiply the first weight by the specified request count to obtain the first target request count. Multiply the second weight by the second target request count to obtain the second target request count.

[0119] The specified request count in the embodiments of the present application is pre-set, but the embodiments of the present application do not limit the specified request count, and the specified count in the embodiments of the present application can be set according to the actual situation.

[0120] Step 502: Obtain the current usage count of the target microservice of the updated version and the current usage count of the target microservice of the non-updated version;

[0121] Step 503: Determine the target version corresponding to the target microservice according to the current usage count of the target microservice of the updated version, the current usage count of the target microservice of the non-updated version, the first target request count, and the second target request count.

[0122] In one embodiment, step 503 can be specifically implemented in the following three ways:

[0123] 1. If the current usage times of the target microservice of the updated version is less than the first target request times, and the current usage times of the target microservice of the non-updated version is less than the second target request times, then determine that the target version is the updated version or the non-updated version.

[0124] In the case of Method 1 in the embodiments of the present application, the application requests can be randomly assigned to the versions of the target microservice.

[0125] 2. If the current usage times of the target microservice of the updated version is less than the first target request times, and the current usage times of the target microservice of the non-updated version is not less than the second target request times, then determine that the target version is the updated version.

[0126] 3. If the current usage times of the target microservice of the updated version is not less than the first target request times, and the current usage times of the target microservice of the non-updated version is less than the second target request times, then determine that the target version is the non-updated version.

[0127] In one embodiment, before executing step 503, determine that the total number of received application requests is not greater than the specified request times.

[0128] To ensure the accuracy rate of the full-link application update, in one embodiment, if it is determined that the total number of received application requests is greater than the specified request times, then reset the total number of application requests, the current usage times of the target microservice of the updated version, and the current usage times of the target microservice of the non-updated version.

[0129] That is, set the total number of application requests, the current usage times of the target microservice of the updated version, and the current usage times of the target microservice of the non-updated version to 0.

[0130] Method 2: If the traffic allocation policy is the request header allocation policy, then determine the target version corresponding to the target microservice based on the target parameter value in the request header of the application request.

[0131] In one embodiment, Method 2 can be specifically implemented as: if the target parameter value is the first specified parameter value, then determine that the target version is the updated version; if the target parameter value is the second specified parameter value, then determine that the target version is the non-updated version.

[0132] The target parameter value in the embodiments of the present application can be a tocken value, an IP address, etc., and can be specifically set according to the actual situation, and the embodiments of the present application do not limit this here.

[0133] It should be noted that the first specified parameter value and the second specified parameter value in the embodiments of the present application can be set according to the actual situation, and the embodiments of the present application do not limit the specific values of the first specified parameter value and the second specified parameter value herein. For example, Figure 7 as shown, Figure 7 taking the target parameter value as the tocken value in Figure 7 as an example for illustration, the first specified parameter value and the second specified parameter value corresponding to the tocken value can be set in

[0134] Method 3: If the traffic allocation policy is the cookie allocation policy, then based on the cookie in the application request, determine the target version corresponding to the target microservice.

[0135] In one embodiment, Method 3 can be specifically implemented as: If the parameter value corresponding to the specified field in the cookie is the third specified parameter value, then determine that the target version is the updated version; or if the parameter value corresponding to the specified field in the cookie is the fourth specified parameter value, then determine that the target version is the non-updated version.

[0136] The specified fields in the embodiments of the present application include fields such as tocken, userid, username, and departmentcode, etc., which can be specifically set according to the actual situation, and the embodiments of the present application do not limit them herein, and the third specified parameter value and the fourth specified parameter value in the embodiments of the present application can also be set according to the actual situation, and the embodiments of the present application do not limit the specific values of the third specified parameter value and the fourth specified parameter value herein.

[0137] It should be noted that: Regarding which traffic allocation policy among the three methods described above is specifically used, the priorities of each traffic allocation policy can be set. For example, the priorities of each traffic allocation policy can be the request header allocation policy > the cookie allocation policy > the weight allocation policy. However, the priorities of each traffic allocation policy in the embodiments of the present application can be set according to the actual situation, and the embodiments of the present application do not set the priorities of the traffic allocation policies herein.

[0138] Step 305: Send the application request to the target microservice of the target version to execute the operation corresponding to the target microservice;

[0139] Step 306: When it is determined that the target microservice of the target version has completed the corresponding operation, determine whether the traversal of each target microservice is completed. If so, execute Step 307; if not, return to execute Step 303;

[0140] Step 307: Complete the response to the application request.

[0141] As Figure 8 shown, when each microservice starts, an additional slave container proxy will be started, that is, the proxy of microservice A and microservice B in Figure 8 . The slave container of each microservice is built into the system and is used to specifically handle the reception and sending of application requests of this microservice. The interaction between each microservice is carried out through the proxies of the two microservices. In this way, the microservice can focus only on the processing of business logic without having to care about where its next request is sent.

[0142] As Figure 9 described, it is a schematic flowchart of the update method for the full-link application in the embodiment of the present application. As can be seen from Figure 9 , each microservice in the embodiment of the present application has two corresponding versions. When a user sends an application request through a terminal device, the gateway distributes each application request to the corresponding version based on the traffic distribution policy. V1 and V2 of each microservice in the figure represent the two versions of this microservice.

[0143] Based on the same general inventive concept, the above-described update method for the full-link application of the present disclosure can also be implemented by an update device for the full-link application. The effect of the update device for the full-link application is similar to the effect of the foregoing method and will not be elaborated herein.

[0144] Figure 10 It is a schematic structural diagram of an update device for a full-link application according to an embodiment of the present disclosure.

[0145] As Figure 10 shown, the update device 1000 for the full-link application of the present disclosure may include a start module 1010, a target microservice determination module 1020, a traversal module 1030, a microservice version determination module 1040, an execution microservice module 1050, and a sending module 1060.

[0146] The start module 1010 is configured to start a microservice of the updated version corresponding to the microservice for any microservice in any application that needs to be updated;

[0147] The target microservice determination module 1020 is configured to, when receiving an application request sent by a user, determine at least one target microservice corresponding to the application request based on the application request;

[0148] The traversal module 1030 is configured to sequentially traverse each of the target microservices according to the preset priorities of the target microservices;

[0149] The microservice version determination module 1040 is used to determine the target version corresponding to any traversed target microservice by using the pre-configured traffic allocation policy, where the target version of any target microservice is an updated version or an un-updated version; and,

[0150] The microservice execution module 1050 is used to send the application request to the target microservice of the target version to execute the operation corresponding to the target microservice;

[0151] The sending module 1060 is used to, when it is determined that the target microservice of the target version has completed the corresponding operation, return to the step of traversing each target microservice according to the priorities of the target microservices, and when the traversal of each target microservice is completed, the response to the application request is completed.

[0152] In one embodiment, the traffic allocation policy includes a weight allocation policy, a request header allocation policy, and a cookie allocation policy;

[0153] The microservice version determination module 1040 is specifically used for:

[0154] If the traffic allocation policy is the weight allocation policy, the first weight of the target microservice corresponding to the updated version of the target microservice and the second weight of the target microservice corresponding to the un-updated version of the target microservice that are pre-set are used to obtain the target version corresponding to the target microservice; or,

[0155] If the traffic allocation policy is the request header allocation policy, the target version corresponding to the target microservice is determined based on the target parameter value in the request header of the application request; or,

[0156] If the traffic allocation policy is the cookie allocation policy, the target version corresponding to the target microservice is determined based on the cookie in the application request.

[0157] In one embodiment, when the microservice version determination module 1040 executes the operation of using the first weight of the target microservice corresponding to the updated version of the target microservice and the second weight of the target microservice corresponding to the un-updated version of the target microservice that are pre-set to obtain the target version corresponding to the target microservice, it is specifically used for:

[0158] Based on the first weight, obtain the first target request count; and obtain the second target request count according to the second weight; wherein, the first target request count is the maximum request count of the target microservice of the updated version within the specified request count, and the second target request count is the maximum request count of the target microservice of the non-updated version within the specified request count, and the specified request count is the sum of the first target request count and the second target request count, and the sum of the first weight and the second weight is a fixed value; and,

[0159] Obtain the current usage count of the target microservice of the updated version and the current usage count of the target microservice of the non-updated version;

[0160] Determine the target version corresponding to the target microservice according to the current usage count of the target microservice of the updated version, the current usage count of the target microservice of the non-updated version, the first target request count, and the second target request count.

[0161] In one embodiment, the microservice version determination module 1040 executes obtaining the first target request count based on the first weight, and specifically is used for:

[0162] Multiply the first weight by the specified request count to obtain the first target request count;

[0163] The microservice version determination module 1040 executes obtaining the second target request count according to the second weight, and specifically is used for:

[0164] Multiply the second weight by the second target request count to obtain the second target request count.

[0165] In one embodiment, the microservice version determination module 1040 is further used for:

[0166] If the current usage count of the target microservice of the updated version is less than the first target request count, and the current usage count of the target microservice of the non-updated version is less than the second target request count, then determine that the target version is the updated version or the non-updated version; or,

[0167] If the current usage count of the target microservice of the updated version is less than the first target request count, and the current usage count of the target microservice of the non-updated version is not less than the second target request count, then determine that the target version is the updated version; or,

[0168] If the current usage times of the target microservice of the updated version is not less than the first target request times, and the current usage times of the target microservice of the non-updated version is less than the second target request times, then determine that the target version is the non-updated version.

[0169] In one embodiment, the apparatus further includes:

[0170] A determination module 1070, configured to determine that the total number of received application requests does not exceed the specified request times before determining the target version corresponding to the target microservice according to the current usage times of the target microservice of the updated version, the current usage times of the target microservice of the non-updated version, the first target request times, and the second target request times.

[0171] In one embodiment, the apparatus further includes:

[0172] A reset module 1080, configured to reset the total number of received application requests, the current usage times of the target microservice of the updated version, and the current usage times of the target microservice of the non-updated version if it is determined that the total number of received application requests exceeds the specified request times.

[0173] In one embodiment, the microservice version determination module 1040 executes to determine the target version corresponding to the target microservice based on the target parameter value in the request header of the application request, specifically:

[0174] If the target parameter value is the first specified parameter value, then determine that the target version is the updated version;

[0175] If the target parameter value is the second specified parameter value, then determine that the target version is the non-updated version.

[0176] In one embodiment, the microservice version determination module 1040 executes to determine the target version corresponding to the target microservice based on the target parameter value in the request header of the application request, specifically:

[0177] If the parameter value corresponding to the specified field in the cookie is the third specified parameter value, then determine that the target version is the updated version; or,

[0178] If the parameter value corresponding to the specified field in the cookie is the fourth specified parameter value, then determine that the target version is the non-updated version.

[0179] After introducing an update method and apparatus for a full-link application according to an exemplary embodiment of the present disclosure, next, an electronic device according to another exemplary embodiment of the present disclosure is introduced.

[0180] Those skilled in the art can understand that various aspects of the present disclosure can be implemented as a system, a method, or a program product. Therefore, various aspects of the present disclosure can be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software aspects, which can be collectively referred to as "circuits", "modules", or "systems" here.

[0181] In some possible implementation manners, an electronic device according to the present disclosure may at least include at least one processor and at least one computer storage medium. Among them, the computer storage medium stores program codes, and when the program codes are executed by the processor, the processor executes the steps in the update method of the full-link application according to various exemplary implementation manners of the present disclosure described above in this specification. For example, the processor may execute steps 301-306 as shown in Figure 3 the figure.

[0182] Next, refer to Figure 11 to describe the electronic device 1100 according to this implementation manner of the present disclosure. Figure 11 The shown electronic device 1100 is only an example and should not impose any limitation on the functions and usage scopes of the embodiments of the present disclosure.

[0183] As Figure 11 shown, the electronic device 1100 is presented in the form of a general electronic device. The components of the electronic device 1100 may include but are not limited to: the above-mentioned at least one processor 1101, the above-mentioned at least one computer storage medium 1102, and a bus 1103 connecting different system components (including the computer storage medium 1102 and the processor 1101).

[0184] The bus 1103 represents one or more of several types of bus structures, including a computer storage medium bus or a computer storage medium controller, a peripheral bus, a processor, or a local bus using any bus structure in a variety of bus structures.

[0185] The computer storage medium 1102 may include a readable medium in the form of a volatile computer storage medium, such as a random access computer storage medium (RAM) 1121 and / or a cache storage medium 1122, and may further include a read-only computer storage medium (ROM) 1123.

[0186] The computer storage medium 1102 may also include a program / utilities 1125 having a set (at least one) of program modules 1124. Such program modules 1124 include, but are not limited to: an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment.

[0187] The electronic device 1100 may also communicate with one or more external devices 1104 (such as a keyboard, a pointing device, etc.), and may also communicate with one or more devices that enable a user to interact with the electronic device 1100, and / or communicate with any device that enables the electronic device 1100 to communicate with one or more other electronic devices (such as a router, a modem, etc.). Such communication may be performed through the input / output (I / O) interface 1105. Also, the electronic device 1100 may communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through the network adapter 1106. As shown in the figure, the network adapter 1106 communicates with other modules for the electronic device 1100 through the bus 1103. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1100, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0188] In some possible implementation manners, various aspects of an update method for a full-link application provided by the present disclosure may also be implemented in the form of a program product, which includes program code. When the program product runs on a computer device, the program code is used to cause the computer device to execute the steps in the update method for the full-link application according to various exemplary implementation manners of the present disclosure described above in this specification.

[0189] The program product may adopt any combination of one or more readable media. The readable media may be a readable signal medium or a readable storage medium. The readable storage medium may, for example, be but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access computer storage medium (RAM), a read-only computer storage medium (ROM), an erasable programmable read-only computer storage medium (EPROM or flash memory), an optical fiber, a portable compact disk read-only computer storage medium (CD-ROM), an optical computer storage medium, a magnetic computer storage medium, or any suitable combination of the above.

[0190] The updated program product of the full-link application according to the embodiments of the present disclosure may be embodied on a portable compact disc read-only computer storage medium (CD-ROM) and include program code, and may be run on an electronic device. However, the program product of the present disclosure is not limited thereto. In this document, a readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0191] A readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which the readable program code is carried. Such a propagated data signal may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium other than a readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0192] The program code contained on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0193] The program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and also including conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on the user's electronic device, partially on the user's device, executed as a stand-alone software package, partially on the user's electronic device and partially on a remote electronic device, or entirely on a remote electronic device or server. In the case of a remote electronic device, the remote electronic device may be connected to the user's electronic device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external electronic device (e.g., through the Internet using an Internet service provider).

[0194] It should be noted that although several modules of the apparatus are mentioned in the above detailed description, such a division is merely exemplary and not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more of the above-described modules may be embodied in one module. Conversely, the features and functions of one module described above may be further divided and embodied by a plurality of modules.

[0195] In addition, although the operations of the methods of the present disclosure are depicted in the figures in a particular order, this is not a requirement or implication that the operations must be performed in that particular order, or that all of the illustrated operations must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step and performed, and / or one step may be broken down into multiple steps and performed.

[0196] Those skilled in the art will appreciate that embodiments of the present disclosure may be provided as a method, system, or computer program product. Accordingly, the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, magnetic computer storage media, CD-ROM, optical computer storage media, etc.) that contain computer-usable program code.

[0197] The present disclosure is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to the present disclosure. It should be understood that each flow and / or block in the flowchart illustrations and / or block diagrams, and combinations of flows and / or blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to the processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that the instructions executed by the processor of the computer or other programmable data processing device create means for implementing the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or combinations of blocks.

[0198] These computer program instructions may also be stored in a computer-readable computer storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable computer storage medium produce a manufacture including instruction means that implement the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or combinations of blocks.

[0199] These computer program instructions may also be loaded onto a computer or other programmable data processing device, such that a series of operational steps are performed on the computer or other programmable device to produce a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or combinations of blocks.

[0200] Obviously, those skilled in the art can make various changes and modifications to the present disclosure without departing from the spirit and scope of the present disclosure. Thus, if these modifications and variations of the present disclosure fall within the scope of the claims of the present disclosure and their equivalent technologies, the present disclosure is also intended to include these modifications and variations.

Claims

1. A method for updating a full-link application, characterized in that The method includes: For any microservice in any application that needs to be updated, start the microservice of the corresponding updated version of the microservice; When an application request sent by a user is received, based on the application request, determine at least one target microservice corresponding to the application request; Traverse each of the target microservices in sequence according to the preset priorities of the target microservices; For any traversed target microservice, use the pre-configured traffic allocation policy to determine the target version corresponding to the target microservice, where the target version of any target microservice is an updated version or an un-updated version; and, Send the application request to the target microservice of the target version to execute the operation corresponding to the target microservice; When it is determined that the target microservice of the target version has completed the corresponding operation, return to the step of traversing each of the target microservices according to the priorities of the target microservices until the traversal of each of the target microservices is completed, and then complete the response to the application request.

2. The method according to claim 1, characterized in that, The traffic allocation policy includes a weight allocation policy, a request header allocation policy, and a cookie allocation policy; The using the pre-configured traffic allocation policy to determine the target version corresponding to the target microservice includes: If the traffic allocation policy is the weight allocation policy, use the first weight of the target microservice of the updated version corresponding to the target microservice and the second weight of the target microservice of the un-updated version corresponding to the target microservice that are pre-set to obtain the target version corresponding to the target microservice; or, If the traffic allocation policy is the request header allocation policy, determine the target version corresponding to the target microservice based on the target parameter value in the request header of the application request; or, If the traffic allocation policy is the cookie allocation policy, determine the target version corresponding to the target microservice based on the cookie in the application request.

3. The method according to claim 2, wherein The using the first weight of the target microservice of the updated version corresponding to the target microservice and the second weight of the target microservice of the un-updated version corresponding to the target microservice that are pre-set to obtain the target version corresponding to the target microservice includes: Based on the first weight, obtain the first target request number; and obtain the second target request number according to the second weight; where the first target request number is the maximum request number of the target microservice of the updated version in the specified number of requests, and the second target request number is the maximum request number of the target microservice of the un-updated version in the specified number of requests, and the specified number of requests is the sum of the first target request number and the second target request number, and the sum of the first weight and the second weight is a fixed value; and, Obtain the current usage times of the target microservice of the updated version and the current usage times of the target microservice of the un-updated version; Determine a target version corresponding to the target microservice according to the current usage times of the target microservice of the updated version, the current usage times of the target microservice of the unupdated version, the first target request times, and the second target request times.

4. The method according to claim 3, wherein The obtaining of the first target request times based on the first weight includes: Multiplying the first weight by the specified request times to obtain the first target request times; The obtaining of the second target request times according to the second weight includes: Multiplying the second weight by the second target request times to obtain the second target request times.

5. The method according to claim 3, characterized in that, The determining of the target version corresponding to the target microservice according to the current usage times of the target microservice of the updated version, the current usage times of the target microservice of the unupdated version, the first target request times, and the second target request times includes: If the current usage times of the target microservice of the updated version is less than the first target request times, and the current usage times of the target microservice of the unupdated version is less than the second target request times, then determine that the target version is the updated version or the unupdated version; or, If the current usage times of the target microservice of the updated version is less than the first target request times, and the current usage times of the target microservice of the unupdated version is not less than the second target request times, then determine that the target version is the updated version; or, If the current usage times of the target microservice of the updated version is not less than the first target request times, and the current usage times of the target microservice of the unupdated version is less than the second target request times, then determine that the target version is the unupdated version.

6. The method according to claim 3, characterized in that Before the determining of the target version corresponding to the target microservice according to the current usage times of the target microservice of the updated version, the current usage times of the target microservice of the unupdated version, the first target request times, and the second target request times, the method further includes: Determine that the total number of received application requests is not greater than the specified request times.

7. The method according to claim 6, wherein The method further includes: If it is determined that the total number of received application requests is greater than the specified request times, then reset the total number of application requests, the current usage times of the target microservice of the updated version, and the current usage times of the target microservice of the unupdated version.

8. The method according to claim 2, wherein The determining of the target version corresponding to the target microservice based on the target parameter value in the request header of the application request includes: If the target parameter value is the first specified parameter value, then determine that the target version is the updated version; If the target parameter value is the second specified parameter value, then determine that the target version is the unupdated version.

9. The method according to claim 2, characterized in that The determining of the target version corresponding to the target microservice based on the cookie in the application request includes: If the parameter value corresponding to the specified field in the cookie is the third specified parameter value, then determine that the target version is the updated version; or, If the parameter value corresponding to the specified field in the cookie is the fourth specified parameter value, determine that the target version is the unupdated version.

10. An electronic device, characterized in that, It includes a processor and a memory, and the processor and the memory are connected by a bus; The memory stores a computer program, and the processor is configured to perform the following operations based on the computer program: For any microservice in any application that needs to be updated, start the microservice of the updated version corresponding to the microservice; When an application request sent by the user is received, based on the application request, determine at least one target microservice corresponding to the application request; Traverse each of the target microservices in sequence according to the preset priorities of the target microservices; For any traversed target microservice, use the pre-configured traffic allocation strategy to determine the target version corresponding to the target microservice, where the target version of any target microservice is an updated version or an unupdated version; and Send the application request to the target microservice of the target version to execute the operation corresponding to the target microservice; When it is determined that the target microservice of the target version has completed the corresponding operation, return to the step of traversing each of the target microservices according to the priorities of the target microservices until the traversal of each of the target microservices is completed, then complete the response to the application request.