Service gateway implementation method, device, beam network node and readable storage medium

By designing a service gateway implementation method that can listen and parse HTTP and UDP service requests, the problems of high coupling degree and insufficient protocol support in satellite communication systems in the prior art are solved, and the satisfaction of different scenarios and system management is achieved. simplify.

CN119094279BActive Publication Date: 2025-02-18CHENGDU CORESAT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411516131.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2025-02-18
Estimated Expiration
2044-10-29

Smart Images

  • Figure CN119094279B_ABST
    Figure CN119094279B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of satellite communication technology, and provides a service gateway implementation method, device, beam network node and readable storage medium, which are applied to beam network node BNN, and BNN provides multiple types of communication services to a network management system, and the method comprises: monitoring a service request data packet sent by the network management system; if the service request data packet comes from an HTTP request monitoring port, parsing out a uniform resource identifier URI in the service request data packet, and using the URI as a matching keyword; if the service request data packet comes from a UDP request monitoring port, parsing out a UDP packet type in the service request data packet, and using the UDP packet type as a matching keyword; determining a target service from multiple types of communication services according to the matching keyword; and forwarding the service request data packet to the target service. This solution can simultaneously meet service requests based on both HTTP and UDP protocols.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of satellite communication technology, and in particular to a service gateway implementation method, device, beam network node and readable storage medium. Background Art

[0002] In a satellite communication system that supports single-star single-beam, a satellite uses only one beam to cover a specific geographical area. Usually, a satellite network management system (referred to as network management system) manages a BNN (Beam Network Node). A BNN contains multiple functional services, such as access session management service, resource management service, device management service, gateway service, etc. Different services can use different communication protocols to provide services to the outside world, and the same service can also support different communication protocols to provide services to the outside world at the same time.

[0003] The existing interaction mode between the network management system and BNN is: the network management system directly calls the services inside the BNN. This method requires the network management system to care about the services inside the BNN, including the communication protocols supported by each service and call the corresponding services according to the communication protocols they support. The coupling degree between the two is high, which increases the complexity of system implementation and management.

[0004] In order to reduce the coupling between the two and simplify system implementation and management, the existing technology uses an open source gateway to aggregate services on the BNN, so that the BNN forms a functional black box to provide services to the outside world. The network management system does not need to care about the internal services of the BNN, which greatly reduces the complexity of the network management system implementation and management. However, the open source gateway can only support the conventional HTTP protocol (Hypertext Transfer Protocol). The communication based on the HTTP protocol has high security, but the latency is also relatively high. The application scenarios of satellite communication systems include both scenarios that focus on security requirements and scenarios that focus on latency requirements. The open source gateway cannot meet the application scenario requirements of the satellite communication system. Summary of the invention

[0005] The purpose of the present invention is to provide a service gateway implementation method, device, beam network node and readable storage medium, which can simultaneously meet service requests based on HTTP and UDP (User Datagram Protocol), and ultimately meet the needs of different scenarios in a satellite communication system.

[0006] The embodiments of the present invention can be implemented as follows:

[0007] In a first aspect, the present invention provides a service gateway implementation method, which is applied to a beam network node BNN, the BNN communicates with a network management system, and the BNN provides multiple types of communication services to the network management system, the method comprising:

[0008] Monitoring the service request data packets sent by the network management system;

[0009] If the service request data packet comes from the HTTP request listening port, parse out the uniform resource identifier URI in the service request data packet and use the URI as a matching keyword;

[0010] If the service request data packet comes from the UDP request listening port, parse out the UDP packet type in the service request data packet, and use the UDP packet type as the matching keyword;

[0011] determining a target service from the plurality of types of communication services according to the matching keywords;

[0012] The service request data packet is forwarded to the target service.

[0013] In an optional implementation, the BNN pre-stores a plurality of service routing rules, each of the service routing rules includes a preset keyword and a preset service identifier, and the step of determining a target service from the plurality of types of communication services according to the matching keyword includes:

[0014] If there is a target service routing rule whose preset keyword matches the matching keyword in the multiple service routing rules, determining a candidate service according to the target preset service identifier in the target service routing rule;

[0015] If the target service routing rule does not exist in the multiple service routing rules, and the matching keyword is a UDP packet type, determining the candidate service according to the UDP packet type;

[0016] A target service is determined from the candidate services.

[0017] In an optional implementation manner, each type of communication service corresponds to a service identifier, each of the communication services has a service status, and the step of determining a candidate service according to the target preset service identifier in the target service routing rule includes:

[0018] Selecting a communication service with the same service identifier as the target preset service identifier among the multiple types of communication services as an optional service;

[0019] An optional service whose service status is an active state is determined as the candidate service.

[0020] In an optional implementation, the step of determining the candidate service according to the UDP packet type includes:

[0021] If the UDP packet type represents broadcast, a communication service whose service status is an active state among the multiple types of communication services is determined as the candidate service.

