Unit switching methods, devices, equipment and media under a modular architecture

By combining health check results and performance information in the unitized architecture for dual judgment, the problem of inaccurate unit switching is solved, more accurate unit switching operation is achieved, and service call speed and user experience are improved.

CN116366655BActive Publication Date: 2026-05-26INDUSTRIAL AND COMMERCIAL BANK OF CHINA

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INDUSTRIAL AND COMMERCIAL BANK OF CHINA
Filing Date
2023-03-22
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing technologies are not accurate enough in unit switching in modular architectures, leading to unnecessary unit switching operations.

Method used

When the health check result of the target unit does not meet the preset conditions and the performance information does not meet the performance information of the target transaction, a unit switching operation is performed, and the health check result and performance information of the load balancing system are used for dual judgment.

Benefits of technology

This improved the accuracy of unit switching, avoided unnecessary unit switching operations, and enhanced service call speed and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116366655B_ABST
    Figure CN116366655B_ABST
Patent Text Reader

Abstract

This application provides a unit switching method, apparatus, device, and medium under a unitized architecture, relating to the field of computer technology. The method is applied to a service consumer, wherein the service consumer establishes communication connections with any unit under the unitized architecture and a load balancing system. The method includes: generating a target request for a target transaction, and determining the identification information of the target unit and the performance information of the target transaction under the unitized architecture based on the target request; selecting the health check results and performance information of the target unit from the health check results and performance information of all units obtained from the load balancing system based on the identification information of the target unit; and performing a unit switching operation when the health check results of the target unit do not meet preset conditions and the performance information of the target unit does not meet the performance information of the target transaction. This approach improves the accuracy of the unit switching operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a unit switching method, apparatus, device and medium under a modular architecture. Background Technology

[0002] Unitized architecture uses units as the basic unit of system deployment, with several units deployed across all data centers nationwide. Unitized architecture not only implements data sharding but also sharding for routing access, applications, and caching. To ensure effective invocation of unit backend services, availability assessment of these services is necessary.

[0003] Specifically, in a unitized architecture, existing technologies periodically initiate health checks through a load balancing system to detect the number of live backend services for each unit. When a service consumer actively sends an HTTP request specifically for determining whether to switch units, the load balancing system inserts the number of live backend services for the corresponding unit into a preset field in the HTTP response header and returns an HTTP response to the service consumer. The service consumer compares the number of live backend services returned by the load balancing system with a preset liveness threshold for the unit's backend services. If the number of live backend services is less than the preset threshold, the backend service for that unit is deemed unavailable, and the service consumer actively switches to consume other available backend services. Otherwise, the service consumer continues to consume the backend service for that unit.

[0004] In scenarios where the overall performance capacity of all surviving backend services within a given unit can support the transaction volume initiated by service consumers, but the number of surviving backend services in that unit is less than a preset threshold, unit switching occurs according to current technology. Therefore, the current unit switching method is not accurate enough and generates unnecessary unit switching operations. Summary of the Invention

[0005] This application provides a unit switching method, apparatus, device, and medium under a unitized architecture to solve the problem of poor unit switching accuracy caused by directly performing unit switching in scenarios where the number of surviving services within a target unit does not meet a preset threshold.

[0006] According to a first aspect of this application, a unit switching method under a unitized architecture is provided, applied to a service consumer, wherein the service consumer establishes communication connections with any unit under the unitized architecture and a load balancing system, the method comprising:

[0007] A target request is generated for the target transaction, and the identification information of the target unit under the unit architecture and the performance information of the target transaction are determined based on the target request;

[0008] Based on the identification information of the target unit, the health check results and performance information of the target unit are selected from the health check results and performance information of all units obtained from the load balancing system.

[0009] When the health check result of the target unit does not meet the preset conditions, and the performance information of the target unit does not meet the performance information of the target transaction, a unit switching operation is performed.

[0010] Optionally, the execution unit switching operation includes:

[0011] From the health check results and performance information of all units obtained from the load balancing system, the health check results and performance information of other units are filtered out, wherein the other units are any units other than the target unit under the unit architecture;

[0012] The backup unit is determined based on the health check results and performance information of the other units;

[0013] Based on the backup unit, a backup request is generated for the target transaction;

