Middleware cluster active-active switching method and device, electronic equipment and storage medium

By accessing the preset -level computer room, creating a global server load balancing domain name and configured flow distribution strategies, solving the problem of high cost, high probability of error, and low switching efficiency of traditional middleware clusters in traditional middle parts. Double -live switching.

CN119363756APending Publication Date: 2025-01-24PING AN BANK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411398768.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

Traditional middleware cluster dual-active switching technology has high cost, high probability of errors, and low switching efficiency.

Method used

By connecting the target middleware cluster to the first and second computer rooms of the preset level, create a global server load balancing domain name, configure the traffic distribution policy, establish the corresponding relationship between the access alias and the traffic distribution policy, and dynamically allocate and forward the external network ask.

Benefits of technology

The accuracy and efficiency of the dual -living switching of the middle part of the cluster is improved, the technical and human costs are reduced, and the stability of the switching is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119363756A_ABST
    Figure CN119363756A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, and discloses a middleware cluster active-active switching method and device, electronic equipment and a storage medium. The method comprises the following steps: accessing a target middleware cluster to a first machine room and a second machine room of a preset level; creating at least one global server load balancing domain name, and configuring the first machine room and the second machine room as global server load balancing members; configuring a flow distribution strategy corresponding to the global server load balancing domain name; creating an access alias, and establishing an access corresponding relationship between the access alias and the traffic distribution strategy; distributing the received external network request to the corresponding flow distribution strategy according to the access corresponding relation; and forwarding the external network request to the target middleware cluster of the first machine room or the second machine room according to the traffic distribution strategy. According to the method, the accuracy and the stability of middleware cluster active-active switching are improved, the switching time is shortened, and the comprehensive cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, electronic device and storage medium for middleware cluster active-active switching. Background Art

[0002] In traditional cluster technology solutions, systems in financial technology industries such as banks, insurance, and credit generally build active-active data centers in the same city to improve application availability. Active-active data centers in the same city refer to setting up two data centers or data centers in the same city. Both data centers are active at the same time and are processing traffic and service requests. One application scenario in active-active data centers in the same city is the active-active data center switching of middleware clusters (such as Redis, HBase, Kafka, ETCD, etc.). When traditional middleware clusters switch active-active data centers, the solution adopted is that the operation and maintenance personnel manually update the cluster configuration (for example, cluster IP address, port number, etc.) of the configuration center (for example, Apollo, etc.), and then the program reloads the middleware cluster configuration to achieve active-active switching of the middleware cluster. However, on the one hand, the technical cost of accessing the configuration center is high (for example, the configuration center does not provide the corresponding SDK toolkit), and the scalability and adjustability of the configuration center are insufficient. On the other hand, the operation and maintenance personnel manually operate the active-active switching of the middleware cluster, which is prone to errors when manually updating the cluster configuration in an emergency. In addition, the manual update of the active-active configuration requires multiple reviews, which consumes more active-active switching time. Summary of the invention

[0003] The main technical problem to be solved by the implementation methods of the present application is that the comprehensive technical cost of active-active switching of traditional middleware clusters is high, the error probability is high, and the switching efficiency is low.

[0004] To solve the above technical problems, the first technical solution adopted in the implementation mode of the present application is: to provide a middleware cluster active-active switching method, including: connecting the target middleware cluster to the first computer room and the second computer room of a preset level; creating at least one global server load balancing domain name, and configuring the first computer room and the second computer room as global server load balancing members; configuring the traffic distribution policy corresponding to the global server load balancing domain name, wherein the traffic distribution policy includes the first computer room or the second computer room; creating an access alias, and establishing an access correspondence between the access alias and the traffic distribution policy; according to the access correspondence, allocating the received external network request to the corresponding traffic distribution policy; forwarding the external network request to the target middleware cluster of the first computer room or the second computer room according to the traffic distribution policy.

[0005] Optionally, after the step of forwarding the external network request to the target middleware cluster of the first computer room or the second computer room according to the traffic distribution strategy, it also includes: monitoring the network operation status of the first computer room and the second computer room; if the network operation status of the first computer room or the second computer room becomes an interrupted state, establishing a new access correspondence between the access alias and the new traffic distribution strategy, wherein the network operation status of the computer room associated with the new traffic distribution strategy is a connected state; forwarding the external network request to the target middleware cluster of the first computer room or the second computer room according to the traffic distribution policy associated with the new access correspondence.

