Flow switching method and device based on gateway platform, equipment and storage medium

By using the gateway platform-based traffic switching method in the financial business system, monitoring environmental parameters and switching traffic when the probability of failure exceeds the threshold, the login storm problem of the financial business system when switching to the grayscale environment is solved, and the system stability is improved .

CN119135608APending Publication Date: 2024-12-13CHINA PING AN PROPERTY INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411181739.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-26
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

When the financial business system switches to a grayscale environment, the user needs to log out of the system and log in again, resulting in a login storm and reducing the stability of the system.

Method used

Through the traffic switching method based on the gateway platform, the environmental parameters of the business system are monitored and the probability of failure is calculated. When the probability of failure exceeds the threshold, the traffic switching strategy is determined to divert traffic from the current environment to the backup environment to prevent users from logging in again.

Benefits of technology

It effectively avoids login storms, improves the stability of the financial business system, ensures that the system can switch smoothly when abnormalities occur, and reduces user influence.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119135608A_ABST
    Figure CN119135608A_ABST
Patent Text Reader

Abstract

The invention relates to the field of data processing, and provides a flow switching method based on a gateway platform, and the method comprises the steps: monitoring a current environment of a business system based on a flow monitoring graph, obtaining related parameters of the current environment, and calculating a fault probability of the business system in a preset time period based on the related parameters; when the fault probability exceeds a preset probability threshold, determining a flow switching strategy corresponding to the service system based on a system identifier of the service system and the fault probability; and based on a gateway traffic switching platform and the traffic switching strategy, shunting the traffic of the service system from the current environment to a standby environment. On the basis of the traffic switching strategy, part or all of the traffic in the current environment is forwarded to the standby environment, so that the current environment is prevented from being abnormal, a login storm caused by the fact that a user needs to exit the system and re-login in a concentrated manner is avoided, and the stability of a financial service system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of data processing and financial technology, and in particular to a traffic switching method, device, computer equipment and computer-readable storage medium based on a gateway platform. Background Art

[0002] For financial business systems, the user experience of the financial business system is an important indicator of whether a financial business system is perfect. Current financial business systems generally require two environments, production and grayscale, to ensure the stability of the financial business system. On version days or major event nodes, if the production environment is abnormal, it will be switched to the grayscale environment to deal with production environment abnormalities. However, most current financial business systems require users to log out of the system and log in again after switching to the grayscale environment. At the same time, logging out and logging in again will cause a login storm, thereby reducing the stability of the financial business system.

[0003] Therefore, how to avoid login storms caused by centralized logins to improve the stability of financial business systems has become a technical problem that needs to be solved urgently. Summary of the invention

[0004] The main purpose of the present invention is to provide a traffic switching method, device, equipment and computer-readable storage medium based on a gateway platform, aiming to avoid login storms caused by centralized logins to improve the technical problem of the stability of the financial business system.

[0005] To achieve the above object, the present invention provides a traffic switching method based on a gateway platform, and the traffic switching method comprises the following steps:

[0006] Based on the traffic monitoring graph, the current environment of the business system is monitored to obtain relevant parameters of the current environment, and based on the relevant parameters, the failure probability of the business system within a preset time period is calculated;

[0007] When the failure probability exceeds a preset probability threshold, determining a traffic switching strategy corresponding to the business system based on the system identifier of the business system and the failure probability;

[0008] Based on the gateway traffic switching platform and the traffic switching strategy, the traffic of the business system is diverted from the current environment to the backup environment.

[0009] In addition, to achieve the above-mentioned purpose, the present invention also provides a traffic switching device based on a gateway platform, and the traffic switching device based on a gateway platform includes:

[0010] An environmental parameter monitoring module is used to monitor the current environment of the business system based on the traffic monitoring diagram, obtain relevant parameters of the current environment, and calculate the failure probability of the business system within a preset time period based on the relevant parameters;

[0011] A switching strategy determination module, configured to determine a flow switching strategy corresponding to the business system based on a system identifier of the business system and the failure probability when the failure probability exceeds a preset probability threshold;

