Service management method and device, gateway station and computer readable storage medium

By dividing the same type of services into the same service group in the satellite communication system and selecting takeover services according to the high availability type of the faulty service group, the problem that the existing technology cannot meet the needs of multiple high availability types is solved, and the system is realized support and high availability of multiple high availability types.

CN119298977APending Publication Date: 2025-01-10CHENGDU CORESAT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411425254.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-12
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

The existing distributed high availability architecture cannot meet the low latency requirements of multiple types of services in satellite communication systems and different development languages ​​and technology stacks, resulting in the inability to effectively support the needs of multiple high availability types.

Method used

Divide the same type of services into the same service group, configure the high availability type of the master and backup switching type according to the service group. When any service fails, select takeover based on the pre-configured master and backup switching type of the fault service group to which the fault service belongs. Services to ensure high availability of the system.

Benefits of technology

It realizes support for high-availability services for master-slip switching types except for distributed high availability, improves system availability and reliability, reduces development and operation and maintenance costs, and simplifies configuration and management among services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119298977A_ABST
    Figure CN119298977A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of satellite communication, and provides a service governance method and device, a gateway station and a computer readable storage medium, which are applied to the gateway station, the gateway station runs multiple types of services, the same type of services are divided into the same service group, and the service group is divided into multiple service groups. The method comprises the following steps: when any service in multiple types of services is detected to have a fault, obtaining a fault service group to which a fault service belongs and a pre-configured high availability type of the fault service group; if the high-availability type is the master-standby switching type and the service state of the fault service is the master state, selecting a takeover service for takeover the fault service from the fault service group; and setting the service state of the takeover service as a main state, and updating the service state of the fault service as a fault state. According to the scheme, the gateway station can support high-availability services of main and standby switching types except for distributed high-availability services.
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 management method, device, gateway station and computer-readable storage medium. Background Art

[0002] In the gateway stations of satellite communication systems, there are many services with different functions. In order to ensure the availability of the system, a service with one function is generally equipped with at least one corresponding backup service (which may also work simultaneously and share part of the load) to ensure the continuity and availability of data transmission and signaling interaction between user terminal stations and gateway stations. Such a satellite communication system is a high-availability system.

[0003] Service governance is the process of managing and controlling services in a high-availability system. At present, the service governance of satellite communication systems draws on the distributed high-availability architecture adopted by the existing microservices in the Internet industry. Under this architecture, multiple types of services on the same gateway station share the same high-availability type, namely distributed high availability. However, in satellite communication systems, there are many types of services on gateway stations, with different low-latency requirements, development languages, and development technology stacks. The high-availability types also vary due to business needs and technical implementation methods. There is only one distributed high-availability method, which cannot meet the needs of satellite communication systems. Summary of the invention

[0004] The present invention aims to provide a service management method, device, gateway station and computer-readable storage medium.

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

[0006] In a first aspect, the present invention provides a service management method, which is applied to a gateway station, wherein the gateway station runs multiple types of services, and services of the same type are divided into the same service group, and the method comprises:

[0007] When it is detected that any service among the multiple types of services fails, obtaining the faulty service group to which the faulty service belongs and the high availability type pre-configured for the faulty service group;

[0008] If the high availability type is an active-standby switching type and the service state of the faulty service is an active state, selecting a takeover service for taking over the faulty service from the faulty service group;

[0009] The service state of the takeover service is set to the active state, and the service state of the faulty service is updated to the faulty state.

[0010] In an optional embodiment, the method further comprises:

[0011] Receive a target group to which the target service belongs, an IP address, a port, and a current service status of the target service reported by any target service among the multiple types of services;

[0012] Determine whether the target service is a newly registered service according to the IP address and port of the target service;

[0013] If yes, determining the expected state of the target service according to the target group and recording the expected state of the target service in a service registration repository while setting the service state of the target service in the service registration repository to being configured;

[0014] If not, the information of the target service recorded in the service registration repository is updated according to the current service status.

[0015] In an optional implementation manner, the gateway station pre-establishes at least one service session, each of the service sessions is pre-configured with an IP address and a port for service interaction through each service session, and the step of determining whether the target service is a newly registered service according to the IP address and the port of the target service includes:

[0016] If there is a session in the at least one service session whose IP address is the same as the IP address of the target service and whose port is the same as the port of the target service, it is determined that the target service is not a newly registered service; otherwise, it is determined that the target service is a newly registered service.

[0017] In an optional implementation manner, the step of determining the expected state of the target service according to the target group includes:

[0018] Obtain the target high availability type pre-configured for the target group;

[0019] If the target high availability type is a non-configuration type of active / standby switching, determining the expected state of the target service according to the service states of the remaining services in the target group except the target service;

[0020] If the target high availability type is the master-slave switching type of the configuration class and the number of services to which the configuration has been applied in the target group does not reach a preset number, the expected state of the target service is set to the master state; otherwise, the expected state of the target service is set to the standby state.

[0021] In an optional implementation manner, the step of determining the expected state of the target service according to the service states of the remaining services in the target group except the target service includes:

[0022] If there is a service in the active state among the services other than the target service in the target group, setting the expected state of the target service to the standby state;

[0023] If there is no service whose service status is the active state among the remaining services in the target group except the target service, a candidate service is determined from the target group, and when the candidate service is the target service, the expected state of the target service is set to the active state, and when the candidate service is not the target service, the expected state of the target service is set to the standby state.