[0014] The backup request is sent to the backup unit.

[0015] Optionally, determining the backup unit based on the health check results and performance information of the other units includes:

[0016] Other units whose health check results meet preset conditions are identified as first pending units, and other units whose health check results do not meet preset conditions but whose performance information meets the performance information of the target transaction are identified as second pending units.

[0017] In the presence of both the first pending unit and the second pending unit, a backup unit is selected from the first pending unit.

[0018] Optionally, the method further includes:

[0019] When the health check result of the target unit meets the preset conditions, or when the health check result of the target unit does not meet the preset conditions and the performance information of the target unit meets the performance information of the target transaction, the target request is sent to the target unit.

[0020] Optionally, the health check result of the target unit includes the number of services alive within the target unit, and the performance information of the target unit and the performance information of the target transaction both include at least one of the following: the number of concurrent connections, the number of connections within a preset time period, and the number of requests within a preset time period.

[0021] According to a second aspect of this application, a unit switching method under a unitized architecture is provided, applied to a load balancing system, wherein the load balancing system establishes a communication connection with any unit and service consumption unit under the unitized architecture, and the method includes:

[0022] For each unit in the modular architecture, a health check request is initiated, the health check results of all units are received, and the performance information of the live services in each unit is obtained.

[0023] The performance information of all the surviving services in each unit is used as the performance information of each unit, and is sent to the service consumer in accordance with the health check results of each unit, so that the service consumer can determine whether to perform a unit switching operation based on the target request, the health check results of the target unit and the performance information of the target unit, wherein the target unit is the unit specified by the target request.

[0024] According to a third aspect of this application, a unit switching device under a unitized architecture is provided, applied to a service consumer, wherein the service consumer establishes communication connections with any unit under the unitized architecture and a load balancing system, the device comprising:

[0025] A generation and determination module is used to generate a target request for a target transaction, and determine the identification information of the target unit under the unit architecture and the performance information of the target transaction based on the target request;

[0026] The selection module is used to select the health check results and performance information of the target unit from the health check results and performance information of all units obtained from the load balancing system based on the identification information of the target unit.

[0027] The execution module is used to perform a unit switching operation when the health check result of the target unit does not meet the preset conditions and the performance information of the target unit does not meet the performance information of the target transaction.

[0028] According to a fourth aspect of this application, a unit switching device under a unitized architecture is provided, applied to a load balancing system, wherein the load balancing system establishes a communication connection with any unit and service consumption unit under the unitized architecture, and the device includes:

[0029] The initiating receiving module is used to initiate a health check request for each of the units under the unitized architecture, receive the health check results of all the units, and obtain the performance information of the live services in each unit.

[0030] The sending module is used to send the performance information of all the surviving services in each unit as the performance information of each unit, and send it to the service consumer in accordance with the health check results of each unit, so that the service consumer can determine whether to perform a unit switching operation based on the target request, the health check results of the target unit and the performance information of the target unit, wherein the target unit is the unit specified by the target request.

[0031] According to a fifth aspect of this application, an electronic device is provided, comprising: at least one processor and a memory;

[0032] The memory stores computer-executed instructions;

[0033] The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the unit switching method under the unitized architecture as described in the first or second aspect above.

[0034] According to a sixth aspect of this application, a computer-readable storage medium is provided, wherein computer-executable instructions are stored therein, which, when executed by a processor, are used to implement the unit switching method under the unitized architecture described in the first or second aspect above.

[0035] According to a seventh aspect of this application, a computer program product is provided, including a computer program that, when executed by a processor, implements the unit switching method under the unitized architecture described in the first or second aspect.

[0036] This application provides a unit switching method, apparatus, device, and medium under a unitized architecture, applied to a service consumer, wherein the service consumer establishes communication connections with any unit under the unitized architecture and the load balancing system. The method includes: generating a target request for a target transaction, and determining the identification information of the target unit and the performance information of the target transaction under the unitized architecture based on the target request; selecting the health check results and performance information of the target unit from the health check results and performance information of all units obtained from the load balancing system based on the identification information of the target unit; and performing a unit switching operation when the health check results of the target unit do not meet preset conditions and the performance information of the target unit does not meet the performance information of the target transaction.