[0022] In an optional implementation manner, there are multiple candidate services, and the step of determining the target service from the candidate services includes:

[0023] If the target service routing rule exists in the multiple service routing rules and the target service routing rule is pre-set with a load balancing strategy, the target service is determined from the multiple candidate services according to the load balancing strategy.

[0024] In an optional implementation manner, there are multiple candidate services, and the step of determining the target service from the candidate services includes:

[0025] If the target service routing rule does not exist in the multiple service routing rules, each of the candidate services is used as a target service.

[0026] In an optional implementation manner, the step of forwarding the service request data packet to the target service includes:

[0027] Obtain the IP address and port of the target service;

[0028] Encapsulate the IP address of the target service as the destination IP address and the port of the target service as the destination port in the service request data packet to obtain a data packet to be forwarded;

[0029] The data packet to be forwarded is forwarded to the target service in an asynchronous manner.

[0030] In a second aspect, the present invention provides a service gateway implementation device, which is applied to a beam network node BNN, the BNN communicates with a network management system, and the BNN provides multiple types of communication services to the network management system, and the device includes:

[0031] A monitoring module, used for monitoring the service request data packets sent by the network management system;

[0032] A parsing module, configured to parse out a uniform resource identifier URI in the service request data packet if the service request data packet comes from an HTTP request listening port, and use the URI as a matching keyword;

[0033] The parsing module is further configured to parse out the UDP packet type in the service request data packet if the service request data packet comes from the UDP request listening port, and use the UDP packet type as the matching keyword;

[0034] a determination module, configured to determine a target service from the plurality of types of communication services according to the matching keywords;

[0035] A forwarding module is used to forward the service request data packet to the target service.

[0036] In a third aspect, the present invention provides a beam network node, comprising a processor and a memory, wherein the memory is used to store a program, and the processor is used to implement a service gateway implementation method as described in any one of the aforementioned embodiments when executing the program.

[0037] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a service gateway implementation method as described in any one of the aforementioned embodiments.

[0038] Compared with the prior art, the present invention monitors service request data packets of two different protocols, HTTP and UDP, through different request monitoring ports, and parses corresponding matching keywords therefrom, determines the target service from various types of communication function services provided by BNN according to the respective matching keywords, and finally sends the service request data packet to the target service, thereby realizing the ability to simultaneously meet service requests based on both HTTP and UDP protocols. Since HTTP can meet scenarios with a focus on security requirements, and UDP can meet scenarios with a focus on latency requirements, the needs of different scenarios in the satellite communication system are ultimately met. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0040] Figure 1 This is an example diagram of a single-star single-beam scenario provided in this embodiment.

[0041] Figure 2 This is an example diagram of a multi-satellite multi-beam scenario provided in this embodiment.

[0042] Figure 3 This is a block diagram of an example beam network node provided for this embodiment.

[0043] Figure 4 This is a flow chart of the service gateway implementation method provided in this embodiment.

[0044] Figure 5 This is a block diagram of an example of a service gateway implementation device provided in this embodiment.

[0045] Figure 6 This is an example diagram of the service gateway architecture diagram provided for this embodiment.

[0046] Figure 7 Based on the Figure 6 An example flow chart of the service gateway implementation method of the gateway architecture.

[0047] Icons: 10 - beam network node; 11 - processor; 12 - memory; 13 - bus; 20 - network management system; 30 - satellite; 40 - user terminal station; 100 - service gateway implementation device; 110 - monitoring module; 120 - analysis module; 130 - determination module; 140 - forwarding module. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

[0049] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. 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.

[0050] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0051] In the description of the present invention, it should be noted that if the terms "upper", "lower", "inside", "outside", etc. appear to indicate an orientation or position relationship, they are based on the orientation or position relationship shown in the accompanying drawings, or are the orientation or position relationship in which the product of the invention is usually placed when used. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.

[0052] In addition, the terms “first”, “second”, etc., if used, are merely used to distinguish between the descriptions and should not be understood as indicating or implying relative importance.

[0053] It should be noted that, in the absence of conflict, the features in the embodiments of the present invention may be combined with each other.

