CN114217883A - Service registration method and method for calling service according to registration information - Google Patents

Service registration method and method for calling service according to registration information Download PDF

Info

Publication number
CN114217883A
CN114217883A CN202111509321.0A CN202111509321A CN114217883A CN 114217883 A CN114217883 A CN 114217883A CN 202111509321 A CN202111509321 A CN 202111509321A CN 114217883 A CN114217883 A CN 114217883A
Authority
CN
China
Prior art keywords
service
services
registration
information
private information
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
CN202111509321.0A
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.)
Postal Savings Bank of China Ltd
Original Assignee
Postal Savings 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 Postal Savings Bank of China Ltd filed Critical Postal Savings Bank of China Ltd
Priority to CN202111509321.0A priority Critical patent/CN114217883A/en
Publication of CN114217883A publication Critical patent/CN114217883A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a service registration method and a method for calling service according to registration information. The invention comprises the following steps: splitting and grouping a plurality of services to obtain a plurality of service groups and a plurality of private information corresponding to the plurality of service groups; the service group is registered with a registration center to obtain corresponding registration information; and registering the private information corresponding to the service group to the registration center. The invention solves the problem that services and instances are respectively registered in the registration center in the related technology, and the registration center has too much pressure when the services and the instances needing to be registered reach a certain number.

Description

