CN117278621A - Method, device, equipment and storage medium for registering micro-service of multi-cloud platform - Google Patents

Method, device, equipment and storage medium for registering micro-service of multi-cloud platform Download PDF

Info

Publication number
CN117278621A
CN117278621A CN202311257925.XA CN202311257925A CN117278621A CN 117278621 A CN117278621 A CN 117278621A CN 202311257925 A CN202311257925 A CN 202311257925A CN 117278621 A CN117278621 A CN 117278621A
Authority
CN
China
Prior art keywords
cloud platform
metadata
micro
micro service
registration
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311257925.XA
Other languages
Chinese (zh)
Inventor
王硕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bank of China Ltd
Original Assignee
Bank of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202311257925.XA priority Critical patent/CN117278621A/en
Publication of CN117278621A publication Critical patent/CN117278621A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/561Adding application-functional data or data for application control, e.g. adding metadata
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/54Presence management, e.g. monitoring or registration for receipt of user log-on information, or the connection status of the users
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/566Grouping or aggregating service requests, e.g. for unified processing

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Library & Information Science (AREA)
  • Stored Programmes (AREA)

Abstract

The application provides a method, a device, equipment and a storage medium for registering micro services of a multi-cloud platform, which can be used in the technical field of computers. The method comprises the following steps: receiving a registration request of a micro service sent by a micro service provider; generating a configuration information file of the micro-service according to the registration request, wherein the configuration information file is used for inputting metadata of the micro-service, and the metadata of the micro-service is in a yaml format; acquiring type information of each cloud platform from each cloud platform registration center of the multi-cloud platform, and extracting input metadata from the configuration information file; and carrying out format conversion processing on the metadata according to the type information of the cloud platforms to obtain target format metadata of each cloud platform, and sending the target format metadata to a corresponding cloud platform registry. According to the method, the micro-service registration efficiency of the multi-cloud platform is improved.

Description