[0012] The system traffic diversion module is used to divert the traffic of the business system from the current environment to the backup environment based on the gateway traffic switching platform and the traffic switching strategy.

[0013] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer device, which includes a processor, a memory, and a gateway platform-based traffic switching program stored in the memory and executable by the processor, wherein when the gateway platform-based traffic switching program is executed by the processor, the steps of the gateway platform-based traffic switching method as described above are implemented.

[0014] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, on which a traffic switching program based on a gateway platform is stored, wherein when the traffic switching program based on the gateway platform is executed by a processor, the steps of the traffic switching method based on the gateway platform as described above are implemented.

[0015] The present application provides a traffic switching method based on a gateway platform, the method monitors the current environment of the business system based on a traffic monitoring graph, obtains relevant parameters of the current environment, and calculates the failure probability of the business system within a preset time period based on the relevant parameters; when the failure probability exceeds the preset probability threshold, the traffic switching strategy corresponding to the business system is determined based on the system identifier of the business system and the failure probability; based on the gateway traffic switching platform and the traffic switching strategy, the traffic of the business system is diverted from the current environment to the backup environment. In the above manner, the present application monitors the current environment of the business system, and when the failure probability of the current environment exceeds the preset probability threshold, it means that the business in the current environment will soon be unable to provide services to the outside world. Based on the traffic switching strategy corresponding to the business system, part or all of the traffic in the current environment can be forwarded to the backup environment to avoid abnormalities in the current environment, thereby avoiding login storms caused by users having to log out of the system and then log in again, thereby improving the stability of the financial business system. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1It is a flow chart of the first embodiment of the traffic switching method based on the gateway platform of the present invention;

[0017] Figure 2 It is a flow chart of the second embodiment of the traffic switching method based on the gateway platform of the present invention;

[0018] Figure 3 It is a flow chart of the third embodiment of the traffic switching method based on the gateway platform of the present invention;

[0019] Figure 4 It is a schematic diagram of a flow switching device based on a gateway platform of the present invention;

[0020] Figure 5 The figure is a schematic diagram of the hardware structure of a computer device involved in an embodiment of the present invention.

[0021] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0022] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0023] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0024] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0025] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0026] The gateway platform-based traffic switching method involved in the embodiment of the present invention is mainly applied to computer equipment. The gateway platform-based traffic switching generating device can be a PC, a portable computer, a mobile terminal, or other device with display and processing functions.

[0027] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0028] Reference Figure 1 , Figure 1 It is a flow chart of the first embodiment of the traffic switching method based on the gateway platform of the present invention.

[0029] like Figure 1 As shown, an embodiment of the present invention provides a traffic switching method based on a gateway platform, and the traffic switching method based on a gateway platform includes steps S10 to S30.

[0030] In this embodiment, the traffic switching method based on the gateway platform includes the following steps:

[0031] Step S10: Based on the traffic monitoring graph, monitor the current environment of the business system, obtain relevant parameters of the current environment, and calculate the failure probability of the business system within a preset time period based on the relevant parameters;

[0032] The current financial business systems generally require two environments, production and grayscale, to ensure the stability of the financial business systems. On version dates or major event nodes, if the production environment is abnormal, it is switched to the grayscale environment to deal with the production environment abnormality. However, most of the current financial business systems require users to log out of the system and log in again after switching to the grayscale environment. At the same time, logging out and logging in again will cause a login storm, thereby reducing the stability of the financial business system.

[0033] In this embodiment, in order to solve the above problems, a gateway platform and a traffic switching method based on the platform are provided to achieve smooth switching of traffic. The gateway platform is a gateway traffic switching platform, which is an operating platform based on openresty middleware for traffic diversion. The traffic switching method monitors the current environment of the business system. When the failure probability of the current environment exceeds the preset probability threshold, it means that the business in the current environment will soon be unable to provide services to the outside world. Based on the traffic switching strategy corresponding to the business system, part or all of the traffic in the current environment can be forwarded to the backup environment to avoid abnormalities in the current environment, thereby avoiding login storms caused by users exiting the system and then logging in again, thereby improving the stability of the financial business system.