Service registration method and method for calling service according to registration information
Technical Field
The invention relates to the field of service registration, in particular to a service registration method and a method for calling a service according to registration information.
Background
In the related art, under the micro-service framework, when the number of services and instances reaches a certain number, it is a very big challenge for the registry. Such as: there are 2000 services, 2000 instances of each service, which is 400 ten thousand instances to the registry, which has difficulty carrying this many instances.
In view of the above problems in the related art, no effective solution has been proposed.
Disclosure of Invention
The main objective of the present invention is to provide a service registration method and a method for invoking a service according to registration information, so as to solve the problem that in the related art, services and instances are respectively registered in a registration center, and when the number of the services and instances to be registered reaches a certain number, the registration center is under too much pressure.
In order to achieve the above object, according to one aspect of the present invention, there is provided a service registration method. The invention comprises the following steps: the method comprises the steps that a plurality of services are split and grouped to obtain a plurality of service groups and a plurality of private information corresponding to the service groups, wherein the service groups comprise the services, and the private information comprises mapping relations between the services in each service group and example information corresponding to the services and service fields corresponding to the services; performing service registration on the service group to a registration center to obtain corresponding registration information, wherein the registration information at least comprises services correspondingly provided by the service group and example information corresponding to the service group, and the example information at least comprises a port number, a version number and a communication protocol corresponding to each example; and registering the private information corresponding to the service group to the registration center.
Further, the splitting the plurality of services to obtain the plurality of service groups comprises at least one of: determining example information corresponding to each service, and determining a plurality of services with consistent example information as a service group; and determining an application package corresponding to the service, and determining a plurality of services belonging to the same application package as a service group.
Further, after registering the private information corresponding to the service group to the registry, the method further includes: caching private information corresponding to the service group to a preset position; when the mapping relation between any service and any instance in the service group and/or the service field corresponding to any service is detected to be changed, obtaining the change information corresponding to the change; and updating the private information of the preset position according to the change information.
To achieve the above object, according to one aspect of the present invention, there is provided a method of calling a service according to registration information. The invention comprises the following steps: determining target private information associated with the service to be called, wherein the private information comprises mapping relations between a plurality of services in each service group and instance information corresponding to the plurality of services and service fields corresponding to the plurality of services; determining a target service group corresponding to the target private information, wherein the target service group comprises a service to be called; and acquiring an instance corresponding to the service to be called according to the target service group, and calling the service to be called deployed on the instance.
Further, prior to determining the target private information associated with the service to be invoked, the method includes: and obtaining the private information from the preset position in which the private information is cached.
Further, before determining the target private information associated with the service to be invoked, the method further comprises: subscribing private information; and receiving reminding information triggered by change when the mapping relation between any service corresponding to the private information and any instance is detected and/or the service field corresponding to any service is changed.
In order to achieve the above object, according to another aspect of the present invention, there is provided a service registration apparatus. The device includes: the system comprises a splitting unit, a storage unit and a processing unit, wherein the splitting unit is used for splitting and grouping a plurality of services to obtain a plurality of service groups and a plurality of private information corresponding to the service groups, the service groups comprise a plurality of services, and the private information comprises mapping relations between the plurality of services in each service group and example information corresponding to the plurality of services and service fields corresponding to the plurality of services; the registration unit is used for registering the service group to a registration center to obtain corresponding registration information, wherein the registration information at least comprises the service correspondingly provided by the service group and the example information corresponding to the service group, and the example information at least comprises a port number, a version number and a communication protocol corresponding to each example; and a registration unit which registers the private information corresponding to the service group to the registration center.
Further, the splitting unit comprises at least one of: the first determining subunit determines the instance information corresponding to each service and determines a plurality of services with consistent instance information as a service group; and the second determining subunit determines the application package corresponding to the service, and determines a plurality of services belonging to the same application package as a service group.
In order to achieve the above object, according to another aspect of the present application, there is provided a computer-readable storage medium including a stored program, wherein the program performs a service registration method of any one of the above.
To achieve the above object, according to another aspect of the present application, there is provided a processor for executing a program, wherein the program performs a service registration method of any one of the above.
The invention adopts the following steps: the method comprises the steps that a plurality of services are split and grouped to obtain a plurality of service groups and a plurality of private information corresponding to the service groups, wherein the service groups comprise the services, and the private information comprises mapping relations between the services in each service group and example information corresponding to the services and service fields corresponding to the services; performing service registration on the service group to a registration center to obtain corresponding registration information, wherein the registration information at least comprises services correspondingly provided by the service group and example information corresponding to the service group, and the example information at least comprises a port number, a version number and a communication protocol corresponding to each example; the private information corresponding to the service group is registered to the registration center, so that the problem that the registration center is stressed too much when the services and the instances which need to be registered reach a certain number in the related technology are respectively registered to the registration center is solved, and the effect of relieving the pressure of the registration center is achieved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate an embodiment of the invention and, together with the description, serve to explain the invention and not to limit the invention. In the drawings:
fig. 1 is a flowchart of a service registration method according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating a relationship between a service, a service group, and private information provided by an embodiment of the present application;
FIG. 3 is a flowchart of a method for invoking a service according to registration information according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of the interaction of service providers and service consumers with a registry, respectively;
fig. 5 is a schematic diagram of a service registration apparatus provided in accordance with an embodiment of the present invention;
fig. 6 is a schematic diagram of an apparatus for invoking a service according to registration information according to an embodiment of the present invention.
Detailed Description
It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict. The present invention will be described in detail below with reference to the embodiments with reference to the attached drawings.
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged under appropriate circumstances in order to facilitate the description of the embodiments of the invention herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
For convenience of description, some terms or expressions referring to the embodiments of the present invention are explained below:
the registration center: and providing a service governance function for realizing service registration and service discovery of each micro-service instance.
Service registration: in a service administration framework, a registry is usually constructed, each service unit registers services provided by the service unit to the registry, the registry is informed of additional information such as a host, a port number, a version number, a communication protocol and the like, and the registry organizes a service list according to service name classification.
According to an embodiment of the present invention, there is provided a service registration method.
Fig. 1 is a flowchart of a service registration method according to an embodiment of the present invention. As shown in fig. 1, the present invention comprises the steps of:
step S101, splitting and grouping a plurality of services to obtain a plurality of service groups and a plurality of private information corresponding to the service groups, wherein the service groups comprise a plurality of services, and the private information comprises mapping relations between the plurality of services and instance information corresponding to the plurality of services in each service group and service fields corresponding to the plurality of services.
Step S102, registering the service group with the registry to obtain a corresponding registration message, wherein the registration message at least includes the service correspondingly provided by the service group, the instance message corresponding to the service group, and the instance message at least includes the port number, version number and communication protocol corresponding to each instance.
The service is service content provided by a service provider, for example, taking a bank as an example, the service is deposit, withdrawal, bill inquiry and the like, where the example is a server deployed in the background, and the example information is information such as a port number, a version number, a communication protocol and the like of the example.
In the embodiment provided by the present application, each service group corresponds to a piece of private information, where the private information includes mapping relationships between services in the service group and instances where the services are deployed, and instance information, and a service field corresponding to each service, for example: the service group 1 comprises a telephone charge checking service and a point checking service, and the corresponding private information comprises embodiment information with the telephone charge checking service and embodiment information with the point checking service, and two service fields of 'telephone charge checking' and 'point checking'.
Step S103, registering the private information corresponding to the service group to the registration center.
By the method, the mapping relation between the plurality of services and the deployed server and the service fields corresponding to the plurality of services are registered in the registration center, the registration center can dynamically add information, the operation is simple, and quick switching is realized for the user to select the service. For example, taking a bank as an example, if the "deposit" service is deployed on servers No. 1, 2, and 3, it means that the "deposit" service has a mapping relationship with servers No. 1, 2, and 3.
Further, when a service consumer calls a service, the private information of a service group corresponding to the service is first found through the registry, and then the instance information of the service deployment to be called is determined through the private information.
In an alternative example, the de-grouping of the plurality of services to obtain the plurality of service groups comprises at least one of: determining example information corresponding to each service, and determining a plurality of services with consistent example information as a service group; and determining an application package corresponding to the service, and determining a plurality of services belonging to the same application package as a service group.
In the above, the plurality of services are split into two service groups, and the basis of splitting the service groups is divided into two types, as follows:
according to one: splitting and grouping a plurality of services according to deployed servers, and determining a plurality of services consistent with the servers as a service group;
according to the second step: and determining a plurality of services belonging to the same application package as a service group, wherein the services of the same series belong to the same application package.
For example, if the "query" service and the "query detail" service provided by the bank are deployed in the same server, the two services are determined to be the same service group. The service of 'printing withdrawal certificate' and the service of 'inquiring the balance in the card' provided by the bank belong to the same series of services, and the two services are determined as the same service group.
In an optional example, after registering the private information corresponding to the service group to the registry, the method further comprises: caching private information corresponding to the service group to a preset position; when the mapping relation between any service and any instance in the service group and/or the service field corresponding to any service is detected to be changed, obtaining the change information corresponding to the change; and updating the private information of the preset position according to the change information.
In the above manner, the private information corresponding to the service group is cached to the preset position, and the user can know the specific service group position when calling the interface of the service provider.
When the relation between any one of the plurality of services and the server where the service is deployed and the service field corresponding to any one of the plurality of services are changed, the private information is changed without extra operation to solve the problem of service discovery, the technical effects of dynamically adding the changed information and updating the private information of the preset position according to the changed information are achieved.
For example, the money withdrawing service provided by the bank has a mapping relationship with servers of 4, 5 and 6 respectively at the preset position in the registry, and after the money withdrawing service provided by the bank has a mapping relationship with servers of 7, 8 and 9 respectively, the original preset position in the registry is updated to the mapping relationship between the inquiry service and the servers of 7, 8 and 9. The updating operation is simple and convenient, no additional operation is needed, and dynamic updating is realized.
Fig. 2 is a schematic diagram of a relationship among services, service groups, and private information provided in an embodiment of the present application, and specifically, as shown in fig. 2, by grouping services to form a plurality of service groups and registering the service groups with a registry, it is implemented that only one registration information is registered for a plurality of services in one service group, and pressure of the registry is reduced.
It should be noted that the registry is a mechanism in the network, verifies the user digital authentication request, issues the authentication through the authentication center, and when the service provider adds nodes, IP changes, and the like, it is not necessary to perform additional operations to solve the problem of service discovery, thereby implementing dynamic joining. The service registration is to register the server, port, version number, communication protocol and the like of the service to the registration center.
According to an embodiment of the present invention, there is provided a method of invoking a service according to registration information.
Fig. 3 is a flow chart of a method for invoking a service according to registration information in accordance with an embodiment of the present invention. As shown in fig. 3, the present invention comprises the steps of:
step S301, determining target private information associated with the service to be called, wherein the private information includes mapping relations between a plurality of services in each service group and instance information corresponding to the plurality of services, and service fields corresponding to the plurality of services.
Step S302, a target service group corresponding to the target private information is determined, wherein the target service group comprises a service to be called.
Step S303, obtaining an instance corresponding to the service to be called according to the target service group, and calling the service to be called deployed on the instance.
In the above, when a service to be called is received, the private information corresponding to the service to be called is determined, where the service to be called and other services form a service group and submit a service registration to the registration center, the service group corresponds to a piece of private information, and the private information includes a mapping relationship between the service in the service group and an instance in which the service is deployed and a service field corresponding to each service, that is, the instance in which the service to be called is deployed can be obtained through the private information.
For example, when a user wants to withdraw money from a bank, the machine side calls a withdrawal service by acquiring private information corresponding to a withdrawal service when receiving a withdrawal service request.
In the above way, the user calls through the target service group according to personal requirements, and acquires and deploys the instances of the service to be called through private information.
In an alternative example, prior to determining the target private information associated with the service to be invoked, the method includes: and obtaining the private information from the preset position in which the private information is cached.
In the above manner, the private information party caches the preset position of the registration center, acquires the private information corresponding to the service group corresponding to the service to be called, and needs to perform an acquisition operation from the preset position in which the private information is cached.
In an optional example, before determining the target private information associated with the service to be invoked, the method further comprises: subscribing private information; and receiving reminding information triggered by change when the mapping relation between any service corresponding to the private information and any instance is detected and/or the service field corresponding to any service is changed.
In the above manner, the user subscribes the private information, and when the mapping relationship between the plurality of services and the deployed server and the service fields corresponding to the plurality of services change, the change information is updated to the private information, so that no error occurs when the service consumer calls the private information, and the calling efficiency is improved.
The service registration method provided by the embodiment of the invention obtains a plurality of service groups and a plurality of private information corresponding to the service groups by splitting and grouping a plurality of services, wherein the service groups comprise a plurality of services, and the private information comprises mapping relations between the plurality of services and example information corresponding to the plurality of services in each service group and service fields corresponding to the plurality of services; performing service registration on the service group to a registration center to obtain corresponding registration information, wherein the registration information at least comprises services correspondingly provided by the service group and example information corresponding to the service group, and the example information at least comprises a port number, a version number and a communication protocol corresponding to each example; the private information corresponding to the service group is registered to the registration center, so that the problem that the registration center is stressed too much when the services and the instances which need to be registered reach a certain number in the related technology are respectively registered to the registration center is solved, and the effect of relieving the pressure of the registration center is achieved.
Fig. 4 is an interaction schematic diagram of a service provider and a service consumer with a registry, respectively, where the service provider provides a service for a user, performs service registration with the registry to obtain a piece of corresponding registration information, and registers private information corresponding to a service group in the registry. The user determines and subscribes the target private information associated with the service to be called, and the registration pressure of the registration center is reduced through the embodiment.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowcharts, in some cases, the steps illustrated or described may be performed in an order different than presented herein.
The embodiment of the present invention further provides a service registration apparatus, and it should be noted that the service registration apparatus of the embodiment of the present invention may be used to execute the service registration method provided by the embodiment of the present invention. A service registration apparatus according to an embodiment of the present invention is described below.
Fig. 5 is a schematic diagram of a service registration apparatus according to an embodiment of the present invention. As shown in fig. 5, the apparatus includes: the splitting unit 501 splits and groups a plurality of services to obtain a plurality of service groups and a plurality of private information corresponding to the plurality of service groups, where a service group includes a plurality of services, and the private information includes mapping relationships between the plurality of services in each service group and instance information corresponding to the plurality of services and service fields corresponding to the plurality of services; a registration unit 502, configured to perform service registration on a service group with a registration center to obtain a piece of corresponding registration information, where the registration information at least includes a service correspondingly provided by the service group, instance information corresponding to the service group, and the instance information at least includes a port number, a version number, and a communication protocol corresponding to each instance; the registration unit 503 registers the private information corresponding to the service group in the registry.
In an alternative example, the splitting unit 501 includes at least one of: the first determining subunit determines the instance information corresponding to each service and determines a plurality of services with consistent instance information as a service group; and the second determining subunit determines the application package corresponding to the service, and determines a plurality of services belonging to the same application package as a service group.
In an optional example, the apparatus further comprises: the cache unit caches the private information corresponding to the service group to a preset position after registering the private information corresponding to the service group to the registration center; the first obtaining unit is used for obtaining change information corresponding to change when the mapping relation between any service and any instance in the service group is detected and/or the service field corresponding to any service is changed; and the updating unit updates the private information of the preset position according to the change information.
The embodiment of the present invention further provides a device for invoking a service according to registration information, and it should be noted that the device for invoking a service according to registration information of the embodiment of the present invention can be used for executing the method for invoking a service according to registration information provided by the embodiment of the present invention. A device for invoking a service according to registration information according to an embodiment of the present invention is described below.
Fig. 6 is a diagram illustrating an apparatus for invoking a service according to registration information according to an embodiment of the present invention. As shown in fig. 6, the apparatus includes: the first determining unit 601 is configured to determine target private information associated with a service to be called, where the private information includes mapping relationships between multiple services in each service group and instance information corresponding to the multiple services, and service fields corresponding to the multiple services; a second determining unit 602, configured to determine a target service group corresponding to the target private information, where the target service group includes a service to be invoked; the second obtaining unit 603 obtains an instance corresponding to the service to be invoked according to the target service group, and invokes the service to be invoked deployed on the instance.
In an alternative example, the apparatus comprises: and the third acquisition unit is used for acquiring the private information from the preset position in which the private information is cached before determining the target private information associated with the service to be called.
In an optional example, the apparatus further comprises: the subscription unit subscribes the private information before determining the target private information associated with the service to be called; and the receiving unit is used for receiving the reminding information triggered by the change when the mapping relation between any service corresponding to the private information and any instance is detected and/or the service field corresponding to any service is changed.
The service registration device provided by the embodiment of the invention obtains a plurality of service groups and a plurality of private information corresponding to the service groups by splitting and grouping a plurality of services, wherein the service groups comprise a plurality of services, and the private information comprises mapping relations between the plurality of services and example information corresponding to the plurality of services in each service group and service fields corresponding to the plurality of services; performing service registration on the service group to a registration center to obtain corresponding registration information, wherein the registration information at least comprises services correspondingly provided by the service group and example information corresponding to the service group, and the example information at least comprises a port number, a version number and a communication protocol corresponding to each example; the private information corresponding to the service group is registered to the registration center, so that the problem that the registration center is stressed too much when the services and the instances which need to be registered reach a certain number in the related technology are respectively registered to the registration center is solved, and the effect of relieving the pressure of the registration center is achieved.
The service registration apparatus includes a processor and a memory, the splitting unit 501 and the like are stored in the memory as a program unit, and the processor executes the program unit stored in the memory to implement a corresponding function.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more than one, and the technical problem that services and instances are respectively registered in a registry in the related art is solved by adjusting kernel parameters, and the registry is stressed too much when the services and the instances needing to be registered reach a certain number.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
An embodiment of the present invention provides a computer-readable storage medium on which a program is stored, which, when executed by a processor, implements the service registration method.
The embodiment of the invention provides a processor, which is used for running a program, wherein the service registration method is executed when the program runs.
The embodiment of the invention provides equipment, which comprises a processor, a memory and a program which is stored on the memory and can run on the processor, wherein the processor executes the program and realizes the following steps: the method comprises the steps that a plurality of services are split and grouped to obtain a plurality of service groups and a plurality of private information corresponding to the service groups, wherein the service groups comprise the services, and the private information comprises mapping relations between the services in each service group and example information corresponding to the services and service fields corresponding to the services; performing service registration on the service group to a registration center to obtain corresponding registration information, wherein the registration information at least comprises services correspondingly provided by the service group and example information corresponding to the service group, and the example information at least comprises a port number, a version number and a communication protocol corresponding to each example; and registering the private information corresponding to the service group to the registration center.
In an alternative example, the de-grouping of the plurality of services to obtain the plurality of service groups comprises at least one of: determining example information corresponding to each service, and determining a plurality of services with consistent example information as a service group; and determining an application package corresponding to the service, and determining a plurality of services belonging to the same application package as a service group.
In an optional example, after registering the private information corresponding to the service group to the registry, the method further comprises: caching private information corresponding to the service group to a preset position; when the mapping relation between any service and any instance in the service group and/or the service field corresponding to any service is detected to be changed, obtaining the change information corresponding to the change; and updating the private information of the preset position according to the change information.
Determining target private information associated with the service to be called, wherein the private information comprises mapping relations between a plurality of services in each service group and instance information corresponding to the plurality of services and service fields corresponding to the plurality of services; determining a target service group corresponding to the target private information, wherein the target service group comprises a service to be called; and acquiring an instance corresponding to the service to be called according to the target service group, and calling the service to be called deployed on the instance.
In an alternative example, prior to determining the target private information associated with the service to be invoked, the method includes: and obtaining the private information from the preset position in which the private information is cached.
In an optional example, before determining the target private information associated with the service to be invoked, the method further comprises: subscribing private information; and receiving reminding information triggered by change when the mapping relation between any service corresponding to the private information and any instance is detected and/or the service field corresponding to any service is changed.
The device herein may be a server, a PC, a PAD, a mobile phone, etc.
The invention also provides a computer program product adapted to perform a program for initializing the following method steps when executed on a data processing device: the method comprises the steps that a plurality of services are split and grouped to obtain a plurality of service groups and a plurality of private information corresponding to the service groups, wherein the service groups comprise the services, and the private information comprises mapping relations between the services in each service group and example information corresponding to the services and service fields corresponding to the services; performing service registration on the service group to a registration center to obtain corresponding registration information, wherein the registration information at least comprises services correspondingly provided by the service group and example information corresponding to the service group, and the example information at least comprises a port number, a version number and a communication protocol corresponding to each example; and registering the private information corresponding to the service group to the registration center.
In an alternative example, the de-grouping of the plurality of services to obtain the plurality of service groups comprises at least one of: determining example information corresponding to each service, and determining a plurality of services with consistent example information as a service group; and determining an application package corresponding to the service, and determining a plurality of services belonging to the same application package as a service group.
In an optional example, after registering the private information corresponding to the service group to the registry, the method further comprises: caching private information corresponding to the service group to a preset position; when the mapping relation between any service and any instance in the service group and/or the service field corresponding to any service is detected to be changed, obtaining the change information corresponding to the change; and updating the private information of the preset position according to the change information.
Determining target private information associated with the service to be called, wherein the private information comprises mapping relations between a plurality of services in each service group and instance information corresponding to the plurality of services and service fields corresponding to the plurality of services; determining a target service group corresponding to the target private information, wherein the target service group comprises a service to be called; and acquiring an instance corresponding to the service to be called according to the target service group, and calling the service to be called deployed on the instance.
In an alternative example, prior to determining the target private information associated with the service to be invoked, the method includes: and obtaining the private information from the preset position in which the private information is cached.
In an optional example, before determining the target private information associated with the service to be invoked, the method further comprises: subscribing private information; and receiving reminding information triggered by change when the mapping relation between any service corresponding to the private information and any instance is detected and/or the service field corresponding to any service is changed.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above are merely examples of the present invention, and are not intended to limit the present invention. Various modifications and alterations to this invention will become apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of the claims of the present invention.