[0006] Optionally, the step of configuring the traffic distribution strategy corresponding to the global server load balancing domain name includes: obtaining a preset percentage step; setting the first traffic percentage of the first computer room in a loop starting from 0, and the increment of each accumulation is the percentage step; calculating the second traffic percentage of the second computer room in turn according to the first traffic percentage, wherein the sum of the first traffic percentage and the second traffic percentage is 100%; and generating the corresponding traffic distribution strategy according to the first traffic percentage and the second traffic percentage calculated each time.

[0007] Optionally, the step of establishing an access correspondence between the access alias and the traffic distribution strategy includes: obtaining performance indicator data of the first computer room and the second computer room, and historical traffic data undertaken by the first computer room and the second computer room; calculating, based on the performance indicator data and the historical traffic data, first predicted traffic threshold data and second predicted traffic threshold data that the first computer room and the second computer room can currently undertake correspondingly; calculating the threshold ratio of the first predicted traffic threshold data and the second predicted traffic threshold data, and matching the corresponding traffic distribution strategy according to the threshold ratio; and establishing an access correspondence between the access alias and the traffic distribution strategy.

[0008] Optionally, after the step of forwarding the external network request to the target middleware cluster of the first computer room or the second computer room according to the traffic distribution strategy associated with the new access correspondence, the step also includes: if it is monitored that the network operation status of the first computer room or the second computer room changes from an interrupted state to a connected state; re-execute the steps of obtaining the performance indicator data of the first computer room and the second computer room to the step of matching the corresponding traffic distribution strategy according to the threshold ratio to obtain a new traffic distribution strategy; establish an access correspondence between the access alias and the new traffic distribution strategy.

[0009] Optionally, after the step of obtaining the performance indicator data of the first computer room and the second computer room, it also includes: monitoring whether the performance indicator data of the first computer room and the second computer room change; if the performance indicator data changes, calculating the performance change rate of the performance indicator data; if the performance change rate exceeds a preset performance change rate threshold, re-executing the steps from obtaining the performance indicator data of the first computer room and the second computer room to establishing the access correspondence between the access alias and the traffic distribution strategy.

[0010] Optionally, after the step of matching the corresponding traffic distribution strategy according to the threshold ratio, it also includes: obtaining the performance indicator data, the historical traffic data and the corresponding traffic distribution strategy as training data; training the preset middleware cluster active-active switching model according to the training data to obtain a trained middleware cluster active-active switching model, wherein the input of the middleware cluster active-active switching model is the computer room performance indicator data and historical traffic data, and the output of the middleware cluster active-active switching model is the corresponding traffic distribution strategy; using the middleware cluster active-active switching model to configure the traffic distribution strategy corresponding to the global server load balancing domain name.

[0011] To solve the above technical problems, the second technical solution adopted in the implementation mode of the present application is: to provide a middleware cluster active-active switching device, including: a computer room access module, used to connect the target middleware cluster to the first computer room and the second computer room of a preset level; a domain name creation module, used to create at least one global server load balancing domain name, and configure the first computer room and the second computer room as global server load balancing members; a distribution policy module, used to configure the traffic distribution policy corresponding to the global server load balancing domain name, wherein the traffic distribution policy includes the first computer room or the second computer room; an alias creation module, used to create an access alias, and establish an access correspondence between the access alias and the traffic distribution policy; an alias access module, used to distribute the received external network request to the corresponding traffic distribution policy according to the access correspondence; a traffic distribution module, used to forward the external network request to the target middleware cluster of the first computer room or the second computer room according to the traffic distribution policy.

[0012] To solve the above technical problems, the third technical solution adopted in the implementation manner of the present application is: to provide an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the middleware cluster active-active switching method as described above.

[0013] In order to solve the above-mentioned technical problems, the fourth technical solution adopted in the implementation mode of the present application is: providing a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are executed by an electronic device, the electronic device executes the middleware cluster active-active switching method as described above.

[0014] Different from the related technologies, the present application connects the target middleware cluster to the first and second computer rooms of preset levels; creates at least one global server load balancing domain name, configures the first and second computer rooms as global server load balancing members; configures the traffic distribution policy corresponding to the global server load balancing domain name; creates an access alias, and establishes an access correspondence between the access alias and the traffic distribution policy; according to the access correspondence, distributes the received external network requests to the corresponding traffic distribution policy; forwards the external network requests to the target middleware cluster in the first or second computer room according to the traffic distribution policy, which not only improves the accuracy of the middleware cluster when performing active-active switching and shortens the time of active-active switching, but also improves the stability of the active-active switching of the middleware cluster and reduces the technical and labor costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] One or more embodiments are exemplarily described by corresponding drawings, which do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and the figures in the drawings do not constitute proportional limitations unless otherwise stated.