Method, device, equipment and storage medium for registering micro-service of multi-cloud platform
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for registering a micro service of a multi-cloud platform.
Background
The cloud environment is a software infrastructure, and provides a new call relationship (the software A can call the software B without knowing the address of the software B and only knowing the name of the software B) different from the traditional call relationship (the software A knows the address of the software B and directly calls the software B) for the software accessing the infrastructure. Wherein the registry is the core of a cloud environment. If only one type of registry is used in the cloud environment, the cloud environment is referred to as a single cloud environment, and if multiple types of registries are used in one cloud environment, the cloud environment is referred to as a multi-cloud environment, and according to different registries, a Eureka, SOFA, TSF, zookeeper cloud environment is commonly used in the market. In a cloud environment, all micro services need to register their own service names, service address lists, and metadata in a registry. When a certain micro-service needs to call other micro-services, the registry needs to search the address list and metadata corresponding to the micro-service name, select an address from the address list, and initiate the call to the address.
In the prior art, when a micro service is registered on a multi-cloud platform, each registry obtains metadata of the micro service in a corresponding manner, for example: when registering with the SOFA, the metadata is obtained by reading configuration information in a configuration file, wherein each configuration information is a key/value key value pair, when registering with the TSF, the program is used for inputting 'Tags' configuration information, the configuration information is a character string, the character string is required to be in the form of 'a=b', and a represents metadata keywords and b represents metadata contents.
However, the registry not only wastes operation resources, but also causes a problem of low efficiency of micro service registration of the multi-cloud platform.
Disclosure of Invention
The application provides a method, a device, equipment and a storage medium for registering micro services of a multi-cloud platform, which are used for solving the problem of low efficiency of registering the micro services of the multi-cloud platform.
In a first aspect, the present application provides a method for registering a microservice of a multi-cloud platform, including:
receiving a registration request of a micro service sent by a micro service provider;
generating a configuration information file of the micro service according to the registration request, wherein the configuration information file is used for inputting metadata of the micro service, and the metadata of the micro service is in a yaml format;
acquiring type information of each cloud platform from each cloud platform registration center of the multi-cloud platform, and extracting input metadata from the configuration information file;
and carrying out format conversion processing on the metadata according to the type information of the cloud platform to obtain target format metadata of each cloud platform, and sending the target format metadata to a corresponding cloud platform registry.
In a second aspect, the present application provides a method for registering a microservice of a multi-cloud platform, including:
receiving target format metadata of a micro service sent by a micro service registration device of a multi-cloud platform, wherein the target format metadata refer to metadata in a format corresponding to the cloud platform;
receiving registration information of the micro service sent by a micro service provider, wherein the registration information comprises a micro service name and a corresponding IP address;
injecting the target format metadata into the registration information of the micro service;
and registering the micro service according to the registration information injected with the metadata of the target format.
In a third aspect, the present application provides a micro service registration device of a multi-cloud platform, including:
the receiving module is used for receiving a registration request of the micro service sent by the micro service provider;
the generation module is used for generating a configuration information file of the micro service according to the registration request, wherein the configuration information file is used for inputting metadata of the micro service, and the metadata of the micro service is in a yaml format;
the acquisition module is used for acquiring the type information of each cloud platform from each cloud platform registration center of the multi-cloud platform and extracting the input metadata from the configuration information file;
and the sending module is used for carrying out format conversion processing on the metadata according to the type information of the cloud platforms to obtain target format metadata of each cloud platform and sending the target format metadata to a corresponding cloud platform registry.
In a fourth aspect, the present application provides a micro service registration device of a multi-cloud platform, including:
the receiving module is used for receiving target format metadata of the micro service sent by the micro service registration device of the multi-cloud platform, wherein the target format metadata refer to the metadata in a format corresponding to the cloud platform;
the receiving module is further configured to receive registration information of the micro service sent by a micro service provider, where the registration information includes a micro service name and a corresponding IP address;
the injection module is used for injecting the target format metadata into the registration information of the micro service;
and the registration module is used for registering the micro service according to the registration information injected with the target format metadata.
In a fifth aspect, the present application provides a micro-service registration apparatus of a multi-cloud platform, including:
a processor, a memory, a communication interface;
the memory is used for storing executable instructions of the processor;
wherein the processor is configured to perform the micro-service registration method of the multi-cloud platform as described in the first aspect above via execution of the executable instructions.
In a sixth aspect, the present application provides a readable storage medium comprising: a computer program stored thereon, which when executed by a processor, implements a method of performing micro-service registration of a multi-cloud platform as described in the first aspect above.
According to the micro service registration method, device and equipment for the multi-cloud platform and the storage medium, the registration request of the micro service sent by the micro service provider is received, the configuration information file of the micro service is generated according to the registration request, the configuration information file is used for inputting metadata of the micro service, the metadata of the micro service is in a yaml format, type information of each cloud platform is obtained from each cloud platform registration center of the multi-cloud platform, the input metadata is extracted from the configuration information file, format conversion processing is carried out on the metadata according to the type information of the cloud platform, the target format metadata of each cloud platform is obtained, and the target format metadata of each cloud platform is sent to the corresponding cloud platform registration center, wherein the mode of generating the configuration information file of each cloud platform is adopted, the input mode of the metadata is unified, the metadata of the micro service is injected into each cloud platform at the same time, the operation resource is saved, and the efficiency of the micro service registration of the multi-cloud platform is further improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
Fig. 1 is a schematic diagram of an application scenario provided in the present application;
fig. 2 is a flow chart of a micro service registration method of a multi-cloud platform according to an embodiment of the present application;
fig. 3 is a flow chart of a micro service calling method of a multi-cloud platform according to an embodiment of the present application;
fig. 4 is a flow chart of a micro service registration method of a multi-cloud platform according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a micro service registration device of a multi-cloud platform according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a micro service registration device of a multi-cloud platform according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a micro service registration device with a multi-cloud platform according to an embodiment of the present application.
Specific embodiments thereof have been shown by way of example in the drawings and will herein be described in more detail. These drawings and the written description are not intended to limit the scope of the inventive concepts in any way, but to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present application as detailed in the accompanying claims.
In the prior art, when a micro service is registered on a multi-cloud platform, each registry obtains metadata of the micro service in a corresponding manner, for example: when registering with the SOFA, the metadata is obtained by reading configuration information in a configuration file, wherein each configuration information is a key/value key value pair, when registering with the TSF, the program is used for inputting 'Tags' configuration information, the configuration information is a character string, the character string is required to be in the form of 'a=b', and a represents metadata keywords and b represents metadata contents. However, the registry not only wastes operation resources, but also causes a problem of low efficiency of micro service registration of the multi-cloud platform.
According to the method, a registration request of the micro service sent by a micro service provider is received, a configuration information file of the micro service is generated according to the registration request, the configuration information file is used for inputting metadata of the micro service, the metadata of the micro service is in a yaml format, type information of each cloud platform is obtained from each cloud platform registration center of the multi-cloud platform, the input metadata is extracted from the configuration information file, format conversion processing is carried out on the metadata according to the type information of each cloud platform, target format metadata of each cloud platform is obtained, and the target format metadata of each cloud platform is sent to a corresponding cloud platform registration center, wherein the mode of generating the configuration information file of the micro service, obtaining the target format metadata of each cloud platform according to the type information of each cloud platform and sending the target format metadata to the corresponding cloud platform registration center is unified, the input mode of the metadata is unified, operation resources are saved, the efficiency of metadata injection of the micro service is further improved, and the efficiency of micro service registration of the multi-cloud platform is further improved.
It should be noted that, the method and the device for registering the micro-services of the multi-cloud platform can be used in the technical field of computers, and can also be used in any field except the field of computers, and the application field of the method and the device for registering the micro-services of the multi-cloud platform is not limited.
Term interpretation:
cloud environment: the cloud environment is a software infrastructure, and provides a new call relationship (the software A can call the software B without knowing the address of the software B and only knowing the name of the software B) different from the traditional call relationship (the software A knows the address of the software B and directly calls the software B) for the software accessing the infrastructure.
Micro-services: in cloud environments, a large application is generally split into multiple independent components that can be reused, each component has a respective area of responsibility, and such services are relatively small compared to traditional services, and are called micro-services. When handling a user request, a microservice-based application may invoke many microservices to perform a complex function.
The registry: in a cloud environment, all micro-services need to register their own list of service names and service addresses in a registry. When a certain micro-service needs to call other micro-services, the registry needs to search an address list corresponding to the micro-service name, select an address from the address list, and initiate call to the address. The registry is the core of a cloud environment.
Single cloud environment: only one registry is used in the cloud environment, referred to as a single cloud environment. The general cloud environment refers to a single cloud environment.
Cloudy environment: depending on the registry, there are Eureka, SOFA, TSF, zookeeper cloud environments commonly used in the market. If a cloud environment uses multiple registries, it is referred to as a multi-cloud environment.
Fig. 1 is a schematic diagram of an application scenario provided in the present application, where a specific application scenario in the present application includes: a micro-service registration device of a multi-cloud platform, a micro-service provider, a micro-service caller and a plurality of cloud platform registries.
Specifically, the micro service provider is connected with the micro service registration device of the multi-cloud platform and the plurality of cloud platform registries, and is used for sending a registration request of the micro service to the micro service registration device of the multi-cloud platform, and the micro service provider is also used for sending registration information of the micro service to the plurality of cloud platform registries.
Specifically, the micro-service registration device of the multi-cloud platform is connected with the micro-service provider, the micro-service caller and a plurality of cloud platform registries and is used for receiving registration requests of the micro-services sent by the micro-service provider; and generating a configuration information file of the micro-service according to the registration request, wherein the configuration information file is used for inputting metadata of the micro-service, and the metadata of the micro-service is in a yaml format. The micro-service registration device of the multi-cloud platform is also used for acquiring the type information of each cloud platform from each cloud platform registration center of the multi-cloud platform and extracting input metadata from the configuration information file; and carrying out format conversion processing on the metadata according to the type information of the cloud platforms to obtain target format metadata of each cloud platform, and sending the target format metadata to a corresponding cloud platform registry. The method is also used for receiving a micro-service calling request sent by a micro-service calling party, wherein the calling request comprises the name of the micro-service; and acquiring the corresponding IP address and the target format metadata of each cloud platform according to the name of the micro service, so as to be used for calling the micro service through the target format metadata of each cloud platform and the corresponding IP address.
Specifically, the cloud platform registry is connected with the micro service provider, the micro service registration device and the micro service caller and is used for receiving registration information of the micro service sent by the micro service provider, and the cloud platform registry is also used for receiving target format metadata of the micro service sent by the micro service registration device of the multi-cloud platform, wherein the target format metadata refers to metadata in a format corresponding to the cloud platform; the method comprises the steps of injecting target format metadata into registration information of the micro service, wherein the registration information comprises a micro service name and a corresponding IP address; and registering the micro service according to the registration information injected with the metadata of the target format.
Specifically, the micro-service caller is connected with the micro-service registration device of the multi-cloud platform and is used for sending a call request of the micro-service to the micro-service registration device of the multi-cloud platform.
The data transmission method aims at solving the technical problems in the prior art.
The following describes the technical solutions of the present application and how the technical solutions of the present application solve the above technical problems in detail with specific embodiments. The following embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
Fig. 2 is a flow chart of a micro service registration method of a multi-cloud platform according to the first embodiment of the present application, where an execution body is a micro service registration device of the multi-cloud platform, and the execution body may be implemented by software, or implemented by hardware, or implemented by a combination of software and hardware.
As shown in fig. 2, the method for registering a micro service of the multi-cloud platform of the present embodiment may include the following steps:
step S201, receiving a registration request of the micro service sent by the micro service provider.
Specifically, a registration request of the micro service sent by the micro service provider may be received, where the registration request of the micro service refers to a request instruction sent by the micro service when registering with the multi-cloud platform.
Step S202, generating a configuration information file of the micro-service according to the registration request, wherein the configuration information file is used for inputting metadata of the micro-service, and the metadata of the micro-service is in a yaml format.
Specifically, according to the registration request of the micro service sent by the micro service provider and received in step S101, a configuration information file of the corresponding micro service is generated, where the configuration information file is used for inputting metadata of the micro service, and the metadata of the micro service is in yaml format, and optionally, the manner of inputting metadata of the micro service in the configuration information file includes, but is not limited to: manual input by a micro-service developer, automatic input according to a set application program, and the like.
Wherein, the metadata refers to information except micro service name and IP address when micro service registration is performed, and the metadata includes but is not limited to: information such as machine room information, region information, and priority information, for example: the metadata may store machine room information and region information, for example, for a micro SERVICE0001, there are 10 machines to provide SERVICEs, and the 10 machines are distributed in two regions of beijing and shanghai, and each region has two machine rooms. Among the metadata, the metadata in the beijing machine room 1 is area=bj and idc=01, the metadata in the beijing machine room 2 is area=bj and idc=02, the metadata in the Shanghai machine room 1 is area=sh and idc=01, and the metadata in the Shanghai machine room 2 is area=sh and idc=02. Optionally, when the micro service caller performs service call, a suitable machine room and region may be selected according to the location of the micro service caller and metadata of the micro service, for example: when a subscriber of the Beijing machine room 1 invokes the SERVICE0001 micro SERVICE, one machine of the Beijing machine room 1 can be selected nearby for invocation according to the machine room and region information. For example: the metadata may also store priority information, and if some of the metadata has high machine performance and some of the metadata has low machine performance, the metadata priority value may be set to distinguish the machine performance. For example, priority=1 indicates the highest performance, and priority=10 indicates the lowest performance. Assume that there are 2 machines in the Beijing machine room 1, that the metadata information set by the machine with high performance is priority=1, and that the metadata information set by the machine with low performance is priority=5. Alternatively, when the micro service caller performs service call, most of the transactions can be sent to the machine with high performance, and the small part of the transactions can be sent to the machine with low performance according to the priority in the metadata.
Step S203, the type information of each cloud platform is obtained from each cloud platform registration center of the multi-cloud platform, and the input metadata is extracted from the configuration information file.
Specifically, the type information of each cloud platform may be acquired from each cloud platform registration center of the multiple cloud platforms, and the input metadata may be extracted from the configuration information file generated in step S102. The description of the multi-cloud platform may refer to the description of the multi-cloud environment above, which is not repeated in this embodiment, where the type information of the cloud platform refers to information representing the type of the cloud platform, and optionally, the type of the multi-cloud platform includes, but is not limited to: the types and the number of cloud platforms in the multi-cloud platform are not limited in this embodiment, and optionally, the Eureka cloud platform, the SOFA cloud platform, the TSF cloud platform, the zookeeper cloud platform and other cloud platforms are selected.
And step S204, performing format conversion processing on the metadata according to the type information of the cloud platforms to obtain target format metadata of each cloud platform, and sending the target format metadata to a corresponding cloud platform registry.
Specifically, the metadata extracted from the configuration information file may be formatted according to the type information of the cloud platform acquired in step S103, so as to obtain target format metadata of each cloud platform, and send the target format metadata to the corresponding cloud platform registry. The target formats of the metadata corresponding to the cloud platforms are different, specifically, firstly, the target format of the metadata corresponding to the cloud platform can be obtained according to the obtained type information of the cloud platform, secondly, format conversion can be performed on the extracted metadata according to the obtained target format of the metadata corresponding to the cloud platform to obtain the target format metadata of the cloud platform, wherein, as described in step S102, the metadata of the extracted micro service is in a yaml format, and finally, the target format metadata of the cloud platform can be sent to a corresponding cloud platform registry.
According to the micro-service registration method of the multi-cloud platform, a registration request of the micro-service is received, a configuration information file of the micro-service is generated according to the registration request, the configuration information file is used for inputting metadata of the micro-service, the metadata of the micro-service is in a yaml format, type information of each cloud platform is obtained from each cloud platform registration center of the multi-cloud platform, the input metadata is extracted from the configuration information file, format conversion processing is carried out on the metadata according to the type information of the cloud platform, target format metadata of each cloud platform is obtained, and the target format metadata of each cloud platform is sent to a corresponding cloud platform registration center, wherein the mode of generating the configuration information file of the micro-service and sending the target format metadata of each cloud platform to the corresponding cloud platform registration center is adopted, the input mode of the metadata is unified, the metadata of the micro-service is injected at the same time of each cloud platform of the multi-cloud platform, running resources are saved, and the efficiency of micro-service registration of the multi-cloud platform is further improved.
On the basis of the embodiment shown in fig. 2, a second embodiment of the present application provides a method for registering a micro service of a multi-cloud platform, where the multi-cloud platform includes: SOFA cloud platform and TSF cloud platform. Specifically, if the type information indicates that the cloud platform is an SOFA cloud platform, the target format of the metadata is a key value pair format. If the type information indicates that the cloud platform is a TSF cloud platform, the target format of the metadata is a character string format.
Fig. 3 is a flow chart of a micro service call method of a multi-cloud platform according to a third embodiment of the present application, and on the basis of the embodiment shown in fig. 2, the micro service call method of the multi-cloud platform is described in this embodiment, and an execution body is a micro service registration device of the multi-cloud platform, which may be generally implemented by software, or implemented by hardware, or implemented by a combination of software and hardware.
As shown in fig. 3, the micro service invocation method of the multi-cloud platform of the present embodiment may include the following steps:
step S301, a micro-service call request sent by a micro-service caller is received, where the call request includes a name of the micro-service.
Specifically, a call request of the micro service sent by the micro service caller can be received, wherein the call request refers to a request instruction sent by the micro service caller for calling the micro service registered in the multi-cloud platform, and the call request comprises the name of the micro service.
Step S302, obtaining the corresponding IP address and the target format metadata of each cloud platform according to the name of the micro service, so as to be used for calling the micro service through the target format metadata of each cloud platform and the corresponding IP address.
Specifically, the corresponding IP address and the target format metadata of each cloud platform may be obtained from each cloud platform of the multiple cloud platforms according to the name of the micro service, so as to be used for invoking the micro service through the target format metadata of each cloud platform and the corresponding IP address. The specific calling manner may refer to the description of the example shown in step S202, and this embodiment will not be repeated.
Optionally, if the cloud platform registry is a SOFA cloud platform registry, the presentation mode of the target format metadata obtained according to the name of the micro service is Map mode. If the cloud platform registry is a TSF cloud platform registry, the presentation mode of the target format metadata acquired according to the name of the micro service is in a List form.
According to the micro-service calling method of the multi-cloud platform, the micro-service calling request sent by the micro-service calling party is received, the micro-service name is included in the calling request, the corresponding IP address and the target format metadata of each cloud platform are obtained according to the micro-service name, so that micro-service calling is conducted through the target format metadata of each cloud platform and the corresponding IP address, all the corresponding IP addresses and all the target format metadata of each cloud platform are obtained from each cloud platform of the multi-cloud platform according to the micro-service name, a user can select according to own requirements, user experience is improved, and the risk of micro-service calling failure is reduced.
Fig. 4 is a flow chart of a micro service registration method of a multi-cloud platform according to a fourth embodiment of the present application, where an execution body is a cloud platform registration center, and the execution body may be implemented by software, or implemented by hardware, or implemented by a combination of software and hardware.
As shown in fig. 4, the micro service registration of the multi-cloud platform of the present embodiment may include the following steps:
in step S401, target format metadata of the micro service sent by the micro service registration device of the multi-cloud platform is received, where the target format metadata refers to metadata in a format corresponding to the cloud platform.
Specifically, target format metadata of the micro service sent by the micro service registration device of the multi-cloud platform can be received, wherein the target format metadata refers to metadata of a format corresponding to the cloud platform. Optionally, if the cloud platform corresponding to the cloud platform registry is an SOFA cloud platform, the target format metadata is metadata in a key-value pair format, where the key-value pair format metadata is in a key/value form, the key represents a keyword of the metadata, the value represents a content of the metadata, and if the cloud platform corresponding to the cloud platform registry is a TSF cloud platform, the target format metadata is metadata in a character string format, where the metadata in the character string format is in a form of "a=b", a represents the keyword of the metadata, and b represents the content of the metadata.
Step S402, receiving registration information of the micro service sent by the micro service provider, wherein the registration information comprises a micro service name and a corresponding IP address.
Specifically, the registration information of the micro service sent by the micro service provider may be received, where the registration information includes a micro service name and a corresponding IP address, and optionally, one micro service name may correspond to a plurality of IP addresses.
Step S403, the metadata of the target format is injected into the registration information of the micro service.
Specifically, the target format metadata received in step S401 may be injected into the registration information of the micro service received in step S402, where the method for injecting metadata into the registration information of the micro service is not limited in the present application.
Step S404, registering the micro service according to the registration information injected with the metadata of the target format.
Specifically, the micro-service may be registered according to the registration information with the target format metadata injected obtained in step S302, where the method for registering the micro-service according to the registration information with the target format metadata injected is not limited, and any method capable of completing the registration of the micro-service may be used as the technical solution of the present application.
According to the micro service registration method of the multi-cloud platform, the target format metadata of the micro service sent by the micro service registration device of the multi-cloud platform is received, the target format metadata refer to metadata in a format corresponding to the cloud platform, the target format metadata are injected into registration information of the micro service, the registration information comprises micro service names and corresponding IP addresses, and the micro service is registered according to the registration information injected with the target format metadata, wherein each cloud platform registration center of the multi-cloud platform receives the target format metadata of the micro service sent by the micro service registration device of the multi-cloud platform at the same time, and the target format metadata are injected into the registration information of the micro service, so that the metadata of the micro service are injected at the same time of each cloud platform of the multi-cloud platform, operation resources are saved, the efficiency of metadata injection is improved, and the efficiency of micro service registration of the multi-cloud platform is further improved.
Optionally, on the basis of the embodiment shown in fig. 4, the method for registering a micro service of a multi-cloud platform provided in the embodiment of the present application further includes: if the registration information of the micro service is received again or the target format metadata of the micro service is received again, the target format metadata is not injected into the registration information of the micro service. The process of only filling the metadata into the registration information of the micro-service is only carried out once, so that the waste of operation resources caused by repeated registration or repeated filling of the metadata is avoided, and the efficiency of micro-service registration of the multi-cloud platform is further improved.
Fig. 5 is a schematic structural diagram of a micro service registration device of a multi-cloud platform according to a fifth embodiment of the present application.
As shown in fig. 5, the micro service registration device 50 of the multi-cloud platform of the present embodiment includes a receiving module 51, a generating module 52, an obtaining module 53, and a transmitting module 54.
A receiving module 51, configured to receive a registration request of a micro service sent by a micro service provider;
the generating module 52 is configured to generate a configuration information file of the micro service according to the registration request, where the configuration information file is used for inputting metadata of the micro service, and the metadata of the micro service is in yaml format;
an obtaining module 53, configured to obtain type information of each cloud platform from each cloud platform registration center of the multiple cloud platforms, and extract input metadata from the configuration information file;
and the sending module 54 is configured to perform format conversion processing on the metadata according to the type information of the cloud platform, obtain target format metadata of each cloud platform, and send the target format metadata to a corresponding cloud platform registry.
The device provided in this embodiment may be used to implement the technical solutions of any one of fig. 2 to 3 in the above method embodiments, and the implementation principle and technical effects are similar, which are not described here again.
Fig. 6 is a schematic structural diagram of a micro service registration device of a multi-cloud platform according to a sixth embodiment of the present application.
As shown in fig. 6, the micro service registration device 60 of the multi-cloud platform of the present embodiment includes a receiving module 61, an injecting module 62, and a registration module 63.
A receiving module 61, configured to receive target format metadata of a micro service sent by a micro service registration device of a multi-cloud platform, where the target format metadata refers to metadata in a format corresponding to the cloud platform;
the receiving module 61 is further configured to receive registration information of the micro service sent by the micro service provider, where the registration information includes a name of the micro service and a corresponding IP address;
an injection module 62 for injecting the target format metadata into the registration information of the micro service;
a registration module 63 for registering the micro service according to the registration information into which the metadata of the target format is injected.
The device provided in this embodiment may be used to implement the technical scheme of fig. 4 in the above method embodiment, and its implementation principle and technical effects are similar, and this embodiment will not be described herein again.
Fig. 7 is a schematic structural diagram of a micro service registration device of a multi-cloud platform according to a seventh embodiment of the present application.
As shown in fig. 7, the micro service registration apparatus 70 of the multi-cloud platform of the present embodiment includes: processor 71, memory 72, communication interface 73.
The memory 72 is used to store executable instructions for the processor.
Wherein the processor 71 is configured to perform the micro-service registration method of the multi-cloud platform of any of the above method embodiments fig. 2 to 3 or fig. 4 via execution of executable instructions.
In the embodiment shown in fig. 7, it should be understood that the processor may be a central processing unit (english: central Processing Unit, abbreviated as CPU), or may be other general purpose processors, digital signal processors (english: digital Signal Processor, abbreviated as DSP), application specific integrated circuits (english: application Specific Integrated Circuit, abbreviated as ASIC), or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present invention may be embodied directly in a hardware processor for execution, or in a combination of hardware and software modules in a processor for execution.
The Memory may comprise high-speed Memory (Random Access Memory, RAM) or may further comprise Non-volatile Memory (NVM), such as at least one disk Memory.
The bus may be an industry standard architecture (Industry Standard Architecture, ISA) bus, an external device interconnect (Peripheral Component, PCI) bus, or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, among others. The buses may be divided into address buses, data buses, control buses, etc. For ease of illustration, the buses in the drawings of the present application are not limited to only one bus or one type of bus.
The embodiment of the application further provides a readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a method for registering micro services of the multi-cloud platform of any one of fig. 2 to 3 or fig. 4 for executing the method embodiment described above.
It should be noted that, the user information (including but not limited to user equipment information, user personal information, etc.) and the data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present application are information and data authorized by the user or fully authorized by each party, and the collection, use and processing of the related data need to comply with the related laws and regulations and standards of the related country and region, and provide corresponding operation entries for the user to select authorization or rejection.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It is to be understood that the present application is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (10)