Claims (10)

1.一种服务注册方法,其特征在于,包括:1. a service registration method, is characterized in that, comprises: 对多条服务进行拆分分组以获得多个服务组以及多个所述服务组对应的多个私有信息,其中,所述服务组中包含多条服务,所述私有信息包括每个所述服务组中多条所述服务与多条所述服务对应的实例信息之间的映射关系以及多条所述服务对应的服务字段;Split and group multiple services to obtain multiple service groups and multiple private information corresponding to multiple service groups, wherein the service group includes multiple services, and the private information includes each of the services The mapping relationship between the multiple pieces of the service in the group and the instance information corresponding to the multiple pieces of the service, and the service fields corresponding to the multiple pieces of the service; 将所述服务组向注册中心进行服务注册以获得一条对应的注册信息,其中,所述注册信息中至少包括所述服务组对应提供的服务、所述服务组对应的实例信息,所述实例信息至少包括每个所述实例对应的端口号、版本号以及通信协议;Perform service registration of the service group with the registration center to obtain a piece of corresponding registration information, wherein the registration information at least includes the service provided correspondingly by the service group, the instance information corresponding to the service group, and the instance information At least include the port number, version number and communication protocol corresponding to each of the instances; 将所述服务组对应的所述私有信息登记至所述注册中心。The private information corresponding to the service group is registered in the registration center. 2.根据权利要求1所述的方法,其特征在于,对多条服务进行拆分分组以获得多个服务组包括以下至少之一:2. The method according to claim 1, wherein the splitting and grouping of a plurality of services to obtain a plurality of service groups comprises at least one of the following: 确定每条所述服务对应的实例信息,并将所述实例信息一致的多条所述服务确定为一个所述服务组;Determine the instance information corresponding to each of the services, and determine a plurality of the services with the same instance information as one of the service groups; 确定所述服务对应的应用包,将同属于一个所述应用包的多条所述服务,确定为一个所述服务组。An application package corresponding to the service is determined, and a plurality of the services belonging to the same application package are determined as one of the service groups. 3.根据权利要求1所述的方法,其特征在于,在将所述服务组对应的所述私有信息登记至所述注册中心之后,所述方法还包括:3. The method according to claim 1, wherein after registering the private information corresponding to the service group in the registration center, the method further comprises: 将所述服务组对应的所述私有信息缓存至预设位置;caching the private information corresponding to the service group to a preset location; 在检测到所述服务组中任意一条所述服务与任意一个所述实例之间的映射关系和/或,任意一条所述服务对应的服务字段发生变化时,获取所述变化对应的变化信息;When detecting that the mapping relationship between any one of the services in the service group and any one of the instances and/or that the service field corresponding to any one of the services has changed, acquiring the change information corresponding to the change; 依据所述变化信息,更新所述预设位置的所述私有信息。According to the change information, the private information of the preset location is updated. 4.一种依据注册信息调用服务的方法,其特征在于,包括:4. A method for invoking a service according to registration information, comprising: 确定与待调用服务相关联的目标私有信息,其中,所述私有信息包括每个所述服务组中多条所述服务与多条所述服务对应的实例信息之间的映射关系以及多条所述服务对应的服务字段;Determine the target private information associated with the service to be called, wherein the private information includes the mapping relationship between the multiple pieces of the service in each of the service groups and the instance information corresponding to the multiple pieces of the service, and the multiple pieces of all The service field corresponding to the above service; 确定所述目标私有信息对应的目标服务组,其中,所述目标服务组中包括所述待调用服务;determining a target service group corresponding to the target private information, wherein the target service group includes the service to be called; 依据所述目标服务组,获取所述待调用服务对应的实例,并调用部署在所述实例上的所述待调用服务。According to the target service group, the instance corresponding to the service to be called is obtained, and the service to be called deployed on the instance is called. 5.根据权利要求4所述的方法,其特征在于,在确定与待调用服务相关联的目标私有信息之前,所述方法包括:5. The method according to claim 4, wherein before determining the target private information associated with the service to be called, the method comprises: 从缓存有所述私有信息的预设位置处获取所述私有信息。The private information is acquired from a preset location where the private information is cached. 6.根据权利要求4所述的方法,其特征在于,在确定与待调用服务相关联的目标私有信息之前,所述方法该包括:6. The method according to claim 4, wherein before determining the target private information associated with the service to be called, the method comprises: 订阅所述私有信息;subscribe to said private information; 在检测所述私有信息对应的任意一条服务与任意一个实例之间的映射关系和/或,任意一条所述服务对应的服务字段发生变化时,接收所述变化触发的提醒信息。When detecting a mapping relationship between any service corresponding to the private information and any instance and/or when a service field corresponding to any one of the services changes, receiving reminder information triggered by the change. 7.一种服务注册装置,其特征在于,包括:7. A service registration device, comprising: 拆分单元,对多条服务进行拆分分组以获得多个服务组以及多个所述服务组对应的多个私有信息,其中,所述服务组中包含多条服务,所述私有信息包括每个所述服务组中多条所述服务与多条所述服务对应的实例信息之间的映射关系以及多条所述服务对应的服务字段;A splitting unit for splitting and grouping a plurality of services to obtain a plurality of service groups and a plurality of private information corresponding to the service groups, wherein the service group includes a plurality of services, and the private information includes each A mapping relationship between a plurality of the services in each of the service groups and the instance information corresponding to the plurality of the services, and the service fields corresponding to the plurality of the services; 注册单元,将所述服务组向注册中心进行服务注册以获得一条对应的注册信息,其中,所述注册信息中至少包括所述服务组对应提供的服务、所述服务组对应的实例信息,所述实例信息至少包括每个所述实例对应的端口号、版本号以及通信协议;A registration unit, which registers the service group with the registration center to obtain a piece of corresponding registration information, wherein the registration information at least includes the service provided by the service group and the instance information corresponding to the service group, and The instance information includes at least the port number, version number and communication protocol corresponding to each of the instances; 登记单元,将所述服务组对应的所述私有信息登记至所述注册中心。a registration unit, which registers the private information corresponding to the service group to the registration center. 8.根据权利要求7所述的装置,其特征在于,所述拆分单元包括以下至少之一:8. The device according to claim 7, wherein the splitting unit comprises at least one of the following: 第一确定子单元,确定每条所述服务对应的实例信息,并将所述实例信息一致的多条所述服务确定为一个所述服务组;The first determination subunit determines the instance information corresponding to each of the services, and determines a plurality of the services with the same instance information as one of the service groups; 第二确定子单元,确定所述服务对应的应用包,将同属于一个所述应用包的多条所述服务,确定为一个所述服务组。The second determination subunit determines an application package corresponding to the service, and determines a plurality of the services that belong to the same application package as one of the service groups. 9.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质包括存储的程序,其中,在所述程序运行时控制所述计算机可读存储介质所在设备执行权利要求1至3中任意一项所述一种服务注册方法。9. A computer-readable storage medium, characterized in that the computer-readable storage medium comprises a stored program, wherein, when the program is run, a device where the computer-readable storage medium is located is controlled to execute claims 1 to 3 A service registration method described in any one of the above. 10.一种处理器,其特征在于,所述处理器用于运行程序,其中,所述程序运行时执行权利要求1至3中任意一项所述一种服务注册方法。10 . A processor, wherein the processor is configured to run a program, wherein when the program runs, the service registration method according to any one of claims 1 to 3 is executed.
CN202111509321.0A 2021-12-10 2021-12-10 Service registration method and method for calling service according to registration information Pending CN114217883A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111509321.0A CN114217883A (en) 2021-12-10 2021-12-10 Service registration method and method for calling service according to registration information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111509321.0A CN114217883A (en) 2021-12-10 2021-12-10 Service registration method and method for calling service according to registration information