[0016] Figure 1 It is a schematic diagram of the operating environment of the middleware cluster active-active switching method provided in an embodiment of the present application.

[0017] Figure 2 It is a schematic diagram of the execution flow of the middleware cluster active-active switching method provided in an embodiment of the present application.

[0018] Figure 3 It is a schematic diagram of the execution flow of a computer room traffic distribution strategy for generating different traffic ratios provided in an embodiment of the present application.

[0019] Figure 4 It is a schematic diagram of the execution flow of establishing an access correspondence between an access alias and a traffic allocation strategy based on performance indicator data provided in an embodiment of the present application.

[0020] Figure 5 It is a structural diagram of a middleware cluster active-active switching device provided in an embodiment of the present application.

[0021] Figure 6 It is a hardware structure diagram of an electronic device for executing a middleware cluster active-active switching method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0022] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0023] It should be noted that, if there is no conflict, the various features in the embodiments of the present application can be combined with each other, all within the scope of protection of the present application. In addition, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a different order than the module division in the device schematic diagram or the order in the flow chart.

[0024] Unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The term "and / or" used in this specification includes any and all combinations of one or more of the related listed items.

[0025] To facilitate understanding of this embodiment, a middleware cluster active-active switching method disclosed in an embodiment of the present application is first introduced in detail. The executor of the middleware cluster active-active switching method provided in the embodiment of the present application is generally an electronic device with certain computing capabilities, such as a computer device. In some possible implementation methods, the middleware cluster active-active switching method can be implemented by a processor calling computer-readable instructions stored in a memory.

[0026] The following uses a computer device as an example to illustrate the middleware cluster active-active switching method provided in the embodiment of the present application. Figure 1 , Figure 1 Schematic diagram of the operating environment of the middleware cluster active-active switching method provided in the embodiment of the present application, such as Figure 1 As shown, when the global load balancing server 101 receives a network request from the external network 201 for the target middleware cluster, it will distribute the network request to the corresponding first computer room 301 and / or second computer room 302 according to the pre-configured traffic distribution strategy. Figure 1 The global load balancing server 101 can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. Figure 1 The number of servers shown in the global load balancing server 101, the first computer room 301 and the second computer room 302 is only schematic and can be expanded to any number according to actual needs.

[0027] Please continue reading Figure 2 , Figure 2 is a schematic diagram of the execution flow of the middleware cluster active-active switching method provided in an embodiment of the present application, such as Figure 2 As shown, the middleware cluster active-active switching method includes the following steps:

[0028] S1. Connect the target middleware cluster to the first computer room and the second computer room of the preset level.

[0029] As an example, a data storage middleware cluster is commonly used in systems of financial technology industries such as banks, insurance, and credit. The data storage middleware cluster can be a Redis (Remote Dictionary Server) cluster. Redis is an open source in-memory data structure storage system, also known as a data structure server. It can be used as a database, cache, and message middleware, and supports a variety of data structures, such as strings, hash tables, lists, sets, and ordered sets. Redis cluster is a deployment method for improving Redis performance and availability, which is achieved by storing data shards in multiple Redis instances. Redis clusters usually include multiple master nodes and multiple slave nodes. Each master node is responsible for storing part of the data, and there are corresponding slave nodes for data backup and failover. In this example, corresponding Redis clusters are deployed in different computer rooms. Furthermore, the server in the server cluster corresponding to the above Redis cluster is an F5 server. The F5 server is a server that has built-in load balancing control, application security, application delivery control, SSL management, and other server software and hardware applications when it leaves the factory.

[0030] S2. Create at least one global server load balancing domain name, and configure the first computer room and the second computer room as global server load balancing members.

[0031] Among them, Global Server Load Balancing (GSLB) usually uses DNS (Domain Name System, Domain Name System) to achieve traffic distribution. When a user requests to access a domain name, the GSLB system will select the most appropriate server IP address according to the preset strategy and return it to the user. For example, in a certain insurance system, the corresponding global server load balancing domain name is redis.gslb.pab.com.cn, the IP address of the entry F5 server corresponding to the first computer room is 10.1.13.1, the port number is 80, the IP address range of the Redis cluster (including 3 master servers and 3 slave servers) in the first computer room is 10.1.16.1~10.1.16.6, the port number is 7001, the IP address of the entry F5 server corresponding to the second computer room is 10.2.20.1, the port number is 80, the IP address range of the Redis cluster (including 3 master servers and 3 slave servers) in the second computer room is 10.2.26.1~10.2.26.6, the port number is 7002. Finally, add the configured first and second computer rooms to the members of the above global server load balancing.