[0034] Specifically, the traffic monitoring graph is used to represent the traffic changes of the business system in the current environment over time. The relevant parameters include the traffic growth ratio and the number of instances of system failures, which are used to represent the system service status. Based on the relevant parameters of the current environment, the failure probability of the business system within a preset time period is calculated.

[0035] In one embodiment, the step S10 specifically includes:

[0036] Based on the traffic monitoring graph, the traffic growth ratio of the current environment within the preset time period and the number of faulty system instances are obtained as the relevant parameters;

[0037] Based on the traffic growth ratio and / or the number of system instances of the failure, the failure probability of the business system within the preset time period is calculated.

[0038] Specifically, the preset time period may be a time period of five minutes, ten minutes, etc. The flow growth ratio is a ratio of the flow growth amount to the flow corresponding to the start time point. The faulty system instance is a system instance with a hang situation.

[0039] Specifically, the traffic growth ratio of the current environment within a preset time period and the number of faulty system instances can be detected in real time, and when it is detected that the traffic growth ratio of the current environment within the preset time period exceeds the preset ratio threshold or the number of faulty system instances exceeds the preset number threshold, the failure probability of the business system within the preset time period can be calculated. If the traffic growth ratio of the current environment within the preset time period does not exceed the preset ratio threshold and the number of faulty system instances does not exceed the preset number threshold, there is no need to calculate the failure probability of the business system within the preset time period, and it is sufficient to continue to detect the traffic growth of the current environment and the fault conditions of the system instances.

[0040] In a specific embodiment, the traffic growth data corresponding to the abnormal system environment and the fault data of the system instance can be analyzed, and based on the analysis results, the relationship between the traffic growth data and the probability of business system failure, as well as the relationship between the number of failed instances in the system and the probability of business system failure, can be obtained. Then, based on the relationship between the traffic growth data and the probability of business system failure, and the traffic growth ratio of the current environment in the preset time period, the probability of failure of the business system in the preset time period is determined; based on the relationship between the number of failed instances in the system and the probability of business system failure, and the number of failed instances in the system in the current environment in the preset time period, the probability of failure of the business system in the preset time period is determined; finally, the traffic growth ratio and the ratio corresponding to the number of failed instances in the system are used to obtain the final probability of failure of the business system in the preset time period.

[0041] For example, when the traffic growth ratio is in the range of (0-1), the failure probability of the business system is 0.2; when the traffic growth ratio is in the range of (2-3), the failure probability of the business system is 0.4; when the traffic growth ratio is in the range of (4-5), the failure probability of the business system is 0.6; when the traffic growth ratio is in the range of (6-7), the failure probability of the business system is 0.8; when the traffic growth ratio is 8 or above, the failure probability of the business system is 0.9;

[0042] When the number of failed instances is in the range of (0-10), the failure probability of the business system is 0.2; when the number of failed instances is in the range of (11-20), the failure probability of the business system is 0.4; when the number of failed instances is in the range of (21-30), the failure probability of the business system is 0.6; when the number of failed instances is in the range of (31-40), the failure probability of the business system is 0.8; when the number of failed instances is 41 or more, the failure probability of the business system is 0.9, etc.

[0043] The ratio of the traffic growth ratio to the number of failed instances in the system may be 1:1 or 2:1, etc.

[0044] Step S20: when the failure probability exceeds a preset probability threshold, determine a flow switching strategy corresponding to the business system based on the system identifier of the business system and the failure probability;

[0045] In this embodiment, when the failure probability exceeds the preset probability threshold, it means that the business system is about to fail in the current environment and cannot continue to provide external services. Based on the system identification topic of the business system, in each business system and its corresponding flow determination strategy, the flow switching strategy corresponding to the business system is determined.