Publications (1)

Publication Number Publication Date
CN114217883A true CN114217883A (en) 2022-03-22

Family

ID=80700962

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111509321.0A Pending CN114217883A (en) 2021-12-10 2021-12-10 Service registration method and method for calling service according to registration information

Country Status (1)

Country Link
CN (1) CN114217883A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114827295A (en) * 2022-04-26 2022-07-29 北京奇艺世纪科技有限公司 Service registration method, registration center, system and readable storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104737133A (en) * 2012-10-16 2015-06-24 微软公司 Distributed application optimization using service groups
CN106603594A (en) * 2015-10-15 2017-04-26 中国电信股份有限公司 Distributed service management method and system
CN108134766A (en) * 2016-12-01 2018-06-08 阿里巴巴集团控股有限公司 A kind of method, apparatus, system, server and client for servicing publication
CN111147605A (en) * 2019-12-31 2020-05-12 中国银行股份有限公司 Service registration method, device and equipment
CN111190736A (en) * 2019-12-31 2020-05-22 苏宁云计算有限公司 Low-intrusion distributed timing task scheduling system and method based on microservice
CN111221653A (en) * 2020-01-06 2020-06-02 中国银联股份有限公司 Service processing method and device and computer readable storage medium
CN112445580A (en) * 2019-08-28 2021-03-05 烽火通信科技股份有限公司 Micro-service grouping management control method and system
CN113296972A (en) * 2020-07-20 2021-08-24 阿里巴巴集团控股有限公司 Information registration method, computing device and storage medium
CN113742100A (en) * 2021-08-27 2021-12-03 欧电云信息科技(江苏)有限公司 Service calling method, system, equipment and medium based on micro-service architecture
CN113746928A (en) * 2021-09-07 2021-12-03 中国银行股份有限公司 Cross-cloud service calling method, device and system

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104737133A (en) * 2012-10-16 2015-06-24 微软公司 Distributed application optimization using service groups
CN106603594A (en) * 2015-10-15 2017-04-26 中国电信股份有限公司 Distributed service management method and system
CN108134766A (en) * 2016-12-01 2018-06-08 阿里巴巴集团控股有限公司 A kind of method, apparatus, system, server and client for servicing publication
CN112445580A (en) * 2019-08-28 2021-03-05 烽火通信科技股份有限公司 Micro-service grouping management control method and system
CN111147605A (en) * 2019-12-31 2020-05-12 中国银行股份有限公司 Service registration method, device and equipment
CN111190736A (en) * 2019-12-31 2020-05-22 苏宁云计算有限公司 Low-intrusion distributed timing task scheduling system and method based on microservice
CN111221653A (en) * 2020-01-06 2020-06-02 中国银联股份有限公司 Service processing method and device and computer readable storage medium
CN113296972A (en) * 2020-07-20 2021-08-24 阿里巴巴集团控股有限公司 Information registration method, computing device and storage medium
CN113742100A (en) * 2021-08-27 2021-12-03 欧电云信息科技(江苏)有限公司 Service calling method, system, equipment and medium based on micro-service architecture
CN113746928A (en) * 2021-09-07 2021-12-03 中国银行股份有限公司 Cross-cloud service calling method, device and system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114827295A (en) * 2022-04-26 2022-07-29 北京奇艺世纪科技有限公司 Service registration method, registration center, system and readable storage medium