[0032] S3. Configure the traffic distribution strategy corresponding to the global server load balancing domain name, where the traffic distribution strategy includes the first computer room or the second computer room.

[0033] As an optional implementation, please continue to refer to Figure 3 , Figure 3 is a schematic diagram of the execution flow of generating a machine room traffic distribution strategy with different traffic ratios provided in an embodiment of the present application, such as Figure 3 As shown, after creating the corresponding global server load balancing domain name, different traffic distribution strategies can be configured for each global server load balancing domain name to cope with different situations by corresponding each global server load balancing domain name to a different traffic distribution strategy. Specifically, the above step S3 may include the following steps:

[0034] S31, obtaining a preset percentage step. For example, if the percentage step is set to 10%, the percentage of each increase or decrease is 10%. It should be noted that in the actual implementation process, the percentage step can be reduced or increased according to the granularity requirements of the flow control. Reducing the percentage step can obtain a flow control strategy with finer granularity, and vice versa, a flow control strategy with coarser granularity is obtained.

[0035] S32, cyclically accumulating and setting the first flow percentage of the first computer room starting from 0, with the increment of each accumulation being the percentage step.

[0036] S33. Calculate the second flow percentage of the second computer room according to the first flow percentage in sequence, wherein the sum of the first flow percentage and the second flow percentage is 100%.

[0037] As an example, when calculating the traffic distribution strategy corresponding to a global server load balancing domain name, the traffic allocated to the first computer room is first set to 0, and the traffic allocated to the second computer room is set to 100%, and then the traffic proportion allocated to the first computer room is increased successively, with an increase in the proportion of 10%. That is, the traffic proportion allocated to the first computer room is set to 10% during the second calculation. At this time, the traffic proportion allocated to the second computer room is reduced to 90%, and so on, until the traffic proportion allocated to the first computer room increases to 100%, and the traffic proportion allocated to the second computer room is correspondingly reduced to 0, then 11 corresponding traffic proportion distribution schemes can be obtained.

[0038] S34: Generate a corresponding flow distribution strategy according to the first flow percentage and the second flow percentage calculated each time. For example, the 11 flow ratio distribution schemes obtained in the above example are set as corresponding flow distribution strategies.

[0039] S4. Create an access alias and establish an access correspondence between the access alias and the traffic distribution policy.

[0040] Among them, an access alias is created to correspond to the traffic distribution strategy instead of directly corresponding the above-mentioned global server load balancing domain name to the traffic distribution strategy. Because in the actual implementation process, the middleware cluster is generally used by multiple applications. Modifying the traffic distribution strategy corresponding to the above-mentioned global server load balancing domain name may affect other applications' access to the middleware cluster. Secondly, modifying the above-mentioned access alias does not require modifying the program code. The new traffic distribution strategy can take effect by automatically reconnecting the program or restarting the program.

[0041] As an optional implementation, please continue to refer to Figure 4 , Figure 4 is a schematic diagram of an execution flow of establishing an access correspondence relationship between an access alias and a traffic allocation strategy according to performance indicator data provided by an embodiment of the present application, such as Figure 4 As shown, in the above step S4, establishing an access correspondence between the access alias and the traffic distribution strategy specifically includes the following steps:

[0042] S41. Obtain performance indicator data of the first computer room and the second computer room, and historical traffic data received by the first computer room and the second computer room.

[0043] S42. Calculate the first predicted traffic threshold data and the second predicted traffic threshold data that the first computer room and the second computer room can currently handle based on the performance indicator data and the historical traffic data. The performance indicator data that can be referenced for different types of clusters can be different, and different traffic threshold calculation methods can be used to obtain predicted traffic data with different focuses, such as focusing on the inlet bandwidth and outlet bandwidth that the computer room can provide, or focusing on the network delay data of the computer room.

[0044] S43, calculating a threshold ratio between the first predicted traffic threshold data and the second predicted traffic threshold data, and matching a corresponding traffic allocation strategy according to the threshold ratio.

[0045] S44: Establish an access correspondence between the access alias and the traffic distribution strategy.

[0046] Among them, by generating different traffic distribution strategies based on the performance indicator data of the computer room, the access efficiency of the middleware cluster can be further improved. If a computer room with insufficient performance is allocated traffic that does not match the performance, the middleware cluster will be unable to provide sufficiently stable service capabilities, such as causing more network delays, network request failures and other problems.