1. The micro-service registration method for the multi-cloud platform is characterized by comprising the following steps of:
receiving a registration request of a micro service sent by a micro service provider;
generating a configuration information file of the micro service according to the registration request, wherein the configuration information file is used for inputting metadata of the micro service, and the metadata of the micro service is in a yaml format;
acquiring type information of each cloud platform from each cloud platform registration center of the multi-cloud platform, and extracting input metadata from the configuration information file;
and carrying out format conversion processing on the metadata according to the type information of the cloud platform to obtain target format metadata of each cloud platform, and sending the target format metadata to a corresponding cloud platform registry.
2. The method of claim 1, wherein the multi-cloud platform comprises: SOFA cloud platform and TSF cloud platform;
if the type information indicates that the cloud platform is the SOFA cloud platform, the target format of the metadata is a key value pair format;
and if the type information indicates that the cloud platform is the TSF cloud platform, the target format of the metadata is a character string format.
3. The method according to claim 2, wherein the method further comprises:
receiving a calling request of a micro service sent by a micro service calling party, wherein the calling request comprises the name of the micro service;
and acquiring the corresponding IP address and the target format metadata of each cloud platform according to the name of the micro service, and calling the micro service through the target format metadata of each cloud platform and the corresponding IP address.
4. The method of claim 3, wherein if the cloud platform registry is a SOFA cloud platform registry, the presentation mode of the target format metadata obtained according to the name of the micro service is Map mode; and if the cloud platform registry is a TSF cloud platform registry, the presentation mode of the target format metadata acquired according to the name of the micro service is in a List form.
5. The micro-service registration method of the multi-cloud platform is characterized by being applied to a cloud platform registration center and comprising the following steps of:
receiving target format metadata of a micro service sent by a micro service registration device of a multi-cloud platform, wherein the target format metadata refer to metadata in a format corresponding to the cloud platform;
receiving registration information of the micro service sent by a micro service provider, wherein the registration information comprises a micro service name and a corresponding IP address;
injecting the target format metadata into the registration information of the micro service;
and registering the micro service according to the registration information injected with the metadata of the target format.
6. The method of claim 5, wherein after the registering of the micro service according to the registration information into which the target format metadata is injected, further comprising:
and if the registration information of the micro service is received again or the target format metadata of the micro service is received again, the target format metadata is not injected into the registration information of the micro service.
7. A micro-service registration device of a multi-cloud platform, comprising:
the receiving module is used for receiving a registration request of the micro service sent by the micro service provider;
the generation module is used for generating a configuration information file of the micro service according to the registration request, wherein the configuration information file is used for inputting metadata of the micro service, and the metadata of the micro service is in a yaml format;
the acquisition module is used for acquiring the type information of each cloud platform from each cloud platform registration center of the multi-cloud platform and extracting the input metadata from the configuration information file;
and the sending module is used for carrying out format conversion processing on the metadata according to the type information of the cloud platforms to obtain target format metadata of each cloud platform and sending the target format metadata to a corresponding cloud platform registry.
8. A micro-service registration device of a multi-cloud platform, comprising:
the receiving module is used for receiving target format metadata of the micro service sent by the micro service registration device of the multi-cloud platform, wherein the target format metadata refer to the metadata in a format corresponding to the cloud platform;
the receiving module is further configured to receive registration information of the micro service sent by a micro service provider, where the registration information includes a micro service name and a corresponding IP address;
the injection module is used for injecting the target format metadata into the registration information of the micro service;
and the registration module is used for registering the micro service according to the registration information injected with the target format metadata.
9. A microservice registration device of a multi-cloud platform, comprising:
a processor, a memory, a communication interface;
the memory is used for storing executable instructions of the processor;
wherein the processor is configured to perform the micro-service registration method of the multi-cloud platform of any of claims 1 to 4 or claims 4-6 via execution of the executable instructions.
10. A readable storage medium having stored thereon a computer program, which when executed by a processor implements a method of micro-service registration for executing the multi-cloud platform of any of claims 1 to 4 or claims 4-6.
CN202311257925.XA 2023-09-26 2023-09-26 Method, device, equipment and storage medium for registering micro-service of multi-cloud platform Pending CN117278621A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311257925.XA CN117278621A (en) 2023-09-26 2023-09-26 Method, device, equipment and storage medium for registering micro-service of multi-cloud platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311257925.XA CN117278621A (en) 2023-09-26 2023-09-26 Method, device, equipment and storage medium for registering micro-service of multi-cloud platform

