Method for realizing smooth upgrade of application version
By implementing a traffic shunt strategy on load balancing devices, and gradually diversion of new and old versions is solved, the problem that traditional application version update methods cannot adapt to in the fast iteration of the Internet industry, smooth upgrades and rapid rollbacks of the application version are achieved, and time-consuming and labor-consuming version switching is reduced.
Patent Information
- Application Number
- CN202411771748.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-03-28
AI Technical Summary
The traditional application version update method cannot adapt to the fast iteration of the Internet industry, resulting in major defects or poor user feedback during the version upgrade process, and frequent version switching is required, which leads to time-consuming and labor-consuming.
By implementing a traffic shunt policy on load balancing devices, some users' traffic is routed to the new version of the application, and the other part is still routed to the old version of the application, and the new and old versions are gradually diverted until the new version of the application is defective and accepted by the user.
It realizes smooth upgrade of the application version, avoids downtime caused by version rollback, allows small-scale user testing of the new version, and switches when encountering problems, reducing the time and effort of version switching.
Smart Images

Figure CN119718371A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of application version upgrade, and in particular to a method for implementing smooth application version upgrade. Background Art
[0002] With the continuous development of society, various applications in various industries are constantly being developed and used. In order to achieve the following purposes, the same application is also constantly updating its version: (1) Improving security: Software updates usually include security patches to fix known security vulnerabilities and prevent hacker attacks and data leaks. Regular updates can enhance the security of the system and prevent malicious attacks or data leaks; (2) Fixing vulnerabilities and errors: During use, various errors and vulnerabilities may appear in the software. Updates can fix these problems and ensure the stability and reliability of the software; (3) Adding new functions and improving existing functions: Software developers will continuously add new functions and improve existing functions based on user needs and technological advances. Updates allow users to experience the latest functions and improve user experience and satisfaction; (4) Improving performance: Updates can optimize the code, improve operating efficiency, reduce resource consumption, and thus improve the overall performance of the software. For example, updated software may have faster loading speeds, lower memory usage, and higher response speeds; (5) Coping with hardware upgrades: As hardware continues to upgrade, software also needs to adapt to ensure compatibility with the latest technologies and hardware devices, thereby improving user experience; (6) Market competition pressure: In order to remain competitive, software developers need to continuously launch new features or improve existing features to meet user needs and respond to new features of competitors; (7) User experience optimization: Updates may optimize interface style, interaction methods, etc., to provide a better user experience and make user use more convenient and comfortable.
[0003] The traditional way to update an application version is to directly stop the old version of the application and start the new version of the application. At this time, all users can use all the functions of the new version of the application. When there are major defects in the system or users give poor feedback on the new version of the application, the application needs to be switched to the old version as soon as possible. In this case, the new version of the application needs to be stopped and the old version of the application needs to be restored. When the database of the new and old versions is incompatible, the operation and maintenance team needs to process the data, and the entire recovery process is even more time-consuming.
[0004] With the rapid development of the Internet industry, the frequency of application releases has increased from once a month to once a day or even multiple times a day. The original application release model can no longer adapt to the rapid iteration and upgrade of applications today. Summary of the invention
[0005] The present invention provides a method for realizing smooth upgrade of application version to achieve the purpose of smoother application version upgrade.
[0006] To achieve the above object, the technical solution of the present invention is to provide a method for realizing smooth upgrade of application version, and its innovation lies in that it specifically comprises the following steps:
[0007] S1. Traffic diversion: When launching a new version of an application, formulate a traffic diversion strategy for application users, and route the traffic of some users to the new version of the application through the load balancing device, while the traffic of the remaining users is still routed to the old version of the application;
[0008] S2. Deactivate the new version of the application: If the user acceptance of the new version of the application is not high or the new version of the application has defects, all users will be switched to the old version of the application, the new version of the application will be deactivated, and the new version will be improved. After the improvement, steps S1 and S2 will be repeated to separate the use of the new and old versions;
[0009] S3. Deactivate the old version of the application: When the new version of the application is improved to have no defects and users can accept the new version of the application, all users will be switched to the new version of the application, and the old version of the application will be deactivated to complete the smooth upgrade of the application version.
[0010] Furthermore, the user traffic diversion strategy applied in step S1 is to divert traffic according to the client IP, and the specific diversion process is as follows:
[0011] S11. First, get the client IP address. The HTTP protocol is based on TCP:
[0012] a. If the X-Forwarded-For field does not exist in the HTTP request header, the server can obtain the remote IP of TCP, that is, the client IP;
[0013] b. If the X-Forwarded-For field exists in the HTTP request Header, it means that the request is sent through a proxy, and the client's real IP address is obtained from the X-Forwarded-For field value;
[0014] S12. Arbitrarily set the IP that can be routed to the new version or the old version as the target IP, and perform exact matching, regular matching, IP segment matching, and geographic location matching based on the obtained client IP, so as to route the request traffic to different versions of the application;
[0015] a. Exact match: If the target IP is routed to the new version of the application, and the client IP is equal to the target IP, the traffic is routed to the new version of the application, otherwise the traffic is routed to the old version of the application; if the target IP is routed to the old version of the application, and the client IP is equal to the target IP, the traffic is routed to the old version of the application, otherwise the traffic is routed to the new version of the application;
[0016] b. Regular expression matching: If the target IP is routed to the new version of the application and the client IP matches the regular expression, the traffic is routed to the new version of the application, otherwise the traffic is routed to the old version of the application; if the target IP is routed to the old version of the application and the client IP matches the regular expression, the traffic is routed to the old version of the application, otherwise the traffic is routed to the new version of the application;
[0017] c. IP segment matching: If the target IP is routed to the new version of the application and the client IP is within the target IP segment, the traffic is routed to the new version of the application, otherwise the traffic is routed to the old version of the application; if the target IP is routed to the old version of the application and the client IP is within the target IP segment, the traffic is routed to the old version of the application, otherwise the traffic is routed to the new version of the application;
[0018] d. Geographic location matching: Prepare the GEOIP data file in advance, and use the IP segment matching logic in step c above to match the client IP with all IP segments in the GEOIP data file one by one. If the client IP is within the IP segment, take the geographic location of the IP segment, and finally determine whether the geographic location of the IP segment matches the target geographic location. If they match, route the traffic to the new version of the application or the old version of the application corresponding to the target IP, otherwise route the traffic to another version of the application.
[0019] Furthermore, in step b of S11, the format of the X-Forwarded-For header is: X-Forwarded-For: client1, proxy1, proxy2, where client1 is the real client IP, and proxy1 and proxy2 are the IPs of the proxy servers passed through the link.
[0020] Furthermore, the user traffic diversion strategy applied in step S1 is diversion according to HTTP Header, and the specific diversion process is:
[0021] S21. Define any Header field and assign a value to the field when the client sends an HTTP request;
[0022] S22. Arbitrarily set the Header field value that can be routed to the new version or the old version as the target value. The load balancing device reads the value of the Header field, performs exact matching and regular matching, and routes the request traffic to different versions of applications according to the matching results;
[0023] a. Exact match: If the target value is the corresponding route to the new version of the application, and the value of the Header field is equal to the target value, the traffic is routed to the new version of the application, otherwise the traffic is routed to the old version of the application; if the target value is the corresponding route to the old version of the application, and the value of the Header field is equal to the target value, the traffic is routed to the old version of the application, otherwise the traffic is routed to the new version of the application;
[0024] b. Regular match: If the target value is the corresponding route to the new version of the application, and the value of the Header field matches the target value, the traffic is routed to the new version of the application, otherwise the traffic is routed to the old version of the application; if the target value is the corresponding route to the old version of the application, if the value of the Header field matches the target value, the traffic is routed to the old version of the application, otherwise the traffic is routed to the new version of the application.
[0025] Furthermore, the user traffic diversion strategy applied in step S1 is diversion according to HTTP Cookie, and the specific diversion process is:
[0026] S31. Define any Cookie field, and assign a value to the field when the client sends an HTTP request;
[0027] S32. Arbitrarily set the Cook ie field value that can be routed to the new version or the old version as the target value. The load balancing device reads the value of the Cook ie field, performs exact matching and regular matching, and routes the request traffic to different versions of applications according to the matching results;
[0028] a. Exact match: If the target value is the corresponding route to the new version of the application, and the value of the Cookie field is equal to the target value, the traffic is routed to the new version of the application, otherwise the traffic is routed to the old version of the application; if the target value is the corresponding route to the old version of the application, and the value of the Cookie field is equal to the target value, the traffic is routed to the old version of the application, otherwise the traffic is routed to the new version of the application;
[0029] b. Regular match: If the target value is the corresponding route to the new version of the application, and the value of the Cookie field matches the target value, the traffic is routed to the new version of the application, otherwise the traffic is routed to the old version of the application; if the target value is the corresponding route to the old version of the application, if the value of the Cookie field matches the target value, the traffic is routed to the old version of the application, otherwise the traffic is routed to the new version of the application.
[0030] Furthermore, the user traffic diversion strategy applied in step S1 is diversion according to HTTP Query parameters, and the specific diversion process is:
[0031] S41. Define any Query field in the Query part of the HTTP URL, and assign a value to the field when the client sends an HTTP request;
[0032] S42. Arbitrarily set the Query field value that can be routed to the new version or the old version as the target value. The load balancing device reads the value of the Query field, performs exact matching and regular matching, and routes the request traffic to different versions of the application according to the matching result;
[0033] a. Exact match: If the target value is the corresponding route to the new version of the application, and the value of the Query field is equal to the target value, the traffic is routed to the new version of the application, otherwise the traffic is routed to the old version of the application; if the target value is the corresponding route to the old version of the application, and the value of the Query field is equal to the target value, the traffic is routed to the old version of the application, otherwise the traffic is routed to the new version of the application;
[0034] b. Regular match: If the target value is the corresponding route to the new version of the application, and the value of the Query field matches the target value, the traffic is routed to the new version of the application, otherwise the traffic is routed to the old version of the application; if the target value is the corresponding route to the old version of the application, and the value of the Query field matches the target value, the traffic is routed to the old version of the application, otherwise the traffic is routed to the new version of the application.
[0035] Furthermore, the user traffic diversion strategy applied in step S1 is to divert traffic according to whether the user has permission to use the new version of the application. The specific diversion process is as follows:
[0036] S51. Set up an application portal for the new version of the application on the application's official website or other access channels, and the user fills out the application, which is approved by the system administrator. After approval, the user obtains the right to use the new version of the application;
[0037] S52. When a user accesses the system, it is determined whether the current user has permission to use the new version of the application. If the user has permission, the request traffic is routed to the new version of the application. Otherwise, the request flow is routed to the old version of the application.
[0038] Furthermore, other access channels in step S51 include customer service telephone or offline questionnaire survey.
[0039] Compared with the prior art, the present invention has the following beneficial effects:
[0040] A method for realizing smooth upgrade of application version of the present invention uses both old and new versions at the same time during the upgrade process, thereby avoiding the time-consuming and labor-intensive problem of using all new versions, which results in versions being difficult to use or having many defects and needing to be modified, and then switching all traffic to the old version of the application, thereby realizing small-scale user testing of the new version, and convenient and quick switching when the new version encounters problems, thereby reducing the downtime caused by version rollback. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 The present invention is a flow chart of a method for realizing smooth upgrade of application version. DETAILED DESCRIPTION
[0043] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0044] Example 1
[0045] This embodiment provides a method for implementing a smooth upgrade of an application version, and its specific structure is as follows: Figure 1 As shown, the specific steps include:
[0046] S1. Traffic diversion: When launching a new version of an application, formulate a traffic diversion strategy for application users, and route the traffic of some users to the new version of the application through the load balancing device, while the traffic of the remaining users is still routed to the old version of the application;
[0047] S2. Deactivate the new version of the application: If the user acceptance of the new version of the application is not high or the new version of the application has defects, all users will be switched to the old version of the application, the new version of the application will be deactivated, and the new version will be improved. After the improvement, steps S1 and S2 will be repeated to separate the use of the new and old versions;
[0048] S3. Deactivate the old version of the application: When the new version of the application is improved to have no defects and users can accept the new version of the application, all users will be switched to the new version of the application, and the old version of the application will be deactivated to complete the smooth upgrade of the application version.
[0049] Example 2
[0050] In this embodiment, based on the embodiment 1, the user traffic diversion strategy applied in step S1 is to divert traffic according to the client IP. The specific diversion process is as follows:
[0051] S11. First, obtain the client IP. The HTTP protocol is based on TCP. The remote IP address of the TCP connection can be obtained at the network layer:
[0052] a. If the X-Forwarded-For field does not exist in the HTTP request header, the server can obtain the remote IP of TCP, that is, the client IP;
[0053] b. If the X-Forwarded-For field exists in the HTTP request Header, it means that the request is sent through a proxy, and the client's real IP address is obtained from the X-Forwarded-For field value;
[0054] S12. Arbitrarily set the IP that can be routed to the new version or the old version as the target IP, and perform exact matching, regular matching, IP segment matching, and geographic location matching based on the obtained client IP, so as to route the request traffic to different versions of the application;
[0055] a. Exact match: If the target IP is routed to the new version of the application, and the client IP is equal to the target IP, the traffic is routed to the new version of the application, otherwise the traffic is routed to the old version of the application; if the target IP is routed to the old version of the application, and the client IP is equal to the target IP, the traffic is routed to the old version of the application, otherwise the traffic is routed to the new version of the application;
[0056] b. Regular expression matching: If the target IP is routed to the new version of the application and the client IP matches the regular expression, the traffic is routed to the new version of the application, otherwise the traffic is routed to the old version of the application; if the target IP is routed to the old version of the application and the client IP matches the regular expression, the traffic is routed to the old version of the application, otherwise the traffic is routed to the new version of the application;
[0057] c. IP segment matching: If the target IP is routed to the new version of the application and the client IP is within the target IP segment, the traffic is routed to the new version of the application, otherwise the traffic is routed to the old version of the application; if the target IP is routed to the old version of the application and the client IP is within the target IP segment, the traffic is routed to the old version of the application, otherwise the traffic is routed to the new version of the application;
[0058] d. Geographic location matching: Prepare the GEOIP data file in advance, and use the IP segment matching logic in step c above to match the client IP with all IP segments in the GEOIP data file one by one. If the client IP is within the IP segment, take the geographic location of the IP segment, and finally determine whether the geographic location of the IP segment matches the target geographic location. If they match, route the traffic to the new version of the application or the old version of the application corresponding to the target IP, otherwise route the traffic to another version of the application.
[0059] In step b of S11 of this embodiment, the format of the X-Forwarded-For header is: X-Forwarded-For: client1, proxy1, proxy2, where client1 is the real client IP, and proxy1 and proxy2 are the IPs of the proxy servers passed in the link. This situation usually occurs during the CDN back-to-source process.
[0060] When the exact match of this embodiment is specifically implemented, 100.0.0.2 is set as the target IP for routing to the new version. If the client IP is equal to the target IP, the new version is routed, otherwise the old version is routed.
[0061] When regular matching of this embodiment is specifically implemented, ^100.+$ is set as the target IP regular expression for routing to the new version. If the client IP matches the regular expression, it is routed to the new version, otherwise it is routed to the old version.
[0062] When the IP segment matching of this embodiment is specifically implemented, 100.0.0.0 / 8 is set as the target IP segment for routing to the new version. If the client IP is within the target IP segment, it is routed to the new version, otherwise it is routed to the old version.
[0063] When the geographic location matching of this embodiment is implemented, a province or city is set as the target address location for routing to the new version. The province or city in the GEOIP data file contains two IP segments 100.0.0.0 / 8 and 200.0.0.0 / 8. If the client IP is in one of the IP segments 100.0.0.0 / 8 and 200.0.0.0 / 8, it is routed to the new version, otherwise it is routed to the old version.
[0064] Example 3
[0065] In this embodiment, based on the embodiment 1, the user traffic diversion strategy applied in step S1 is diversion according to HTTP Header, and the specific diversion process is as follows:
[0066] S21. Define any Header field and assign a value to the field when the client sends an HTTP request;
[0067] S22. Arbitrarily set the Header field value that can be routed to the new version or the old version as the target value. The load balancing device reads the value of the Header field, performs exact matching and regular matching, and routes the request traffic to different versions of applications according to the matching results;
[0068] a. Exact match: If the target value is the corresponding route to the new version of the application, and the value of the Header field is equal to the target value, the traffic is routed to the new version of the application, otherwise the traffic is routed to the old version of the application; if the target value is the corresponding route to the old version of the application, and the value of the Header field is equal to the target value, the traffic is routed to the old version of the application, otherwise the traffic is routed to the new version of the application;
[0069] b. Regular match: If the target value is the corresponding route to the new version of the application, and the value of the Header field matches the target value, the traffic is routed to the new version of the application, otherwise the traffic is routed to the old version of the application; if the target value is the corresponding route to the old version of the application, if the value of the Header field matches the target value, the traffic is routed to the old version of the application, otherwise the traffic is routed to the new version of the application.
[0070] When the exact match of this embodiment is implemented, the Header field "_CANARY" is defined, and "1" is set as the target value for routing to the new version. When the client sends an HTTP request, if the field is assigned a value of "1", it will be routed to the new version, otherwise it will be routed to the old version.
[0071] When the regular expression matching of this embodiment is implemented, the Header field "_CANARY" is defined, and "^ca.*$" is set as the target value for routing to the new version. When the client sends an HTTP request, the field is assigned a value of "ca001". If it matches the target value, it is routed to the new version, otherwise it is routed to the old version.
[0072] Example 4
[0073] In this embodiment, based on the embodiment 1, the user traffic diversion strategy applied in step S1 is to divert traffic according to HTTP Cooki e, and the specific diversion process is as follows:
[0074] S31. Define any Cookie field, and assign a value to the field when the client sends an HTTP request;
[0075] S32. Arbitrarily set the Cook ie field value that can be routed to the new version or the old version as the target value. The load balancing device reads the value of the Cook ie field, performs exact matching and regular matching, and routes the request traffic to different versions of applications according to the matching results;
[0076] a. Exact match: If the target value is the corresponding route to the new version of the application, and the value of the Cookie field is equal to the target value, the traffic is routed to the new version of the application, otherwise the traffic is routed to the old version of the application; if the target value is the corresponding route to the old version of the application, and the value of the Cookie field is equal to the target value, the traffic is routed to the old version of the application, otherwise the traffic is routed to the new version of the application;
[0077] b. Regular match: If the target value is the corresponding route to the new version of the application, and the value of the Cookie field matches the target value, the traffic is routed to the new version of the application, otherwise the traffic is routed to the old version of the application; if the target value is the corresponding route to the old version of the application, if the value of the Cookie field matches the target value, the traffic is routed to the old version of the application, otherwise the traffic is routed to the new version of the application.
[0078] When the exact match of this embodiment is implemented, the Cookie field "_CANARY" is defined, and "1" is set as the target value for routing to the new version. When the client sends an HTTP request, if the field is assigned a value of "1", it will be routed to the new version, otherwise it will be routed to the old version.
[0079] When the regular matching of this embodiment is implemented, the Cookie field "_CANARY" is defined, and "^ca.*$" is set as the target value of the new version of the oil filter paper. When the client sends an HTTP request, the field is assigned a value of "ca001". If it matches the target value, it is routed to the new version, otherwise it is routed to the old version.
[0080] Example 5
[0081] In this embodiment, based on the embodiment 1, the user traffic diversion strategy applied in step S1 is to divert traffic according to HTTPQuery parameters. The specific diversion process is as follows:
[0082] S41. Define any Query field in the Query part of the HTTP URL, and assign a value to the field when the client sends an HTTP request;
[0083] S42. Arbitrarily set the Query field value that can be routed to the new version or the old version as the target value. The load balancing device reads the value of the Query field, performs exact matching and regular matching, and routes the request traffic to different versions of the application according to the matching result;
[0084] a. Exact match: If the target value is the corresponding route to the new version of the application, and the value of the Query field is equal to the target value, the traffic is routed to the new version of the application, otherwise the traffic is routed to the old version of the application; if the target value is the corresponding route to the old version of the application, and the value of the Query field is equal to the target value, the traffic is routed to the old version of the application, otherwise the traffic is routed to the new version of the application;
[0085] b. Regular match: If the target value is the corresponding route to the new version of the application, and the value of the Query field matches the target value, the traffic is routed to the new version of the application, otherwise the traffic is routed to the old version of the application; if the target value is the corresponding route to the old version of the application, and the value of the Query field matches the target value, the traffic is routed to the old version of the application, otherwise the traffic is routed to the new version of the application.
[0086] When the exact match of this embodiment is implemented, the Query field "_CANARY" is defined, and "1" is set as the target value for routing to the new version. When the client sends an HTTP request, the field is assigned a value of "1", and it is routed to the new version, otherwise it is routed to the old version.
[0087] When the regular matching of this embodiment is implemented, the Query field "_CANARY" is defined, and "^ca.*$" is set as the target value of the new version of the oil filter paper. When the client sends an HTTP request, the field is assigned a value of "ca001". If it matches the target value, it is routed to the new version, otherwise it is routed to the old version.
[0088] Example 6
[0089] In this embodiment, based on the embodiment 1, the user traffic diversion strategy applied in step S1 is to divert traffic according to whether the user has the permission to use the new version of the application. The specific diversion process is as follows:
[0090] S51. Set up an application portal for the new version of the application on the application's official website or other access channels, and the user fills out the application, which is approved by the system administrator. After approval, the user obtains the right to use the new version of the application;
[0091] S52. When a user accesses the system, it is determined whether the current user has permission to use the new version of the application. If the user has permission, the request traffic is routed to the new version of the application. Otherwise, the request flow is routed to the old version of the application.
[0092] Preferably, other access channels in step S51 of this embodiment include customer service telephone or offline questionnaire survey.
[0093] When this embodiment is implemented, in the initial state of the system, all users do not have the permission to use the new version of the application. At this time, when the user accesses the system, the system finds that the user does not have the permission to use the new version of the application, so it is routed to the old version. The user fills out the application for the use of the new version of the application through the application portal of the official website, and it is reviewed by the administrator. When the user accesses the system again, the system finds that the user has the permission to use the new version of the application, so it is routed to the new version.
[0094] The embodiments described above are merely descriptions of preferred implementation modes of the present invention, and are not intended to limit the concept and scope of the present invention. Without departing from the design concept of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary engineering technicians in the field should fall within the protection scope of the present invention. The technical contents for which protection is sought in the present invention have been fully recorded in the technical requirements.
Claims
1. A method for achieving smooth upgrade of application version, characterized by: The specific steps include: S1. Traffic diversion: When launching a new version of an application, formulate a traffic diversion strategy for application users, and route the traffic of some users to the new version of the application through the load balancing device, while the traffic of the remaining users is still routed to the old version of the application; S2. Deactivate the new version of the application: If the user acceptance of the new version of the application is not high or the new version of the application has defects, all users will be switched to the old version of the application, the new version of the application will be deactivated, and the new version will be improved. After the improvement, steps S1 and S2 will be repeated to separate the use of the new and old versions; S3. Deactivate the old version of the application: When the new version of the application is improved to have no defects and users can accept the new version of the application, all users will be switched to the new version of the application, and the old version of the application will be deactivated to complete the smooth upgrade of the application version.
2. A method for implementing a smooth upgrade of an application version according to claim 1, characterized in that: The user traffic diversion strategy applied in step S1 is to divert traffic based on the client IP. The specific diversion process is as follows: S11. First, get the client IP. The HTTP protocol is based on TCP: a. If the X-Forwarded-For field does not exist in the HTTP request header, the server can obtain the remote IP of TCP, that is, the client IP; b. If the X-Forwarded-For field exists in the HTTP request header, it means that the request is sent through a proxy, and the client's real IP address is obtained from the X-Forwarded-For field value; S12. Arbitrarily set the IP that can be routed to the new version or the old version as the target IP, and perform exact matching, regular matching, IP segment matching, and geographic location matching based on the obtained client IP, so as to route the request traffic to different versions of the application; a. Exact match: If the target IP is routed to the new version of the application, and the client IP is equal to the target IP, the traffic is routed to the new version of the application, otherwise the traffic is routed to the old version of the application; if the target IP is routed to the old version of the application, and the client IP is equal to the target IP, the traffic is routed to the old version of the application, otherwise the traffic is routed to the new version of the application; b. Regular expression matching: If the target IP is routed to the new version of the application and the client IP matches the regular expression, the traffic is routed to the new version of the application, otherwise the traffic is routed to the old version of the application; if the target IP is routed to the old version of the application and the client IP matches the regular expression, the traffic is routed to the old version of the application, otherwise the traffic is routed to the new version of the application; c. IP segment matching: If the target IP is routed to the new version of the application and the client IP is within the target IP segment, the traffic is routed to the new version of the application, otherwise the traffic is routed to the old version of the application; if the target IP is routed to the old version of the application and the client IP is within the target IP segment, the traffic is routed to the old version of the application, otherwise the traffic is routed to the new version of the application; d. Geographic location matching: Prepare the GEOIP data file in advance, and use the IP segment matching logic in step c above to match the client IP with all IP segments in the GEOIP data file one by one. If the client IP is within the IP segment, take the geographic location of the IP segment, and finally determine whether the geographic location of the IP segment matches the target geographic location. If they match, route the traffic to the new version of the application or the old version of the application corresponding to the target IP, otherwise route the traffic to another version of the application.
3. A method for implementing a smooth upgrade of an application version according to claim 2, characterized in that: In step b of S11, the format of the X-Forwarded-For header is: X-Forwarded-For:client1,proxy1,proxy2, where client1 is the real client IP, and proxy1 and proxy2 are the IPs of the proxy servers passed in the link.
4. A method for implementing a smooth upgrade of an application version according to claim 1, characterized in that: The user traffic diversion strategy applied in step S1 is to divert traffic according to HTTP Header. The specific diversion process is as follows: S21. Define any Header field and assign a value to the field when the client sends an HTTP request; S22. Arbitrarily set the Header field value that can be routed to the new version or the old version as the target value. The load balancing device reads the value of the Header field, performs exact matching and regular matching, and routes the request traffic to different versions of applications according to the matching results; a. Exact match: If the target value is the corresponding route to the new version of the application, and the value of the Header field is equal to the target value, the traffic is routed to the new version of the application, otherwise the traffic is routed to the old version of the application; if the target value is the corresponding route to the old version of the application, and the value of the Header field is equal to the target value, the traffic is routed to the old version of the application, otherwise the traffic is routed to the new version of the application; b. Regular match: If the target value is the corresponding route to the new version of the application, and the value of the Header field matches the target value, the traffic is routed to the new version of the application, otherwise the traffic is routed to the old version of the application; if the target value is the corresponding route to the old version of the application, if the value of the Header field matches the target value, the traffic is routed to the old version of the application, otherwise the traffic is routed to the new version of the application.
5. A method for implementing a smooth upgrade of an application version according to claim 1, characterized in that: The user traffic diversion strategy applied in step S1 is to divert traffic based on HTTP Cookie, and the specific diversion process is as follows: S31. Define any Cookie field and assign a value to the field when the client sends an HTTP request; S32. Arbitrarily set the Cookie field value that can be routed to the new version or the old version as the target value. The load balancing device reads the value of the Cookie field, performs exact matching and regular matching, and routes the request traffic to different versions of the application according to the matching result; a. Exact match: If the target value is the corresponding route to the new version of the application, and the value of the cookie field is equal to the target value, the traffic is routed to the new version of the application, otherwise the traffic is routed to the old version of the application; If the target value corresponds to the old version of the application, and the value of the Cookie field is equal to the target value, the traffic is routed to the old version of the application, otherwise the traffic is routed to the new version of the application; b. Regular match: If the target value is the corresponding route to the new version of the application, and the value of the Cookie field matches the target value, the traffic is routed to the new version of the application, otherwise the traffic is routed to the old version of the application; If the target value is corresponding to the route to the old version of the application, if the value of the Cookie field matches the target value, the traffic is routed to the old version of the application, otherwise the traffic is routed to the new version of the application.
6. A method for implementing a smooth upgrade of an application version according to claim 1, characterized in that: The user traffic diversion strategy applied in step S1 is to divert traffic according to HTTP Query parameters. The specific diversion process is as follows: S41. Define any Query field in the Query part of the HTTP URL, and assign a value to the field when the client sends an HTTP request; S42. Arbitrarily set the Query field value that can be routed to the new version or the old version as the target value. The load balancing device reads the value of the Query field, performs exact matching and regular matching, and routes the request traffic to different versions of the application according to the matching result; a. Exact match: If the target value is the corresponding route to the new version of the application, and the value of the Query field is equal to the target value, the traffic is routed to the new version of the application, otherwise the traffic is routed to the old version of the application; if the target value is the corresponding route to the old version of the application, and the value of the Query field is equal to the target value, the traffic is routed to the old version of the application, otherwise the traffic is routed to the new version of the application; b. Regular match: If the target value is the corresponding route to the new version of the application, and the value of the Query field matches the target value, the traffic is routed to the new version of the application, otherwise the traffic is routed to the old version of the application; if the target value is the corresponding route to the old version of the application, and the value of the Query field matches the target value, the traffic is routed to the old version of the application, otherwise the traffic is routed to the new version of the application.
7. A method for implementing a smooth upgrade of an application version according to claim 1, characterized in that: The user traffic diversion strategy applied in step S1 is to divert traffic according to whether the user has the permission to use the new version of the application. The specific diversion process is: S51. Set up an application portal for the new version of the application on the application's official website or other access channels, and the user fills out the application, which is approved by the system administrator. After approval, the user obtains the right to use the new version of the application; S52. When a user accesses the system, it is determined whether the current user has permission to use the new version of the application. If the user has permission, the request traffic is routed to the new version of the application. Otherwise, the request flow is routed to the old version of the application.
8. A method for implementing a smooth upgrade of an application version according to claim 7, characterized in that: Other access methods in step S51 include customer service telephone or offline questionnaire survey.