[0047] As another optional implementation, in the actual implementation process, the performance data of the computer room is not fixed. For example, the computer room may be modified and upgraded accordingly to improve performance, or a sudden fire or other accident may occur in the computer room, resulting in performance degradation. Therefore, after obtaining the performance indicator data of the first computer room and the second computer room in the above step S41, the following steps may be further included:

[0048] S411. Monitor whether the performance indicator data of the first computer room and the second computer room change.

[0049] S412: If the performance indicator data changes, the performance change rate of the performance indicator data is calculated. For example, if the average network delay of a certain computer room increases in a certain time period, the increase rate of the average network delay in the time period is calculated.

[0050] S413: If the performance change rate exceeds a preset performance change rate threshold, re-execute the steps from obtaining the performance indicator data of the first computer room and the second computer room to establishing an access correspondence relationship between the access alias and the traffic distribution strategy.

[0051] Among them, the traffic distribution strategy corresponding to the access alias is adjusted according to the performance change rate, rather than adjusting it immediately after the performance data changes, in order to maintain the stability of traffic distribution, that is, when the performance data of the computer room decreases to a limited extent, the traffic distribution strategy is not adjusted.

[0052] As another optional implementation, the above adjustment of the traffic distribution strategy can also be performed through an artificial intelligence model. A corresponding middleware cluster active-active switching model can be newly created first, and then the corresponding model training can be performed, and then the application can be performed after the training is completed. Specifically, after the above S43 matches the corresponding traffic distribution strategy according to the threshold ratio, the following steps are also included:

[0053] S431, obtaining performance indicator data, historical traffic data and corresponding traffic allocation strategy as training data. The training data is not limited to the data in step S431, but can also be set according to specific traffic requirements, such as the route data of the network initiator in the traffic to the target computer room.

[0054] S432. Train the preset middleware cluster active-active switching model according to the training data to obtain a trained middleware cluster active-active switching model, wherein the input of the middleware cluster active-active switching model is the computer room performance indicator data and historical traffic data, and the output of the middleware cluster active-active switching model is the corresponding traffic distribution strategy.

[0055] S433. Use the middleware cluster active-active switching model to configure the traffic distribution strategy corresponding to the global server load balancing domain name.

[0056] Among them, after the above-mentioned middleware cluster active-active switching model is applied, subsequent performance indicator data, historical traffic data, etc. can continue to be obtained as training data to continue training and optimizing the middleware cluster active-active switching model.

[0057] S5. Allocate the received external network request to the corresponding traffic distribution strategy according to the access correspondence.

[0058] S6. Forward the external network request to the target middleware cluster in the first computer room or the second computer room according to the traffic distribution strategy.

[0059] As an optional implementation, when one of the active-active computer rooms is inaccessible, all traffic needs to be switched to the only accessible computer room, and specific warning information needs to be reported to add a new middleware cluster computer room to maintain the stability of the active-active switching solution of the middleware cluster. Specifically, after the above step S6, the following steps are also included:

[0060] S61. Monitor the network operation status of the first computer room and the second computer room.

[0061] S62. If the network operation status of the first computer room or the second computer room changes to an interrupted state, a new access correspondence between the access alias and the new traffic distribution strategy is established, wherein the network operation status of the computer room associated with the new traffic distribution strategy is a connected state.

[0062] S63: forward the external network request to the target middleware cluster in the first computer room or the second computer room according to the traffic distribution strategy associated with the new access correspondence.

[0063] As another optional implementation, corresponding to the above-mentioned computer room failure, when the fault of the faulty computer room has been eliminated and restored to use, the computer room after the fault is eliminated can continue to be added to the middleware cluster active-active switching solution. Specifically, after the above-mentioned step S63, the following steps can also be included:

[0064] S631, if the network operation status of the first computer room or the second computer room is monitored to change from an interrupted state to a connected state. In addition, the performance indicator data of the computer room with restored network access can also be considered. By default, the performance indicator data does not change, but there is also the possibility of performance indicator data change. The performance indicator data change detection can be selectively performed according to the duration of the network interruption in the faulty computer room. For example, if the network interruption lasts for less than 30 minutes, no performance indicator data change detection is performed. If the network interruption lasts for more than 30 minutes but within 1 hour, only some important performance indicator data change detection is performed. If the network interruption lasts for more than 1 hour, a comprehensive performance indicator data change detection is performed.

