Service processing method, device, equipment and medium based on service cluster system

By building a cross-cluster registration synchronization center and multiple service cluster systems, the problem that the registration center in the existing technology cannot realize cross-network and cross-region service calls, and efficient cross-region service calls are achieved.

CN115866061BActive Publication Date: 2025-05-23NINGBO GEELY AUTOMOBILE RES & DEV CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211519497.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-30
Publication Date
2025-05-23
Estimated Expiration
2042-11-30

AI Technical Summary

Technical Problem

In the prior art, the registration center of the microservice architecture only records the mapping relationship between the services and service addresses in the cluster, and cannot realize service calls across networks and regions.

Method used

By building a service cluster system composed of a cross-cluster registration synchronization center and multiple service clusters, service calls across networks and regions are realized. The specific method includes: the first service cluster receives a service call request sent by the cross-cluster registration synchronization center, query and obtains the identity of the second service cluster corresponding to the service identifier to be called, and sends a cross-cluster call request to the second service cluster to realize the service call across the cluster.

Benefits of technology

It realizes service calls across networks and regions, solves the problem that the registration center cannot call services across regions in the existing technology, optimizes the service call experience and improves the service call efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115866061B_ABST
    Figure CN115866061B_ABST
Patent Text Reader

Abstract

The present application provides a service processing method, device, equipment and medium based on a service cluster system. The method includes: by constructing a service cluster system composed of a service cluster and a cross-cluster registration and synchronization center, obtaining a first time difference, a second time difference, a third time difference and a service load list, a service load sorting list according to a heartbeat mechanism, and obtaining a first formula, a second formula, and a third formula according to corresponding weights, thereby obtaining the highest priority service cluster and the highest priority service node in the highest priority service cluster, and making a cross-cluster call to the service node. Compared with the prior art, the registration center within the cluster only records the mapping relationship between the services and service addresses within the cluster, and cannot realize cross-network and cross-region service calls. The present application constructs a service call priority algorithm, which optimizes the service call experience and improves the service call efficiency while realizing cross-network and cross-region service calls.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of service invocation technology, and in particular to a service processing method, device, equipment and medium based on a service cluster system. Background Art

[0002] With the development of communication technology, more and more microservice architectures are deployed in cloud environments. However, in the microservice architecture system in the prior art, the registration center only records the mapping relationship between services working in a single network area and service addresses.

[0003] However, in the prior art, if the microservice architecture is deployed across network regions, it is impossible to obtain services between different network regions by querying the registration address in the registration center, making it difficult to implement cross-network and cross-region service calls. Summary of the invention

[0004] The present application provides a service processing method, device, equipment and medium based on a service cluster system, which is used to solve the problem in the prior art that the registration center in the cluster only records the mapping relationship between the services and service addresses in the cluster and cannot realize cross-network and cross-region service calls.

[0005] In a first aspect, the present application provides a service processing method based on a service cluster system, comprising:

[0006] The first service cluster receives a service invocation request sent by the cross-cluster registration synchronization center, where the service invocation request includes: an identifier of a service to be invoked.

[0007] The first service cluster performs a call processing on the service to be called corresponding to the service identifier to be called according to the service call request, and during the calling process, when it is determined to call a calling service associated with the service to be called, and the associated calling service is not in the first service cluster, the identifier of the second service cluster corresponding to the service identifier to be called is queried from the first registration center in the first service cluster.

[0008] The first service cluster sends a cross-cluster call request carrying the identifier of the associated call service to the second service cluster corresponding to the identifier of the second service cluster, so that the second service cluster can call the associated call service corresponding to the identifier of the associated call service according to the cross-cluster call request.

[0009] In a specific implementation manner, the first service cluster performs a call process on the service to be called corresponding to the service identifier to be called according to the service call request, including:

[0010] The local API gateway in the first service cluster queries and obtains, from the first registration center, a current service load list corresponding to the service identifier to be called and a first time difference corresponding to the service identifier to be called in the current first delay table based on the service call request, and obtains the service node with the highest priority under the service to be called based on the current load list and the corresponding weight, and the first time difference and the corresponding weight, so as to forward the service call request to the service node with the highest priority.

[0011] The service node with the highest priority in the first service cluster performs service call processing according to the call request.

[0012] In a specific embodiment, it also includes:

[0013] The first registration center in the first service cluster performs heartbeat mechanism processing with each service in the first service cluster respectively to obtain or update the first delay table, where the first delay table includes a first time difference corresponding to each service.

[0014] The first registration center in the first service cluster obtains a service load list corresponding to each service according to the load status of the service node in each service under the first service cluster, and sends the service load list corresponding to each service to the cross-cluster registration synchronization center.

[0015] In a specific embodiment, it also includes:

[0016] The first registration center in the first service cluster performs heartbeat mechanism processing on other service clusters, obtains a third delay table, and sends the third delay table to the cross-cluster registration synchronization center.

[0017] The third delay table includes a third time difference corresponding to each service cluster.

[0018] In a second aspect, the present application provides a service processing method based on a service cluster system, comprising:

[0019] The cross-cluster registration synchronization center obtains a service call request, where the service call request includes: an identifier of a service to be called.

[0020] The cross-cluster registration synchronization center searches for and obtains a service cluster list where the service identifier to be called is located according to the service call request.

[0021] The cross-cluster registration synchronization center obtains the second time difference and the third time difference corresponding to each service cluster in the cluster list according to the second delay table and the third delay table, and obtains the delay level of each service cluster according to the second time difference and the corresponding weight, and the third time difference and the corresponding weight.

[0022] The cross-cluster registration synchronization center obtains the load corresponding to the service identifier to be called under each service cluster according to the service load sorting list, and obtains the priority of each service cluster according to the latency level and corresponding weight of each service cluster, and the load and corresponding weight corresponding to the service identifier to be called under each service cluster.

[0023] The cross-cluster registration synchronization center sends the service call request to the service cluster with the highest priority, so that the service cluster with the highest priority performs corresponding service call processing according to the service call request.

[0024] In a specific embodiment, it also includes:

[0025] The cross-cluster registration synchronization center performs heartbeat mechanism processing with the registration center in each service cluster, obtains a second delay table, and sends the second delay table to the registration center in each service cluster; wherein the second delay includes a second time difference corresponding to each service cluster.

[0026] The cross-cluster registration synchronization center obtains the third delay table reported by each service cluster respectively; wherein the third delay table is a delay table obtained by the registration center in the service cluster performing heartbeat mechanism processing on other service clusters.

[0027] In a specific embodiment, it also includes:

