System and method for microservice cross-zone registration and invocation

The cross-region registration and calling of microservices is realized through the service bus, which solves the problem of cross-region service calling in the power system, reduces the development difficulty, and improves the real-time performance of data processing and system stability.

CN119232722BActive Publication Date: 2025-10-14XJ ELECTRIC CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310795764.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-30
Publication Date
2025-10-14
Estimated Expiration
2043-06-30

AI Technical Summary

Technical Problem

In the power system, during the transformation to microservice architecture, services cannot be registered and called across regions, making the development of cross-region functional applications extremely difficult.

Method used

The service bus determines whether the microservice is registered across regions, generates the file format required for cross-region transmission, synchronizes and parses cross-region metadata and information, and completes cross-region registration and calling.

Benefits of technology

It reduces the difficulty of developing cross-region service calls, improves the real-time performance of cross-region data processing and the reliability and stability of the main station system, and ensures reliable operation during the technological transformation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119232722B_ABST
    Figure CN119232722B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of power systems, and particularly relates to a system and method for micro-service cross-zone registration and calling. The steps include: the application determines the security zone to be registered by the micro-service through a service bus and completes the registration; the service bus of the registered security zone calls the micro-service in the zone according to the service name and calling information, and inputs the return result to the calling party. The whole process is completely transparent to the calling party of the service, and reduces the development difficulty of application cross-zone service calling. The application solves the technical problem that the service cannot be called across zones in the process of the main station system transformation to the micro-service architecture, reduces the cross-zone business development difficulty of the main station system, improves the real-time performance of cross-zone data processing, and guarantees the reliable and stable operation of the main station system in the process of technical transformation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of power systems, and in particular relates to a system and method for cross-region registration and calling of microservices. Background Art

[0002] To ensure the security of power operation data, the system adopts a "horizontal isolation, vertical encryption" security protection strategy. "Horizontal isolation" means that data transmission between the production control area (Safety Zone I) and the management information area (Safety Zone IV) must use a power-specific isolation device. Data transmission from Safety Zone I to Safety Zone IV requires a forward isolation device, known as forward data transmission. Data transmission from Safety Zone IV to Safety Zone I requires a reverse isolation device, known as reverse data transmission. Forward and reverse data transmission based on the forward and reverse isolation devices can only transmit files in a specific format (CIME files).

[0003] With the rapid development of intelligent power system equipment, the amount of data processed by power master station systems is increasing. To achieve horizontal system expansion, power master station systems generally adopt a microservices architecture, improving the system's data processing capabilities through the deployment of multiple microservice instances. The core concept of the microservices architecture is to register multiple microservice instances with a service bus. Service calls are decoupled through the service bus, and mutual service calls are made using service names. The specific service instance corresponding to the service name is retrieved through the service bus. The same service name may correspond to different service instances. Load balancing is performed through the service gateway to ensure that the optimal service instance is selected for each service call. Summary of the Invention

[0004] The purpose of the present invention is to provide a system and method for cross-region registration and calling of microservices, so as to solve the problem that services cannot be registered and called across regions, which makes the development of cross-region functional applications extremely difficult.

[0005] To solve the above technical problems, the present invention provides a method for cross-region registration and calling of microservices, comprising the following steps:

[0006] 1) In the current security zone, determine whether the microservice in the security zone needs to be registered in the current zone. If so, register the microservice with the service bus of the security zone; if not, the service bus of the current security zone generates the metadata of the microservice into the file format required for cross-zone transmission and executes step 2);

[0007] 2) The current security zone synchronizes the metadata to the connected security zone and uses this security zone as the current security zone. If the microservice is not registered in the current security zone, step 2) is repeated until the metadata is synchronized to the target security zone to be registered. The service bus of the target security zone parses the microservice metadata to complete the registration.

[0008] 3) The current security zone obtains the microservice information to be called from the security zone service bus through the service name, and the service bus judges whether the called microservice is registered in the security zone according to the microservice information, if yes, the current security zone directly initiates a call to the microservice and sends the obtained return result to the service caller; if not, the current security zone service bus generates a file format required for cross-zone transmission after the information of the microservice, and executes step 4);