[0024] In an optional implementation, the information of the target service recorded in the service registration warehouse includes an expiration time, a service state, and an expected state, the expiration time being the time when the validity of the service state of the target service recorded in the service registration warehouse becomes invalid, the expected state being the service state determined by the target session pre-established by the gateway when the target service is registered, the target session being pre-configured with an IP address and a port for service interaction, the IP address of the target session being the same as the IP address of the target service, and the port of the target session being the same as the port of the target service, and the step of updating the information of the target service recorded in the service registration warehouse according to the current service state includes:

[0025] If the service state of the target session is consistent with the current service state, the expiration time is updated; otherwise, the information of the target service in the service registration repository is updated according to the current service state and the expected state.

[0026] In an optional implementation, the step of updating the information of the target service in the service registration repository according to the current service state and the expected state includes:

[0027] If the current service state is consistent with the expected state, the service state of the target service in the service registration warehouse is updated to the expected state; otherwise, the information of the target service is deleted from the service registration warehouse.

[0028] In a second aspect, the present invention provides a service management device, which is applied to a gateway station, wherein the gateway station runs multiple types of services, and services of the same type are divided into the same service group, and the device includes:

[0029] A detection module, configured to, when a failure is detected in any service of the plurality of types of services, obtain a failure service group to which the failure service belongs and a high availability type pre-configured for the failure service group;

[0030] A processing module, configured to select a takeover service from the faulty service group to take over the faulty service if the high availability type is an active-standby switching type and the service state of the faulty service is an active state;

[0031] The processing module is further used to set the service state of the takeover service to the active state, and update the service state of the faulty service to the faulty state.

[0032] In a third aspect, the present invention provides a gateway station, including a processor and a memory, wherein the memory is used to store a program, and the processor is used to implement a service governance method as described in any one of the aforementioned implementation modes when executing the program.

[0033] 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 governance method as described in any one of the aforementioned embodiments.

[0034] Compared with the prior art, the present invention divides services of the same type into the same service group, and configures the high availability type of the active-standby switching type according to the service group. When any service fails, a takeover service is selected to take over the failed service according to the high availability type of the active-standby switching type pre-configured in the fault service group to which the failed service belongs, so that the takeover service can continue to provide the services originally provided by the failed service, thereby ensuring that the gateway station can support high availability services of the active-standby switching type. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] 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.

[0036] Figure 1 This is an example diagram of an application scenario provided by this embodiment.

[0037] Figure 2 This is an example block diagram of a gateway station provided in this embodiment.

[0038] Figure 3 This is an example flow chart of the service governance method provided in this embodiment.

[0039] Figure 4 This is an example diagram of the interaction between the service client and the registration center in the service status reporting process provided in this embodiment.

[0040] Figure 5This is an example diagram of the interaction between the service client and the registration center in the service status subscription process provided in this embodiment.

[0041] Figure 6 A block diagram of an example service management device provided for this embodiment.

[0042] Figure 7 This is a diagram showing an example of the architecture of the registration center provided in this embodiment.

[0043] Figure 8 This is a diagram showing an example of the architecture of the service client provided in this embodiment.

[0044] Icons: 10 - gateway station; 11 - processor; 12 - memory; 13 - bus; 20 - user terminal station; 30 - satellite; 100 - service management device; 110 - detection module; 120 - processing module. DETAILED DESCRIPTION

[0045] 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.

[0046] 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.

[0047] 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.

[0048] 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.

[0049] 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.

[0050] 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.

[0051] Please refer to Figure 1 , Figure 1 This is an example diagram of an application scenario provided in this embodiment. Figure 1 In a satellite communication system, n user terminal stations 20 communicate with a gateway station 10 via a satellite 30. The gateway station 10 provides various types of services. In this embodiment, the services provided by the gateway station can be grouped according to functional types, including but not limited to the following groups: access session management service, resource management service, device management service, gateway service, network management service, mobile control management service, etc. The services configure the IP and port information of the caller, call each other, and depend on each other.

[0052] The session management service is responsible for the access session control of the user terminal station 20, the application of wireless resources, the management of user sessions and session contexts, the application of beam network switching, the issuance of beam switching signaling, the issuance of other control signaling, etc.

[0053] The resource management service is mainly responsible for the scheduling of reverse dynamic link resources.

[0054] The device management service is mainly responsible for the configuration of forward board devices, reverse board devices, clock devices, beacon devices and other devices, as well as the management and control of active-standby switching.

[0055] The gateway service is mainly responsible for IP routing forwarding, channel multiplexing data ACM scheduling, GSE baseband frame encapsulation and forwarding, etc.

[0056] The network management service is mainly responsible for the network configuration and management of the entire satellite communication system. The mobile control management service is mainly responsible for the management of the user terminal station location and beams and the decision-making control of the user terminal station satellite and beam network switching.

[0057] The same group includes multiple services of the same type. In order to improve the reliability of the satellite communication system, the services in the same group are generally equipped with at least one corresponding backup service. When any service fails, the backup service can take over in time to ensure the normal operation of the satellite communication system and the continuity and availability of data transmission and signaling interaction between the user terminal station and the gateway station. The Internet industry is usually implemented based on a distributed architecture, and especially in satellite communication systems that support the MF-TDMA system, due to the requirements of demanding scenarios such as low latency, some services are currently unable to support distributed high availability.

[0058] The gateway station 10 is mainly responsible for processing the signal transmission and conversion between the ground network and the satellite. The gateway station is usually equipped with high-performance receiving and transmitting equipment, which can transmit high-speed data with the satellite, and is also responsible for processing such as modulation, demodulation, amplification, and frequency conversion of the signal.

[0059] The user terminal station 20 generally refers to a ground station that communicates directly with the user, and can be a mobile station, such as a satellite phone for personal use, a vehicle-mounted, ship-mounted or aircraft-mounted terminal, or a fixed station, such as a fixed station that provides services to an entire community.

[0060] However, due to various reasons such as low latency requirements of services, development languages, and development technology stacks, high availability types also vary due to business needs and technical implementation methods. Some services can ensure high availability in a distributed manner, while other services can ensure high availability in a master-slave manner. In order to provide support for multiple high availability methods, this embodiment uses the same high availability type for the same service group, and different service groups can use different high availability types, thereby achieving support for multiple high availability types in the satellite communication system. For example Figure 1 In the , the access session management service supports the active-standby switching high-availability service, and the mobile control management service supports the distributed high-availability service. These two types of services are located in different groups, and each group uses a different high-availability type. Of course, different groups can also use the same high-availability type. In this case, the same high-availability type can use a unified processing framework. The entire satellite communication system can include a variety of processing frameworks with different high-availability types. When a new service type is added, the required high-availability type can be selected based on the existing processing framework. It only needs to register the new service type to the high-availability type in the selected processing framework. It will be described in detail below.

[0061] Please refer to Figure 2 , Figure 2 The schematic block diagram of the gateway station 10 provided in this embodiment includes a processor 11 , a memory 12 and a bus 13 . The processor 11 and the memory 12 are connected via the bus 13 .

[0062] The processor 11 may be an integrated circuit chip having the ability to process signals. In the implementation process, each step of the service governance method of the above embodiment may be completed by an integrated logic circuit of hardware in the processor 11 or by instructions in the form of software. 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 management method. The program may be a software function module stored in the memory 12 in the form of software or firmware or fixed in the OS (Operating System) of the gateway station 10.

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

[0065] based on Figure 1 This embodiment also provides an application scenario for Figure 1 and Figure 2 For service management methods of Zhongguankou Station, please refer to Figure 3 , Figure 3 This is a flow chart of an example of a service governance method provided in this embodiment. The method includes the following steps:

[0066] Step S101: when it is detected that any service among multiple types of services fails, the failed service group to which the failed service belongs and the high availability type pre-configured for the failed service group are obtained.

[0067] In this embodiment, the user can pre-configure the corresponding high availability type for each type of service group according to actual needs. The high availability type can be a distributed high availability type based on a distributed framework or an active-standby switching type. There are two forms of active-standby switching types: a configuration-based active-standby switching type and a non-configuration-based active-standby switching type. Configure the high availability type group so that the services in the group can provide services corresponding to the high availability type.

[0068] For the distributed high availability type, it can provide distributed high availability services and support distributed deployment. It can deploy 2 or more nodes, all of which work at the same time and can share part of the load. When any of the nodes goes down, the remaining nodes do not need to do additional processing, and can seamlessly replace the down node and bear part of the load, which naturally supports high availability.

[0069] For non-configuration type of active / standby switching, it can provide active / standby switching high availability services, which are hot standby services and support the deployment of 2 or more nodes. However, only one of these nodes provides services as the primary node. Although the remaining nodes are started, they are in a "non-working" state and cannot share the load with the primary node. When the primary node goes down, a single node is elected from the remaining nodes as the primary node to replace the original down primary node, thus achieving high availability.

[0070] For the configuration-based active / standby switching type, it can provide high-availability services based on active / standby switching. It is a variant of hot standby and supports the deployment of 2 or more nodes. However, only nodes with configurations can provide services as active nodes. Although the remaining nodes without configurations are started, they are in a "non-working" state and cannot share the load with the active node. When the active node goes down, the only node elected from the nodes without configurations applies the configuration and takes over as the active node to replace the original active node, thus achieving high availability.

[0071] Step S102: If the high availability type is an active-standby switching type and the service state of the failed service is an active state, a takeover service for taking over the failed service is selected from the failed service group.

[0072] In this embodiment, services whose service status is the main status (also called the Active status) can provide services to the outside. In addition, there are services whose service status is the standby status (also called the Standby status). Such services cannot provide services to the outside. They can only provide services to the outside when their status changes to the main status. For the high availability type of the main-standby switching type, if the faulty service is a service in the main status, it is necessary to select other services in the same group to take over the faulty service. The selected service to take over the faulty service is called the takeover service to ensure the high availability of the entire system. If the faulty service is in the standby status, there is no need to find a takeover service for it. The way to select a takeover service includes, but is not limited to, Oldest Qualification (oldest qualification principle), Weight Priority (weight priority algorithm), Raft (Raft consensus algorithm), etc.

[0073] Step S103, setting the service state of the takeover service to the active state, and updating the service state of the failed service to the failed state.

[0074] In this embodiment, after the service status of the faulty service is updated to the faulty status, the faulty service may be removed from the faulty service group. In addition, in order to prevent other services related to the faulty service from being affected by timely knowing that the service status of the faulty service has changed, the following processing may be performed after the service status of the faulty service is updated to the faulty status: obtaining a related service group that monitors the faulty service in multiple service groups; and notifying each service in the related service group of the faulty service of the faulty status.

[0075] The above method provided in this embodiment divides services of the same type into the same service group, and configures the high availability type of the active-standby switching type according to the service group. When any service fails, a takeover service is selected to take over the failed service according to the high availability type of the active-standby switching type pre-configured in the fault service group to which the failed service belongs, so that the takeover service can continue to provide the services originally provided by the failed service, thereby ensuring that the gateway station can support high availability services of the active-standby switching type in addition to distributed high availability.

[0076] In an optional implementation, each service will report its own information and current service status in a timely manner to maintain a communication connection with each service or configure a newly registered service. This embodiment also provides an implementation method for processing the information reported by the service and the current service status:

[0077] First, receiving the target group, IP address, port and current service status of the target service reported by any target service among multiple types of services;

[0078] In this embodiment, the target service is any service among multiple types of services, the group to which the target service belongs is the target group, the service requester can request the target service through the IP address and port of the target service, and the external target service can periodically report the target group, the IP address and port of the target service and the current service status of the target service according to a preset period. As an implementation method, each group can be represented by an identifier, and the target service can report the target group by reporting the identifier of the target group.

[0079] Secondly, determine whether the target service is a newly registered service based on the IP address and port of the target service; if so, determine the expected state of the target service based on the target group and record the expected state of the target service in the service registration warehouse and set the service state of the target service in the service registration warehouse to be configured; if not, update the information of the target service recorded in the service registration warehouse according to the current service state.

[0080] In this embodiment, the service registration repository includes information of all registered services, including but not limited to the group identifier, service type, high availability type, IP address, port, service status, and other information to which the registered service belongs.

[0081] For a newly registered service, after determining its service status, it is necessary to return the determined service status to the newly registered service so that it can set its own service status to the returned service status. In order to ensure the reliability of the connection between the service client of the newly registered service and the registration center that confirms the service status of the newly registered service, there is a confirmation and response process between the two parties. The expected status is introduced here. The service registration repository also stores the expected status of the newly registered service. Before the newly registered service is set according to the determined service status, the service status of the newly registered service in the service registration repository is the temporary status in the configuration, and the expected status is the determined status. When the registration center returns the expected status to the service client, and the service client sets the newly registered service to the expected status, the status reported by the newly registered service is the expected status, and the configuration of the service status in the service registration repository will eventually be updated to the expected status.

[0082] For registered services, in order to make the information of registered services in the service registration repository up to date, it is necessary to update the information of registered services in the service registration repository according to the reported service status.

[0083] In an optional implementation manner, when a service requester needs to request a service provided by a gateway station, it is necessary to first establish a service session with the requested service, and request the corresponding service through the service session. Each service session is pre-configured with an IP address and port for service interaction through each service session. According to the IP address and port of the service session and the IP address and port of the target service, it is possible to determine whether the target service is a newly registered service. The specific implementation method is as follows:

[0084] If there is a session in at least one service session whose IP address is the same as the IP address of the target service and whose port is the same as the port of the target service, it is determined that the target service is not a newly registered service, otherwise it is determined that the target service is a newly registered service.

[0085] In an optional implementation manner, for the active / standby switching type of the configuration class and the active / standby switching type of the non-configuration class, the manner of determining the expected state of the target service is different. This embodiment provides an implementation manner of determining the expected state of the target service according to the target group:

[0086] First, obtain the target high availability type pre-configured in the target group;

[0087] Second, determine the expected state of the target service based on the target high availability type.

[0088] For a non-configuration type of active / standby switching of the target high availability type, the expected state of the target service is determined according to the service states of the remaining services in the target group except the target service;

[0089] In this embodiment, for the non-configuration type of active-standby switching, there is only one service in the active state in the target group. When the report information of the newly registered service is received, if there is already a service in the active state in the target group, the expected state of the newly registered service can only be the standby state. If there is no service in the active state in the target group, a candidate service is determined from the target group and used as the service in the active state. The specific implementation method is: if there is a service with a service status of the active state among the remaining services except the target service in the target group, the expected state of the target service is set to the standby state; if there is no service with a service status of the active state among the remaining services except the target service in the target group, a candidate service is determined from the target group, and when the candidate service is the target service, the expected state of the target service is set to the active state; when the candidate service is not the target service, the expected state of the target service is set to the standby state.

[0090] For the active / standby switching type of the target high availability type being the configuration class, the target group is also pre-configured with a preset number. The number of services that have been configured in the target group cannot exceed the preset number. The service status of the services that have been configured is the active status, and the service status of the remaining services that have not been configured is the standby status. The expected status of the target service needs to be determined based on the preset number of target group configurations and the number of services that have been configured in the target group. The specific implementation method is as follows:

[0091] If the number of services to which the configuration has been applied in the target group does not reach the preset number, the expected state of the target service is set to the active state, otherwise the expected state of the target service is set to the standby state.

[0092] In this embodiment, for example, the target high availability type of the target group is the master-slave switching type of the configuration class, and the preset number of configurations is 3. There are already 2 configured services in the target group: a and b. At this time, the group has added a target service c. Since the current number of configured services is 2, the expected state of the target service c should be the master state. There will be a series of subsequent processing, and the service state of the target service c will eventually be the master state. If a target service d is added to the target group later, then since the current number of configured services is 3, the expected state of the target service d should be the standby state.

[0093] In an optional implementation, the information of the target service recorded in the service registration warehouse includes an expiration time, a service state, and an expected state. The expiration time is the time when the validity of the service state of the target service recorded in the service registration warehouse becomes invalid. The expected state is the service state determined by the target session pre-established by the gateway when the target service is registered. The target session is pre-configured with an IP address and a port for service interaction. The IP address of the target session is the same as the IP address of the target service and the port of the target session is the same as the port of the target service. For a non-newly registered service, in order to ensure that the information of the target service in the service registration warehouse is the latest, after receiving the latest information reported by the target service, it is necessary to update the existing information of the target service in the service registration warehouse according to the latest information reported by the target service. The specific implementation method is as follows:

[0094] If the service status of the target session is consistent with the current service status, the expiration time is updated; otherwise, the information of the target service in the service registration repository is updated according to the current service status and the expected status.

[0095] In this embodiment, in order to ensure the continuity of the connection between the service client and the registration center, or to ensure the heartbeat connection between the service client and the registration center, the expiration time of the target service is also stored in the service registration warehouse. The expiration time is the time when the validity of the service status of the target service recorded in the service registration warehouse becomes invalid. If the current system time reaches the expiration time, it means that the service status of the target service in the service registration warehouse may be unreliable.

[0096] In addition, for established sessions, each session corresponds to a service status. Normally, the service status of each session is consistent with the service status of the corresponding service in the service registration repository. In other words, the service status of the target session is consistent with the service status of the target service in the service registration repository. This is a normal periodic report between the service client and the registration center, which means that the connection between the two is normal. In order to maintain the heartbeat connection between the two, the expiration time needs to be updated at this time.

[0097] Of course, the two may be inconsistent under special circumstances. In some cases, the inconsistency between the two is normal, and in some cases, it is an abnormal situation, which requires different processing according to different situations. The specific processing method is: if the current service status is consistent with the expected status, the service status of the target service in the service registration warehouse is updated to the expected status, otherwise the information of the target service is deleted from the service registration warehouse.

[0098] In this embodiment, if the current service status is inconsistent with the service status of the target session, and the current service status is consistent with the expected status of the target service, it means that the current service status of the target service is determined by the registration center during registration and returned to the service client. At this time, the service status of the target service in the service registration warehouse is a temporary status in the configuration. This is a normal situation, and the service status of the target service in the service registration warehouse is updated to the expected status.

[0099] If the current service status is inconsistent with the service status of the target session, and the current service status is inconsistent with the expected status of the target service, it may be that there is an abnormality in the service client or there is an abnormal situation in which a forged service client sends a spoofed data packet. In order to avoid further expansion of the abnormal situation and affect other related services, the information of the target service needs to be deleted from the service registration repository.

[0100] In this embodiment, in order to facilitate expansion, the party responsible for service governance (also called the registration center) and the governed party (also called the service client) are decoupled. The registration center is the control and coordination center of the entire service management, high-availability type matching and master selection, and high-availability switching (master-standby switching). It can be installed and deployed as an independent service program but is not limited to the gateway station 10. The service client refers to the various managed services, which here refers to programs or methods that can be provided as a separate library (or jar package) to various services for reference and calling, so that various services have functions such as high-availability switching, service discovery, and service calling.

[0101] To clearly illustrate the interaction between the registry and the service client in the above service governance method, please refer to Figure 4 , Figure 4 This is an example diagram of the interaction between the service client and the registration center in the service status reporting process provided in this embodiment. Figure 4 In the example, the two interact as follows:

[0102] The service client periodically reports its own service basic information and service status to the registration center at a preset period. The service basic information includes, but is not limited to, service group, IP address, port, etc.

[0103] The registration center determines whether there is a corresponding service session based on the basic service information (if it exists, it means that the service is not a newly registered service, otherwise it means that the service is a newly registered service): (1) If it does not exist, determine the status of the service according to the high availability type of the service group, set the expected status and service status and save them to the service registration warehouse. The expected status is the determined status, and the service status is the configuring status. Send the specified status (the specified status is the expected status) and service configuration to the service client. The service client applies the service configuration to switch the service status of the service to the specified status; (2) If it exists, determine whether the reported service status is consistent with the status of the service session. If they are consistent, update the expiration time to maintain the heartbeat. If they are inconsistent, compare the reported service status with the expected status. If they are inconsistent, remove the service from the service registration warehouse. If they are consistent, update the service status of the service in the service registration warehouse with the expected status of the service, and notify all services listening to the service group in the form of an event.

[0104] In this embodiment, in order to promptly notify the services of the service group that care about the service when the service status of the service changes, each service can subscribe to the event of the service status change of the service it cares about through a subscription method. Figure 5 , Figure 5 This is an example diagram of the interaction between the service client and the registration center in the service status subscription process provided in this embodiment. Figure 5 In , the interaction process between the service client and the registration center is as follows:

[0105] The service client starts monitoring service status information changes, and periodically initiates service status change subscription requests to the registration center at a preset period (only monitoring services of all concerned service groups). The subscription request content includes: service identifier, subscribed group identifier set.

[0106] The registration center writes the received subscription request to the subscription list (subscriber service identifier, subscribed service group identifier set) and sends a subscription response to the service client.

[0107] The service client determines whether the subscription is successful. If so, it pulls the latest service status list of all service groups according to the related service group identifier set. The registration center queries the service status list of all specified service groups according to the service group identifier set and sends a pull response to the service client. The service client determines whether the pull response is successful. If so, it writes the service status list of all subscribed service groups to the local service repository and terminates the periodic task. If the subscription fails or the pull fails, it waits for the next cycle to re-initiate the subscription request.

[0108] In this embodiment, in order to maintain a continuous communication connection between the service client and the registration center, the service client periodically performs heartbeat detection with the registration center at a preset periodic frequency. If it is detected that no heartbeat response from the registration center is received within the preset timeout period, the service client re-initiates the service registration process and service subscription and pull tasks to other registration centers (if multiple registration centers are configured) until success; if only one registration center is configured, it still attempts to initiate the registration process and service subscription and pull tasks to the registration center until success.

[0109] In this embodiment, as another implementation method, the registration center periodically runs the expired service timed cleanup scheduler at a preset time period. When any of the services fails, the service will be removed from the available service list by the registration center, and all other services (service clients) that monitor the status change of the service group will be notified. Then, at least one service consistent with the service group is determined according to the service group information (service group identifier, high availability type), and then any one or more services in the at least one service are switched to the primary state as the primary service according to the primary selection algorithm in the group information, and the specified state and / or service configuration are sent to the selected service client. When the high availability type is a non-configuration type of primary-standby switching, the specified state is sent to the selected service client. When the high availability type is a configuration type of primary-standby switching, the specified state and service configuration are sent to the selected service client. The service configuration indicates whether the corresponding service is configured as "applied". If the service client receives the service configuration indicating "applied", the service state of the service is switched to the primary state. If the service client receives the service configuration indicating "not applied", the service state of the service is switched to the standby state.

[0110] In addition, in order to improve the scalability and robustness of the overall system, the above method can be provided by a hot-swappable plug-in management method and a common management control API, and custom plug-ins can be written according to plug-in rules, such as plug-in service monitoring plug-ins, etc., which can support graphical interface monitoring of service status and improve operation and maintenance management efficiency.

[0111] In order to execute the corresponding steps in the above embodiments and various possible implementations, a method for implementing the service management device 100 is given below. Figure 6 , Figure 6 This is a block diagram of the service governance device provided in this embodiment. It should be noted that the basic principles and technical effects of the service governance 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.

[0112] The service management device 100 includes a detection module 110 and a processing module 120.

[0113] The detection module 110 is used to obtain the fault service group to which the fault service belongs and the high availability type pre-configured for the fault service group when a fault is detected in any service of the multiple types of services;

[0114] The processing module 120 is configured to select a takeover service from the faulty service group to take over the faulty service if the high availability type is an active-standby switching type and the service state of the faulty service is an active state;

[0115] The processing module 120 is further configured to set the service status of the takeover service to the active status, and update the service status of the failed service to the failed status.

[0116] In an optional implementation, the processing module 120 is further configured to:

[0117] Receive the target group, IP address, port and current service status of the target service reported by any target service among multiple types of services;

[0118] Determine whether the target service is a newly registered service based on the IP address and port of the target service;

[0119] If so, determine the expected state of the target service according to the target group and record the expected state of the target service in the service registration repository, and set the service state of the target service in the service registration repository to be configured;

[0120] If not, the target service information recorded in the service registration repository is updated according to the current service status.

[0121] In an optional implementation manner, the gateway station pre-establishes at least one service session, and each service session is pre-configured with an IP address and a port for service interaction through each service session. When the processing module 120 is used to determine whether the target service is a newly registered service according to the IP address and the port of the target service, it is specifically used to:

[0122] If there is a session in at least one service session whose IP address is the same as the IP address of the target service and whose port is the same as the port of the target service, it is determined that the target service is not a newly registered service, otherwise it is determined that the target service is a newly registered service.

[0123] In an optional implementation manner, when the processing module 120 is used to determine the expected state of the target service according to the target group, it is specifically used to:

[0124] Get the target high availability type pre-configured for the target group;

[0125] If the target high availability type is a non-configuration type of active / standby switching, the expected state of the target service is determined based on the service states of the remaining services in the target group except the target service.

[0126] If the target high availability type is the active-standby switching type of the configuration class and the number of services to which the configuration has been applied in the target group does not reach a preset number, the expected state of the target service is set to the active state, otherwise the expected state of the target service is set to the standby state.

[0127] In an optional implementation manner, when the processing module 120 is used to determine the expected state of the target service according to the service states of the remaining services in the target group except the target service, it is specifically used to:

[0128] If there is a service in the active state among the services other than the target service in the target group, the expected state of the target service is set to the standby state;

[0129] If there is no service whose service status is the primary state among the remaining services in the target group except the target service, a candidate service is determined from the target group, and when the candidate service is the target service, the expected state of the target service is set to the primary state, and when the candidate service is not the target service, the expected state of the target service is set to the standby state.

[0130] In an optional implementation, the information of the target service recorded in the service registration warehouse includes an expiration time, a service state, and an expected state. The expiration time is the time when the validity of the service state of the target service recorded in the service registration warehouse becomes invalid. The expected state is the service state determined by the target session pre-established by the gateway when the target service is registered. The target session is pre-configured with an IP address and a port for service interaction. The processing module 120 is specifically used in the step of updating the information of the target service recorded in the service registration warehouse according to the current service state:

[0131] If the service status of the target session is consistent with the current service status, the expiration time is updated; otherwise, the information of the target service in the service registration repository is updated according to the current service status and the expected status.

[0132] In an optional implementation manner, when the processing module 120 is used to update the information of the target service in the service registration repository according to the current service state and the expected state, it is specifically used to:

[0133] If the current service status is consistent with the expected status, the service status of the target service in the service registration repository is updated to the expected status, otherwise the information of the target service is deleted from the service registration repository.

[0134] The above service management device is a specific manifestation of the knowledge service management method. As another specific manifestation, this embodiment also provides an example diagram of the architecture of a registration center, please refer to Figure 7 , Figure 7 This is an example diagram of the architecture of the registration center provided in this embodiment. Figure 7 In the Registry, based on the UDP protocol, the Registry uses non-blocking IO, IO multiplexing technology, observer design pattern, and thread pool to establish an overall packet processing framework to improve transmission efficiency and reduce latency. It can handle a large number of concurrent requests and can be deployed and run as a separate program. The entire Registry consists of a packet receiving thread (Packet Rx Thread), a packet decoding thread pool (Packet Decoder Thread Pool), a worker thread pool (Worker Thread Pool), a processor (Processor), a core library (Core Library), a task scheduler (Scheduler), a service registration repository (Service Register Repository), a management control interface (M&C API), and a cache (Cache).

[0135] After the Packet Rx Thread receives the service status data packet reported by the service client, it is handed over to the PacketDecoder Thread Pool for decoding. After decoding, it is handed over to the Worker Thread Pool for logical processing by the Processor. The processing unit mainly includes: service status reporting processing (Service Status ReportingHandler), active status selection (Active Status Service Selector), service registration repository update (Service Register Repository Updater), service status indication issuance (Service StatusIndicator), service status update event distribution (Service Status Update Event (Listen Services) Distributor), notifying all services that listen to the service group ID). The specific processing flow has been described above and will not be repeated here.

[0136] The management and control interface (M&C API) mainly handles the subscription / unsubscription / query requests (Subscribe / Unsubscribe / Query Listen Services) of the service client's service status monitoring, as well as the query service register repository request. The specific process has been described above and will not be repeated here.

[0137] The task scheduler (Scheduler) periodically runs expired services at a preset time period to clean up the Scheduler, detect service failures, select the primary, and perform high-availability switching. The specific process has been described above and will not be repeated here.

[0138] The Service Register Repository is used to store all registered service information, including GroupId, ServiceFunctionTypeId, HighAvailabilityType, LeaderElectionAlgorithm, ServiceId, Status, IP, Udp Port, Tcp Port, Listen Services, etc. The Cache is used to store service listener information (Service Listener Cache) and other information.

[0139] It should be noted that in order to enhance the overall robustness and scalability, the Core Library can provide some basic public component libraries and define some extensible rules, including: Event Subscription Rules, Plugin Rules, Plugin Hot PlugLoad Management, etc. Developers can write plug-ins based on these rules and store them in the specified directory. In this way, functional expansion can be performed without intrusion. For example, you can customize the graphical management plug-in to achieve real-time display and monitoring of service status.

[0140] In addition, this embodiment also provides an example diagram of the architecture of the service client, please refer to Figure 8 , Figure 8 This is an example diagram of the architecture of the service client provided in this embodiment. Figure 8In the , the service client is based on the UDP protocol and adopts the observer design pattern as the overall packet processing framework to improve transmission efficiency. The service client is provided in the form of a public library, which can be provided to various services for reference and call. The entire service client consists of a packet receiving thread (Packet Rx Thread), a packet decoder (Packet Decoder), a listening processor (Processor / Listener), a task scheduler (Scheduler), a subscribed local services registry (Subscribed Local Services Repository), a cache (Cache), etc.

[0141] The task scheduler includes the Report Service Status task, Heartbeat Detect task, Subscribe Listener & Pull Services task, and all three tasks run periodically at a specified cycle. The process of reporting service status, heartbeat detection, subscription listening, and service pulling has been described above and will not be repeated here.

[0142] After the Packet Rx Thread receives the data packet sent by the registration center, it is decoded by the Packet Decoder and then handed over to the processor (Processor / Listener) for logical processing. The processing unit mainly includes: update of local service status (Local Service Status Update Listener), update and application of local service configuration (Local Service Config Update Listener), update of monitored service status (SubscribedServices Update Listener). The specific process has been described above and will not be repeated here.

[0143] The Subscribed Local Services Repository is used to store all monitored service information, including GroupId, ServiceFunctionTypeId, HighAvailabilityType, LeaderElectionAlgorithm, ServiceId, Status, IP, Udp Port, Tcp Port, Listen Services, etc. The Cache is used to store information such as the Local Service Instance Cache, including local service status and service configuration.

[0144] After implementing the registration center and service client, the registration center program can be installed and deployed on the gateway station (or on the server), and each service (such as access session management service, resource management service, device management service, gateway service, network management service, mobile control management service, etc.) references and integrates the service client, configures the high availability type of each service, the registration center address, the monitored service group ID, the service function type ID, the master election algorithm and other parameters, installs and starts running these services to complete the registration, master election, switching, and service discovery management of these services.

[0145] It should be noted that Figure 7 and Figure 8 They are just a specific implementation form of the registration center and the service client, and those skilled in the art can add, delete or modify them according to actual needs based on the above content without creative work. For example, Figure 7 and Figure 8 UDP is used as the data packet transmission protocol to improve transmission efficiency and reduce processing delay. Of course, TCP or other protocols can also be used to achieve the same function. Figure 7 and Figure 8 In order to save resources, the service registration, client data packet decoder and processor adopt the single-thread mode. If performance, processing efficiency, processing latency and other considerations are taken into account, thread pool or multi-threading can be used to improve performance and achieve the same function. For example, Figure 7 and Figure 8 Based on performance considerations, the service registration center uses a thread pool to decode and process data packets. The same function can be achieved using a single-threaded approach.

[0146] An embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the service governance method as described in any one of the aforementioned implementation modes is implemented.

[0147] In summary, an embodiment of the present invention provides a service governance method, device, gateway station and computer-readable storage medium, which are applied to the gateway station, and the gateway station runs multiple types of services, and services of the same type are divided into the same service group. The method includes: when a failure is detected in any service of the multiple types of services, obtaining the fault service group to which the fault service belongs and the high availability type pre-configured for the fault service group; if the high availability type is a master-slave switching type and the service state of the fault service is the master state, selecting a takeover service from the fault service group to take over the fault service; setting the service state of the takeover service to the master state, and updating the service state of the fault service to the fault state. Compared with the prior art, this embodiment has at least the following advantages: (1) Services of the same type are grouped into the same service group, and high availability types are configured according to the service group. When a service fails, one or more services can be flexibly selected from the service group as the primary replacement according to the high availability type pre-configured in the faulty service group to which the faulty service group belongs, so as to take over the faulty service and promptly notify other services to change their status, thereby improving the system's RTO (Recovery Time Objective) and ensuring the availability and sustainability of the business. (2) Services of various functional types and various high availability types are managed in a unified manner, and each service no longer needs to issue and implement its own high availability primary selection and switching scheme, thereby reducing development costs, improving management efficiency, and reducing operation and maintenance costs. (3) By using the subscription mechanism, the service caller only needs to subscribe to the service status change event that it is concerned about to know the current status of the service that it is concerned about in real time. The service status change event contains basic information such as the IP and port of the service, which can greatly reduce the complex configuration information such as the IP and port between the original services, reduce the configuration process, reduce the coupling between services, and at the same time reduce the network IO of the registration center and the service client, saving CPU resources.

[0148] 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 governance method, characterized in that: Applied to a gateway station, the gateway station runs multiple types of services, and services of the same type are divided into the same service group. The method includes: When it is detected that any service among the multiple types of services fails, obtaining the faulty service group to which the faulty service belongs and the high availability type pre-configured for the faulty service group; If the high availability type is an active-standby switching type and the service state of the faulty service is an active state, selecting a takeover service for taking over the faulty service from the faulty service group; The service state of the takeover service is set to the active state, and the service state of the faulty service is updated to the faulty state.

2. The service management method according to claim 1, characterized in that: The method further comprises: Receive a target group to which the target service belongs, an IP address, a port, and a current service status of the target service reported by any target service among the multiple types of services; Determine whether the target service is a newly registered service according to the IP address and port of the target service; If yes, determining the expected state of the target service according to the target group and recording the expected state of the target service in a service registration repository while setting the service state of the target service in the service registration repository to being configured; If not, the information of the target service recorded in the service registration repository is updated according to the current service status.

3. The service management method according to claim 2, characterized in that: The gateway station pre-establishes at least one service session, and each of the service sessions is pre-configured with an IP address and a port for service interaction through each service session. The step of determining whether the target service is a newly registered service according to the IP address and the port of the target service includes: If there is a session in the at least one service session whose IP address is the same as the IP address of the target service and whose port is the same as the port of the target service, it is determined that the target service is not a newly registered service; otherwise, it is determined that the target service is a newly registered service.

4. The service management method according to claim 2, characterized in that: The step of determining the expected state of the target service according to the target grouping comprises: Obtain the target high availability type pre-configured for the target group; If the target high availability type is a non-configuration type of active / standby switching, determining the expected state of the target service according to the service states of the remaining services in the target group except the target service; If the target high availability type is the master-slave switching type of the configuration class and the number of services to which the configuration has been applied in the target group does not reach a preset number, the expected state of the target service is set to the master state; otherwise, the expected state of the target service is set to the standby state.

5. The service management method according to claim 4, characterized in that: The step of determining the expected state of the target service according to the service states of the remaining services in the target group except the target service comprises: If there is a service in the active state among the services other than the target service in the target group, setting the expected state of the target service to the standby state; If there is no service whose service status is the active state among the remaining services in the target group except the target service, a candidate service is determined from the target group, and when the candidate service is the target service, the expected state of the target service is set to the active state, and when the candidate service is not the target service, the expected state of the target service is set to the standby state.

6. The service governance method according to claim 2, characterized in that: The information of the target service recorded in the service registration warehouse includes an expiration time, a service state, and an expected state, wherein the expiration time is the time when the validity of the service state of the target service recorded in the service registration warehouse becomes invalid, and the expected state is the service state determined by the target session pre-established by the gateway when the target service is registered, and the target session is pre-configured with an IP address and a port for service interaction, the IP address of the target session is the same as the IP address of the target service, and the port of the target session is the same as the port of the target service, and the step of updating the information of the target service recorded in the service registration warehouse according to the current service state includes: If the service state of the target session is consistent with the current service state, the expiration time is updated; otherwise, the information of the target service in the service registration repository is updated according to the current service state and the expected state.

7. The service management method according to claim 6, characterized in that: The step of updating the information of the target service in the service registration repository according to the current service status and the expected status includes: If the current service state is consistent with the expected state, the service state of the target service in the service registration warehouse is updated to the expected state; otherwise, the information of the target service is deleted from the service registration warehouse.

8. A service management device, characterized in that: Applied to a gateway station, the gateway station runs multiple types of services, and services of the same type are divided into the same service group. The device includes: A detection module, configured to, when a failure is detected in any service of the plurality of types of services, obtain a failure service group to which the failure service belongs and a high availability type pre-configured for the failure service group; A processing module, configured to select a takeover service from the faulty service group to take over the faulty service if the high availability type is an active-standby switching type and the service state of the faulty service is an active state; The processing module is further used to set the service state of the takeover service to the active state, and update the service state of the faulty service to the faulty state.

9. A gateway station, characterized in that: It includes a processor and a memory, the memory is used to store programs, and the processor is used to implement the service governance method as described in any one of claims 1-7 when executing the program.

10. 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 governance method as described in any one of claims 1-7 is implemented.