Similar Documents

Publication Publication Date Title
CN111163129B (en) A resource processing method and device based on a cross-chain network
CN110472438B (en) Transaction data processing and transaction inquiring method, device and equipment based on blockchain
CN109669709B (en) Data migration method and data migration system for block chain upgrading
CN108600326B (en) Communication method, device and equipment
CN110086944B (en) Communication method and device based on virtual number
CA3054840A1 (en) Method and apparatus for consensus verification
EP2778968B1 (en) Mobile telecommunication device remote access to cloud-based or virtualized database systems
CN108255614A (en) A kind of interface calling system and method based on micro services framework
US20140250105A1 (en) Reliable content recommendations
US20160149854A1 (en) Framework for Application to Application Interworking in the M2M World
TWI686703B (en) Method and device for data storage and business processing
CN105635191A (en) Invocation guiding system and invocation guiding method for service traffic
CN112491943A (en) Data request method, device, storage medium and electronic equipment
CN106559453A (en) The external resource management method of cloud intercommunication, apparatus and system
CN114217883A (en) Service registration method and method for calling service according to registration information
TW201732587A (en) Resource loading method of application APP, business function realization method and device
CN113010332A (en) Remote service calling method, device, equipment and storage medium
CN115002228A (en) Service cascade calling method and device, electronic equipment and storage medium
CN114363254A (en) Tenant isolation method and device and electronic equipment
CN115545639B (en) Financial business processing method, device, electronic equipment and storage medium
CN115811481B (en) Interactive service testing method and device, computer equipment and storage medium
CN112055039B (en) Data access method, device and system and computing equipment
CN110753082B (en) Service calling method and terminal equipment
CN109788015A (en) Application service invocation system, method and device
WO2023092316A1 (en) Third-party service login method and apparatus, terminal device, and storage medium

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