[0065] S632: Re-execute the steps from obtaining the performance indicator data of the first computer room and the second computer room to matching the corresponding traffic distribution strategy according to the threshold ratio to obtain a new traffic distribution strategy.

[0066] S633: Establish an access correspondence between the access alias and the new traffic distribution strategy.

[0067] The middleware cluster active-active switching method provided in the embodiment of the present application is achieved by connecting the target middleware cluster to the first computer room and the second computer room of the preset level; creating at least one global server load balancing domain name, configuring the first computer room and the second computer room as global server load balancing members; configuring the traffic distribution policy corresponding to the global server load balancing domain name, wherein the traffic distribution policy includes the first computer room or the second computer room; creating an access alias, and establishing an access correspondence between the access alias and the traffic distribution policy; according to the access correspondence, allocating the received external network request to the corresponding traffic distribution policy; forwarding the external network request to the target middleware cluster in the first computer room or the second computer room according to the traffic distribution policy, which not only improves the accuracy of the middleware cluster in active-active switching and shortens the time of active-active switching, but also improves the stability of the active-active switching of the middleware cluster and reduces the technical cost and labor cost.

[0068] Please continue reading Figure 5 , Figure 5 is a structural diagram of a middleware cluster active-active switching device provided in an embodiment of the present application, such as Figure 5 As shown, it includes: a computer room access module 51, a domain name creation module 52, an allocation strategy module 53, an alias creation module 54, an alias access module 55 and a traffic allocation module 56.

[0069] The computer room access module 51 is used to connect the target middleware cluster to the first computer room and the second computer room of the preset level;

[0070] The domain name creation module 52 is used to create at least one global server load balancing domain name and configure the first computer room and the second computer room as global server load balancing members;

[0071] The distribution strategy module 53 is used to configure the traffic distribution strategy corresponding to the global server load balancing domain name, wherein the traffic distribution strategy includes the first computer room or the second computer room;

[0072] The alias creation module 54 is used to create an access alias and establish an access correspondence between the access alias and the traffic distribution strategy;

[0073] The alias access module 55 is used to allocate the received external network request to the corresponding traffic allocation strategy according to the access correspondence;

[0074] The traffic distribution module 56 is used to forward the external network request to the target middleware cluster of the first computer room or the second computer room according to the traffic distribution strategy.

[0075] As an optional implementation, the middleware cluster active-active switching device also includes a network status monitoring module, which is used to monitor the network operation status of the first computer room and the second computer room; if the network operation status of the first computer room or the second computer room becomes an interrupted state, a new access correspondence between the access alias and the new traffic distribution strategy is established, wherein the network operation status of the computer room associated with the new traffic distribution strategy is a connected state; according to the traffic distribution policy associated with the new access correspondence, the external network request is forwarded to the target middleware cluster of the first computer room or the second computer room.

[0076] As an optional implementation, the allocation strategy module 53 is also used to obtain a preset percentage step; to set the first flow percentage of the first computer room in a loop starting from 0, with the increment of each accumulation being the percentage step; to calculate the second flow percentage of the second computer room in turn according to the first flow percentage, wherein the sum of the first flow percentage and the second flow percentage is 100%; and to generate the corresponding flow allocation strategy according to the first flow percentage and the second flow percentage calculated each time.

[0077] As an optional implementation, the alias creation module 54 is also used to obtain performance indicator data of the first computer room and the second computer room, and historical traffic data undertaken by the first computer room and the second computer room; calculate the first predicted traffic threshold data and the second predicted traffic threshold data that the first computer room and the second computer room can currently undertake according to the performance indicator data and the historical traffic data; calculate the threshold ratio of the first predicted traffic threshold data and the second predicted traffic threshold data, and match the corresponding traffic distribution strategy according to the threshold ratio; establish an access correspondence between the access alias and the traffic distribution strategy.

[0078] As an optional implementation, the network status monitoring module is also used to, if it is monitored that the network operation status of the first computer room or the second computer room changes from an interrupted state to a connected state; re-execute the steps from obtaining the performance indicator data of the first computer room and the second computer room to matching the corresponding traffic distribution strategy according to the threshold ratio, to obtain a new traffic distribution strategy; and establish an access correspondence between the access alias and the new traffic distribution strategy.

[0079] As an optional implementation, the network status monitoring module is also used to monitor whether the performance indicator data of the first computer room and the second computer room have changed; if the performance indicator data has changed, the performance change rate of the performance indicator data is calculated; if the performance change rate exceeds a preset performance change rate threshold, the steps from obtaining the performance indicator data of the first computer room and the second computer room to establishing the access correspondence between the access alias and the traffic distribution strategy are re-executed.