[0046] Specifically, the traffic switching strategy includes a natural person switching strategy, a traffic percentage switching strategy, and a traffic full switching strategy.

[0047] Among them, the natural person switching strategy is to switch the traffic according to the user identity information. For example, after upgrading or adding a certain function of the system, the system environment corresponding to the target users of the function (such as users aged 18-30, users who are programmers, or female users, etc.) is switched from the raw tea environment to the grayscale environment to perform version function verification of the grayscale environment.

[0048] The traffic percentage switching strategy is to switch traffic according to the preset traffic ratio of each system environment. For example, when the business system carries out major node activities such as Double Eleven, the traffic ratio of the production environment and the grayscale environment is set to 50% in advance, so that the traffic is evenly distributed to the two environments to avoid the situation where one of the environments is unavailable due to the pressure of business activities.

[0049] The traffic switching strategy is to switch all traffic in the production environment to the grayscale environment when the traffic of the business system in the production environment increases suddenly and some instances are already hung. If it is predicted that the business system will be unable to provide external services within a preset time period, all traffic in the production environment will be switched to the grayscale environment so that the business system can continue to provide external services.

[0050] Step S30: Based on the gateway traffic switching platform and the traffic switching strategy, the traffic of the business system is diverted from the current environment to the backup environment.

[0051] In this embodiment, in order to enable the traffic of the business system to switch smoothly between the production environment and the gray environment, an operating platform based on the openresty middleware for diversion, namely the gateway platform, is developed. The platform provides three strategies: natural person switching strategy, traffic percentage switching strategy, and full traffic switching strategy. Specifically, users can choose the switching method that suits them according to actual needs. The gateway platform issues policies based on the user's setting instructions through the unique system identification topic of each system on the platform. In a specific embodiment, the gateway platform can also determine the corresponding switching strategy based on the specific situation of the business system, and then issue the corresponding switching strategy to the corresponding business system.

[0052] It is understandable that each business system will apply for the topics, producers and consumers of the gateway traffic switching platform in advance.

[0053] In one embodiment, before the traffic of the business system is diverted from the current environment to the backup environment based on the gateway traffic switching platform and the traffic switching strategy, the method further includes:

[0054] An openresty application cluster is built in the business system, and the identifier of the business system, the switching policy corresponding to the business system, and the openresty server are registered in the upstream configuration in the openresty application cluster to generate the gateway traffic switching platform.

[0055] In one embodiment, the gateway traffic switching platform is an operating platform for diverting traffic based on openresty middleware, and the gateway traffic switching platform and the traffic switching strategy are used to divert the traffic of the business system from the current environment to the backup environment, including:

[0056] Based on the gateway traffic switching platform, the traffic switching strategy is sent to the openresty application cluster corresponding to the business system in a kafka manner;

[0057] The openresty middleware in the openresty application cluster is called, and the traffic of the business system is forwarded from the current environment to the standby environment through the traffic switching strategy.

[0058] Specifically, before each business system switches traffic through the gateway traffic switching platform, it is necessary to build an openresty application cluster in the business system, and register each business system identification topic and openresty server information in the configuration by modifying the upstream configuration in the openresty cluster. After the user selects the traffic switching strategy corresponding to each business system on the gateway traffic switching platform, the gateway traffic switching platform sends the traffic switching strategy to be issued to the openresty application cluster of the corresponding business system through kafka, and forwards traffic based on the middleware of the openresty application cluster of the business system and the issued traffic switching strategy.

[0059] When a user logs in to the system, the user's login information is obtained, and the user is tagged with an environment tag in the user information table according to the environment in which the user logs in to the system. For example, if the user logs in to the production environment, the user is tagged with the PRD environment tag; if the user logs in to the gray environment, the user is tagged with the GRAY environment tag.