[0054] Please refer to Figure 1 , Figure 1 This is an example diagram of a single-star single-beam scenario provided in this embodiment. Figure 1 In the embodiment, a plurality of user terminal stations 40 ( Figure 1 The user terminal stations 1-n in the network are connected via a satellite 30 and a beam network node 10 ( Figure 1 BNN) communication, BNN provides various types of communication services, such as access session management service, resource management service, device management service, gateway service, etc. Each type of service can have multiple, for example, the access session management service includes n: access session management services 1-n, each access session management service can provide access session management service when the status is normal.

[0055] BNN is the provider of communication services, and its implemented functions include beamforming, beam switching, beam management, signal processing, interference suppression, resource allocation, etc.

[0056] The network management system 20 (also known as the satellite network management system) is the user of the communication service and is responsible for managing and monitoring the operating status of the entire satellite communication network. It can not only effectively manage network resources but also ensure the quality of service. The network management system 20 can directly call the services provided by the BNN. Normally, the service request between the network management system 20 and the BNN can use a conventional HTTP RESTful API for service calls. The service requests of the HTTP protocol mentioned in this embodiment can all be in the form of HTTP RESTful API service calls.

[0057] As the application of satellite communication systems becomes more and more widespread, the number of user terminal stations 40 that need to be supported has also increased sharply, and the number of BNNs managed by the network management system has also increased accordingly, and the managed service configurations will also increase. Please refer to Figure 2 , Figure 2 This is an example diagram of a multi-satellite multi-beam scenario provided in this embodiment. Figure 2 In the example, there are two satellites 30, and different user terminal stations 40 can communicate with the beam network nodes 10 through different satellites 30. The network management system manages N BNNs: BNN-1 to BNN-n. Figure 2 In the application scenario, if the network management system still directly calls the services of each BNN, the coupling degree and system complexity will increase, making it difficult to manage.

[0058] In order to reduce the coupling between services, a service gateway is introduced on the BNN. All requests to the internal services of each BNN are first aggregated at the service gateway, and then routed and forwarded to each service by the service gateway. In this way, the network management system no longer needs to care about the relationship between the services within the BNN, and only needs to manage the gateway layer, which can greatly reduce the complexity of service configuration and calling.

[0059] Open source gateways such as Spring Cloud Gateway and Spring Cloud Zuul can only support conventional HTTP protocols. Communications based on the HTTP protocol are highly secure, but the latency is also relatively high. In some application scenarios of satellite communication systems, due to the high priority of signaling processing latency and concurrency requirements, the latency of HTTP cannot meet the requirements. In this case, a low-latency protocol must be used, such as the UDP protocol. However, open source gateways cannot meet the requirements of using the low-latency UDP protocol in satellite communication systems.

[0060] In view of this, the present embodiment provides a service gateway implementation method, device, beam network node and readable storage medium, which can simultaneously meet service requests based on both HTTP and UDP protocols, and will be described in detail below.

[0061] based on Figure 1 and Figure 2 This embodiment also provides a block diagram of the beam network node 10, please refer to Figure 3 , Figure 3 The block diagram of the beam network node 10 provided in this embodiment includes a processor 11 , a memory 12 and a bus 13 , and the processor 11 and the memory 12 are connected through the bus 13 .

[0062] The processor 11 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the service gateway implementation method of the above embodiment may be completed by an integrated logic circuit of hardware in the processor 11 or instructions in software form. The above processor 11 may be a general-purpose processor, including a CPU (Central Processing Unit), a NP (Network Processor), etc.; it may also be a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Logic Gate Array) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.

[0063] The memory 12 is used to store a program for implementing the service gateway implementation method. The program may be a software function module stored in the memory 12 in the form of software or firmware or solidified in the OS (Operating System) of the beam network node 10 .

[0064] After receiving the execution instruction, the processor 11 executes the program to implement the service gateway implementation method of the above embodiment.

[0065] This embodiment also provides a service gateway implementation method, which is applied to Figure 1-Figure 3 The beam network node 10 (also called BNN) in Figure 4 , Figure 4 The flowchart of the service gateway implementation method provided in this embodiment includes the following steps:

[0066] Step S101: monitoring a service request data packet sent by a network management system.

[0067] In this embodiment, a proxy listener can be established to listen to service request packets. Service request packets of different protocols can be received through different specific ports. Therefore, different proxy listeners can be established according to actual needs to listen to service request packets of different ports. As an implementation method, the port and the corresponding protocol can be written into the startup configuration file in advance, and the startup configuration file is automatically read when the BNN is started, and the required proxy listener is established according to the configuration in the startup configuration file.

[0068] Step S102: If the service request data packet comes from the HTTP request listening port, parse out the uniform resource identifier URI in the service request data packet and use the URI as a matching keyword.

[0069] Step S103: if the service request data packet comes from the UDP request listening port, parse out the UDP packet type in the service request data packet, and use the UDP packet type as a matching keyword.

[0070] In this embodiment, the BNN provides a variety of communication services. The service requested by the service request data packet can be determined based on the matching keywords. The matching keywords of service request data packets of different protocols are also different.

[0071] For HTTP requests, the URI (Uniform Resource Identifier) ​​usually carries identification information of the resource to be requested. The resource can be a document, image, service, etc. The general structure of URI includes the protocol (scheme), host (host), port (port), path (path), query string (query) and fragment (fragment). For example, a web page with the URL HTTP: / / service gateway IP / rms / index, in which "rms" is the identification information of the resource to be requested, which means that the service to be requested is the rms service.