[0009] 4) The current security zone synchronizes the information to the connected security zone and takes the security zone as the current security zone, if the microservice is not registered in the current security zone, step 4) is re-executed, until the information is synchronized to the target security zone where the microservice is registered, the service bus of the target security zone analyzes the service information and performs a call, and then synchronizes the return result of the call to the security zone where the caller is located, and the security zone where the caller is located analyzes the return result and returns it to the service caller.

[0010] The beneficial effects are that the application determines the security zone where the microservice is to be registered through the service bus and completes the registration, the service bus of the registered security zone calls the microservice in the zone according to the service name and the call information, and inputs the return result to the caller. The whole process is completely transparent to the service caller, and the development difficulty of cross-zone service call of the application is reduced. The application solves the technical problem that the services cannot be called across zones in the process of transformation of the host system to the microservice architecture, reduces the development difficulty of cross-zone business of the host system, improves the real-time performance of cross-zone data processing, and ensures the reliable and stable operation of the host system in the process of technical transformation.

[0011] Further, the metadata of the microservice includes at least one of a service registration security zone, a service call protocol, a service name, a service address, a service port number, a service interface list, whether the service is available, and a service heartbeat frequency.

[0012] The beneficial effects are that it is beneficial to judge the cross-zone registration of the microservice in the target security zone, is the basis for cross-zone call of the microservice, reduces the development difficulty of cross-zone business of the host system from the side, improves the real-time performance of cross-zone data processing, and ensures the reliable and stable operation of the host system in the process of technical transformation.

[0013] Further, the service interface list includes at least one of an interface request path, an interface request method, an interface input parameter definition, and an interface return value definition.

[0014] The beneficial effects are that it is beneficial to judge the cross-zone registration of the microservice in the target security zone, is the basis for cross-zone call of the microservice, reduces the development difficulty of cross-zone business of the host system from the side, improves the real-time performance of cross-zone data processing, and ensures the reliable and stable operation of the host system in the process of technical transformation.

[0015] Further, the CIME file format is used as the file format required for cross-zone transmission.

[0016] The CIME file format is used for cross-zone transmission of information, which is beneficial to safe transmission of data between zones, ensures the security of data in each security zone, and ensures the reliable and stable operation of the main station system during technical transformation.

[0017] To solve the above technical problems, the application further provides a micro-service cross-zone registration and calling system, comprising at least two security zones connected in sequence, and each security zone is connected through an isolation device, and a method for realizing micro-service calling between the security zones is used.

[0018] 1) determining whether the micro-service of the current security zone is registered in the current zone, if yes, registering the micro-service to the service bus of the security zone, if no, generating a file format required for cross-zone transmission of the metadata of the micro-service by the service bus of the current security zone, and executing step 2);

[0019] 2) synchronizing the metadata to the connected security zone, and taking the security zone as the current security zone, if the micro-service is not registered in the current security zone, re-executing step 2), until the metadata is synchronized to the target security zone where the micro-service is registered, and the service bus of the target security zone parses the metadata of the micro-service to complete the registration;

[0020] 3) obtaining the micro-service information to be called from the service bus of the security zone by the service name, and judging whether the called micro-service is registered in the security zone according to the micro-service information, if yes, directly initiating the calling of the micro-service in the current security zone and sending the obtained return result to the service caller, if no, generating a file format required for cross-zone transmission of the information of the micro-service by the service bus of the current security zone, and executing step 4);

[0021] 4) synchronizing the information to the connected security zone and taking the security zone as the current security zone, if the micro-service is not registered in the current security zone, re-executing step 4), until the information is synchronized to the target security zone where the micro-service is registered, the service bus of the target security zone parses the service information and calls, and then synchronizes the return result of the calling to the security zone where the service caller is located, the security zone where the service caller is located parses the return result and returns it to the service caller.

[0022] The beneficial effects are that: the security zones of the system are connected in turn, the service bus of the registered security zone on the basis of the system calls the zone micro service according to the service name and the calling information, and inputs the return result to the calling party.