[0037] This application sets dual conditions for performing unit switching operations. That is, if the health check result of the target unit does not meet the preset conditions, the unit switching operation is not performed. Instead, the unit switching operation is performed only when both the health check result and the performance information of the target unit do not meet the requirements. This unit switching method improves the accuracy of unit switching operations.

[0038] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent from the following description. Attached Figure Description

[0039] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0040] Figure 1 A flowchart illustrating a unit switching method under a modular architecture provided in an embodiment of this application;

[0041] Figure 2 A flowchart illustrating an execution unit switching operation provided in an embodiment of this application;

[0042] Figure 3 A flowchart illustrating another unit switching method under a modular architecture provided in this application embodiment;

[0043] Figure 4 A flowchart illustrating another unit switching method under a modular architecture provided in this application embodiment;

[0044] Figure 5 This is a schematic diagram of a unit switching device under a unitized architecture provided in an embodiment of this application;

[0045] Figure 6 A schematic diagram of a unit switching device under another unitized architecture provided in this application embodiment;

[0046] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0047] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0048] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application.

[0049] In a unitized architecture, existing technologies periodically initiate health checks through a load balancing system to detect the number of live backend services for each unit. When the load balancing system receives an HTTP request from a service consumer to determine whether a unit switch is needed, it inserts the number of live backend services for the corresponding unit into a preset field in the HTTP response header and returns an HTTP response to the service consumer. The service consumer compares the number of live backend services returned by the load balancing system with a preset liveness threshold for the unit's backend services. If the number of live backend services is less than the preset threshold, the backend service for that unit is deemed unavailable, and the service consumer actively switches to consume other available backend services. Otherwise, the service consumer continues to consume the backend service for that unit.

[0050] In scenarios where the overall performance capacity of all surviving backend services within a given unit can support the transaction volume initiated by service consumers, but the number of surviving backend services in that unit is less than a preset threshold, unit switching occurs according to current technology. Therefore, the current unit switching method is not accurate enough and generates unnecessary unit switching operations.

[0051] To address the aforementioned technical problems, the overall inventive concept of this application is to provide a method applicable to the computer field for improving the accuracy of unit switching when the number of surviving services within a target unit does not meet a preset threshold.

[0052] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0053] Example 1:

[0054] Figure 1 This is a flowchart illustrating a unit switching method under a modular architecture provided in an embodiment of this application. Figure 1 As shown, the method in this embodiment is applied to the service consumer, wherein the service consumer establishes communication connections with any unit in the unitized architecture and the load balancing system. The method includes the following steps:

[0055] S10. Generate a target request for the target transaction, and determine the identification information of the target unit under the unit architecture and the performance information of the target transaction based on the target request.

[0056] It should be understood that the aforementioned target request may carry information such as the identification information of the target unit under the unit architecture and the performance information of the target transaction. The identification information of the target unit may include the unit number, unit name, unit IP address, etc. The performance information, also known as performance capacity, is used to indicate the performance capacity required by the target transaction.

[0057] This embodiment can determine the identification information of the target unit and the performance information of the target transaction under the unit architecture by parsing the target request.

[0058] S20. Based on the identification information of the target unit, select the health check results and performance information of the target unit from the health check results and performance information of all units obtained from the load balancing system.

[0059] In this embodiment, the health check result of the unit is used to represent the number of surviving services in the unit. The term "service" is an abbreviation for the unit's backend service. That is, the unit contains both surviving and non-surviving services, and the number of surviving services refers to the total number of surviving services within the unit.

[0060] In this embodiment, the load balancing system has two main functions: first, to periodically perform health checks on each unit to obtain the health check results of each unit; second, to obtain the performance information of all surviving services in the corresponding unit based on the health check results, and to perform superposition calculation on the performance information of all surviving services to obtain the performance information of each unit.

[0061] S30. When the health check result of the target unit does not meet the preset conditions, and the performance information of the target unit does not meet the performance information of the target transaction, execute the unit switching operation.

[0062] It should be understood that the preset condition refers to whether the number of surviving services within the target unit reaches a preset threshold. In this embodiment, the conditions for performing the unit switching operation are set twice in step S30.

[0063] This application embodiment sets dual conditions for performing unit switching operations. That is, if the health check result of the target unit does not meet the preset conditions, the unit switching operation is not performed. Instead, the unit switching operation is performed only when both the health check result and the performance information of the target unit do not meet the requirements. This unit switching method can effectively avoid the service consumer from performing unnecessary unit switching operations and improve the accuracy of unit switching.

[0064] In one possible implementation, the health check result of the target unit includes the number of services alive within the target unit, and the performance information of the target unit and the performance information of the target transaction both include at least one of the following: the number of concurrent connections, the number of connections within a preset time period, and the number of requests within a preset time period.

[0065] The embodiments of this application do not specify the exact value of the preset time period; it can be per second, etc.

[0066] For example, the number of services alive within the target unit is 10. The performance information of the target unit is: 100,000 concurrent connections, 100,000 connections per second, 50,000 requests per second, etc. The performance information differs for different units, and the process for determining the performance information is described in Example 4 below, and will not be repeated here.

[0067] The embodiments of this application specify the performance information of the target unit, which can provide a basis for determining whether to perform a unit switching operation, thereby avoiding unnecessary unit switching operations when the performance of the service within the target unit is sufficient.

[0068] In one possible implementation, the method further includes the following steps:

[0069] S40. When the health check result of the target unit meets the preset conditions, or when the health check result of the target unit does not meet the preset conditions and the performance information of the target unit meets the performance information of the target transaction, the target request is sent to the target unit.

[0070] In this embodiment of the application, when the health check result of the target unit does not meet the preset conditions and the performance information of the target unit meets the performance information of the target transaction, unnecessary unit switching operations are avoided in scenarios where the performance of services within the target unit is sufficient.

[0071] Based on the above embodiments, the technical solution of this application will be described in more detail below with reference to several specific embodiments.

[0072] Example 2:

[0073] Figure 2 This is a flowchart illustrating an execution unit switching operation provided in an embodiment of this application. Figure 1 Based on the illustrated embodiment, this embodiment focuses on Figure 1 The S30 in the text is further refined. For example... Figure 2 As shown, step S30, when the health check result of the target unit does not meet the preset conditions, and the performance information of the target unit does not meet the performance information of the target transaction, performs a unit switching operation, including the following steps:

[0074] S301. From the health check results and performance information of all units obtained from the load balancing system, filter out the health check results and performance information of other units, where other units are any units under the unit architecture other than the target unit.

[0075] S302. Based on the health check results and performance information of other units, determine the backup unit.

[0076] S303. Based on the backup unit, generate a backup request for the target transaction.

[0077] S304. Send the backup request to the backup unit.

[0078] By performing the operations described in S301 to S304, this application embodiment can quickly and accurately determine the backup unit in scenarios where the service performance in the target unit is insufficient, thereby enabling the effective sending of the target transaction request, improving the service call rate, and enhancing the user experience.

[0079] In one possible implementation, step S302, determining the backup unit based on the health check results and performance information of other units, includes the following steps:

[0080] S3021. Other units whose health check results meet the preset conditions are identified as first pending units, and other units whose health check results do not meet the preset conditions but whose performance information meets the performance information of the target transaction are identified as second pending units.

[0081] For example, there are 10 other units. Among these 10 other units, 5 are first undetermined units and 3 are second undetermined units. The remaining 2 other units are units whose health check results do not meet the preset conditions and whose performance information does not meet the performance information of the target transaction. Therefore, these 2 other units cannot be used as backup units. Thus, this application can accurately select the first undetermined units and the second undetermined units that can become backup units through step S3021.

[0082] S3022. If there is a first undetermined unit and a second undetermined unit, select a backup unit from the first undetermined unit.

[0083] This embodiment of the application allows for priority settings for the first and second pending units. It prioritizes units in the first pending unit as backup units for request processing. Furthermore, if multiple units exist in the first pending unit, the unit with the largest number of surviving services is prioritized as the backup unit for request processing. Through these operations, this embodiment can quickly determine the backup unit.

[0084] Optionally, embodiments of this application can further determine the historical requests generated by the service consumer for the same transaction type based on the transaction type of the target transaction of the service consumer, parse the historical requests to obtain historical units. The health check result of the historical unit at the current moment is determined. If the health check result of the historical unit meets preset conditions, the historical unit is preferentially used as a backup unit to improve the success rate of request processing. Alternatively, if the health check result of the historical unit does not meet the preset conditions, but the performance information of the historical unit meets the performance information of the target transaction, the historical unit is preferentially used as a backup unit. Alternatively, when there are multiple historical units, the historical unit with the largest number of surviving services in the historical unit set is used as the backup unit, thereby improving the success rate of request processing.

[0085] Since other units under the unitized architecture may serve as backup units when services are unavailable in the target unit, this embodiment can improve the accuracy of backup units through steps S3021 to S3022, thereby improving the accuracy of unit switching and providing a foundation for improving the service call rate in the future.

[0086] Example 3:

[0087] Figure 3 This is a flowchart illustrating another unit switching method under a unitized architecture provided in an embodiment of this application. Figure 3 As shown, the method of this embodiment is applied to a load balancing system, wherein the load balancing system establishes a communication connection with any unit and service consumption unit under the unitized architecture. The method includes:

[0088] S50 initiates a health check request for each unit in the unitized architecture, receives the health check results of all units, and obtains the performance information of the surviving services in each unit.

[0089] S60. The performance information of all surviving services in each unit is used as the performance information of each unit and sent to the service consumer in accordance with the health check results, so that the service consumer can determine whether to perform the unit switching operation based on the target request, the health check results of the target unit and the performance information of the target unit. The target unit is the unit specified by the target request.

[0090] As described in Examples 1 and 4, the load balancing system mainly has the following two functions: first, to periodically perform health checks on each unit under the unitized architecture to obtain the health check results of each unit; second, based on the health check results, to obtain the performance information of all surviving services in the corresponding unit, and to perform superposition calculation on the performance information of all surviving services to obtain the performance information of each unit, and then to provide all the information of each unit to the service consumer.

[0091] The load balancing system in this application embodiment can provide accurate and real-time data on whether the service consumer performs a unit switching operation, thereby improving the accuracy of unit switching.

[0092] Example 4:

[0093] Figure 4 This is a flowchart illustrating another unit switching method under a modular architecture provided in an embodiment of this application. For example... Figure 4 As shown, the method in this embodiment realizes the interaction between the load balancing system, two units under the unitized architecture, and the service consumption unit, including the following steps:

[0094] S41. Analyze the performance information of each backend service within the unit.

[0095] In this embodiment, all backend services under each unit in the unitized architecture execute step S41 as described above. The performance information of this service can be used to analyze its corresponding performance capacity, which reflects the amount of traffic each service can support. This performance capacity includes three metrics: concurrent connections, connections per second, and requests per second. The analysis method for the performance information of a single backend service is as follows:

[0096] The backend service, based on its own CPU and memory specifications, as well as the middleware product it deploys (e.g., Nginx, Tomcat, Apache, etc.), sends a query command to the configuration center. This query command retrieves the corresponding performance capacity from the preset "Physical Specifications - Middleware - Middleware Version - Performance Capacity" table. The preset "Physical Specifications - Middleware - Middleware Version - Performance Capacity" table is shown in Table 1:

[0097] Table 1 shows the preset "Physical Specifications - Middleware - Middleware Version - Performance Capacity" table.

[0098]

[0099]

[0100] The table is stored in the configuration center. When the data in the table is updated, the configuration center actively notifies each backend service under each unit so that the backend service can actively obtain the latest data from the configuration center and thus determine the performance capacity.

[0101] For example: A backend service in a certain unit deploys Nginx version 1.20.1 under 4C8G and sends a query request to the configuration center. The configuration center determines the performance capacity of the backend service based on the preset "physical specifications-middleware-middleware version-performance capacity" table: it can support 10,000 concurrent connections, 10,000 connections per second, and 5,000 requests per second, and feeds this information back to the backend service.

[0102] In addition, each backend service within each unit exposes an HTTP interface, allowing external devices to access the performance capacity of the backend service.

[0103] S42, the load balancing system periodically initiates health check requests to detect the liveness of each backend service under each unit, and periodically accesses the HTTP interfaces provided by each backend service under each unit to obtain its performance capacity.

[0104] S43. The load balancing system accumulates the performance capacity of each surviving backend service under the unit to obtain the overall performance capacity of the unit.

[0105] In addition, the load balancing system also exposes its corresponding HTTP interface so that external devices can access the HTTP interface to obtain the overall performance capacity of each unit.

[0106] This overall performance capacity also corresponds to the three metrics mentioned above: number of concurrent connections, number of connections per second, and number of requests per second.

[0107] S44. Service consumers periodically access the HTTP interface provided by the load balancing system to obtain the overall performance capacity of each unit.

[0108] It should be understood that the embodiments of this application do not specifically limit the period length corresponding to the periodicity in each stage.

[0109] S45. The service consumer compares the number of concurrent connections, connections per second, and requests per second of the initiated transaction with the overall performance capacity of the corresponding unit. If the former is greater than the latter, proceed to step S46; if the former is less than or equal to the latter, proceed to step S47.

[0110] S46. Service consumer: Perform a switching operation to actively switch to other backend services within the unit that meet the current transaction performance requirements.

[0111] S47. Service consumers continue to consume backend services within this unit.

[0112] This embodiment, by executing steps S41 to S47, can solve the problem of inaccurate unit switching in existing unit switching methods when the unit backend service performance is sufficient, improve the accuracy of unit switching, and avoid unnecessary unit switching operations.

[0113] Example 5:

[0114] Figure 5 This is a schematic diagram of a unit switching device under a modular architecture, provided as an embodiment of this application. The device in this embodiment can be in software and / or hardware form. For example... Figure 5 As shown, the unit switching device under the unitized architecture provided in this embodiment is applied to the service consumer. The service consumer establishes communication connections with any unit and the load balancing system under the unitized architecture. The device includes a generation and determination module 51, a selection module 52, and an execution module 53.

[0115] The generation and determination module 51 is used to generate a target request for the target transaction and determine the identification information of the target unit under the unit architecture and the performance information of the target transaction based on the target request.

[0116] The selection module 52 is used to select the health check results and performance information of the target unit from the health check results and performance information of all units obtained from the load balancing system based on the identification information of the target unit.

[0117] The execution module 53 is used to perform a unit switching operation when the health check result of the target unit does not meet the preset conditions and the performance information of the target unit does not meet the performance information of the target transaction.

[0118] In one possible implementation, execution module 53 is further used for:

[0119] From the health check results and performance information of all units obtained from the load balancing system, the health check results and performance information of other units are filtered out. The other units are any units under the unit architecture other than the target unit.

[0120] The backup unit is determined based on the health check results and performance information of other units.

[0121] Based on the backup unit, a backup request is generated for the target transaction.

[0122] Send the backup request to the backup unit.

[0123] In one possible implementation, execution module 53 is further used for:

[0124] Other units whose health check results meet the preset conditions are identified as first pending units, and other units whose health check results do not meet the preset conditions but whose performance information meets the performance information of the target transaction are identified as second pending units.

[0125] If there are a first undetermined unit and a second undetermined unit, a backup unit is selected from the first undetermined unit.

[0126] In one possible implementation, the unit switching device under this modular architecture is further used for:

[0127] When the health check result of the target unit meets the preset conditions, or when the health check result of the target unit does not meet the preset conditions but the performance information of the target unit meets the performance information of the target transaction, the target request will be sent to the target unit.

[0128] In one possible implementation, the health check result of the target unit includes the number of services alive within the target unit, and the performance information of the target unit and the performance information of the target transaction both include at least one of the following: the number of concurrent connections, the number of connections within a preset time period, and the number of requests within a preset time period.

[0129] The unit switching device under the unitized architecture provided in this embodiment can be used to execute the unit switching method under the unitized architecture provided in any of the method embodiments of Embodiments 1, 2 and 4 above. Its implementation principle and technical effect are similar, and will not be described in detail here.

[0130] Example 6:

[0131] Figure 6 This is a schematic diagram of a unit switching device under another unitized architecture provided in an embodiment of this application. The device in this embodiment can be in software and / or hardware form. For example... Figure 6 As shown, the unit switching device under the unitized architecture provided in this embodiment is applied to a load balancing system. The load balancing system establishes a communication connection with any unit and service consumption unit under the unitized architecture. The device includes an initiation and reception module 61 and a transmission module 62.

[0132] The receiving module 61 is used to initiate a health check request for each unit in the unitized architecture, receive the health check results of all units, and obtain the performance information of the surviving services in each unit.

[0133] The sending module 62 is used to send the performance information of all surviving services in each unit as the performance information of each unit, and send it to the service consumer in accordance with the health check results, so that the service consumer can determine whether to perform the unit switching operation based on the target request, the health check results of the target unit and the performance information of the target unit, wherein the target unit is the unit specified by the target request.

[0134] The unit switching device under the unitized architecture provided in this embodiment can be used to execute the unit switching method under the unitized architecture provided in any of the method embodiments in Embodiments 3 and 4 above. Its implementation principle and technical effect are similar, and will not be described in detail here.

[0135] It should be noted that the user information and data involved in this application (including but not limited to data used for analysis, stored data, and displayed data) are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use, and processing of the relevant data must comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.

[0136] In other words, the collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution of this application all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0137] According to embodiments of this application, this application also provides an electronic device and a readable storage medium.

[0138] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device includes a receiver 70, a transmitter 71, at least one processor 72, and a memory 73. The electronic device composed of the above components can be used to implement the above-described specific embodiments of this application, which will not be described in detail here.

[0139] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the methods described above.

[0140] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the various steps in the methods described above.

[0141] Various embodiments of the systems and technologies described above in this application can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0142] The program code used to implement the methods of this application may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or electronic device.

[0143] In the context of this application, a computer-readable storage medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium can be a machine-readable signal medium or a machine-readable storage medium. A computer-readable storage medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of computer-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0144] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0145] The systems and technologies described herein can be implemented in computing systems that include back-end components (e.g., as data electronic devices), or computing systems that include middleware components (e.g., application electronic devices), or computing systems that include front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0146] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this application can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this application can be achieved, and this is not limited herein.

[0147] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the principles of this application should be included within the scope of protection of this application.

Claims

1. A cell switching method under a cell-based architecture, characterized in that, Applied to the service consumer, wherein the service consumer establishes communication connections with any unit under the unitized architecture and the load balancing system, the method includes: A target request is generated for the target transaction, and the identification information of the target unit under the unit architecture and the performance information of the target transaction are determined based on the target request; Based on the identification information of the target unit, the health check results and performance information of the target unit are selected from the health check results and performance information of all units obtained from the load balancing system. The health check results of the target unit include the number of services alive within the target unit. The performance information of the target unit and the performance information of the target transaction both include at least one of the following: the number of concurrent connections, the number of connections within a preset time period, and the number of requests within a preset time period. When the health check result of the target unit does not meet the preset conditions, and the performance information of the target unit does not meet the performance information of the target transaction, a unit switching operation is performed. The execution unit switching operation includes: From the health check results and performance information of all units obtained from the load balancing system, the health check results and performance information of other units are filtered out, wherein the other units are any units other than the target unit under the unit architecture; Other units whose health check results meet preset conditions are identified as first pending units, and other units whose health check results do not meet preset conditions but whose performance information meets the performance information of the target transaction are identified as second pending units; both the first pending units and the second pending units can serve as backup units; In the presence of both the first undetermined unit and the second undetermined unit, a backup unit is selected from the first undetermined unit; Based on the backup unit, a backup request is generated for the target transaction; The backup request is sent to the backup unit.

2. The method of claim 1, wherein, Also includes: When the health check result of the target unit meets the preset conditions, or when the health check result of the target unit does not meet the preset conditions and the performance information of the target unit meets the performance information of the target transaction, the target request is sent to the target unit.