[0080] As an optional implementation, the middleware cluster active-active switching device also includes an active-active switching model module, and the active-active switching model is used to obtain the performance indicator data, the historical traffic data and the corresponding traffic distribution strategy as training data; the preset middleware cluster active-active switching model is trained according to the training data to obtain a trained middleware cluster active-active switching model, wherein the input of the middleware cluster active-active switching model is the computer room performance indicator data and historical traffic data, and the output of the middleware cluster active-active switching model is the corresponding traffic distribution strategy; the middleware cluster active-active switching model is used to configure the traffic distribution strategy corresponding to the global server load balancing domain name.

[0081] It should be noted that the above-mentioned middleware cluster active-active switching device can execute the middleware cluster active-active switching method provided in the embodiment of the present application, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not fully described in the embodiment of the middleware cluster active-active switching device, please refer to the middleware cluster active-active switching method provided in the embodiment of the present application.

[0082] Please continue reading Figure 6 , Figure 6 is a schematic diagram of the hardware structure of an electronic device 600 for executing a middleware cluster active-active switching method provided in an embodiment of the present application, such as Figure 6 As shown, the electronic device 600 includes:

[0083] One or more processors 610 and memory 620, Figure 6 A processor 610 is taken as an example.

[0084] The processor 610 and the memory 620 may be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.

[0085] The memory 620, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the middleware cluster active-active switching method in the embodiment of the present application. The processor 610 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions and modules stored in the memory 620, that is, implementing the middleware cluster active-active switching method in the above method embodiment.

[0086] The memory 620 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created according to the use of the middleware cluster active-active switching device, etc. In addition, the memory 620 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 620 may optionally include a memory remotely arranged relative to the processor 610, and these remote memories may be connected to the middleware cluster active-active switching device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0087] The one or more modules are stored in the memory 620, and when executed by the one or more processors 610, the middleware cluster active-active switching method in any of the above method embodiments is executed, for example, the above described Figure 2 Steps S1 to S6 of the method, Figure 3 Steps S31 to S34 of the method, Figure 4 Steps S41 to 44 of the method are implemented Figure 5 The functions of modules 51-56 in.

[0088] The above-mentioned product can execute the method provided in the embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to the method provided in the embodiment of the present application.

[0089] The embodiment of the present application provides a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed by one or more processors, such as Figure 6 A processor 610 in the embodiment may enable the one or more processors to execute the middleware cluster active-active switching method in any of the above method embodiments, for example, to execute the above described Figure 2 Steps S1 to S6 of the method, Figure 3 Steps S31 to S34 of the method, Figure 4 Steps S41 to 44 of the method are implemented Figure 5 The functions of modules 51-56 in.

[0090] The present application provides a computer program product, wherein the computer program product includes a computer program stored on a non-volatile computer-readable storage medium, wherein the computer program includes program instructions, and when the program instructions are executed by the electronic device, the electronic device is enabled to execute the middleware cluster active-active switching method in any of the above method embodiments, for example, to execute the above described Figure 2 Steps S1 to S6 of the method, Figure 3 Steps S31 to S34 of the method, Figure 4 Steps S41 to 44 of the method are implemented Figure 5 The functions of modules 51-56 in.

[0091] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0092] Through the description of the above implementation methods, ordinary technicians in this field can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, it can also be implemented by hardware. Ordinary technicians in this field can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0093] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Under the concept of the present application, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other changes in different aspects of the present application as described above, which are not provided in detail for the sake of simplicity. Although the present application has been described in detail with reference to the aforementioned embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features can be replaced by equivalents. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A middleware cluster active-active switching method, characterized in that: include: Connect the target middleware cluster to the first and second computer rooms of the preset level; Create at least one global server load balancing domain name, and configure the first computer room and the second computer room as global server load balancing members; Configure a traffic distribution strategy corresponding to the global server load balancing domain name, wherein the traffic distribution strategy includes the first computer room or the second computer room; Creating an access alias and establishing an access correspondence between the access alias and the traffic distribution strategy; Allocate the received external network request to the corresponding traffic distribution strategy according to the access correspondence; The external network request is forwarded to the target middleware cluster in the first computer room or the second computer room according to the traffic distribution strategy.

2. The middleware cluster active-active switching method according to claim 1 is characterized in that: After the step of forwarding the external network request to the target middleware cluster of the first computer room or the second computer room according to the traffic distribution strategy, the method further includes: Monitoring the network operation status of the first computer room and the second computer room; If the network operation state of the first computer room or the second computer room changes to an interrupted state, a new access correspondence between the access alias and the new traffic distribution strategy is established, wherein the network operation state of the computer room associated with the new traffic distribution strategy is a connected state; According to the traffic distribution strategy associated with the new access correspondence, the external network request is forwarded to the target middleware cluster in the first computer room or the second computer room.

3. The middleware cluster active-active switching method according to claim 1, characterized in that: The step of configuring the traffic distribution strategy corresponding to the global server load balancing domain name includes: Get the preset percentage step size; Starting from 0, cyclically accumulating and setting the first flow percentage of the first computer room, the increment of each accumulation being the percentage step length; Calculating the second flow percentage of the second computer room according to the first flow percentage, wherein the sum of the first flow percentage and the second flow percentage is 100%; The corresponding traffic allocation strategy is generated according to the first traffic percentage and the second traffic percentage calculated each time.

4. The middleware cluster active-active switching method according to claim 2 is characterized in that: The step of establishing an access correspondence between the access alias and the traffic distribution strategy includes: Acquire performance indicator data of the first computer room and the second computer room, and historical traffic data undertaken by the first computer room and the second computer room; Calculate, based on the performance indicator data and the historical traffic data, first predicted traffic threshold data and second predicted traffic threshold data that the first computer room and the second computer room can currently handle correspondingly; Calculating a threshold ratio of the first predicted traffic threshold data and the second predicted traffic threshold data, and matching the corresponding traffic allocation strategy according to the threshold ratio; An access correspondence between the access alias and the traffic distribution strategy is established.

5. The middleware cluster active-active switching method according to claim 4 is characterized in that: After the step of forwarding the external network request to the target middleware cluster of the first computer room or the second computer room according to the traffic distribution strategy associated with the new access correspondence, the method further includes: If it is monitored that the network operation status of the first computer room or the second computer room changes from an interrupted state to a connected state; Re-execute the steps from obtaining the performance indicator data of the first computer room and the second computer room to matching the corresponding traffic distribution strategy according to the threshold ratio to obtain a new traffic distribution strategy; An access correspondence between the access alias and the new traffic distribution strategy is established.

6. The middleware cluster active-active switching method according to claim 4, characterized in that: After the step of obtaining the performance indicator data of the first computer room and the second computer room, the method further includes: Monitoring whether performance indicator data of the first computer room and the second computer room change; If the performance indicator data changes, calculating the performance change rate of the performance indicator data; If the performance change rate exceeds a preset performance change rate threshold, the steps from obtaining the performance indicator data of the first computer room and the second computer room to establishing the access correspondence between the access alias and the traffic distribution strategy are re-executed.

7. The middleware cluster active-active switching method according to claim 4, characterized in that: After the step of matching the corresponding traffic distribution strategy according to the threshold ratio, the method further includes: Acquire the performance indicator data, the historical traffic data and the corresponding traffic allocation strategy as training data; The preset middleware cluster active-active switching model is trained according to the training data to obtain a trained middleware cluster active-active switching model, wherein the input of the middleware cluster active-active switching model is the computer room performance indicator data and the historical traffic data, and the output of the middleware cluster active-active switching model is the corresponding traffic distribution strategy; The middleware cluster active-active switching model is used to configure the traffic distribution strategy corresponding to the global server load balancing domain name.

8. A middleware cluster active-active switching device, characterized in that: include: A computer room access module, used to connect the target middleware cluster to the first computer room and the second computer room of a preset level; A domain name creation module, used to create at least one global server load balancing domain name, and configure the first computer room and the second computer room as global server load balancing members; A distribution strategy module, used to configure a traffic distribution strategy corresponding to the global server load balancing domain name, wherein the traffic distribution strategy includes the first computer room or the second computer room; An alias creation module, used to create an access alias and establish an access correspondence between the access alias and the traffic distribution strategy; An alias access module, used for allocating received external network requests to corresponding traffic allocation strategies according to the access correspondence; A traffic distribution module is used to forward the external network request to the target middleware cluster of the first computer room or the second computer room according to the traffic distribution strategy.

9. An electronic device, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the middleware cluster active-active switching method according to any one of claims 1 to 7.

10. A non-volatile computer-readable storage medium, characterized in that: The non-volatile computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are executed by an electronic device, the electronic device executes the middleware cluster active-active switching method according to any one of claims 1 to 7.