[0028] The cross-cluster registration synchronization center obtains the service load list corresponding to each service under the service cluster reported by each service cluster, and integrates the same services to obtain a service load ranking list.

[0029] In a third aspect, the present application provides a service cluster, including:

[0030] The API gateway is used to receive a service call request sent by a cross-cluster registration and synchronization center, where the service call request includes: a service identifier to be called.

[0031] A service is used to call the service to be called corresponding to the service identifier to be called according to the service call request, and during the calling process, when it is determined to call a calling service associated with the service to be called, and the associated calling service is not in the service cluster, query and obtain the identifier of the second service cluster corresponding to the service identifier to be called from the first registration center in the service cluster.

[0032] The service is also used to send a cross-cluster call request carrying the identifier of the associated calling service to the second service cluster corresponding to the identifier of the second service cluster, so that the second service cluster can call the associated calling service corresponding to the identifier of the associated calling service according to the cross-cluster call request.

[0033] In a specific implementation, the API gateway is specifically used to:

[0034] According to the service call request, the current service load list corresponding to the service identifier to be called and the first time difference corresponding to the service identifier to be called in the current first delay table are queried from the first registration center, and the service node with the highest priority under the service to be called is obtained based on the current load list and the corresponding weight, and the first time difference and the corresponding weight, so as to forward the service call request to the service node with the highest priority.

[0035] The service node with the highest priority in the first service cluster performs service call processing according to the call request.

[0036] In a specific implementation, the first registration center is used to perform heartbeat mechanism processing with each service in the service cluster, obtain or update the first delay table, and the first delay table includes the first time difference corresponding to each service.

[0037] According to the load status of the service nodes in each service under the first service cluster, a service load list corresponding to each service is obtained respectively, and the service load list corresponding to each service is sent to the cross-cluster registration and synchronization center.

[0038] In a specific implementation, the registration center is further used for:

[0039] Perform heartbeat mechanism processing on other service clusters, obtain a third delay table, and send the third delay table to the cross-cluster registration and synchronization center.

[0040] The third delay table includes a third time difference corresponding to each service cluster.

[0041] In a fourth aspect, the present application provides a cross-cluster registration synchronization center, including:

[0042] The external gateway is used to obtain a service call request, wherein the service call request includes: an identifier of a service to be called.

[0043] The internal server is used to search and obtain the service cluster list where the service identifier to be called is located according to the service calling request.

[0044] The internal server is also used to obtain the second time difference and the third time difference corresponding to each service cluster in the cluster list according to the second delay table and the third delay table, and obtain the delay level of each service cluster according to the second time difference and the corresponding weight, and the third time difference and the corresponding weight.

[0045] The internal server is also used to obtain the load corresponding to the service identifier to be called under each service cluster according to the service load sorting list, and obtain the priority of each service cluster according to the latency level and corresponding weight of each service cluster, and the load and corresponding weight corresponding to the service identifier to be called under each service cluster.

[0046] The external gateway is further configured to send the service call request to the service cluster with the highest priority, so that the service cluster with the highest priority can perform corresponding service call processing according to the service call request.

[0047] In a specific implementation, the internal server is further used for:

[0048] Perform heartbeat mechanism processing with the registration center in each service cluster, obtain a second delay table, and send the second delay table to the registration center in each service cluster respectively; wherein the second delay includes a second time difference corresponding to each service cluster.

[0049] The third delay table reported by each service cluster is obtained respectively; wherein the third delay table is a delay table obtained by a registration center in the service cluster performing heartbeat mechanism processing on other service clusters.

[0050] In a specific implementation, the internal server is further used for:

[0051] A service load list corresponding to each service under the service cluster reported by each service cluster is obtained respectively, and the same services are integrated to obtain a service load sorting list.

[0052] In a fifth aspect, the present application provides a service cluster system, comprising: a cross-cluster registration synchronization center and multiple service clusters; wherein the cross-cluster registration synchronization center is used to execute the service processing method as described in the second aspect; and the service cluster is used to execute the service processing method as described in the first aspect.

[0053] In a sixth aspect, the present application provides a service cluster, including:

[0054] Processor, memory, communication interface.

[0055] The memory is used to store executable instructions executable by the processor.

[0056] The processor is configured to execute the service processing method as described in the first aspect by executing the executable instructions.

[0057] In a seventh aspect, the present application provides a cross-cluster registration synchronization center, including:

[0058] Processor, memory, communication interface.

[0059] The memory is used to store executable instructions executable by the processor.

[0060] Wherein, the processor is configured to execute the service processing method as described in the second aspect by executing the executable instructions.

[0061] In an eighth aspect, the present application provides a readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the service processing method described in the first aspect.

[0062] In a ninth aspect, the present application provides a readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the service processing method described in the second aspect.

[0063] The present application provides a service processing method, device, equipment and medium based on a service cluster system, wherein a first service cluster receives a service call request sent by a cross-cluster registration and synchronization center, wherein the service call request includes: a service identifier to be called; the first service cluster performs a call processing on the service to be called corresponding to the service identifier to be called according to the service call request, and during the call process, when it is determined to call a call service associated with the service to be called, and the associated call service is not in the first service cluster, the first service cluster queries and obtains the identifier of the second service cluster corresponding to the service identifier to be called from the first registration center in the first service cluster; the first service cluster sends a cross-cluster call request carrying the identifier of the associated call service to the second service cluster corresponding to the identifier of the second service cluster, so that the second service cluster performs a call processing on the associated call service corresponding to the identifier of the associated call service according to the cross-cluster call request. Compared with the prior art, the registration center in the service cluster only records the mapping relationship between the service and the service address in the cluster, and cannot realize cross-network and cross-region service calls. The present application constructs a service cluster system consisting of a cross-cluster registration and synchronization center and multiple service clusters to realize cross-network and cross-region service calls. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0065] Figure 1 A flowchart of a first embodiment of a service processing method based on a service cluster system provided by the present application;

[0066] Figure 2 A flow chart of a second embodiment of a service processing method based on a service cluster system provided by the present application;

[0067] Figure 3 A flowchart of a third embodiment of a service processing method based on a service cluster system provided by the present application;

[0068] Figure 4 A flowchart of a fourth embodiment of a service processing method based on a service cluster system provided by the present application;

[0069] Figure 5 A schematic diagram of the principle of a service cluster system provided for this application;

[0070] Figure 6 A schematic diagram of the structure of a service cluster embodiment 4 provided in this application;

[0071] Figure 7 A schematic diagram of the structure of a fifth embodiment of a cross-cluster registration and synchronization center provided by the present application;