[0023] Further, the metadata of the micro service includes at least one of a service registration security zone, a service calling protocol, a service name, a service address, a service port number, a service interface list, whether the service is available, and a service heartbeat frequency.

[0024] The beneficial effects are that: it is beneficial to judge the cross-zone registration of the micro service in the target security zone, is the basis for cross-zone calling of the micro service, reduces the cross-zone business development difficulty of the main station system from the side, improves the real-time performance of cross-zone data processing, and guarantees the reliable and stable operation of the main station system in the technical transformation process.

[0025] Further, the service interface list includes at least one of an interface request path, an interface request method, an interface input parameter definition, and an interface return value definition.

[0026] The beneficial effects are that: it is beneficial to judge the cross-zone registration of the micro service in the target security zone, is the basis for cross-zone calling of the micro service, reduces the cross-zone business development difficulty of the main station system from the side, improves the real-time performance of cross-zone data processing, and guarantees the reliable and stable operation of the main station system in the technical transformation process.

[0027] Further, the CIME file format is adopted as the file format required for cross-zone transmission.

[0028] The beneficial effects are that: the CIME file format is adopted for cross-zone transmission information, which is beneficial to the safe transmission of data between cross-zones, guarantees the security of the data of each security zone, and guarantees the reliable and stable operation of the main station system in the technical transformation process. BRIEF DESCRIPTION OF DRAWINGS

[0029] Figure 1 is a micro service registration flowchart of the safety I area of the application;

[0030] Figure 2 is a micro service registration flowchart of the safety IV area of the application;

[0031] Figure 3 is a service calling flowchart of the safety I area of the application;

[0032] Figure 4 is a safe IV area service call flow chart of the present application;

[0033] Figure 5 is a method flow chart of the present application. DETAILED DESCRIPTION

[0034] The basic idea of the present application is to determine whether the microservice of the current security area is cross-area registered, if not, the microservice is registered to the current security area; otherwise, the metadata of the microservice is synchronized to the connected security area by the service bus of the current security area and parsed, and the parsed microservice metadata is registered to the security area; the current security area obtains the microservice call information from the service bus of the area through the service name, and the service bus determines whether the called microservice is registered in the current security area according to the call information, if yes, the microservice is directly called in the current security area; otherwise, the service bus synchronizes the microservice call information to the connected security area and parses, and then calls and returns the return result of the call to the service caller. Based on the idea, a microservice cross-area registration and calling method and a microservice cross-area registration and calling system can be realized.

[0035] The present application will be described in detail below with reference to the accompanying drawings and method embodiments.

[0036] System embodiment:

[0037] The microservice cross-area registration and calling system of the present application comprises a safe IV area and a safe I area; the safe IV area and the safe I area are connected through a forward and reverse isolation device.

[0038] To realize the cross-area registration and calling between microservices, the above system is realized by using the microservice cross-area registration and calling method of the present application, and the flow chart is as shown in Figure 5 The specific implementation steps include:

[0039] Step one, define the format of the microservice metadata information.

[0040] The metadata information of the microservice defined in the CIME file format is shown in Table 1 as follows:

[0041] Table 1

[0042] Key Value Comment serverProtocol * Service call protocol serverName * Service name serverIP * Service IP serverPort * Service port number serverMethods List <method> < / method> Service interface list serverHeartbeat * Service heartbeat frequency serverAvailable * Service availability serverArea * Service registration security area

[0043] Among them, the definition of the service interface (method) is shown in Table 2 as follows:

[0044] Table 2

[0045] Key Value Comment methodUrl * Interface request path methodType * Interface request method methodParams List<*> Interface input parameter definition methodReturn * Interface return value definition

[0046] Step two, the service bus registers the microservice.

[0047] 1) The security I area microservice registration process is as shown in Figure 1 Figure 1, the security I area microservice registers service metadata to the security I area service bus, the security I area service bus judges whether the service is cross-area registration, if it is not cross-area registration, the service is successfully registered to the security I area service bus to complete the registration; if the service is cross-area registration, the security I area service bus will record the service information and generate a CIME file as shown in Table 1. The CIME file is synchronized to the security IV area by forward isolation, the security IV area parses the CIME file containing the microservice metadata, and registers the microservice metadata information to the security IV area service bus, after the service is successfully registered to the security IV area service bus, the registration of the microservice in the security I area in the security IV area is completed.

[0048] 2) The security IV area microservice registration process is as shown in Figure 2 Figure 2, the security IV area microservice registers service metadata to the security IV area service bus, the security IV area service bus judges whether the service is cross-area registration, if it is not cross-area registration, the service is successfully registered to the security IV area service bus to complete the registration; if the service is cross-area registration, the security IV area service bus will record the service information and generate a CIME file as shown in Table 1. The CIME file is synchronized to the security I area by reverse isolation, the security I area parses the CIME file containing the microservice metadata, and registers the microservice metadata information to the security I area service bus, after the service is successfully registered to the security I area service bus, the registration of the microservice in the security IV area in the security I area is completed.

[0049] Step three, the service bus calls the microservice.

[0050] 1) The security I area service call process is as shown in Figure 3As shown in the figure, the application in the security I area calls a service according to a service name, and the application obtains detailed information of the service from the security I area service bus through the service name: including a service calling protocol, a service port number, whether the service is available, an available service instance IP, an interface list of the service, and the like. The service bus judges whether the called service is registered in the security I area, if the service is registered in the security I area, the service bus directly returns the detailed information of the service, the application directly initiates a call to the service and obtains a return result, and the calling of the service is completed; if the called service is registered in the security IV area, the security I area service bus generates a CIME file of the service calling information, the forward isolation device synchronizes the CIME file of the service calling information to the security IV area, the security IV area service bus parses the CIME file of the calling information, and the service calling is performed in the security IV area. The security IV area service bus writes a return result of the service calling into a result CIME file, the result CIME file is synchronized to the security I area through the backward isolation device, the security I area service bus parses the return result of the service, and the result is returned to the service calling party, and the cross-area calling of the service is completed.

[0051] 2) The service calling flow in the security IV area is as shown in the figure Figure 4 As shown in the figure, the application in the security IV area calls a service according to a service name, and the application obtains detailed information of the service from the security IV area service bus through the service name: including a service calling protocol, a service port number, whether the service is available, an available service instance IP, an interface list of the service, and the like. The service bus judges whether the called service is registered in the security IV area, if the service is registered in the security IV area, the service bus directly returns the detailed information of the service, the application directly initiates a call to the service and obtains a return result, and the calling of the service is completed; if the called service is registered in the security I area, the security IV area service bus generates a CIME file of the service calling information, the forward isolation device synchronizes the CIME file of the service calling information to the security IV area, the security IV area service bus parses the CIME file of the calling information, and the service calling is performed in the security IV area. The security IV area service bus writes a return result of the service calling into a result CIME file, the result CIME file is synchronized to the security I area through the backward isolation device, the security I area service bus parses the return result of the service, and the result is returned to the service calling party, and the cross-area calling of the service is completed.

[0052] The application realizes the cross-area registration and calling of micro services, the whole process is completely transparent to the calling party of the service, the development difficulty of the application cross-area service calling is reduced, the technical difficulty that the main station system cannot call services across areas in the process of micro service architecture transformation is solved, the cross-area business development difficulty of the main station system is reduced, the real-time performance of cross-area data processing is improved, and the reliable and stable operation of the main station system in the process of technical transformation is ensured.

[0053] Method embodiment:

[0054] A micro-service cross-region registration and calling method of the present application determines the security region to which the micro-service is to be registered and completes the registration through the service bus on the basis of the above system; the service bus of the registered security region calls the micro-service in the region according to the service name and the calling information, and inputs the return result to the calling party. The specific steps have been described in detail in the system embodiment of the micro-service cross-region registration and calling, and will not be repeated here.

Claims

