Micro-service cross-region registration and calling system and method
Through the service bus, the microservice registration area is judged and the registration is completed in the power system, which solves the problem of cross-region call of microservices, realizes real-time and reliability of cross-region data processing, and reduces the difficulty of development.
Patent Information
- Application Number
- CN202310795764.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-30
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2043-06-30
AI Technical Summary
In the power system, microservices cannot register and call across regions, which makes it difficult to develop cross-region functional applications, and the main station system faces the technical problem of services that cannot be called across regions during the transformation of microservice architecture.
Through the service bus, determine the security area to be registered by the microservice and complete the registration; the service bus of the registered security area calls the microservices in the area based on the service name and call information, and transmits across regions in the CIME file format to ensure data security.
Cross-region registration and call between services is realized, the difficulty of application development is reduced, the real-time nature of cross-region data processing is improved, and the reliable and stable operation of the main station system in the process of technological transformation is ensured.
Smart Images

Figure CN119232722A_ABST
Abstract
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] In order to ensure the security of power operation data, the system adopts the security protection strategy of "horizontal isolation and vertical encryption". "Horizontal isolation" means that the 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, which is called forward data transmission. Data transmission from safety zone IV to safety zone I requires a reverse isolation device, which is called reverse data transmission. Forward and reverse data transmission based on forward and reverse isolation devices can only transmit files of specific formats (CIME files).
[0003] With the rapid development of intelligent power system equipment, the scale of data to be processed by the power master station system is getting larger and larger. In order to achieve horizontal expansion of the system, the power master station system generally adopts microservice architecture, and improves the data processing capability of the system through multi-instance deployment of microservices. The core idea of the microservice architecture is to register multiple microservice instances to the service bus, decouple the calls between services through the service bus, and call each other between services through the service name. The specific service instance corresponding to the service name is obtained 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 best service instance can be 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, resulting in great difficulty in developing cross-region functional applications.
[0005] To solve the above technical problems, the present invention provides a method for cross-zone registration and calling of microservices, comprising the following steps:
[0006] 1) In the current security zone, determine whether the microservice of the security zone needs to be registered in the current zone. If so, register the microservice to 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 executed again 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. 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 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 the microservice information into the file format required for cross-zone transmission and executes step 4);
[0009] 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 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 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.
[0010] Its beneficial effects are as follows: In order to solve the problem that services cannot be registered and called across regions, the present invention determines the security zone where the microservice is to be registered and completes the registration through the service bus; the service bus of the registered security zone calls the microservice in that zone according to the service name and call information, and inputs the return result to the caller. The entire process is completely transparent to the caller of the service, which reduces the difficulty of developing cross-region service calls for applications. The present invention solves the technical problem that the main station system cannot call services across regions during the transformation of the microservice architecture, reduces the difficulty of cross-region business development of the main station system, improves the real-time performance of cross-region data processing, and ensures the reliable and stable operation of the main station system during the technical transformation process.
[0011] Furthermore, 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] Its beneficial effects are: it is helpful to judge whether microservices are registered across zones in the target security zone, and is the basis for cross-zone calls of microservices. It indirectly reduces the difficulty of cross-zone business development of the main station system, improves the real-time performance of cross-zone data processing, and ensures the reliable and stable operation of the main station system during the technological transformation process.
[0013] Furthermore, 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] Its beneficial effects are: it is helpful to judge whether microservices are registered across zones in the target security zone, and is the basis for cross-zone calls of microservices. It indirectly reduces the difficulty of cross-zone business development of the main station system, improves the real-time performance of cross-zone data processing, and ensures the reliable and stable operation of the main station system during the technological transformation process.
[0015] Furthermore, the CIME file format is adopted as the file format required for cross-zone transmission.
[0016] The beneficial effects are: using the CIME file format to transmit information across zones is conducive to secure data transmission between zones, ensuring the security of data in each security zone and ensuring the reliable and stable operation of the master station system during the technological transformation process.
[0017] To solve the above technical problems, the present invention also provides a system for cross-zone registration and calling of microservices, including at least two security zones connected in sequence, and each security zone is connected through an isolation device, and each security zone is used to implement the call of microservices by adopting the following method:
[0018] 1) In the current security zone, determine whether the microservice of the security zone needs to be registered in the current zone. If so, register the microservice to 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);
[0019] 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 executed again 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;
[0020] 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 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 the microservice information into the file format required for cross-zone transmission and executes step 4);
[0021] 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 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 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.
[0022] The beneficial effects are as follows: the various security zones of the system are connected in sequence, and the service bus of the security zone registered on the basis of this system calls the microservice of the zone according to the service name and call information, and inputs the return result to the caller. The whole process is completely transparent to the caller of the service, which reduces the development difficulty of cross-zone service calls of applications. The present invention solves the technical problem that the service cannot be called across zones in the process of microservice architecture transformation of the main station system, reduces the difficulty of cross-zone business development of the main station system, improves the real-time performance of cross-zone data processing, and ensures the reliable and stable operation of the main station system in the process of technological transformation.
[0023] Furthermore, 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.
[0024] Its beneficial effects are: it is helpful to judge whether microservices are registered across zones in the target security zone, and is the basis for cross-zone calls of microservices. It indirectly reduces the difficulty of cross-zone business development of the main station system, improves the real-time performance of cross-zone data processing, and ensures the reliable and stable operation of the main station system during the technological transformation process.
[0025] Furthermore, 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] Its beneficial effects are: it is helpful to judge whether microservices are registered across zones in the target security zone, and is the basis for cross-zone calls of microservices. It indirectly reduces the difficulty of cross-zone business development of the main station system, improves the real-time performance of cross-zone data processing, and ensures the reliable and stable operation of the main station system during the technological transformation process.
[0027] Furthermore, the CIME file format is adopted as the file format required for cross-zone transmission.
[0028] The beneficial effects are: using the CIME file format to transmit information across zones is conducive to secure data transmission between zones, ensuring the security of data in each security zone and ensuring the reliable and stable operation of the master station system during the technological transformation process. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 It is a flow chart of the registration of the microservice in the security zone I of the present invention;
[0030] Figure 2 It is the safety zone IV microservice registration flow chart of the present invention;
[0031] Figure 3 It is a flow chart of the service call of security zone I of the present invention;
[0032] Figure 4 It is a flow chart of calling the security zone IV service of the present invention;
[0033] Figure 5 It is a flow chart of the method of the present invention. DETAILED DESCRIPTION
[0034] The basic concept of the present invention is: determine whether the microservice of the current security zone is registered across zones. If not, the microservice is registered to the current security zone; otherwise, the service bus of the current security zone synchronizes the metadata of the microservice to the connected security zone and parses it, and registers the parsed microservice metadata to this security zone; the current security zone obtains the microservice call information from the service bus of the zone through the service name, and the service bus determines whether the called microservice is registered in the current security zone based on the call information. If so, the microservice is directly called in the current security zone; otherwise, the service bus synchronizes the call information of the microservice to the connected security zone and parses it, and after parsing, calls it and returns the return result of the call to the service caller. Based on this concept, a method for registering and calling a microservice across zones and a system for registering and calling a microservice across zones of the present invention can be realized.
[0035] The present invention will be described in detail below with reference to the accompanying drawings and method embodiments.
[0036] System Example:
[0037] A system for cross-zone registration and calling of microservices of the present invention comprises a safety zone IV and a safety zone I; the safety zone IV and the safety zone I are connected via a forward and reverse isolation device.
[0038] In order to realize cross-region registration and calling between microservices, the above system adopts a method of cross-region registration and calling of microservices of the present invention, as shown in the flow chart. Figure 5 As shown, the specific implementation steps include:
[0039] Step 1: Define the format of microservice metadata information.
[0040] The metadata information of the microservice defined in CIME file format is shown in Table 1 below:
[0041] Table 1
[0042] key value Notes 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 * Is the service available? serverArea * Service Registration Security Zone
[0043] The definition of the service interface (method) is shown in Table 2 below:
[0044] Table 2
[0045] key value Notes methodUrl * Interface request path methodType * Interface request method methodParams List<*> Interface input parameter definition methodReturn * Interface return value definition
[0046] Step 2: The service bus registers the microservice.
[0047] 1) The registration process of microservices in security zone I is as follows Figure 1 As shown in the figure, the microservice in Security Zone I registers the service metadata with the service bus in Security Zone I. The service bus in Security Zone I determines whether the service is cross-zone registered. If not, the service is successfully registered with the service bus in Security Zone I and the registration is completed; if the service is cross-zone registered, the service bus in Security Zone I will record the service information and generate the service metadata information as shown in Table 1. Forward isolation synchronizes the CIME file to Security Zone IV. Security Zone IV parses the CIME file containing the microservice metadata and registers the microservice metadata information with the service bus in Security Zone IV. After the service is successfully registered with the service bus in Security Zone IV, the microservice in Security Zone I is registered in Security Zone IV.
[0048] 2) The registration process of microservices in security zone IV is as follows Figure 2 As shown in the figure, the microservice in the security zone IV registers the service metadata with the security zone IV service bus. The security zone IV service bus determines whether the service is cross-zone registered. If it is not cross-zone registered, the service is successfully registered with the security zone IV service bus to complete the registration; if the service is cross-zone registered, the security zone IV service bus will record the service information and generate the service metadata information as shown in Table 1. Reverse isolation synchronizes the CIME file to the security zone I. The security zone I parses the CIME file containing the microservice metadata and registers the microservice metadata information with the security zone I service bus. After the service is successfully registered with the security zone I service bus, the registration of the microservice in the security zone IV in the security zone I is completed.
[0049] Step 3: The service bus calls the microservice.
[0050] 1) Security Zone I service call process is as follows Figure 3As shown, the application in the security zone I makes a service call based on the service name. The application obtains detailed information of the service from the security zone I service bus through the service name: including service call protocol, service port number, whether the service is available, available service instance IP, service interface list, etc. The service bus determines whether the called service is registered in the security zone I. If the service is registered in the security zone I, it directly returns the service details. The application directly initiates a call to the service and obtains the return result to complete the service call; if the called service is registered in the security zone IV, the security zone I service bus generates a CIME file with the service call information, and the forward isolation device synchronizes the service call information CIME file to the security zone IV. The security zone IV service bus parses the call information CIME file and makes a service call in the security zone IV. The security zone IV service bus writes the return result of the service call into the result CIME file, which is synchronized to the security zone I through the reverse isolation device. The security zone I service bus parses the return result of the service and returns the result to the service caller to complete the cross-zone call of the service.
[0051] 2) Security Zone IV service call process is as follows Figure 4 As shown, the application in the security zone IV makes a service call based on the service name. The application obtains detailed information of the service from the security zone IV service bus through the service name: including service call protocol, service port number, whether the service is available, available service instance IP, service interface list, etc. The service bus determines whether the called service is registered in the security zone IV. If the service is registered in the security zone IV, the service detailed information is directly returned. The application directly initiates a call to the service and obtains the return result to complete the service call; if the called service is registered in the security zone I, the security zone IV service bus generates a CIME file with the service call information, and the reverse isolation device synchronizes the service call information CIME file to the security zone I. The security zone I service bus parses the call information CIME file and makes a service call in the security zone I. The security zone I service bus writes the return result of the service call into the result CIME file, and the result CIME file is synchronized to the security zone IV through the forward isolation device. The security zone IV service bus parses the return result of the service and returns the result to the service caller to complete the cross-zone call of the service.
[0052] The present invention realizes the cross-region registration and calling of microservices. The whole process is completely transparent to the caller of the service, which reduces the development difficulty of cross-region service calling of applications, solves the technical problem that the main station system cannot call services across regions during the transformation of the microservice architecture, reduces the difficulty of cross-region business development of the main station system, improves the real-time performance of cross-region data processing, and ensures the reliable and stable operation of the main station system during the technical transformation process.
[0053] Method Example:
[0054] The present invention provides a method for registering and calling a microservice across zones. Based on the above system, the service bus determines the security zone where the microservice is to be registered 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 specific steps have been described in detail in the embodiment of the system for registering and calling a microservice across zones, and will not be repeated here.
Claims
1. A method for cross-zone registration and invocation of microservices, characterized in that: The steps include: 1) In the current security zone, determine whether the microservice of the security zone needs to be registered in the current zone. If so, register the microservice to 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 executed again 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 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 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 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 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-zone registration and invocation of microservices according to claim 1, characterized in that: The metadata of a microservice includes at least one of: service registration security zone, service call protocol, service name, service address, service port number, service interface list, whether the service is available, and service heartbeat frequency.
3. The method for cross-zone registration and invocation of microservices according to claim 2, characterized in that: 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.
4. The method for cross-zone 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-zone registration and invocation 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 method is used to implement the call of microservices between each security zone: 1) In the current security zone, determine whether the microservice of the security zone needs to be registered in the current zone. If so, register the microservice to 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 executed again 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 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 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 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 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: service registration security zone, service call protocol, service name, service address, service port number, service interface list, whether the service is available, 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: an interface request path, an interface request method, an interface input parameter definition, and an interface return value definition.
8. The system for cross-zone 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
Method for secure access between micro-services and micro-service system
CN111478771A
Enterprise-level micro-service platform cross-regional disaster recovery architecture and method
CN114143323A
Method for micro-service transformation of electricity trading function
WO2019080335A1
Microservice-based load balancing method, apparatus and device, and storage medium
WO2021179493A1