Publications (1)

Publication Number Publication Date
CN117278621A true CN117278621A (en) 2023-12-22

Family

ID=89221071

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311257925.XA Pending CN117278621A (en) 2023-09-26 2023-09-26 Method, device, equipment and storage medium for registering micro-service of multi-cloud platform

Country Status (1)

Country Link
CN (1) CN117278621A (en)

Similar Documents

Publication Publication Date Title
CN110377369B (en) Method, device and computer storage medium for running small program
CN107577629B (en) Data interface processing method, device, server and medium
CN110825448A (en) Method, device, electronic equipment and storage medium for realizing mutual calling of multiple service modules
CN112835632B (en) Method and equipment for calling end capability and computer storage medium
CN109725887B (en) Data interaction method and device based on message research and development framework and terminal equipment
CN114244654A (en) URL forwarding method, device, equipment and computer storage medium
CN111488286B (en) Method and device for independently developing Android modules
CN112818336A (en) Data access method, data access device and computer readable storage medium
CN112256351A (en) Implementation method of Feign component, micro-service calling method and device
CN111597020A (en) Application Programming Interface (API) debugging method and debugging terminal
CN117278621A (en) Method, device, equipment and storage medium for registering micro-service of multi-cloud platform
CN114697888B (en) 5G message processing method, device and storage medium
CN111158777A (en) Component calling method and device and computer readable storage medium
CN116302602A (en) Message transmission method and device for mixed development of router protogenesis
CN115934537A (en) Interface test tool generation method, device, equipment, medium and product
CN112860398A (en) Data processing method, device, equipment and medium based on rule engine
CN110955430A (en) Application program native capability calling method and device and electronic equipment
CN113791777A (en) Picture display method and device, computer readable storage medium and electronic equipment
CN111639936A (en) Transaction information acquisition method and device, electronic equipment and readable storage medium
CN116455917B (en) Data synchronization method and device, electronic equipment and computer readable storage medium
CN110399161A (en) A kind of generation method of mapping relations, call method and device
CN113840020B (en) Positioning method and device based on IP address information, electronic equipment and storage medium
CN113467860B (en) Service logic execution method and device of program source code
WO2024093409A1 (en) Service component calling method and apparatus, and computer device and storage medium
CN116192963A (en) Error code processing method, device, equipment and storage medium for micro-service

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination