CN-121985025-A - Service management system and service calling method, device, equipment and medium
Abstract
The invention provides a service management system, a service calling method, a device, equipment and a medium, wherein the system comprises a service provider, a service calling device and a service calling device, wherein the service provider is used for deploying services and adding unit labels to the services; the system comprises a service provider, a service caller, a unit tag, a registry, a service caller and a service caller, wherein the unit tag is used for representing a service unit to which the service belongs, the registry is used for registering the service which is deployed by the service provider and added with the unit tag, the service caller is used for acquiring a target unit tag corresponding to the designated service unit, determining a target service from the registry according to the target unit tag and calling the target service. By the method and the system, the flow in the service unit can be closed without splitting the registry, the transformation cost of the remote service frame is reduced, the transformation efficiency is improved, and the overall performance of the system is improved.
Inventors
- WANG BIWEN
Assignees
- 北京奇艺世纪科技有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20260104
Claims (10)
- 1. A service management system, the system comprising: The service provider is used for deploying the service and adding a unit tag to the service, wherein the unit tag is used for representing a service unit to which the service belongs; A registry for registering services deployed by the service provider to which the unit tag has been added; and the service calling party is used for acquiring a target unit label corresponding to the designated service unit, determining a target service from the registry according to the target unit label and calling the target service.
- 2. The system of claim 1, wherein the service invoker determining a target service from the registry based on the target unit tag and invoking the target service comprises: The service calling party obtains a service list from the registry, wherein the service list comprises metadata of a plurality of services, each metadata comprises a unit tag corresponding to each service, metadata matched with the target unit tag is determined based on the service list so as to determine a target service, and the target service is called according to the metadata of the target service.
- 3. The system of claim 2, wherein the service caller determining metadata matching the target unit tag based on the service list comprises: The service calling party obtains a state identifier, and if the state identifier is a first state, determines first target metadata matched with the target unit tag based on the service list to determine target service corresponding to the first target metadata, wherein the first state is used for indicating to open a unit flow closing function.
- 4. The system of claim 3, wherein the service caller is further configured to, if the status is identified as a second status, randomly select metadata from the service list to obtain second target metadata to determine a target service corresponding to the second target metadata, where the second status is used to indicate that a unit traffic blocking function is closed.
- 5. The system of any of claims 1-4, wherein the service provider tags the service with a unit tag, comprising: The service provider injects the unit tag into a first environment variable of the service provider, obtains the unit tag from the first environment variable in the case that the service needs to be deployed, and writes the unit tag into metadata of the service to add the service to the unit tag.
- 6. The system according to any one of claims 1-4, wherein the service caller obtaining a target unit tag corresponding to a specified service unit includes: And the service calling party injects the target unit label corresponding to the appointed service unit into a second environment variable of the service calling party, and acquires the target unit label from the second environment variable under the condition that the service needs to be called.
- 7. A service calling method is characterized by being based on a service management system, wherein the service management system comprises a service provider and a registry, the service provider is used for deploying a service and adding a unit tag to the service, the unit tag is used for representing a service unit to which the service belongs, the registry is used for registering the service which is deployed by the service provider and added with the unit tag, and the method comprises the following steps: and acquiring a target unit label corresponding to the designated service unit, determining a target service from the registry according to the target unit label, and calling the target service.
- 8. A service calling device is characterized by being based on a service management system, wherein the service management system comprises a service provider and a registry, the service provider is used for deploying a service and adding a unit tag to the service, the unit tag is used for representing a service unit to which the service belongs, the registry is used for registering the service which is deployed by the service provider and added with the unit tag, and the device comprises: And the service calling module is used for acquiring a target unit label corresponding to the specified service unit, determining a target service from the registry according to the target unit label, and calling the target service.
- 9. An electronic device comprising a processor, a memory, and a computer program stored on the memory and capable of running on the processor, the computer program implementing the service invocation method of claim 7 when executed by the processor.
- 10. A computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, which computer program, when executed by a processor, implements the service invocation method of claim 7.
Description
Service management system and service calling method, device, equipment and medium Technical Field The present invention relates to the field of remote service technologies, and in particular, to a service management system, a service calling method, a device, and a medium. Background With the rapid development of distributed technology, remote services have also become more lightweight, dynamic and intelligent. The RPC (Remote Procedure Call ) is a distributed communication architecture that registers remote services through a registry for service invokers to discover and invoke. Along with the increase of service scale, the original architecture needs to be modified, the whole service is split into a plurality of service units, the traffic of different service units is isolated, the remote service is prevented from being called by the cross service units, and the system performance is improved. In the related art, by splitting the registry, each split registry corresponds to one service unit, so that traffic isolation of different service units is realized. However, such a modification requires reconstruction of the system architecture and migration of the data, which is not only costly but also inefficient. Disclosure of Invention In view of the foregoing, there is provided a service management system and a service invocation method, apparatus, device, medium, which overcome or at least partially solve the foregoing, including: A service management system, the system comprising: The service provider is used for deploying the service and adding a unit tag to the service, wherein the unit tag is used for representing a service unit to which the service belongs; A registry for registering services deployed by the service provider to which the unit tag has been added; and the service calling party is used for acquiring a target unit label corresponding to the designated service unit, determining a target service from the registry according to the target unit label and calling the target service. Optionally, the service calling party determines a target service from the registry according to the target unit tag, and calls the target service, including: The service calling party obtains a service list from the registry, wherein the service list comprises metadata of a plurality of services, each metadata comprises a unit tag corresponding to each service, metadata matched with the target unit tag is determined based on the service list so as to determine a target service, and the target service is called according to the metadata of the target service. Optionally, the service caller determines metadata matching the target unit tag based on the service list, including: The service calling party obtains a state identifier, and if the state identifier is a first state, determines first target metadata matched with the target unit tag based on the service list to determine target service corresponding to the first target metadata, wherein the first state is used for indicating to open a unit flow closing function. Optionally, the service calling party is further configured to, if the state identifier is a second state, randomly select metadata from the service list, and obtain second target metadata, so as to determine a target service corresponding to the second target metadata, where the second state is used to instruct to close a unit flow sealing function. Optionally, the service provider tags the service with a unit, including: The service provider injects the unit tag into a first environment variable of the service provider, obtains the unit tag from the first environment variable in the case that the service needs to be deployed, and writes the unit tag into metadata of the service to add the service to the unit tag. Optionally, the service caller obtains a target unit tag corresponding to the specified service unit, including: And the service calling party injects the target unit label corresponding to the appointed service unit into a second environment variable of the service calling party, and acquires the target unit label from the second environment variable under the condition that the service needs to be called. A service calling method is based on a service management system, the service management system comprises a service provider and a registry, the service provider is used for deploying a service and adding a unit tag to the service, the unit tag is used for representing a service unit to which the service belongs, the registry is used for registering the service which is deployed by the service provider and added with the unit tag, and the method comprises the following steps: and acquiring a target unit label corresponding to the designated service unit, determining a target service from the registry according to the target unit label, and calling the target service. A service calling device is based on a service management system, the service management system comprises a service provider