1. A method for registering and calling microservices across regions, characterized in that: The steps include: 1) In the current security zone, determine whether the microservice in the security zone needs to be registered in the current zone. If so, register the microservice with the service bus of the security zone; If not, the current security zone service bus generates the metadata of the microservice into the file format required for cross-zone transmission and executes step 2); 2) The current security zone synchronizes the metadata to the connected security zone and uses this security zone as the current security zone. If the microservice is not registered in the current security zone, step 2) is repeated until the metadata is synchronized to the target security zone to be registered. The service bus of the target security zone parses the microservice metadata to complete the registration. 3) The current security zone obtains the microservice information to be called from the security zone service bus through the service name. The service bus determines whether the called microservice is registered in the security zone based on the microservice information. If so, the current security zone directly calls the microservice and sends the return result to the service caller. If not, the current security zone service bus generates the microservice information into the file format required for cross-zone transmission and executes step 4). 4) The current security zone synchronizes the information to the connected security zone and uses this security zone as the current security zone. If the microservice is not registered in the current security zone, step 4) is executed again until the information is synchronized to the target security zone where the microservice is registered. The service bus of the target security zone parses the service information and calls it, and then synchronizes the return result of the call to the security zone where the caller is located. The security zone where the caller is located parses the return result and returns it to the service caller.

2. The method for cross-region registration and invocation of microservices according to claim 1, characterized in that: The metadata of a microservice includes at least one of the following: service registration security zone, service call protocol, service name, service address, service port number, service interface list, service availability, and service heartbeat frequency.

3. The method for cross-region registration and invocation of microservices according to claim 2, characterized in that: The service interface list includes at least one of: interface request path, interface request method, interface input parameter definition, and interface return value definition.

4. The method for cross-region registration and invocation of microservices according to any one of claims 1 to 3, characterized in that: The CIME file format is used as the file format required for cross-region transmission.

5. A system for cross-region registration and calling of microservices, characterized in that: It includes at least two security zones connected in sequence, and each security zone is connected through an isolation device. The following methods are used to implement microservice calls between each security zone: 1) In the current security zone, determine whether the microservice in the security zone needs to be registered in the current zone. If so, register the microservice with the service bus of the security zone; If not, the current security zone service bus generates the metadata of the microservice into the file format required for cross-zone transmission and executes step 2); 2) The current security zone synchronizes the metadata to the connected security zone and uses this security zone as the current security zone. If the microservice is not registered in the current security zone, step 2) is repeated until the metadata is synchronized to the target security zone to be registered. The service bus of the target security zone parses the microservice metadata to complete the registration. 3) The current security zone obtains the microservice information to be called from the security zone service bus through the service name. The service bus determines whether the called microservice is registered in the security zone based on the microservice information. If so, the current security zone directly calls the microservice and sends the return result to the service caller. If not, the current security zone service bus generates the microservice information into the file format required for cross-zone transmission and executes step 4). 4) The current security zone synchronizes the information to the connected security zone and uses this security zone as the current security zone. If the microservice is not registered in the current security zone, step 4) is executed again until the information is synchronized to the target security zone where the microservice is registered. The service bus of the target security zone parses the service information and calls it, and then synchronizes the return result of the call to the security zone where the caller is located. The security zone where the caller is located parses the return result and returns it to the service caller.

6. The system for cross-region registration and invocation of microservices according to claim 5, characterized in that: The metadata of a microservice includes at least one of the following: service registration security zone, service call protocol, service name, service address, service port number, service interface list, service availability, and service heartbeat frequency.

7. The system for cross-region registration and invocation of microservices according to claim 6, characterized in that: The service interface list includes at least one of: interface request path, interface request method, interface input parameter definition, and interface return value definition.

8. The system for cross-region registration and invocation of microservices according to any one of claims 5 to 7, characterized in that: The CIME file format is used as the file format required for cross-region transmission.

Citation Information

Patent Citations

  • Cross-security-area micro-service full-link operation monitoring method

    CN110535722A

  • Enterprise-level micro-service platform cross-regional disaster recovery architecture and method

    CN114143323A