3. A cell switching method under a cell-based architecture, characterized in that, The method, applied to a load balancing system, wherein the load balancing system establishes communication connections with any unit and service consumption unit under the unitized architecture, includes: For each unit in the modular architecture, a health check request is initiated, the health check results of all units are received, and the performance information of the live services in each unit is obtained. The performance information of all surviving services within each unit is used as the performance information of each unit, and is sent to the service consumer along with the corresponding health check results. The service consumer then determines whether to perform a unit switching operation based on the target request, the health check results of the target unit, and the performance information of the target unit. The target unit is the unit specified in the target request. If the health check result of the target unit does not meet preset conditions, and the performance information of the target unit does not meet the performance information of the target transaction, the service consumer determines to perform a unit switching operation. This unit switching operation includes: filtering out the health check results and performance information of other units from the health check results and performance information of all units obtained from the load balancing system. The other units are those excluding the target unit in the unit architecture. Any unit other than the target unit; other units whose health check results meet preset conditions are identified as first pending units, and other units whose health check results do not meet preset conditions but whose performance information meets the performance information of the target transaction are identified as second pending units; in the presence of the first pending unit and the second pending unit, a backup unit is selected from the first pending unit; based on the backup unit, a backup request is generated for the target transaction; the backup request is sent to the backup unit; the health check result of the target unit includes the number of services alive within the target unit, and the performance information of the target unit and the performance information of the target transaction both include at least one of the following: the number of concurrent connections, the number of connections within a preset time period, and the number of requests within a preset time period; both the first pending unit and the second pending unit can serve as backup units.

4. A cell switching device under a cell-based architecture, characterized in that, Applied to the service consumer, wherein the service consumer establishes communication connections with any unit under the unitized architecture and the load balancing system, the device includes: A generation and determination module is used to generate a target request for a target transaction, and determine the identification information of the target unit under the unit architecture and the performance information of the target transaction based on the target request; The selection module is used to select the health check result and performance information of the target unit from the health check results and performance information of all units obtained from the load balancing system based on the identification information of the target unit. The health check result of the target unit includes the number of services alive within the target unit, and the performance information of the target unit and the performance information of the target transaction both include at least one of the following: the number of concurrent connections, the number of connections within a preset time period, and the number of requests within a preset time period. The execution module is used to perform a unit switching operation when the health check result of the target unit does not meet the preset conditions and the performance information of the target unit does not meet the performance information of the target transaction. The execution module is specifically used to filter out the health check results and performance information of other units from the health check results and performance information of all units obtained from the load balancing system, wherein the other units are any units other than the target unit under the unit architecture; Other units whose health check results meet preset conditions are identified as first pending units, and other units whose health check results do not meet preset conditions but whose performance information meets the performance information of the target transaction are identified as second pending units; both the first pending units and the second pending units can serve as backup units; In the presence of both the first undetermined unit and the second undetermined unit, a backup unit is selected from the first undetermined unit; Based on the backup unit, a backup request is generated for the target transaction; The backup request is sent to the backup unit.

5. A cell switching device under a cell-based architecture, characterized in that, An apparatus for use in a load balancing system, wherein the load balancing system establishes communication connections with any unit and service consumption unit under the unitized architecture, the apparatus comprising: The initiating and receiving module is used to initiate a health check request for each of the units under the unitized architecture, receive the health check results of all the units, and obtain the performance information of the live services in each unit. The sending module is used to send the performance information of all surviving services within each unit as the performance information of each unit, corresponding to the health check results, to the service consumer. This allows the service consumer to determine whether to perform a unit switching operation based on the target request, the health check results of the target unit, and the performance information of the target unit. The target unit is the unit specified in the target request. When the health check results of the target unit do not meet preset conditions, and the performance information of the target unit does not meet the performance information of the target transaction, the service consumer determines to perform a unit switching operation. This unit switching operation includes: filtering out the health check results and performance information of other units from the health check results and performance information of all units obtained from the load balancing system. The other units are those within the unit architecture. Any unit other than the target unit; other units whose health check results meet preset conditions are identified as first pending units, and other units whose health check results do not meet preset conditions but whose performance information meets the performance information of the target transaction are identified as second pending units; in the presence of the first pending unit and the second pending unit, a backup unit is selected from the first pending unit; based on the backup unit, a backup request is generated for the target transaction; the backup request is sent to the backup unit; the health check result of the target unit includes the number of services alive within the target unit, and the performance information of the target unit and the performance information of the target transaction both include at least one of the following: the number of concurrent connections, the number of connections within a preset time period, and the number of requests within a preset time period; both the first pending unit and the second pending unit can serve as backup units.

6. An electronic device, comprising: include: At least one processor and memory; The memory stores computer-executed instructions; The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the unit switching method under the unitized architecture as described in any one of claims 1 to 3.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the unit switching method under the unitized architecture as described in any one of claims 1 to 3.

8. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, is used to implement the unit switching method under the unitized architecture as described in any one of claims 1 to 3.