[0060] If the traffic monitoring chart detects that the traffic of the business system suddenly increases in the production environment, and some instances have already been hung, it is estimated that the business system will not be able to provide external services within a certain period of time. Therefore, through the gateway traffic switching platform, according to the 100% traffic mechanism, the in-use traffic of the business system is completely switched from the current production environment (i.e., the current environment) to the gray environment (i.e., the backup environment). And during the traffic switching process, the environment flag in the user information table is updated from prd to gray. In a specific embodiment, in order to avoid the user from re-logining after the environment is switched, it is necessary to update the user's current browsing information to the redis cache information through a real-time synchronization task, so that the user only needs to refresh the page when the system is stuck, and it can automatically switch to the gray environment, without having to exit the current system and log in again. As a result, it also avoids the phenomenon of users logging in at the same time causing a gray environment login storm, resulting in application unavailability.

[0061] This embodiment provides a traffic switching method based on a gateway platform, the method monitors the current environment of the business system based on a traffic monitoring graph, obtains relevant parameters of the current environment, and calculates the failure probability of the business system within a preset time period based on the relevant parameters; when the failure probability exceeds the preset probability threshold, the traffic switching strategy corresponding to the business system is determined based on the system identifier of the business system and the failure probability; based on the gateway traffic switching platform and the traffic switching strategy, the traffic of the business system is diverted from the current environment to the backup environment. In the above manner, the present application monitors the current environment of the business system, and when the failure probability of the current environment exceeds the preset probability threshold, it means that the business in the current environment will soon be unable to provide services to the outside world. Based on the traffic switching strategy corresponding to the business system, part or all of the traffic in the current environment can be forwarded to the backup environment to avoid abnormalities in the current environment, thereby avoiding login storms caused by users having to log out of the system and then log in again, thereby improving the stability of the financial business system.

[0062] Reference Figure 2 , Figure 2 It is a flow chart of the second embodiment of the traffic switching method based on the gateway platform of the present invention.

[0063] Based on the above Figure 1 In the embodiment shown, in this embodiment, the traffic switching method based on the gateway platform also includes:

[0064] Step S40, when a system test instruction is detected or the current system time point belongs to the system version date, based on the natural person switching strategy and the gateway traffic switching platform, the traffic of the business system to which the preset type of user belongs is switched from the current environment to the target environment to verify the version function of the target environment.

[0065] In this embodiment, when a system test instruction triggered by a user operation is received, or when the current system time point is a daily system version day, some personnel can be switched to a grayscale environment by switching according to natural persons to verify the version functions of the grayscale environment, and the availability of the grayscale version functions can be verified through the principle of local pilot. If there are no problems with the grayscale version verification, the production environment can be used on a large scale in the future, thereby ensuring the stability of the system.

[0066] Reference Figure 3 , Figure 3 It is a flow chart of the third embodiment of the traffic switching method based on the gateway platform of the present invention.

[0067] Based on the above Figure 1 In the embodiment shown, in this embodiment, the traffic switching method based on the gateway platform also includes:

[0068] Step S50, when the current system time point belongs to the preset time period, based on the traffic percentage switching strategy, determining the percentage of the distributed traffic required for each system environment corresponding to the business system;

[0069] Step S60, based on the gateway traffic switching platform and the percentage of traffic distribution required by each system environment, distribute the traffic of the business system to each system environment respectively.

[0070] In this embodiment, the gateway traffic switching platform also provides other scenario functions to expand the availability of the system. When the business system carries out major node activities such as Double Eleven, the traffic percentage function is used to set the production environment and gray environment traffic to 50% in advance, and distribute the traffic to the two environments smoothly to avoid the situation where one of the environments is unavailable due to the pressure of business activities.

[0071] Furthermore, the step S20 specifically includes:

[0072] When the failure probability exceeds a preset probability threshold, based on the system identifier of the business system, determine the flow switching strategy corresponding to the business system among the natural person switching strategy, the flow percentage switching strategy and the flow full switching strategy;

[0073] When the traffic switching strategy is a traffic percentage switching strategy, based on the failure probability, the percentage of the traffic to be switched in the current environment is determined, so as to divert the traffic of the current environment to the backup environment based on the percentage.