[0072] For UDP requests, in order to support UDP protocol requests, this embodiment redefines the UDP protocol data unit. Table 1 is an example of the composition structure of the redefined UDP protocol data unit.

[0073] Table 1

[0074]

[0075] In Table 1, the UDP protocol data unit includes 4 fields, namely: UDP Packet Type, Source, Reserved, and Content, and the number of bytes occupied by them are: 1, 6, 4, and N, respectively, where N bytes can be determined according to the total length of the UDP protocol data unit and the length of UDP Packet Type, Source, and Reserved.

[0076] It should be noted that if the UDP Packet Type is set to 1 byte, a maximum of 255 services (0-254, 0xFF is the broadcast address) can be supported that use UDP as the service call signaling protocol. In actual application scenarios, the UDP Packet Type length can be appropriately increased or decreased according to the number of managed services to achieve the same effect.

[0077] See Table 2 for descriptions of the fields in Table 1.

[0078] Table 2

[0079]

[0080] Regarding the definition format of the UDP protocol data unit, the UDP data packet type (ie, UDP PacketType) is a matching keyword.

[0081] Step S104: determining a target service from multiple types of communication services according to the matching keywords.

[0082] In this embodiment, if the matching keyword can match a certain type of service among multiple types of communication services, since there can be multiple services of a certain type, the target service is a service that actually provides the service determined from multiple services of this type. For example, a1~a5 can all provide type A services, and a3 is selected as the target service from a1~a5.

[0083] Step S105: forwarding the service request data packet to the target service.

[0084] In this embodiment, each communication service has its own IP address and port. After the target service is determined, the service request data packet can be forwarded to the target service according to the IP address and port of the target service.

[0085] The above method provided in this embodiment can simultaneously meet service requests based on both HTTP and UDP protocols. Since HTTP can meet scenarios with a focus on security requirements, and UDP can meet scenarios with a focus on latency requirements, it ultimately meets the requirements of different scenarios in the satellite communication system.

[0086] In an optional implementation, in order to ensure that when a service call request arrives, the relevant rules can be quickly matched for service routing forwarding, the BNN pre-stores multiple service routing rules, each of which includes a preset keyword and a preset service identifier. If the matching keyword matches the preset keyword of the service routing rule, the service request data packet corresponding to the matching keyword will be forwarded to the service of the type represented by the preset service identifier. This embodiment provides an implementation method for determining the target service:

[0087] (1) If there is a target service routing rule whose preset keyword matches the matching keyword among multiple service routing rules, the candidate service is determined according to the target preset service identifier in the target service routing rule;

[0088] In this embodiment, as an implementation method, the service routing rules may be written into the service routing rule configuration file in advance, and the service routing rules may be loaded from the service routing rule configuration file, thereby improving the flexibility of the service routing rule configuration.

[0089] In this embodiment, the attributes that can be configured for the service routing rule are shown in Table 3.

[0090] Table 3

[0091]

[0092] In Table 3, MatchURI and MatchUdpPacketType are both preset keywords. For HTTP requests, the match keyword is matched with MatchURI to determine whether there is a target service routing rule. For UDP requests, the match keyword is matched with MatchUdpPacketType to determine whether there is a target service routing rule.

[0093] As an implementation method, in order to facilitate the configuration of load balancing so that the selected target service is more in line with the requirements of load balancing, in addition to the preset keywords and preset service identifiers, the service routing rules may also include the load balancing algorithms supported by the service routing rules. The load balancing algorithms include but are not limited to: UdpSpecifiedSourceHashing: UDP signaling performs source address hashing according to the specified Source domain (i.e., the Source field in Table 2), RoundRobin: polling, SourceHashing: source address hashing (i.e., both HTTP and UDP signaling are hashed according to the Source field), WeightRoundRobin: weighted polling, LeastConnections: minimum links.

[0094] As another implementation, in order to configure the forwarding of the service request data packet more flexibly and to improve the scalability, this embodiment can also add an executor list in the service routing rule, the executor list includes at least one executor, each executor includes operations that need to be performed at different stages of forwarding the request data packet, for example, the executor list can include a load balancing executor and a routing forwarding executor, the load balancing executor is used to configure the load balancing algorithm that actually needs to be executed, the algorithm can be specified from the load balancing algorithm, after the load balancing executor is executed, the target service can be determined, the routing forwarding executor is used to encapsulate the IP address and port of the target service in the service request data packet and then forward it and return the callback response to the caller when the asynchronous request callback response is received. Of course, the user can also add other executors to the executor list according to their needs to achieve the required functions, such as log printing and recording, request authentication and interception, black and white list control, etc. Thus, the user can expand or flexibly update the load balancing algorithm that can be supported through LoadBalancingAlgorithm, and can expand or flexibly update the operations that need to be performed when forwarding the service request data packet according to their needs through the executor list, while improving flexibility and scalability.

[0095] In this embodiment, the candidate service may be a service in a certain category of services that satisfies the service request data packet, and the candidate service may be one or more. For example, the communication service of type A matches the target preset service identifier, and communication services a1~a3 can all provide communication services of type A, then a1~a3 are candidate services, and for another example, the communication service of type B matches the target preset service identifier, and among communication services b1~b3, only b2 is in a normal state and can provide communication services of type B, then b2 is a candidate service.

[0096] In this embodiment, the matching keyword that matches the preset keyword can be HTTP protocol or UDP protocol. No matter which protocol it is, there is at most one target service routing rule corresponding to it. Of course, it is also possible that none of the preset keywords of multiple service routing rules matches the matching keyword, in which case there is no target service routing rule.

[0097] (2) If the target service routing rule does not exist in multiple service routing rules and the matching keyword is the UDP packet type, the candidate service is determined according to the UDP packet type;

[0098] In this embodiment, for a service request packet of the HTTP protocol, if there is no target service routing rule, it means that there is no service required by the service request packet. As a response method, a response with HttpResponseStatus of 502 can be returned to the caller of the service request (i.e., the sender of the service request packet) in an asynchronous manner. For a service request packet of the UDP protocol, if there is no target service routing rule, there are at least two situations: (1) there is no service required by the service request packet; in this embodiment, the service request packet is directly discarded. (2) The service request packet needs to be sent to each service in a broadcast manner.

[0099] In an optional implementation manner, if there is a target service routing rule, this embodiment provides an implementation method for determining a candidate service according to a target preset service identifier in the target service routing rule:

[0100] The communication service with the same service identifier as the target preset service identifier among multiple types of communication services is used as an optional service;

[0101] An optional service whose service status is active is determined as a candidate service.

[0102] In this embodiment, the primary state is also referred to as the Active state. If a service is in the primary state, it means that the service can be provided externally.

[0103] In an optional implementation, if there is no target service routing rule, for situation (2), this embodiment provides an implementation method for determining candidate services based on UDP packet type: if the UDP packet type represents broadcast, a communication service with a primary service status among multiple types of communication services is determined as a candidate service.

[0104] In this embodiment, in order to characterize whether the service request data packet of the UDP protocol is broadcast, this embodiment is implemented by setting the UDP packet type to a preset value. The preset value can be set to 0xFF, that is, if the UDP packet type is 0xFF, it means that the service request data packet needs to be broadcast to all services in the BNN whose service status is the main status, otherwise, the service request data packet is forwarded to the service represented by the UDP packet type.

[0105] (3) Determine the target service from the candidate services.

[0106] In this embodiment, when there are multiple candidate services, for two different situations where there is a target service routing rule and there is no target service routing rule, there are different implementation methods for determining the target service from the candidate services:

[0107] In the case where there is a target service routing rule: if there is a target service routing rule among multiple service routing rules and the target service routing rule is pre-set with a load balancing policy, the target service is determined from multiple candidate services according to the load balancing policy.

[0108] In this embodiment, the load balancing strategy can be set in the load balancing executor.

[0109] In the case where there is no target service routing rule: If there is no target service routing rule among multiple service routing rules, each candidate service is used as the target service.

[0110] In this case, the service request data packet needs to be broadcast to all services in the BNN whose service status is the active status, so each candidate service is the target service.

[0111] In this embodiment, after determining the target service, an implementation method of forwarding the service request data packet to the target service is:

[0112] First, obtain the IP address and port of the target service;

[0113] Secondly, the IP address of the target service is used as the destination IP address, and the port of the target service is used as the destination port to encapsulate in the service request data packet to obtain a data packet to be forwarded;

[0114] Finally, the data packets to be forwarded are forwarded to the target service asynchronously.

[0115] In this embodiment, no matter it is an HTTP request or a UDP request, the IP address and port of the target service need to be encapsulated in the service request data packet so that the service request data packet can be forwarded to the target service.

[0116] In addition, for HTTP requests, you can also configure it in the service routing rules as needed to encapsulate some specified headers in the HTTPHeader as tags or function extensions.

[0117] In this embodiment, both HTTP requests and UDP requests are forwarded to the target service in an asynchronous manner.

[0118] For HTTP requests, after forwarding the HTTP request to the target service in an asynchronous manner according to the IP and port information of the target service encapsulated in the request context, when the asynchronous request callback response is completed, the callback response needs to be written back to the caller. As a specific implementation method, for HTTP RESTful API requests, AsyncHttpClient can be used. AsyncHttpClient is an asynchronous HTTP client library based on Java NIO, which allows developers to send HTTP requests asynchronously. Of course, other asynchronous methods can also be used, such as virtual threads in JDK21 and Tokio in Rust.

[0119] For UDP requests, the Content field in the UDP signaling message is directly forwarded to the target service in an asynchronous manner based on the IP and port information of the target service encapsulated in the request context.

[0120] In this embodiment, in order to timely obtain the status of each communication service provided by BNN, as an implementation method, the service gateway registers its own service to the service registration center, subscribes to and monitors in real time the status change events of all services of these ServiceIds in the service routing rule configuration, pulls these services from the service registration center to the local service warehouse according to these ServiceIds, and updates the service status information to the local service warehouse in real time when the service status changes.

[0121] The service content in the local service repository mainly includes ServiceId (service identifier), Status (status), IP (IP address), TcpPort (TCP port), UdpPort (UDP port) and other information. The Status attribute mainly includes two states: Standby and Active. It can distinguish whether the service is in the active state (Active) or the standby state (Standby), so that requests are only forwarded to the service in the active state.

[0122] The service registration center is a software module that can run on BNN or be an independent hardware device that communicates with BNN.

[0123] In order to perform the corresponding steps in the above embodiments and various possible implementations, the following provides an implementation method of the service gateway implementation device 100, which is applied to Figure 3 Please refer to the beam network node in Figure 5 , Figure 5This is a block diagram of the service gateway implementation device provided in this embodiment. It should be noted that the basic principles and technical effects of the service gateway implementation device 100 provided by the present invention are the same as those of the corresponding above-mentioned embodiments, and are not mentioned in this embodiment for the sake of brief description.

[0124] The service gateway implementation device 100 includes a monitoring module 110 , a parsing module 120 , a determining module 130 and a forwarding module 140 .

[0125] A monitoring module 110 is used to monitor a service request data packet sent by a network management system;

[0126] The parsing module 120 is used to parse the uniform resource identifier URI in the service request data packet if the service request data packet comes from the HTTP request listening port, and use the URI as a matching keyword;

[0127] The parsing module 120 is further configured to parse out the UDP packet type in the service request packet if the service request packet comes from the UDP request listening port, and use the UDP packet type as a matching keyword;

[0128] A determination module 130, configured to determine a target service from a plurality of types of communication services according to matching keywords;

[0129] The forwarding module 140 is used to forward the service request data packet to the target service.

[0130] In an optional implementation, the BNN pre-stores a plurality of service routing rules, each service routing rule includes a preset keyword and a preset service identifier, and the determination module 130 is specifically used to:

[0131] If there is a target service routing rule whose preset keyword matches the matching keyword among the multiple service routing rules, the candidate service is determined according to the target preset service identifier in the target service routing rule;

[0132] If the target service routing rule does not exist in multiple service routing rules, and the matching keyword is the UDP packet type, the candidate service is determined according to the UDP packet type;

[0133] Determine the target service from the candidate services.

[0134] In an optional implementation, each type of communication service corresponds to a service identifier, and each communication service has a service status. The determination module 130 is specifically used to determine the candidate service according to the target preset service identifier in the target service routing rule, and is used to:

[0135] The communication service with the same service identifier as the target preset service identifier among multiple types of communication services is used as an optional service;

[0136] An optional service whose service status is active is determined as a candidate service.

[0137] In an optional implementation manner, the determination module 130 is specifically configured to, when determining the candidate service according to the UDP packet type,:

[0138] If the UDP packet type indicates broadcast, a communication service whose service status is an active state among the multiple types of communication services is determined as a candidate service.

[0139] In an optional implementation manner, there are multiple candidate services, and the determination module 130 is further configured to:

[0140] If a target service routing rule exists among the multiple service routing rules and a load balancing strategy is pre-set for the target service routing rule, the target service is determined from the multiple candidate services according to the load balancing strategy.

[0141] In an optional implementation manner, there are multiple candidate services, and the determination module 130 is further configured to:

[0142] If there is no target service routing rule among multiple service routing rules, each candidate service is used as the target service.

[0143] In an optional implementation manner, the forwarding module 140 is configured to:

[0144] Get the IP address and port of the target service;

[0145] The IP address of the target service is used as the destination IP address, and the port of the target service is used as the destination port to encapsulate in the service request data packet to obtain a data packet to be forwarded;

[0146] Asynchronously forwards packets to the target service.

[0147] As another implementation, this embodiment also provides an example of a service gateway architecture. Figure 6 , Figure 6 This is an example diagram of the service gateway architecture diagram provided in this embodiment. Figure 6 In the service gateway, the service gateway is mainly composed of startup configuration (StartConfiguration), rule and executor configuration (Rule&Executer Configuration), service discovery and management (Service Discovery&Management), HTTP listener (HTTPServer), UDP listener (UDPServer), dynamic worker thread pool (Dynamic Worker Thread Pool), processing executor (Processor), and management control interface (M&C API).

[0148] Start Configuration is responsible for loading and managing the startup configuration file, which determines whether to start one or two proxy listeners in HTTPServer or UDPServer. The configuration content mainly includes: TcpProxyPort (TCP proxy port), UdpProxyPort (UDP proxy port), ServiceId (service identifier), HighAvailabilityType (high availability type), ListenServices, and RegistryCenterNodes (registration center node address).

[0149] Rule&Executer Configuration is responsible for loading and managing service routing rules. A service routing rule configuration mainly includes: MatchURI, MatchUdpPacketType, ServiceId, LoadBalancingAlgorithm, and ExecuterList.

[0150] Service Discovery & Management is responsible for monitoring and changing the service status of the service registration center, and maintaining the active and standby status (Active or Standby) of these services in the local service repository. A service status information mainly includes: ServiceId, Status, IP address, UdpPort, TcpPort.

[0151] based on Figure 6 Please refer to the processing process of the service request packet Figure 7 , Figure 7 Based on the Figure 6 An example flow chart of how service request packets are processed in a gateway architecture. Figure 7In the process, HTTPServer and UDPServer listen to HTTP and UDP requests in real time, and hand over the requests to the corresponding Dynamic Worker Thread Pool after receiving them. The Dynamic Worker Thread Pool dynamically adjusts the number of Worker Threads according to the size of the queue data and the average time taken for a service route forwarding, so as to make rational use of thread resources and avoid the waste of thread resources and the overhead caused by frequent thread switching. The Dynamic Worker Thread Pool forwards the request load to the Queue in the corresponding WorkerThread, which is then decoded by the Worker Thread (decoding HTTP Packet or decoding UDPPacket). After decoding, it is processed to the next state machine Processor. The Processor is responsible for matching the entire service routing rules, establishing and executing the execution chain, and asynchronous forwarding of requests.

[0152] The M&C API provides some management control interfaces to support the modification and configuration of service routing rules, the query of some statistical information, etc. Based on these statistical information query APIs, it is easy to expand the Web graphical interface-based operation and maintenance monitoring and traffic statistics of the service gateway.

[0153] It should be added that a specific implementation method is that the HTTPServer in the embodiment of the method is constructed using the Netty framework, and the asynchronous forwarding of the Processor request adopts the AsyncHttpClient technical framework. Based on the two, a high-performance, high-concurrency processing framework can be constructed. Of course, other technologies (or development languages) can also be used to achieve the same effect.

[0154] It should be noted that, in addition to running on the BNN, the service gateway provided in this embodiment can also run on a device independent of the BNN and connected to the BNN for communication. Those skilled in the art can obtain it after adaptive modification based on the disclosure of the embodiments of the present invention without paying any creative labor, and it is also within the scope of protection of the present invention.

[0155] An embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the service gateway implementation method in the aforementioned embodiment is implemented.

[0156] In summary, the embodiments of the present invention provide a service gateway implementation method, device, beam network node and readable storage medium, which are applied to the beam network node BNN, the BNN communicates with the network management system, and the BNN provides multiple types of communication services to the network management system. The method includes: monitoring the service request data packet sent by the network management system; if the service request data packet comes from the HTTP request listening port, parsing the uniform resource identifier URI in the service request data packet, and using the URI as the matching keyword; if the service request data packet comes from the UDP request listening port, parsing the UDP packet type in the service request data packet, and using the UDP packet type as the matching keyword; determining the target service from multiple types of communication services according to the matching keyword; forwarding the service request data packet to the target service. Compared with the prior art, this embodiment has at least the following advantages: (1) It can simultaneously satisfy service requests based on both HTTP and UDP protocols; (2) Based on the subscription monitoring and pull mechanism, a set of local service repositories is maintained, and the high availability types and states of these services are divided into Standby and Active states. When forwarding services, the only service with an Active state can be quickly found according to the load balancing algorithm; (3) The concepts and rules of the execution chain (ExecuterList) and executors are introduced. The execution chain uniformly manages the life cycle of the core functions of the gateway, such as routing, load balancing, and forwarding. The executor can be customized according to the executor rules (such as log printing and recording, request authentication and interception, blacklist and whitelist control, etc.) and added to the execution chain of the service routing rules. After the request arrives, the execution chain is established according to the request and service routing rules. The execution chain executes these executors in sequence, which ensures the order of the executors and enhances the scalability of the service gateway; (4) The 6-byte Source field is defined in the UDP protocol data unit, which can achieve the purpose of forwarding the Source field load of the request data packet of the UDP protocol to the same service.The Source field can be an IP address, a unique identifier of the user terminal station mac24 (or hid), a resource scheduling groupId, or other attributes defined as needed; (5) A protocol data unit (PDU) encapsulation structure is proposed for the UDP service call protocol, and the broadcast attribute when the UDP Packet Type in the encapsulation structure is 0xFF is defined, which can support UDP broadcasts to various services to achieve the broadcast effect, such as broadcasting UTCT (UTC timetable) and other broadcast signals to all services; (6) The Dynamic Worker Thread Pool technology is adopted, which can dynamically adjust the number of Worker Threads according to the size of the queue data and the average time taken for a service routing forwarding, so as to make rational use of thread resources and avoid the waste of thread resources and the overhead caused by frequent thread switching; (7) The asynchronous routing forwarding method is adopted, which can greatly improve the concurrent processing capability of the service gateway and can easily cope with a large number of requests.

[0157] The above are only various embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A service gateway implementation method, characterized in that: Applied to a beam network node BNN, the BNN communicates with a network management system, the BNN pre-stores a plurality of service routing rules, each of the service routing rules includes a preset keyword and a preset service identifier, the BNN provides multiple types of communication services to the network management system, and the same communication service simultaneously supports different communication protocols to provide services externally, the method includes: Monitoring the service request data packets sent by the network management system; If the service request data packet comes from the HTTP request listening port, parse out the uniform resource identifier URI in the service request data packet and use the URI as a matching keyword; If the service request data packet comes from the UDP request listening port, parse out the UDP packet type in the service request data packet, and use the UDP packet type as the matching keyword; determining a target service from the plurality of types of communication services according to the matching keywords; forwarding the service request data packet to the target service; The step of determining a target service from the plurality of types of communication services according to the matching keywords comprises: If there is a target service routing rule whose preset keyword matches the matching keyword in the multiple service routing rules, determining a candidate service according to the target preset service identifier in the target service routing rule; If the target service routing rule does not exist in the multiple service routing rules, and the matching keyword is a UDP packet type, determining the candidate service according to the UDP packet type; Determine a target service from the candidate services; The step of determining the candidate service according to the UDP packet type comprises: If the UDP packet type represents broadcast, determining a communication service whose service status is an active state among the multiple types of communication services as the candidate service; There are multiple candidate services, and the step of determining a target service from the candidate services includes: If the target service routing rule does not exist in the multiple service routing rules, each of the candidate services is used as a target service.

2. The service gateway implementation method according to claim 1, characterized in that: Each type of communication service corresponds to a service identifier, and each of the communication services has a service status. The step of determining a candidate service according to the target preset service identifier in the target service routing rule includes: Selecting a communication service with the same service identifier as the target preset service identifier among the multiple types of communication services as an optional service; An optional service whose service status is an active state is determined as the candidate service.

3. The service gateway implementation method according to claim 1, characterized in that: There are multiple candidate services, and the step of determining a target service from the candidate services includes: If the target service routing rule exists in the multiple service routing rules and the target service routing rule is pre-set with a load balancing strategy, the target service is determined from the multiple candidate services according to the load balancing strategy.

4. The service gateway implementation method according to claim 1, characterized in that: The step of forwarding the service request data packet to the target service comprises: Obtain the IP address and port of the target service; Encapsulate the IP address of the target service as the destination IP address and the port of the target service as the destination port in the service request data packet to obtain a data packet to be forwarded; The data packet to be forwarded is forwarded to the target service in an asynchronous manner.

5. A service gateway implementation device, characterized in that: Applied to a beam network node BNN, the BNN communicates with a network management system, the BNN pre-stores a plurality of service routing rules, each of the service routing rules includes a preset keyword and a preset service identifier, the BNN provides multiple types of communication services to the network management system, and the same communication service simultaneously supports different communication protocols to provide services externally, the device includes: A monitoring module, used for monitoring the service request data packets sent by the network management system; A parsing module, configured to parse out a uniform resource identifier URI in the service request data packet if the service request data packet comes from an HTTP request listening port, and use the URI as a matching keyword; The parsing module is further configured to parse out the UDP packet type in the service request data packet if the service request data packet comes from the UDP request listening port, and use the UDP packet type as the matching keyword; a determination module, configured to determine a target service from the plurality of types of communication services according to the matching keyword; A forwarding module, used for forwarding the service request data packet to the target service; The determination module is specifically used for: if there is a target service routing rule whose preset keyword matches the matching keyword in the multiple service routing rules, determining the candidate service according to the target preset service identifier in the target service routing rule; if the target service routing rule does not exist in the multiple service routing rules and the matching keyword is a UDP packet type, determining the candidate service according to the UDP packet type; determining the target service from the candidate services; if the UDP packet type represents a broadcast, determining the communication service whose service status is the main service status among the multiple types of communication services as the candidate service, and there are multiple candidate services; if the target service routing rule does not exist in the multiple service routing rules, each of the candidate services is taken as the target service.

6. A beam network node, characterized in that: It comprises a processor and a memory, wherein the memory is used to store a program, and the processor is used to implement the service gateway implementation method as described in any one of claims 1-4 when executing the program.

7. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the service gateway implementation method as described in any one of claims 1-4 is implemented.

Citation Information

Patent Citations

  • Method and system for processing user service request

    CN114390108A

  • Distributed service implementation method and distributed service system

    CN114979143A