[0072] Figure 8 This is a structural diagram of a service cluster system embodiment 6 provided in this application.

[0073] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0074] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments made by ordinary technicians in this field under the enlightenment of the embodiments belong to the scope of protection of the present application.

[0075] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0076] In the prior art, the registration center in the cluster only records the mapping relationship between the services and service addresses in the cluster, and can only call the services within the cluster, making it difficult to call services across networks and regions. Therefore, the idea of ​​this application is to realize cross-network and cross-region service calls.

[0077] The technical solution of the present application is described in detail below through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0078] Figure 1 A flow chart of a service processing method embodiment 1 based on a service cluster system provided by the present application, such as Figure 1 As shown, the service processing method based on the service cluster system specifically includes the following steps:

[0079] Step S101: The first service cluster receives a service call request sent by a cross-cluster registration synchronization center.

[0080] The service call request includes: an identifier of the service to be called.

[0081] Step S102: The first service cluster performs a call processing on the service to be called corresponding to the service identifier to be called according to the service call request, and during the call process, when it is determined to call a calling service associated with the service to be called, and the associated calling service is not in the first service cluster, the identifier of the second service cluster corresponding to the service identifier to be called is queried from the first registration center in the first service cluster.

[0082] Specifically, Figure 5 As shown in the principle diagram of a service cluster system provided by the present application, the internal services of each service cluster send their corresponding service information to the registration center in the service cluster through the hypertext transfer protocol HTTP for registration processing to form a local service list. The registration center in the service cluster sends the service information to the external gateway of the cross-cluster registration and synchronization center through the transmission control protocol TCP. The external gateway sends the service information to the internal server through the hypertext transfer protocol HTTP. The internal server sends the service information to the service list through the hypertext transfer protocol HTTP for registration processing, that is, the service list of the cross-cluster registration and synchronization center includes the service information in all service clusters. The internal server of the cross-cluster registration and synchronization center matches the service and the server load balancer SLB corresponding to the service cluster to which the service belongs according to the service information. The service list of the cross-cluster registration and synchronization center will register the service information corresponding to all services in all service clusters, and send it to the external gateway through the internal server, and the external gateway sends it to the registration center of each service cluster through the transmission control protocol TCP.

[0083] If a service exits a service cluster or is in an abnormal state, the registration center within the service cluster to which the service belongs receives a message about the service exit or detects that the service is in an abnormal state through the heartbeat mechanism. It then updates the local service list, synchronously updates the service list of the cross-cluster registration synchronization center, and sends the updated service information to the registration centers in each service cluster.

[0084] The service information includes the service name, the port number corresponding to the service, the service description, the IP address corresponding to the service, the service cluster to which the service belongs, etc. The transmission control protocol TCP connection uses the pki certificate as a two-way verification method. The communication data protocol format is command (fixed to 4 bytes) + length (fixed to 2 bytes) + data. Specifically, command is the command information, length is the length information of data, and data is the data information. The communication data protocol can be compressed using several file compression programs.

[0085] Specifically, when the registration information within the service cluster sends a command to initialize the connection information to the cross-cluster registration synchronization center, the data information included in the command is the service cluster information, service cluster status, service quantity, timestamp, etc.; when the registration information within the service cluster sends a command to request service list synchronization to the cross-cluster registration synchronization center, the data information included in the command is the service cluster information, timestamp, etc.; when the registration information within the service cluster sends a service registration command to the cross-cluster registration synchronization center, the data information included in the command is the service cluster information, SLB information, service name, service status, timestamp, etc.; when the registration information within the service cluster sends a service cancellation command to the cross-cluster registration synchronization center, the data information included in the command is the service cluster information, SLB information, service name, service status, timestamp, etc.; when the cross-cluster registration synchronization center sends a service synchronization command to the registration information within the service cluster, the data information included in the command is the service list, timestamp, etc. Specifically, the service list includes the service name, the service corresponding service cluster, the service status, and the service corresponding SLB; when the cross-cluster registration synchronization center sends a request service list reporting command to the registration information within the service cluster, the data information included in the command is timestamp, etc.

[0086] Step S103: the first service cluster sends a cross-cluster invocation request carrying the identifier of the associated invocation service to the second service cluster corresponding to the identifier of the second service cluster, so that the second service cluster performs invocation processing on the associated invocation service corresponding to the identifier of the associated invocation service according to the cross-cluster invocation request.

[0087] In this embodiment, the service to be called in the first service cluster, that is, the associated calling service, searches for the service cluster to which the associated calling service belongs based on the service information corresponding to the services in all service clusters sent by the cross-cluster registration synchronization center in the registration center within the service cluster. If the query result is that the associated calling service belongs to another service cluster, a cross-cluster calling request is sent to the SLB of the service cluster via the Hypertext Transfer Protocol HTTP. The SLB of the service cluster sends the cross-cluster calling request to the API gateway within the service cluster via the Hypertext Transfer Protocol HTTP. The API gateway searches for the IP address of the associated calling service in the registration center within the service cluster based on the cross-cluster calling request, and calls the associated calling service based on the IP address of the associated calling service.

[0088] Specifically, Figure 5 As shown, the associated calling service, that is, service 3, is queried in the registration center A of service cluster A and belongs to service cluster B. Then, a cross-cluster calling request is sent to SLB-B of service cluster B through the hypertext transfer protocol HTTP. The SLB-B of the service cluster sends the cross-cluster calling request to the API gateway B inside the service cluster through the hypertext transfer protocol HTTP. API gateway B searches for the IP address of service 3 in the registration center inside the service cluster according to the cross-cluster calling request, and calls service 3 according to the IP address of service 3.

[0089] In this embodiment, a service call request sent by a cross-cluster registration and synchronization center is received by the first service cluster, and the service call request includes: a service identifier to be called; the first service cluster performs a call process on the service to be called corresponding to the service identifier to be called according to the service call request, and during the call process, when it is determined to call a call service associated with the service to be called, and the associated call service is not in the first service cluster, the identifier of the second service cluster corresponding to the service identifier to be called is queried from the first registration center in the first service cluster; the first service cluster sends a cross-cluster call request carrying the identifier of the associated call service to the second service cluster corresponding to the identifier of the second service cluster, so that the second service cluster can perform a call process on the associated call service corresponding to the identifier of the associated call service according to the cross-cluster call request. Compared with the prior art service cluster, the registration center in the service cluster only records the mapping relationship between the service and the service address in the service cluster, and cannot realize cross-network and cross-region service calls. This application constructs a service cluster system composed of a cross-cluster registration and synchronization center and multiple service clusters to realize cross-network and cross-region service calls.

[0090] Figure 2 A flow chart of a second embodiment of a service processing method based on a service cluster system provided in this application, such as Figure 2As shown, the service processing method based on the service cluster system specifically includes the following steps:

[0091] Step S201: The cross-cluster registration synchronization center obtains a service call request.

[0092] The service call request includes: an identifier of the service to be called.

[0093] Step S202: the cross-cluster registration synchronization center searches for and obtains a service cluster list where the service identifier to be called is located according to the service call request.

[0094] In this embodiment, each service cluster's internal service sends its corresponding service information to the registration center within the service cluster through the hypertext transfer protocol HTTP for registration processing to form a local service list. The registration center within the service cluster sends the service information to the external gateway of the cross-cluster registration and synchronization center through the transmission control protocol TCP. The external gateway sends the service information to the internal server through the hypertext transfer protocol HTTP. The internal server sends the service information to the service list through the hypertext transfer protocol HTTP for registration processing. That is, the service list of the cross-cluster registration and synchronization center includes the service information in all service clusters. The cross-cluster registration and synchronization center searches for and obtains the service cluster list where the service identifier to be called is located according to the service information corresponding to the service call request.

[0095] The service information includes the service name, the port number corresponding to the service, the service description, the IP address corresponding to the service, the service cluster to which the service belongs, etc. The transmission control protocol TCP connection uses the pki certificate as a two-way verification method. The communication data protocol format is command (fixed to 4 bytes) + length (fixed to 2 bytes) + data. Specifically, command is the command information, length is the length information of data, and data is the data information. The communication data protocol can be compressed using several file compression programs.

[0096] Specifically, when the registration center within the service cluster sends a command to initialize the connection information to the cross-cluster registration synchronization center, the data information included in the command is the service cluster information, service cluster status, service quantity, timestamp, etc.; when the registration center within the service cluster sends a command to request service list synchronization to the cross-cluster registration synchronization center, the data information included in the command is the service cluster information, timestamp, etc.; when the registration center within the service cluster sends a service registration command to the cross-cluster registration synchronization center, the data information included in the command is the service cluster information, SLB information, service name, service status, timestamp, etc.; when the registration center within the service cluster sends a service cancellation command to the cross-cluster registration synchronization center, the data information included in the command is the service cluster information, SLB information, service name, service status, timestamp, etc.; when the cross-cluster registration synchronization center sends a service synchronization command to the registration center within the service cluster, the data information included in the command is the service list, timestamp, etc. Specifically, the service list includes the service name, the service corresponding service cluster, the service status, and the service corresponding SLB; when the cross-cluster registration synchronization center sends a request service list reporting command to the registration center within the service cluster, the data information included in the command is timestamp, etc.

[0097] Step S203: The cross-cluster registration synchronization center obtains the second time difference and the third time difference corresponding to each service cluster in the service cluster list according to the second delay table and the third delay table, and obtains the delay level of each service cluster according to the second time difference and the corresponding weight, and the third time difference and the corresponding weight.

[0098] In this embodiment, the time when the cross-cluster registration synchronization center sends a heartbeat according to the heartbeat mechanism and the time when the registration center in each service cluster receives the heartbeat are recorded to obtain a second delay table. The second delay includes a second time difference corresponding to each service cluster. The second time difference is expressed as T 2 Record the time when the registration center in the service cluster sends a heartbeat according to the heartbeat mechanism and the time when other service clusters receive the heartbeat, and obtain a third delay table, which includes a third time difference, and the third time difference is denoted by T 3 According to actual needs, the weight corresponding to the second time difference is set as the second weight, and ω 2 Indicates that the weight corresponding to the third time difference is the third weight, expressed as ω 3 express.

[0099] According to the second time difference T 2 , the second weight ω 2 , the third time difference T 3 , the third weight ω 3 A first formula is obtained, and a delay level of each service cluster is obtained according to the first formula, wherein the delay level of the service cluster is represented by P.

[0100] Specifically, the first formula is expressed as:

[0101] P=T 2 ×ω 2 +T 3 ×ω 3

[0102] When the registration center within the service cluster sends a heartbeat command to the cross-cluster registration synchronization center, the data information included in the command is the service cluster information, timestamp, etc.; when the cross-cluster registration synchronization center sends a cross-cluster registration synchronization center heartbeat response command to the registration center within the service cluster, the data information included in the command is timestamp, etc.

[0103] Step S204: The cross-cluster registration synchronization center obtains the load corresponding to the service identifier to be called in each service cluster according to the service load sorting list, and obtains the priority of each service cluster according to the latency level and corresponding weight of each service cluster, as well as the load and corresponding weight corresponding to the service identifier to be called in each service cluster.

[0104] In this embodiment, when a service call occurs, the local registration center within the service cluster records the call, updates the load status of each service within the service cluster in real time, obtains the service load list, and synchronizes the load sorting table to the cross-cluster registration synchronization center via the TCP protocol. Specifically, the service load list is represented by M.

[0105] For example, in a service cluster, service 1 is an acquisition function and service 2 is a query function. For horizontal expansion of the same function, service 1 includes service 1.1, service 1.2, and service 1.3; service 2 includes service 2.1, service 2.2, and service 2.3. Currently, service 1.1 is being called 5 times, service 1.2 is being called 4 times, service 1.3 is being called 3 times, service 2.1 is being called 4 times, service 2.2 is being called 3 times, and service 2.3 is being called 2 times. Then the service load list M records that service 1.1 is being called 5 times, service 1.2 is being called 4 times, service 1.3 is being called 3 times, service 2.1 is being called 4 times, service 2.2 is being called 3 times, and service 2.3 is being called 2 times.

[0106] According to the service load sorting list M, the corresponding load N under each service cluster is obtained. In this application, the corresponding load under the service cluster is equivalent to the service load sorting, that is, the service load sorting list can also be used to represent N, and the corresponding load N under each service cluster is synchronized to the cross-cluster registration and synchronization center through the TCP protocol, and then synchronized to the cross-cluster registration and synchronization center through the TCP protocol and sent to each service cluster, so that each service cluster obtains the load N corresponding to all other service clusters.

[0107] Specifically, the load N is the accumulation of the loads of the same service. For example, in the above example, the load N corresponding to service 1 is 5+4+3=12, and the load N corresponding to service 2 is 4+3+2=9 times.

[0108] For the latency level P of the service cluster, according to actual needs, obtain the fourth weight corresponding to the latency level P of the service cluster, and use ω 4 Indicates the load N corresponding to the service cluster. According to actual needs, obtain the fifth weight corresponding to the load N under the service cluster, ω 5 express.

[0109] According to the delay level P of the service cluster and the fourth weight ω 4 , the corresponding load N under the service cluster, the fifth weight ω 5 , obtain a second formula, and obtain the priority of each service cluster according to the second formula, where the priority of the service cluster is represented by X.

[0110] Specifically, the second formula is expressed as:

[0111] X=P×ω 4 +N×ω 5

[0112] Step S205: the cross-cluster registration synchronization center sends the service call request to the service cluster with the highest priority, so that the service cluster with the highest priority performs corresponding service call processing according to the service call request.

[0113] In this embodiment, the time when the registration center in the service cluster sends a heartbeat according to the heartbeat mechanism and the time when the service in the service cluster receives the heartbeat are recorded to obtain a first delay table, or to update the first delay table, wherein the first delay table includes a first time difference corresponding to each service, and the first time difference is denoted by T 1 express.

[0114] For the first time difference T 1 , according to actual needs, obtain the first time difference using T 1 The corresponding first weight is ω 1 Indicates that the service load list M, according to actual needs, obtains the sixth weight corresponding to the service load list M, and uses ω 6 express.

[0115] According to the first time difference T 1 , the first weight ω 1 , service load list M, sixth weight ω 6 A third formula is obtained, and the priority of the service in the service cluster is obtained according to the third formula, wherein the priority of the service in the service cluster is represented by Y.

[0116] Specifically, the third formula is expressed as:

[0117] Y=T 1 ×ω 1 +M×ω 6

[0118] When calling a service across regions, the service node with the highest priority is obtained according to the priority of the service in the service cluster, and the service call is made to the node.

[0119] In this embodiment, when determining the associated calling service, the service to be called in the service cluster searches for the service cluster to which the associated calling service belongs based on the service information corresponding to the services in all service clusters sent by the cross-cluster registration synchronization center in the registration center within the service cluster, and sends a cross-cluster calling request to the SLB of the service cluster through the Hypertext Transfer Protocol HTTP. The SLB of the service cluster sends the cross-cluster calling request to the API gateway within the service cluster through the Hypertext Transfer Protocol HTTP. The API gateway searches for the IP address of the associated calling service in the registration center within the service cluster based on the cross-cluster calling request, and calls the associated calling service based on the IP address of the associated calling service.

[0120] In this embodiment, the cross-cluster registration and synchronization center searches for a list of service clusters where the service identifier to be called is located according to the service call request; and obtains the service cluster with the highest priority corresponding to the associated calling service according to the first formula, the second formula, and the third formula, and queries the service with the highest priority in the service cluster with the highest priority, and performs a call process on the service. Compared with the prior art, the registration center in the service cluster only records the mapping relationship between the services and service addresses in the service cluster, and cannot realize cross-network and cross-region service calls. This application constructs a service cluster system composed of a cross-cluster registration and synchronization center and multiple service clusters, and constructs a service call priority algorithm. While realizing cross-network and cross-region service calls, it optimizes the service call experience and improves the service call efficiency.

[0121] Figure 3 A flow chart of a third embodiment of a service processing method based on a service cluster system provided by the present application, such as Figure 3 As shown, the service processing method based on the service cluster system specifically includes the following steps:

[0122] Step S301: The first service cluster receives a service call request sent by a cross-cluster registration synchronization center.

[0123] The service call request includes: an identifier of the service to be called.

[0124] Step S302: the first service cluster performs a call process on the service to be called corresponding to the service identifier to be called according to the service call request.

[0125] In this embodiment, each service cluster internal service sends its corresponding service information to the registration center in the service cluster through the hypertext transfer protocol HTTP for registration processing to form a local service list. The registration center in the service cluster sends the service information to the external gateway of the cross-cluster registration and synchronization center through the transmission control protocol TCP. The external gateway sends the service information to the internal server through the hypertext transfer protocol HTTP. The internal server sends the service information to the service list through the hypertext transfer protocol HTTP for registration processing, that is, the service list of the cross-cluster registration and synchronization center includes the service information in all service clusters. The internal server of the cross-cluster registration and synchronization center matches the service and the server load balancer SLB corresponding to the service cluster to which the service belongs according to the service information. The service list of the cross-cluster registration and synchronization center will register the service information corresponding to all services in all service clusters, and send it to the external gateway through the internal server, and the external gateway sends it to the registration center of each service cluster through the transmission control protocol TCP.

[0126] If a service exits a service cluster or is in an abnormal state, the registration center within the service cluster to which the service belongs receives a message about the service exit or detects that the service is in an abnormal state through the heartbeat mechanism. It then updates the local service list, synchronously updates the service list of the cross-cluster registration synchronization center, and sends the updated service information to the registration centers in each service cluster.

[0127] The service information of this step includes the service, transmission control protocol verification method and command content as shown in the above embodiment, which will not be repeated here.

[0128] Step S303: the first registration center in the first service cluster performs heartbeat mechanism processing with each service in the first service cluster respectively, and obtains or updates a first delay table, where the first delay table includes a first time difference corresponding to each service.

[0129] In this embodiment, the first time difference is T 1 The detailed process of this step is shown in the previous embodiment and will not be repeated here.

[0130] Step S304: the first registration center in the first service cluster obtains the service load list corresponding to each service according to the load status of the service node in each service under the first service cluster, and sends the service load list corresponding to each service to the cross-cluster registration synchronization center.

[0131] In this embodiment, the service load list is represented by M. The detailed process of this step is shown in the previous embodiment and will not be repeated here.

[0132] Step S305: the first registration center in the first service cluster performs heartbeat mechanism processing on other service clusters, obtains the third delay table, and sends the third delay table to the cross-cluster registration synchronization center.

[0133] The third delay table includes a third time difference corresponding to each service cluster.

[0134] In this embodiment, the third time difference is T 3 The detailed process of this step is shown in the previous embodiment and will not be repeated here.

[0135] Step S306: During the calling process, when it is determined that a calling service associated with the service to be called is called and the associated calling service is not in the first service cluster, query the first registration center in the first service cluster to obtain the identifier of the second service cluster corresponding to the identifier of the service to be called.

[0136] In this embodiment, the second service cluster should be the service cluster with the highest priority. The service cluster priority algorithm is described in the previous embodiment and will not be described again here.

[0137] Step S307: The local API gateway in the first service cluster queries and obtains from the first registration center the current service load list corresponding to the service identifier to be called and the first time difference corresponding to the service identifier to be called in the current first delay table based on the service call request, and obtains the highest priority service node under the service to be called based on the current load list and the corresponding weight, as well as the first time difference and the corresponding weight, so as to forward the service call request to the highest priority service node.

[0138] The service node with the highest priority in the first service cluster performs service call processing according to the call request.

[0139] In this embodiment, the service node priority algorithm is as described in the previous embodiment and will not be described again here.

[0140] Step S308: the first service cluster sends a cross-cluster invocation request carrying the identifier of the associated invocation service to the second service cluster corresponding to the identifier of the second service cluster, so that the second service cluster performs invocation processing on the associated invocation service corresponding to the identifier of the associated invocation service according to the cross-cluster invocation request.

[0141] In this embodiment, the related calling service performs calling processing as described in the above embodiment, which will not be described again here.

[0142] In this embodiment, the first service cluster searches for a list of service clusters where the service identifier to be called is located according to the service call request; and obtains the service cluster with the highest priority corresponding to the associated calling service according to the relevant formula, and queries the service with the highest priority in the service cluster with the highest priority, and calls the service. Compared with the prior art, the registration center in the service cluster only records the mapping relationship between the services and service addresses in the service cluster, and cannot realize cross-network and cross-region service calls. This application constructs a service cluster system composed of a cross-cluster registration synchronization center and multiple service clusters, and constructs a service call priority algorithm. While realizing cross-network and cross-region service calls, it optimizes the service call experience and improves the service call efficiency.

[0143] Figure 4 A flow chart of a fourth embodiment of a service processing method based on a service cluster system provided by the present application, such as Figure 4 As shown, the service processing method based on the service cluster system specifically includes the following steps:

[0144] Step S401: The cross-cluster registration synchronization center obtains a service call request.

[0145] The service call request includes: an identifier of the service to be called.

[0146] Step S402: the cross-cluster registration synchronization center searches for and obtains a service cluster list where the service identifier to be called is located according to the service call request.

[0147] In this embodiment, each service cluster uploads the service information of the registration center to the cross-cluster registration synchronization center. The specific process is shown in the above embodiment and will not be described here.

[0148] Step S403: The cross-cluster registration synchronization center performs heartbeat mechanism processing with the registration center in each service cluster, obtains a second delay table, and sends the second delay table to the registration center in each service cluster; wherein the second delay includes a second time difference corresponding to each service cluster.

[0149] In this embodiment, the second time difference is T 2 The detailed process of this step is shown in the above embodiment and will not be repeated here.

[0150] Step S404: the cross-cluster registration synchronization center obtains the third delay table reported by each service cluster respectively; wherein the third delay table is a delay table obtained by the registration center in the service cluster performing heartbeat mechanism processing on other service clusters.

[0151] In this embodiment, the third time difference is T 3The detailed process of this step is shown in the above embodiment and will not be repeated here.

[0152] Step S405: The cross-cluster registration synchronization center obtains the second time difference and the third time difference corresponding to each service cluster in the service cluster list according to the second delay table and the third delay table, and obtains the delay level of each service cluster according to the second time difference and the corresponding weight, and the third time difference and the corresponding weight.

[0153] In this embodiment, the latency level of the service cluster is represented by P. The detailed process of this step is shown in the above embodiment and will not be repeated here.

[0154] Step S406: The cross-cluster registration synchronization center obtains the service load list corresponding to each service under the service cluster reported by each service cluster, and integrates the same services to obtain a service load ranking list.

[0155] In this embodiment, the service load list is represented by M, and the service load sorting list is represented by N. The detailed process of this step can be found in the above embodiment and will not be repeated here.

[0156] Step S407: The cross-cluster registration synchronization center obtains the load corresponding to the service identifier to be called in each service cluster according to the service load sorting list, and obtains the priority of each service cluster according to the latency level and corresponding weight of each service cluster, as well as the load and corresponding weight corresponding to the service identifier to be called in each service cluster.

[0157] In this embodiment, the priority of the service cluster is represented by the latency level P of the service cluster. The detailed process of this step is shown in the above embodiment and will not be repeated here.

[0158] Step S408: the cross-cluster registration synchronization center sends the service call request to the service cluster with the highest priority, so that the service cluster with the highest priority performs corresponding service call processing according to the service call request.

[0159] In this embodiment, the priority of the service in the service cluster is obtained according to the priority of the service cluster and corresponding parameters. The priority of the service in the service cluster is represented by Y. The detailed process of this step is shown in the above embodiment and will not be repeated here.

[0160] In this embodiment, the cross-cluster registration and synchronization center searches for the service cluster list where the service identifier to be called is located according to the service call request; and obtains the service cluster with the highest priority corresponding to the associated call service according to the relevant formula, and queries and obtains the service with the highest priority in the service cluster with the highest priority, and calls the service. Compared with the prior art, the registration center in the service cluster only records the mapping relationship between the services and service addresses in the service cluster, and cannot realize cross-network and cross-region service calls. This application constructs a service cluster system composed of a cross-cluster registration and synchronization center and multiple service clusters, and constructs a service call priority algorithm. While realizing cross-network and cross-region service calls, it optimizes the service call experience and improves the service call efficiency.

[0161] Figure 6 This is a schematic diagram of the structure of a fourth embodiment of a service cluster provided by the present application. The service cluster may be any of the service clusters of the service processing method based on the service cluster system described above. Figure 6 As shown, the service cluster 50 includes: an API gateway 51 , a service 52 , and a first registration center 53 .

[0162] The API gateway 51 is used to receive a service call request sent by the cross-cluster registration synchronization center, where the service call request includes: a service identifier to be called.

[0163] Service 52 is used to call the service to be called corresponding to the service identifier to be called according to the service call request, and during the calling process, when it is determined to call a calling service associated with the service to be called, and the associated calling service is not in the service cluster, query and obtain the identifier of the second service cluster corresponding to the service identifier to be called from the first registration center 53 in the service cluster.

[0164] Service 52 is further used to send a cross-cluster call request carrying the identifier of the associated call service to the second service cluster corresponding to the identifier of the second service cluster, so that the second service cluster can call the associated call service corresponding to the identifier of the associated call service according to the cross-cluster call request.

[0165] The service cluster 50 in this embodiment can execute the method of Embodiment 1 or Embodiment 3 above, and the implementation principles and technical effects thereof are similar and will not be described in detail here.

[0166] Based on the above embodiment, the API gateway 51 is specifically used for:

[0167] According to the service call request, the current service load list corresponding to the service identifier to be called and the first time difference corresponding to the service identifier to be called in the current first delay table are queried from the first registration center, and the service node with the highest priority under the service to be called is obtained based on the current load list and the corresponding weight, as well as the first time difference and the corresponding weight, so as to forward the service call request to the service node with the highest priority.

[0168] The service node with the highest priority in the first service cluster performs service call processing according to the call request.

[0169] On the basis of the above embodiment, the first registration center 53 is used to perform heartbeat mechanism processing with each service in the service cluster respectively, and obtain or update the first delay table, which includes the first time difference corresponding to each service.

[0170] According to the load status of the service node in each service under the first service cluster, a service load list corresponding to each service is obtained respectively, and the service load list corresponding to each service is sent to the cross-cluster registration and synchronization center.

[0171] Based on the above embodiment, the first registration center 53 is further used for:

[0172] Perform heartbeat mechanism processing on other service clusters, obtain the third delay table, and send the third delay table to the cross-cluster registration and synchronization center.

[0173] The third delay table includes a third time difference corresponding to each service cluster.

[0174] Figure 7 This is a schematic diagram of the structure of a fifth embodiment of a cross-cluster registration and synchronization center provided by the present application. The cross-cluster registration and synchronization center can be any of the cross-cluster registration and synchronization centers of the service processing method based on the service cluster system described above. Specifically, Figure 7 As shown, the cross-cluster registration synchronization center 60 includes: an external gateway 61 and an internal server 62 .

[0175] The external gateway 61 is used to obtain a service call request, which includes: an identifier of a service to be called.

[0176] The internal server 62 is used to search and obtain the service cluster list where the service identifier to be called is located according to the service call request.

[0177] The internal server 62 is also used to obtain the second time difference and the third time difference corresponding to each service cluster in the service cluster list according to the second delay table and the third delay table, and obtain the delay level of each service cluster according to the second time difference and the corresponding weight, and the third time difference and the corresponding weight.

[0178] The internal server 62 is also used to obtain the load corresponding to the service identifier to be called under each service cluster according to the service load sorting list, and obtain the priority of each service cluster according to the latency level and corresponding weight of each service cluster, and the load and corresponding weight corresponding to the service identifier to be called under each service cluster.

[0179] The external gateway 61 is further used to send the service call request to the service cluster with the highest priority, so that the service cluster with the highest priority can perform corresponding service call processing according to the service call request.

[0180] The cross-cluster registration synchronization center 60 in this embodiment can execute the above method embodiment 2 or embodiment 4, and the implementation principles and technical effects are similar, which will not be repeated here.

[0181] Based on the above embodiment, the internal server 62 is also used for:

[0182] Perform heartbeat mechanism processing with the registration center in each service cluster, obtain a second delay table, and send the second delay table to the registration center in each service cluster respectively; wherein the second delay includes a second time difference corresponding to each service cluster.

[0183] The third delay table reported by each service cluster is obtained respectively; wherein the third delay table is a delay table obtained by the registration center in the service cluster performing heartbeat mechanism processing on other service clusters.

[0184] Based on the above embodiment, the internal server 62 is also used for:

[0185] A service load list corresponding to each service under the service cluster reported by each service cluster is obtained respectively, and the same services are integrated to obtain a service load sorting list.

[0186] Figure 8 A structural diagram of a service cluster system embodiment 6 provided in this application, such as Figure 8 As shown, the service cluster system 70 includes: a service cluster 50 and a cross-cluster registration and synchronization center 60 .

[0187] The service cluster 50 is used to execute the technical solution provided in the above-mentioned embodiment 1 or embodiment 3; the cross-cluster registration synchronization center 60 is used to execute the technical solution provided in the above-mentioned embodiment 2 or embodiment 4.

[0188] The present application provides a service cluster, the server comprising: a processor, a memory, and a communication interface; wherein the memory is used to store executable instructions executable by the processor; the processor is configured to execute the technical solution in the above-mentioned embodiment 1 or embodiment 3 by executing the executable instructions. Optionally, the memory can be independent or integrated with the processor.

[0189] Optionally, when the memory is a device independent of the processor, the service cluster may further include: a bus for connecting the above devices.

[0190] The server is used to execute the technical solution in the above-mentioned embodiment 1 or embodiment 3, and its implementation principle and technical effect are similar and will not be repeated here.

[0191] The present application provides a cross-cluster registration synchronization center, the electronic device comprising: a processor, a memory, and a communication interface; wherein the memory is used to store executable instructions executable by the processor; the processor is configured to execute the technical solution in the aforementioned embodiment 2 or embodiment 4 by executing the executable instructions.

[0192] Optionally, the memory can be either independent or integrated with the processor.

[0193] Optionally, when the memory is a device independent of the processor, the cross-cluster registration and synchronization center may further include: a bus for connecting the above devices.

[0194] The cross-cluster registration synchronization center is used to execute the technical solution in the aforementioned embodiment 2 or embodiment 4, and its implementation principle and technical effect are similar, which will not be repeated here.

[0195] An embodiment of the present application provides a readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the technical solution provided in the above-mentioned embodiment 1 or embodiment 3 is implemented.

[0196] An embodiment of the present application provides a readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the technical solution provided in the aforementioned embodiment 2 or embodiment 4 is implemented.

[0197] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

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

[0199] 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 it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A service processing method based on a service cluster system, characterized in that, it includes: The first service cluster receives a service call request sent by a cross-cluster registration synchronization center, and the service call request includes: a service identifier to be called; The first service cluster performs call processing on the service to be called corresponding to the service identifier to be called according to the service call request, and during the call process, when it is determined to call a call service associated with the service to be called and the associated call service is not in the first service cluster, query and obtain the identifier of the second service cluster corresponding to the service identifier to be called from the first registration center in the first service cluster; The first service cluster sends a cross-cluster call request carrying the identifier of the associated call service to the second service cluster corresponding to the identifier of the second service cluster, so that the second service cluster performs call processing on the associated call service corresponding to the identifier of the associated call service according to the cross-cluster call request; The first registration center is used to perform heartbeat mechanism processing with each service in the service cluster respectively, obtain or update a first delay table, and the first delay table includes a first time difference corresponding to each service.

2. The method according to claim 1, characterized in that, The first service cluster performs call processing on the service to be called corresponding to the service identifier to be called according to the service call request, including: The local API gateway in the first service cluster queries and obtains a current service load list corresponding to the service identifier to be called and a first time difference corresponding to the service identifier to be called in the current first delay table from the first registration center according to the service call request, and obtains the service node with the highest priority under the service to be called according to the current service load list and the corresponding weight, and the first time difference and the corresponding weight, so as to forward the service call request to the service node with the highest priority; The service node with the highest priority in the first service cluster performs service call processing according to the call request.

3. The method according to claim 2, characterized in that, it further includes: The first registration center in the first service cluster obtains a service load list corresponding to each service respectively according to the load status of the service nodes in each service under the first service cluster, and sends the service load list corresponding to each service to the cross-cluster registration synchronization center.

4. The method according to any one of claims 1 to 3, characterized in that, it further includes: The first registration center in the first service cluster performs heartbeat mechanism processing with other service clusters, obtains a third delay table, and sends the third delay table to the cross-cluster registration synchronization center; wherein, the third delay table includes a third time difference corresponding to each service cluster.

5. A service processing method based on a service cluster system, characterized in that, it includes: The cross-cluster registration synchronization center obtains a service call request, where the service call request includes: an identifier of a service to be called; The cross-cluster registration synchronization center searches for and obtains a service cluster list where the service identifier to be called is located according to the service call request; The cross-cluster registration synchronization center performs heartbeat mechanism processing with the registration center in each service cluster respectively, obtains a second delay table, and sends the second delay table to the registration center in each service cluster respectively, wherein the second delay table includes a second time difference corresponding to each service cluster; The cross-cluster registration synchronization center obtains the third delay table reported by each service cluster respectively; wherein the third delay table is a delay table obtained by the registration center in the service cluster performing heartbeat mechanism processing on other service clusters; The cross-cluster registration synchronization center obtains the second time difference and the third time difference corresponding to each service cluster in the service cluster list according to the second delay table and the third delay table, and obtains the delay level of each service cluster according to the second time difference and the corresponding weight, and the third time difference and the corresponding weight; The cross-cluster registration synchronization center obtains the load corresponding to the service identifier to be called in each service cluster according to the service load sorting list, and obtains the priority of each service cluster according to the latency level and corresponding weight of each service cluster, and the load and corresponding weight corresponding to the service identifier to be called in each service cluster; The cross-cluster registration synchronization center sends the service call request to the service cluster with the highest priority, so that the service cluster with the highest priority performs corresponding service call processing according to the service call request.

6. The method according to claim 5, It is characterized in that Also includes: The cross-cluster registration synchronization center obtains the service load list corresponding to each service under the service cluster reported by each service cluster, and integrates the same services to obtain a service load ranking list.

7. A service cluster, It is characterized in that include: The API gateway is used to receive a service call request sent by the cross-cluster registration synchronization center, where the service call request includes: a service identifier to be called; A service, configured to perform a call processing on the service to be called corresponding to the service identifier to be called according to the service call request, and during the call process, when it is determined to call a calling service associated with the service to be called and the associated calling service is not in the service cluster, query and obtain the identifier of the second service cluster corresponding to the service identifier to be called from the first registration center in the service cluster; The service is further used to send a cross-cluster call request carrying the identifier of the associated calling service to the second service cluster corresponding to the identifier of the second service cluster, so that the second service cluster can perform a call processing on the associated calling service corresponding to the identifier of the associated calling service according to the cross-cluster call request; The first registration center is used to perform heartbeat mechanism processing with each service in the service cluster respectively, and obtain or update a first delay table, where the first delay table includes a first time difference corresponding to each service.

8. The service cluster according to claim 7, It is characterized in that The API gateway is specifically used for: According to the service call request, query and obtain from the first registration center a current service load list corresponding to the service identifier to be called and a first time difference corresponding to the service identifier to be called in the current first delay table, and obtain a service node with the highest priority under the service to be called according to the current service load list and the corresponding weight, and the first time difference and the corresponding weight, so as to forward the service call request to the service node with the highest priority; The service node with the highest priority in the first service cluster performs service call processing according to the call request.

9. The service cluster according to claim 8, It is characterized in that The first registration center is further used to obtain a service load list corresponding to each service according to the load status of the service node in each service under the first service cluster, and send the service load list corresponding to each service to the cross-cluster registration synchronization center.

10. The service cluster according to any one of claims 7 to 9, It is characterized in that The first registration center is also used for: Perform heartbeat mechanism processing on other service clusters, obtain a third delay table, and send the third delay table to the cross-cluster registration and synchronization center; The third delay table includes a third time difference corresponding to each service cluster.

11. A cross-cluster registration and synchronization center, It is characterized in that include: The external gateway is used to obtain a service call request, wherein the service call request includes: an identifier of the service to be called; The internal server is used to search and obtain the service cluster list where the service identifier to be called is located according to the service call request; The internal server is further used to: perform heartbeat mechanism processing with the registration center in each service cluster, obtain a second delay table, and send the second delay table to the registration center in each service cluster respectively; wherein the second delay includes a second time difference corresponding to each service cluster; Obtaining the third delay table reported by each service cluster respectively; wherein the third delay table is a delay table obtained by the registration center in the service cluster performing heartbeat mechanism processing on other service clusters; The internal server is further configured to respectively obtain a second time difference and a third time difference corresponding to each service cluster in the cluster list according to the second delay table and the third delay table, and respectively obtain a delay level of each service cluster according to the second time difference and the corresponding weight, and the third time difference and the corresponding weight; The internal server is further used to obtain the load corresponding to the service identifier to be called under each service cluster according to the service load sorting list, and obtain the priority of each service cluster according to the latency level and corresponding weight of each service cluster, and the load and corresponding weight corresponding to the service identifier to be called under each service cluster; The external gateway is further configured to send the service call request to the service cluster with the highest priority, so that the service cluster with the highest priority can perform corresponding service call processing according to the service call request.

12. The cross-cluster registration synchronization center according to claim 11, It is characterized in that The internal server is also used to: A service load list corresponding to each service under the service cluster reported by each service cluster is obtained respectively, and the same services are integrated to obtain a service load sorting list.

13. A service cluster system, It is characterized in that include: A cross-cluster registration synchronization center and multiple service clusters; wherein the cross-cluster registration synchronization center is used to execute the service processing method according to claim 5 or 6; The service cluster is used to execute the service processing method according to any one of claims 1 to 4.

14. A service cluster, It is characterized in that include: Processor, memory, communication interface; The memory is used to store executable instructions executable by the processor; The processor is configured to execute the service processing method according to any one of claims 1 to 4 by executing the executable instructions.

15. A cross-cluster registration and synchronization center, It is characterized in that include: Processor, memory, communication interface; The memory is used to store executable instructions executable by the processor; The processor is configured to execute the service processing method of claim 5 or 6 by executing the executable instructions.

16. A readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the service processing method according to any one of claims 1 to 4 is implemented.

17. A readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the service processing method according to claim 5 or 6 is implemented.

Citation Information

Patent Citations

  • Micro-service application calling method and device, computer equipment and storage medium

    CN115174657A