A high-performance gateway design method for application self-registration

By building a registration center and customizing load balancing strategies, the independence and real-time data synchronization of the gateway and application systems are achieved, solving the independence and decoupling problems in gateway design in existing technologies, and improving gateway performance and management efficiency.

CN116016041BActive Publication Date: 2024-10-15SHANGHAI TONGLIAN FINANCIAL SERVICES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310010739.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-04
Publication Date
2024-10-15
Estimated Expiration
2043-01-04

AI Technical Summary

Technical Problem

The existing technology makes it difficult to achieve independence and service decoupling between the gateway and the application system in gateway design, and the load balancing strategy is insufficient to support real-time data synchronization between gateway clusters.

Method used

By building a public registration center and application registration center, register gateway application services and business services, customize load balancing strategies, support RPC calls between gateway clusters, and adopt common socket+xml and http(s)+json communication methods, build SDK database and pull program realize decoupling of gateway and application system and real-time data synchronization.

Benefits of technology

It achieves the independence and service decoupling of gateways and application systems, realizes 100% real-time data synchronization between gateways, supports simultaneous RPC calls to gateway clusters, and improves gateway performance and management efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116016041B_ABST
    Figure CN116016041B_ABST
Patent Text Reader

Abstract

The present invention provides a high-performance gateway design method for application self-registration, and relates to the field of computer network communication technology. The high-performance gateway design method based on application self-registration, the method steps are: S1. construct a public registration center and an application registration center respectively, and register the application registration service and the application Process service of the gateway to the public registration center at the registration center level; S2. At the same time, register the business service of the application system itself to the application registration center, and isolate the public service from the business service at the registration center level; S3. Change the local load balancing strategy of the rpc consumer, customize the cluster strategy, so that the cluster management supports the simultaneous initiation of RPC calls to all gateway clusters. When designing, the present invention takes into account the independence of the gateway application itself and the actual business application system, isolates the gateway and the application system in the registration center, and belongs to different registration centers, so as to better complete the decoupling of the service and the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of computer network communication, and in particular to a high-performance gateway design method applying self-registration. Background Art

[0002] Gateway is also called network connector or protocol converter. Gateway realizes network interconnection above the network layer. It is a complex network interconnection device and is only used for interconnection between two networks with different high-level protocols. Gateway can be used for wide area network interconnection as well as local area network interconnection. Gateway is a computer system or device that performs the important task of conversion. It is used between two systems with different communication protocols, data formats or languages, or even completely different architectures. Unlike a bridge that simply transmits information, a gateway repackages the received information to meet the needs of the destination system.

[0003] In many application systems, a front-end is often required to receive external requests and convert them into internal interactive interfaces for downward transmission. In order to facilitate unified management and provide convenient protocol extension, flow control and other functions, a high-performance gateway that can support application systems to freely register ports is designed based on existing common frameworks such as sofa-rpc and netty. Summary of the invention

[0004] 1. Technical issues to be resolved

[0005] In view of the deficiencies in the prior art, the present invention provides a high-performance gateway design method using self-registration, which solves the problems in the above-mentioned background technology.

[0006] (II) Technical solution

[0007] To achieve the above objectives, the present invention is implemented through the following technical solutions: a high-performance gateway design method using self-registration, the specific method steps are:

[0008] S1. Build a public registration center and an application registration center respectively, and at the registration center level, register the application registration service and application process service (used to receive gateway RPC calls) of the gateway to the public registration center;

[0009] S2. At the same time, the business services of the application system itself are registered in the application registration center, isolating the public service and business service at the registration center level;

[0010] S3. Change the local load balancing policy of the RPC consumer and customize the cluster policy so that cluster management supports initiating RPC calls to all gateway clusters at the same time;

[0011] S4. Build the gateway communication mode, build the gateway port, and set the port monitoring;

[0012] S5. Build an SDK database locally on the gateway, provide and encapsulate the application parameter parsing SDK, and set up the gateway pull program and business call program.

[0013] Preferably, the gateway basic framework is the commonly used sofa-rpc framework or netty framework.

[0014] Preferably, the gateway communication mode is the more common socket+xml and http(s)+json(xml) communication mode.

[0015] (III) Beneficial effects

[0016] The present invention provides a high-performance gateway design method for application self-registration. It has the following beneficial effects:

[0017] 1. The present invention takes into account the independence of the gateway application itself and the actual business application system during design, isolates the gateway and the application system in the registration center, and makes them belong to different registration centers, thereby better completing the decoupling of the service and the system.

[0018] 2. The present invention implements a load balancing strategy broadcast to the server through the SDK itself. The application system can broadcast application registration requests and service offline requests to each node in the gateway cluster, 100% achieving real-time data synchronization between gateways, and supporting simultaneous RPC calls to the gateway cluster, such as application registration, application offline, etc. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 The present invention is a design gateway application self-registration flow chart. DETAILED DESCRIPTION

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

[0021] Embodiment 1:

[0022] like Figure 1 As shown, the embodiment of the present invention provides a high-performance gateway design method for application self-registration, and the specific method steps are:

[0023] S1. The basic framework of the gateway is the commonly used sofa-rpc framework. First, the public registration center and application registration center are built respectively. At the registration center level, the application registration service and application process service of the gateway are registered to the public registration center for receiving gateway RPC calls;

[0024] S2. At the same time, the business services of the application system itself are registered in the application registration center, isolating the public service and business service at the registration center level;

[0025] S3. Change the local load balancing policy of the RPC consumer and customize the cluster policy so that cluster management supports initiating RPC calls to all gateway clusters at the same time;

[0026] S4. Build the gateway communication mode. The gateway communication mode is the more common socket+xml and http(s)+json(xml) communication mode. When in use, the application system passes it to the gateway in the form of sdk parameters. After receiving the request, the gateway parses the parameters to complete the port monitoring or communication parameter update. It supports initiating RPC calls to the gateway cluster at the same time, such as application registration, application offline, etc. At the same time, build the gateway port and set the port monitoring;

[0027] S5. Build an SDK database locally on the gateway, provide and encapsulate the application parameter parsing SDK, provide support for automatic parameter parsing, configuration and application publishing, and set up the gateway pull program and business call program. When the gateway starts, it actively pulls the application services registered to the specified registration center and registers them to the gateway itself, mainly relying on the data synchronization of the registration center;

[0028] When a business request enters the gateway, the first request distribution is completed through the port:

[0029] For TCP SOCKET requests, different ports match different Handlers. Each handler is bound to an appUniqueld, and the processService proxy object cached during registration is matched according to appUniqueld.

[0030] Embodiment 2:

[0031] The difference between this embodiment and the first embodiment is: a high-performance gateway design method for applying self-registration, the specific method steps are:

[0032] S1. The basic framework of the gateway is the commonly used netty framework. First, the public registration center and application registration center are built respectively. At the registration center level, the application registration service and application process service (used to receive gateway RPC calls) of the gateway are registered to the public registration center;

[0033] S2. At the same time, the business services of the application system itself are registered in the application registration center, isolating the public service and business service at the registration center level;

[0034] S3. Change the local load balancing policy of the RPC consumer and customize the cluster policy so that cluster management supports initiating RPC calls to all gateway clusters at the same time;

[0035] S4. Build the gateway communication mode. The gateway communication mode is the more common socket+xml and http(s)+json(xml) communication mode. When in use, the application system passes it to the gateway in the form of sdk parameters. After receiving the request, the gateway parses the parameters to complete the port monitoring or communication parameter update. It supports initiating RPC calls to the gateway cluster at the same time, such as application registration, application offline, etc. At the same time, build the gateway port and set the port monitoring;

[0036] S5. Build an SDK database locally on the gateway, provide and encapsulate the application parameter parsing SDK, provide support for automatic parameter parsing, configuration and application publishing, and set up the gateway pull program and business call program. When the gateway starts, it actively pulls the application services registered to the specified registration center and registers them to the gateway itself. It mainly relies on the data synchronization of the registration center. After the application goes offline, it will initiate an offline request to the gateway through shutdownhook. If offline requests are received from all nodes of the application, the configuration of the application will be removed from the local gateway, and the port listening will be offline at the same time;

[0037] When a business request enters the gateway, the first request distribution is completed through the port. For HTTP requests, different ports match different Handlers. Each handler is bound to an appUniqueld, and the URL is matched according to the appUniqueld. If the URL cannot be matched, the URL is matched from other applications listening to this port. If the URL is matched, an RPC call is initiated through the proxy object. Otherwise, it means that the URL has not been registered by an application and is rejected.

[0038] Working principle: When the gateway is used, the application starts registration, registers the gateway switch, and then publishes the service to the public registration center to detect whether the service is published successfully. If the publication fails, the registration ends. If the publication is successful, the gateway application registration service is called with the registration parameters. The gateway receives the application registration request and processes it to detect whether the application has been registered. If it has been registered, it detects whether the application parameters are consistent. When the parameters are consistent, it determines that the registration is repeated and directly returns to determine that the registration is successful, and ends the registration. When the application parameters are inconsistent, refresh the application configuration cached locally in the gateway. If a port changes, refresh the port monitoring, determine that the registration is successful and end the registration; when it is determined that the application has not been registered, check whether the rpc service is registered successfully. When the touch verification is successful, cache the configuration information listening port and determine that the registration is successful. When the registration failure is detected, directly end the registration and restart the application startup process.

[0039] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A high-performance gateway design method for application self-registration, characterized in that: The specific steps are as follows: S1. Build a public registration center and an application registration center respectively, and register the application registration service and application process service of the gateway to the public registration center at the registration center level; S2. At the same time, the business services of the application system itself are registered in the application registration center, isolating the public service and business service at the registration center level; S3. Change the local load balancing policy of the RPC consumer and customize the cluster policy so that cluster management supports initiating RPC calls to all gateway clusters at the same time; S4. Build the gateway communication mode, build the gateway port, and set the port monitoring; S5. Build the SDK database locally on the gateway, provide and encapsulate the application parameter parsing SDK, and set up the gateway pull program and business call program; The way to apply self-registration is as follows: When the gateway is in use, the application starts registration, registers the gateway switch, and then publishes the service to the public registration center to detect whether the service is published successfully. If the publication fails, the registration ends. If the publication is successful, the gateway application registration service is called with the registration parameters. The gateway receives the application registration request and processes it to detect whether the application has been registered. If it has been registered, it detects whether the application parameters are consistent. When the parameters are consistent, it determines that the registration is repeated and directly returns to determine that the registration is successful and ends the registration. When the application parameters are inconsistent, refresh the application configuration cached locally in the gateway. If a port changes, refresh the port monitoring, determine that the registration is successful and end the registration; when it is determined that the application has not been registered, check whether the rpc service is registered successfully. When the touch verification is successful, cache the configuration information listening port and determine that the registration is successful. When the registration failure is detected, directly end the registration and restart the application startup process.

2. According to claim 1, a high-performance gateway design method for application self-registration is characterized in that: The gateway basic framework is the commonly used sofa-rpc framework or netty framework.

3. According to claim 1, a high-performance gateway design method for application self-registration is characterized in that: The gateway communication mode is socket + xml, http + json, http + xml, https + json or https + xml.