[0074] In this embodiment, after determining that the failure probability exceeds the preset probability threshold, based on the system identifier of the business system, the traffic switching strategy corresponding to the business system is determined among the natural person switching strategy, the traffic percentage switching strategy, and the traffic full switching strategy. And when the traffic switching strategy is the traffic percentage switching strategy, further determine the percentage of traffic that needs to be shared by the current environment (such as the production environment) based on the failure probability, and the failure probability is positively correlated with the percentage of traffic to be switched, that is, the greater the failure probability, the greater the percentage of traffic to be switched. For example, when the failure probability is 10%, the percentage of traffic that needs to be shared by the current environment (such as the production environment) is 10%; when the failure probability is 50%, the percentage of traffic that needs to be shared by the current environment (such as the production environment) is 50%. Therefore, based on the percentage, the traffic of the current environment (i.e., the production environment) is diverted to the backup environment (i.e., the gray environment).

[0075] See also Figure 4 , Figure 4 This is a functional module diagram of a traffic switching device based on a gateway platform provided in an embodiment of the present application.

[0076] like Figure 4 As shown, the traffic switching device 400 based on the gateway platform includes:

[0077] The environmental parameter monitoring module 10 is used to monitor the current environment of the business system based on the traffic monitoring diagram, obtain relevant parameters of the current environment, and calculate the failure probability of the business system within a preset time period based on the relevant parameters;

[0078] A switching strategy determination module 20, configured to determine a flow switching strategy corresponding to the business system based on a system identifier of the business system and the failure probability when the failure probability exceeds a preset probability threshold;

[0079] The system traffic diversion module 30 is used to divert the traffic of the business system from the current environment to the backup environment based on the gateway traffic switching platform and the traffic switching strategy.

[0080] Furthermore, the environmental parameter monitoring module 10 includes:

[0081] A related parameter acquisition unit, used to acquire, based on the traffic monitoring graph, a traffic growth ratio of the current environment within the preset time period and a number of faulty system instances as the related parameters;

[0082] A failure probability calculation unit is used to calculate the failure probability of the business system within the preset time period based on the traffic growth ratio and / or the number of system instances of the failure.

[0083] Furthermore, the switching strategy determination module 20 includes:

[0084] A switching strategy determination unit, configured to determine, when the failure probability exceeds a preset probability threshold, a flow switching strategy corresponding to the business system among a natural person switching strategy, a flow percentage switching strategy, and a flow full switching strategy based on a system identifier of the business system;

[0085] The backup environment diversion unit is used to determine the percentage of the current environment's traffic to be switched based on the failure probability when the traffic switching strategy is a traffic percentage switching strategy, so as to divert the current environment's traffic to the backup environment based on the percentage.

[0086] Furthermore, the traffic switching device 400 based on the gateway platform includes:

[0087] The natural person switching strategy module is used to switch the traffic of the business system to which the preset type of user belongs from the current environment to the target environment based on the natural person switching strategy and the gateway traffic switching platform when a system test instruction is detected or the current system time point belongs to the system version date, so as to verify the version function of the target environment.

[0088] Furthermore, the traffic switching device 400 based on the gateway platform includes a percentage switching strategy for:

[0089] When the current system time point belongs to a preset time period, based on the traffic percentage switching strategy, determining the percentage of the distributed traffic required for each system environment corresponding to the business system;

[0090] Based on the gateway traffic switching platform and the percentage of traffic distribution required by each system environment, the traffic of the business system is distributed to each system environment respectively.

[0091] Furthermore, the gateway platform-based traffic switching device 400 includes a gateway platform building module, which is used to:

[0092] An openresty application cluster is built in the business system, and the identifier of the business system, the switching policy corresponding to the business system, and the openresty server are registered in the upstream configuration in the openresty application cluster to generate the gateway traffic switching platform.

[0093] Furthermore, the gateway platform-based traffic switching device 400 includes a gateway platform building module, which is used to:

[0094] Based on the gateway traffic switching platform, the traffic switching strategy is sent to the openresty application cluster corresponding to the business system in a kafka manner;

[0095] The openresty middleware in the openresty application cluster is called, and the traffic of the business system is forwarded from the current environment to the standby environment through the traffic switching strategy.

[0096] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described device and each module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0097] The above-mentioned device can be implemented in the form of a computer program. Figure 5 Runs on the computer device shown.

[0098] See also Figure 5 , Figure 5 1 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device may be a server.

[0099] See also Figure 5 The computer device includes a processor, a memory and a network interface connected through a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.

[0100] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any traffic switching method based on the gateway platform.

[0101] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.

[0102] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any traffic switching method based on the gateway platform.

[0103] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will appreciate that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0104] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0105] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:

[0106] Based on the traffic monitoring graph, the current environment of the business system is monitored to obtain relevant parameters of the current environment, and based on the relevant parameters, the failure probability of the business system within a preset time period is calculated;

[0107] When the failure probability exceeds a preset probability threshold, determining a traffic switching strategy corresponding to the business system based on the system identifier of the business system and the failure probability;

[0108] Based on the gateway traffic switching platform and the traffic switching strategy, the traffic of the business system is diverted from the current environment to the backup environment.

[0109] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:

[0110] Based on the traffic monitoring graph, the traffic growth ratio of the current environment within the preset time period and the number of faulty system instances are obtained as the relevant parameters;

[0111] Based on the traffic growth ratio and / or the number of system instances of the failure, the failure probability of the business system within the preset time period is calculated.

[0112] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:

[0113] When the failure probability exceeds a preset probability threshold, based on the system identifier of the business system, determine the flow switching strategy corresponding to the business system among the natural person switching strategy, the flow percentage switching strategy and the flow full switching strategy;

[0114] When the traffic switching strategy is a traffic percentage switching strategy, based on the failure probability, the percentage of the traffic to be switched in the current environment is determined, so as to divert the traffic of the current environment to the backup environment based on the percentage.

[0115] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:

[0116] When a system test instruction is detected or the current system time point belongs to the system version date, based on the natural person switching strategy and the gateway traffic switching platform, the traffic of the business system to which the preset type of user belongs is switched from the current environment to the target environment to verify the version function of the target environment.

[0117] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:

[0118] When the current system time point belongs to a preset time period, based on the traffic percentage switching strategy, determining the percentage of the distributed traffic required for each system environment corresponding to the business system;

[0119] Based on the gateway traffic switching platform and the percentage of traffic distribution required by each system environment, the traffic of the business system is distributed to each system environment respectively.

[0120] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:

[0121] An openresty application cluster is built in the business system, and the identifier of the business system, the switching policy corresponding to the business system, and the openresty server are registered in the upstream configuration in the openresty application cluster to generate the gateway traffic switching platform.

[0122] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:

[0123] Based on the gateway traffic switching platform, the traffic switching strategy is sent to the openresty application cluster corresponding to the business system in a kafka manner;

[0124] The openresty middleware in the openresty application cluster is called, and the traffic of the business system is forwarded from the current environment to the standby environment through the traffic switching strategy.

[0125] A computer-readable storage medium is also provided in an embodiment of the present application, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and the processor executes the program instructions to implement any of the gateway platform-based traffic switching methods provided in the embodiments of the present application.

[0126] The computer-readable storage medium may be an internal storage unit of the computer device described in the above embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device.

[0127] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A traffic switching method based on a gateway platform, characterized in that: The flow switching method comprises the following steps: Based on the traffic monitoring graph, the current environment of the business system is monitored to obtain relevant parameters of the current environment, and based on the relevant parameters, the failure probability of the business system within a preset time period is calculated; When the failure probability exceeds a preset probability threshold, determining a traffic switching strategy corresponding to the business system based on the system identifier of the business system and the failure probability; Based on the gateway traffic switching platform and the traffic switching strategy, the traffic of the business system is diverted from the current environment to the backup environment.

2. The traffic switching method based on the gateway platform according to claim 1, characterized in that: The method of monitoring the current environment of the business system based on the traffic monitoring graph, obtaining relevant parameters of the current environment, and calculating the failure probability of the business system within a preset time period based on the relevant parameters includes: Based on the traffic monitoring graph, the traffic growth ratio of the current environment within the preset time period and the number of faulty system instances are obtained as the relevant parameters; Based on the traffic growth ratio and / or the number of system instances of the failure, the failure probability of the business system within the preset time period is calculated.

3. The traffic switching method based on the gateway platform according to claim 1, characterized in that: When the failure probability exceeds a preset probability threshold, determining a flow switching strategy corresponding to the business system based on the system identifier of the business system and the failure probability includes: When the failure probability exceeds a preset probability threshold, based on the system identifier of the business system, determine the flow switching strategy corresponding to the business system among the natural person switching strategy, the flow percentage switching strategy and the flow full switching strategy; When the traffic switching strategy is a traffic percentage switching strategy, based on the failure probability, the percentage of the traffic to be switched in the current environment is determined, so as to divert the traffic of the current environment to the backup environment based on the percentage.

4. The traffic switching method based on the gateway platform according to claim 1, characterized in that: The traffic switching method based on the gateway platform also includes: When a system test instruction is detected or the current system time point belongs to the system version date, based on the natural person switching strategy and the gateway traffic switching platform, the traffic of the business system to which the preset type of user belongs is switched from the current environment to the target environment to verify the version function of the target environment.

5. The traffic switching method based on the gateway platform according to claim 1, characterized in that: The flow switching method further includes: When the current system time point belongs to a preset time period, based on the traffic percentage switching strategy, determining the percentage of the distributed traffic required for each system environment corresponding to the business system; Based on the gateway traffic switching platform and the percentage of traffic distribution required by each system environment, the traffic of the business system is distributed to each system environment respectively.

6. The traffic switching method based on the gateway platform according to claim 1, characterized in that: Before the traffic of the business system is diverted from the current environment to the backup environment based on the gateway traffic switching platform and the traffic switching strategy, the method further includes: An openresty application cluster is built in the business system, and the identifier of the business system, the switching policy corresponding to the business system, and the openresty server are registered in the upstream configuration in the openresty application cluster to generate the gateway traffic switching platform.

7. The traffic switching method based on a gateway platform as claimed in any one of claims 1 to 6, characterized in that: The gateway traffic switching platform is an operating platform for diverting traffic based on openresty middleware. The gateway traffic switching platform and the traffic switching strategy are used to divert the traffic of the business system from the current environment to the backup environment, including: Based on the gateway traffic switching platform, the traffic switching strategy is sent to the openresty application cluster corresponding to the business system in a kafka manner; The openresty middleware in the openresty application cluster is called, and the traffic of the business system is forwarded from the current environment to the standby environment through the traffic switching strategy.

8. A traffic switching device based on a gateway platform, characterized in that: The traffic switching device based on the gateway platform includes: An environmental parameter monitoring module is used to monitor the current environment of the business system based on the traffic monitoring diagram, obtain relevant parameters of the current environment, and calculate the failure probability of the business system within a preset time period based on the relevant parameters; A switching strategy determination module, configured to determine a flow switching strategy corresponding to the business system based on a system identifier of the business system and the failure probability when the failure probability exceeds a preset probability threshold; The system traffic diversion module is used to divert the traffic of the business system from the current environment to the backup environment based on the gateway traffic switching platform and the traffic switching strategy.

9. A computer device, characterized in that: The computer device includes a processor, a memory, and a gateway platform-based traffic switching program stored in the memory and executable by the processor, wherein when the gateway platform-based traffic switching program is executed by the processor, the steps of the gateway platform-based traffic switching method as described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a traffic switching program based on a gateway platform, wherein when the traffic switching program based on a gateway platform is executed by a processor, the steps of the traffic switching method based on a gateway platform as described in any one of claims 1 to 7 are implemented.