CN109547570A - Service registration method, apparatus, registration center's management equipment and storage medium - Google Patents
Service registration method, apparatus, registration center's management equipment and storage medium Download PDFInfo
- Publication number
- CN109547570A CN109547570A CN201811640256.3A CN201811640256A CN109547570A CN 109547570 A CN109547570 A CN 109547570A CN 201811640256 A CN201811640256 A CN 201811640256A CN 109547570 A CN109547570 A CN 109547570A
- Authority
- CN
- China
- Prior art keywords
- center
- registration
- micro services
- registered
- management equipment
- 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.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/51—Discovery or management thereof, e.g. service location protocol [SLP] or web services
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/52—Network services specially adapted for the location of the user terminal
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/566—Grouping or aggregating service requests, e.g. for unified processing
Abstract
The embodiment of the present application discloses a kind of service registration method, apparatus, registration center's management equipment and storage medium, this method comprises: registration center's management equipment obtains deployed environment locating for micro services system;Registration center's management equipment determines that target registered center corresponding with deployed environment locating for micro services system, target registered center are one of at least two registration centers according to the corresponding relationship of deployed environment and registration center;Registration center's management equipment loads realization class corresponding with target registered center, starts target registered center;Registration center's management equipment obtains the micro services to be registered that the first equipment is sent, and micro services to be registered are registered to target registered center by registration center's management equipment.Meet the demand of the multi-environment deployment of micro services system.
Description
Technical field
This application involves field of computer technology, and in particular to a kind of service registration method, apparatus, registration center's management are set
Standby and storage medium.
Background technique
Micro services system is that an independent system of script is split into multiple microminiature services, these small services are all
It is run in process independent, by being based on hypertext transfer protocol (HyperText Transfer between service
Protocol, HTTP) RESTful application programming interface (Application Programming Interface,
API it) cooperates.
Under current micro services development mode, the registration and discovery of service are required using the same registration center, in registration
Central server provider generally only provides a kind of registration center, can only support a kind of service discovery mechanisms.
Summary of the invention
The embodiment of the present application provides a kind of service registration method, apparatus, registration center's management equipment and storage medium, can
To use different registration centers according to different deployed environments, meet the demand of the multi-environment deployment of micro services system.
In a first aspect, the embodiment of the present application provides a kind of service registration method, the method is applied to micro services system, institute
Stating micro services system includes registration center's management equipment, at least two registration centers and the first equipment, which comprises
Registration center's management equipment obtains deployed environment locating for the micro services system;
Registration center's management equipment is according to the determination of the corresponding relationship of deployed environment and registration center and the micro services
The corresponding target registered center of deployed environment locating for system, the target registered center are at least two registration center
One;
Registration center's management equipment loads realization class corresponding with the target registered center, starts the target note
Volume center;
Registration center's management equipment obtains the micro services to be registered that first equipment is sent, the registration center
The micro services to be registered are registered to the target registered center by management equipment.
Second aspect, the embodiment of the present application provide a kind of service registration device, and the service registration device is applied to micro-
Service system, the micro services system include registration center's management equipment, at least two registration centers and the first equipment, the clothes
Business register device include:
Acquiring unit, for obtaining deployed environment locating for the micro services system;
Determination unit, for according to locating for the determination of the corresponding relationship of deployed environment and registration center and the micro services system
The corresponding target registered center of deployed environment, the target registered center is one of at least two registration center;
Loading unit loads realization class corresponding with the target registered center for obtaining, starts the target registered
Center;
Registering unit, the micro services to be registered sent for obtaining first equipment, by it is described it is to be registered in incognito
Business is registered to the target registered center.
The third aspect, the embodiment of the present application provides a kind of registration center's management equipment, including processor, memory, described
For storing one or more programs, one or more of programs are configured to be executed by the processor memory, above-mentioned
Program is included the steps that for executing the instruction in the embodiment of the present application first aspect.
Fourth aspect, the embodiment of the present application provide a kind of computer readable storage medium, wherein above-mentioned computer-readable
Storage medium storage is used for the computer program of electronic data interchange, wherein above-mentioned computer program executes computer such as
Step some or all of described in the embodiment of the present application first aspect.
5th aspect, the embodiment of the present application provide a kind of computer program product, wherein above-mentioned computer program product
Non-transient computer readable storage medium including storing computer program, above-mentioned computer program are operable to make to calculate
Machine executes the step some or all of as described in the embodiment of the present application first aspect.The computer program product can be one
A software installation packet.
As can be seen that service registration method described in the embodiment of the present application, this method is applied to micro services system, micro-
Service system includes registration center's management equipment, at least two registration centers and the first equipment, this method comprises: registration center manages
It manages equipment and obtains deployed environment locating for micro services system;Registration center's management equipment is according to pair of deployed environment and registration center
Should be related to determine target registered corresponding with deployed environment locating for micro services system center, target registered center for it is above-mentioned at least
One of Liang Ge registration center;Registration center's management equipment loads realization class corresponding with target registered center, starting target note
Volume center;Registration center's management equipment obtains the micro services to be registered that the first equipment is sent, which is infused
Volume arrives target registered center.The embodiment of the present application can select matching according to deployed environment locating for micro services system
Registration center can use different registration centers according to different deployed environments, meet the multi-environment deployment of micro services system
Demand.
Detailed description of the invention
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of application for those of ordinary skill in the art without creative efforts, can be with
It obtains other drawings based on these drawings.
Fig. 1 is a kind of structural schematic diagram of micro services system disclosed in the embodiment of the present application;
Fig. 2 is a kind of flow diagram of service registration method disclosed in the embodiment of the present application;
Fig. 3 is a kind of micro services system architecture of service registration and service discovery disclosed in the embodiment of the present application;
Fig. 4 is the flow diagram of another kind service registration method disclosed in the embodiment of the present application;
Fig. 5 is a kind of structural schematic diagram of service registration device disclosed in the embodiment of the present application;
Fig. 6 is a kind of structural schematic diagram of registration center's management equipment disclosed in the embodiment of the present application.
Specific embodiment
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present application
Attached drawing, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described embodiment is only
A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art
Every other embodiment obtained without creative efforts, shall fall within the protection scope of the present invention.
Description and claims of this specification and term " first " in above-mentioned attached drawing, " second " etc. are for distinguishing
Different objects, are not use to describe a particular order.In addition, term " includes " and " having " and their any deformations, it is intended that
It is to cover and non-exclusive includes.Such as the process, method, system, product or equipment for containing a series of steps or units do not have
It is defined in listed step or unit, but optionally further comprising the step of not listing or unit, or optionally also wrap
Include other step or units intrinsic for these process, methods, product or equipment.
Referenced herein " embodiment " is it is meant that a particular feature, structure, or characteristic described can wrap in conjunction with the embodiments
Containing at least one embodiment of the present invention.Each position in the description occur the phrase might not each mean it is identical
Embodiment, nor the independent or alternative embodiment with other embodiments mutual exclusion.Those skilled in the art explicitly and
Implicitly understand, embodiment described herein can be combined with other embodiments.
Equipment in micro services system involved by the embodiment of the present application can be server, virtual machine, physical machine, cloud
Hold server etc..
It describes in detail below to the embodiment of the present application.
In order to be best understood from the service registration method of the application, a kind of micro services system is disclosed first.Referring to Fig. 1, Fig. 1
It is a kind of structural schematic diagram of micro services system disclosed in the embodiment of the present application, as shown in Figure 1, the micro services system includes registration
Centre management equipment 11, at least two registration centers (the first registration center 121 and the second registration center 122 as shown in Figure 1)
With the first equipment 13.Wherein, registration center's management equipment 11, the first registration center 121 and the second registration center 122 can be
Server, registration center's management equipment 11, the first registration center 121 and the second registration center 122 can be different server.
Registration center's management equipment 11 can be identical server with the first registration center 121 or the second registration center 122.First sets
Standby 13 can be server, be also possible to the terminals such as mobile phone, tablet computer.Registration center's management equipment 11 is for managing at least two
A registration center can select which registration center used according to deployed environment.First equipment 13 can be managed to registration center
Equipment 11 sends service registration request.The micro services system can be distributed system.The embodiment of the present application can be according in incognito
Deployed environment locating for business system selects matching registration center, can be according to different deployed environment using different
Registration center meets the demand of the multi-environment deployment of micro services system.Server in Fig. 1 can be virtual machine, physical machine, cloud
Hold any one of server.
Based on micro services system shown in FIG. 1, the embodiment of the present application discloses a kind of service registration method, referring to Fig. 2, figure
2 be a kind of flow diagram of service registration method disclosed in the embodiment of the present application, as shown in Fig. 2, the service registration method packet
Include following steps.
201, registration center's management equipment obtains deployed environment locating for micro services system.
In the embodiment of the present application, micro services system may be at cloud deployed environment, also may be at local disposition environment,
It may be at mixed deployment environment (cloud deployment+local disposition).Under different deployed environments, service discovery mechanisms also not phase
Together.Cloud deployment, is exactly that micro services system operates in Cloud Server, local disposition is exactly that micro services system operates in local clothes
It is engaged in device, mixed deployment is exactly that micro services system a part operates in Cloud Server, and another part operates in local server
In.
Wherein, under different deployed environments, the registration center used is different, and service discovery mechanisms are also different.
Service discovery refers under micro services framework, the mistake of micro services dynamic acquisition other available micro services lists
Journey.
It is registered in the service of the same registration center, mutually it can be found that other side, on the contrary then not all right.
Registration center's management equipment is every time when micro services system starts, the reading that can be started by micro services system
Configuration file in obtain micro services system locating for deployed environment.Remember in the configuration file of the reading of micro services system starting
Deployed environment locating for the micro services system is recorded.
202, registration center's management equipment is according to the determination of the corresponding relationship of deployed environment and registration center and micro services system
The corresponding target registered center of locating deployed environment, target registered center are one of at least two registration centers.
In the embodiment of the present application, deployed environment pass corresponding with registration center can store in registration center's management equipment
System.Under different deployed environments, due to service discovery mechanisms difference, the registration center of required use is also different, in order to suitable
Different deployed environments is answered, matching registration center can be selected according to deployed environment.
After registration center's management equipment determines target registered corresponding with deployed environment locating for micro services system center,
It can star target registered center.
Optionally, the service discovery mechanisms of at least two registration centers are different.
Optionally, step 201 and step 202 can be executed when the micro services system initial start-up is run.Work as micro services
After the deployed environment of system determines, when the subsequent micro services system starts operation every time, then step 201 and step can be skipped automatically
Rapid 202, directly execution step 203.
Optionally, after the deployed environment of the micro services system changes, when which starts, by micro-
Deployed environment locating for micro services system is obtained in the configuration file that service system is read when starting, micro services system starting
Deployed environment locating for the micro services system is had recorded in the configuration file of reading.Judge to have recorded this in the configuration file in incognito
Whether deployed environment when deployed environment locating for business system starts with the micro services system last time is identical, if not identical,
Step 202 is executed to step 204.
203, registration center's management equipment loads realization class corresponding with target registered center, starts target registered center.
In the embodiment of the present application, registration center's management equipment is corresponding with deployed environment locating for micro services system in determination
After target registered center, realization class corresponding with target registered center is just loaded, to start target registered center.
In the prior art, registration center service provider only provides a kind of registration center, and provided registration center
Automatically start, and starting will load realization class automatically every time.The note of the offer of registration center service provider is provided
Volume center can not adapt to different deployed environments.The embodiment of the present application can select in matching registration according to deployed environment
The heart adapts to different service discovery mechanisms so as to adapt to different deployed environments, improves the adaptation energy of micro services system
Power.
204, registration center's management equipment obtains the micro services to be registered that the first equipment is sent, by micro services to be registered
It is registered to target registered center.
In the embodiment of the present application, the first equipment is referred to as service providing device, for registering oneself in registration center
Provided micro services.After micro services to be registered are registered to target registered center by registration center, target registered center can be with
The micro services are put into the service list that it is managed.Micro services in service list can be pushed to service by registration center
Consumer device, for micro services needed for the selection of service consumption equipment.May include in service list micro services service type,
The corresponding network resources address of the service name of micro services, the service provider names of micro services, micro services, for example, this is in incognito
It is engaged in corresponding uniform resource locator (Uniform Resource Locator, URL).
Wherein, in micro services system, after the starting of target registered center, target registered center can be established with the first equipment
It is long to connect and keep.Keep long the first equipment connected that can have with target registered center multiple.Target registered center can permit
Many a service providing devices keep long therewith and connect.The maintained service list in target registered center can dynamically update
(increase and deletion comprising service etc.), target registered center regularly can push its service updated to service consumption equipment
List, so that service consumption equipment can quickly obtain required micro services.Service consumption equipment can also be with target registered
Center keeps long connection.
In the case where target registered center starts, the service consumption equipment kimonos of long connection is kept with target registered center
Business provides equipment and all follows same service discovery mechanisms, and this service discovery mechanisms can be corresponding with the target registered center
Deployed environment is compatible.
Service registration method provided by the embodiment of the present application can be selected according to deployed environment locating for micro services system
Matching registration center is selected, then selection starts matching registration center, can adopt according to different deployed environments
With different registration centers, meet the demand of the multi-environment deployment of micro services system.The service registration method corresponding program generation
Code modified can not can be deployed in various environment, without the realization generation according to different deployed environment modification registration centers
Code, reduces the code revision workload of the developer under micro services development mode.
Optionally, in step 204, micro services to be registered are registered to target registered center by registration center's management equipment,
It is specifically as follows:
Registration center's management equipment sends registration request to target registered center, and registration request includes micro services to be registered
Parameter information, target registered center is used to store the parameter informations of micro services to be registered.
Wherein, the parameter information of micro services to be registered may include the service type of the micro services of the registration, the registration
The service name of micro services, the service provider names of the micro services, the corresponding network resources address of the micro services etc..Target
The parameter information of micro services to be registered can be stored in service list by registration center.
Optionally, after performing step 204, following steps can also be performed:
Registration center's management equipment obtains the service discovery request that the second equipment is sent, and service discovery request carries second and sets
The parameter information of standby required service;
Service discovery request is sent to target registered center by registration center's management equipment.
In the embodiment of the present application, the parameter information serviced needed for the second equipment may include the clothes serviced needed for the second equipment
Service type, service name.
Wherein, the first equipment, the second equipment, registration center's management equipment, the relationship at target registered center may refer to figure
3, Fig. 3 be a kind of micro services system architecture of service registration and service discovery disclosed in the embodiment of the present application.Wherein, registration center
Management equipment can be located at target registered center, and (target registered center can be the first registration center or the second registration in Fig. 3
Center) in, registration center's management equipment can serve as the gateway at target registered center, for building with the first equipment, the second equipment
It stands and keeps long connection.First equipment is referred to as service providing device, and the second equipment is referred to as service consumption equipment.
After first equipment has registered micro services at target registered center, service that the second equipment can be provided by target registered center
Discovery mechanism finds that the registered micro services in target registered center, the second equipment can be in inquiry micro services.Specifically, first sets
After micro services to be registered are registered to target registered center, which can be put into it and be managed by target registered center
Service list in.The micro services can be stored in the form of one or more Service Instances, may include in service list every
The network site of a Service Instance, the network site may include Service Instance Internet protocol (Internet Protocol,
IP) address and port numbers, needed for being obtained so as to service consumption equipment according to the IP address and port numbers of the Service Instance in incognito
Business.Specifically, can send micro services calling to the first equipment after the network site of the second equipment acquisition Service Instance and ask
It asks, to obtain required micro services.
Certainly, when the first equipment no longer provides service, the first equipment can also will be registered micro- at target registered center
Service is deleted.Correspondingly, target registered center can also update service list and corresponding database.
Micro services in service list can be pushed to service consumption equipment by target registered center, so that service consumption is set
Micro services needed for alternative, the second equipment can also be required in incognito from the acquisition of target registered center by service discovery mechanisms
Business.
Wherein, the service discovery mechanisms of different registration centers are different.For example, some service discovery mechanisms are based on client
What end was realized, be client discovery mode, some service discovery mechanisms are realized based on server-side, is server-side discovery mould
Formula.
Specifically, client is responsible for the network site of determining available service example simultaneously when using client discovery mode
And load balancing is carried out to by their request.Client query service register center, service register center are registration centers
An available service example database.Client then uses load-balancing algorithm to select one in available Service Instance
It is a and this request is routed to the Service Instance.When Service Instance starting, its network address is registered to service
Registration center.When the Service Instance terminates, which removes from service register center.The registration of Service Instance usually makes
It is periodically flushed with heartbeat mechanism.
When using server-side discovery mode, client is sent to server-side by load balancer and is requested.Load balancing
Device inquiry registration center simultaneously routes each request to available Service Instance.As client discovery mechanism, Service Instance
It needs to registration center's registration and unregistration.
Referring to Fig. 4, Fig. 4 is the flow diagram of another kind service registration method disclosed in the embodiment of the present application, such as Fig. 4
Shown, which includes the following steps.
401, registration center's management equipment obtains the realization component at target registered center, to the realization group at target registered center
The source code of part is modified, and to remove the automatic load function of the core classes at target registered center, obtains modified target
The realization component of registration center;The core classes include the corresponding class of service type that micro services system is supported.
In the embodiment of the present application, the realization component at target registered center is the program groups for realizing the function at target registered center
Part.When realization component when the target registered center is run on target registered center, target registered center just can normal work
Make.The realization component at target registered center can be the realization group of the registration center of other registration centers service provider offer
Part.Registration center's management equipment can the source code of realization component to target registered center modify, to remove target note
The automatic load function of the core classes at volume center, the realization component at modified target registered center, and to modified target
The realization component of registration center is Resealed.
Wherein, micro services system can support the modification of the realization component of multiple registration centers, the reality of other registration centers
The modification of existing component may refer to the modification of the realization component at target registered center, and details are not described herein again.
Optionally, the realization component for obtaining target registered center, can also be by developer to the reality at target registered center
The source code of existing component is modified, and to remove the automatic load function of the core classes at target registered center, is obtained modified
The realization component at target registered center.Wherein, the realization component at the target registered center is that open source registration center realizes component, is led to
Modification source code is crossed, automatic load function is removed, repacks encapsulation, the registration center for obtaining closing automatic load function realizes
Component.
The core classes include the corresponding class of service type that micro services system is supported.Specifically, in order to meet client's
Demand, the corresponding class of the service type that micro services system is supported also are limited, and core classes here refer to that client is wanted
Seek the class of support.
Under current micro services development mode, same set of code can only support a kind of service discovery mechanisms, if be related to
The modification of discovery mechanism must modify to source code.It such as will be using when being deployed to cloud environment, it is necessary to it is suitable to modify code
Service discovery mechanisms with cloud environment, the quantity of service being related to is more, and the difficulty and workload of transformation are also bigger.When predecessor company is
Product allocation mode to industry is all more diversified, and when non-cloud environment is disposed, registration center used in registration center is realized
There are many kinds of scheme, registration center's realization that cloud uses when disposing is not also unique, and non-cloud deployment is also different.But we need
Different deployment is done according to itself technical characterstic and customer demand, can not just be accomplished in the case where not modifying source code
It is deployed to different environment, the demand and registration center that are not able to satisfy multi-environment deployment realize the scene of replacement.As it can be seen that existing
Registration center service provider only provides a kind of registration center in technology, and provided registration center starts automatically,
And starting will load realization class automatically every time.Leading to the registration center of the offer of registration center service provider can not adapt to
Different deployed environments.The realization group for the registration center that the embodiment of the present application can provide each registration center service provider
The automatic load function of core classes in part removes, and avoids the automatic load of core classes.It can be selected therewith according to deployed environment
Matched registration center adapts to different service discovery mechanisms, improves micro services so as to adapt to different deployed environments
The adaptability of system.
402, realization component of registration center's management equipment at the modified target registered center of target registered center loaded.
In the embodiment of the present application, after the realization component at the modified target registered center of target registered center loaded,
When target registered center starts, since the automatic load function of core classes has been removed, the registration center will not be loaded automatically certainly
The core classes of band.
403, registration center's management equipment obtains deployed environment locating for micro services system.
404, registration center's management equipment is according to the determination of the corresponding relationship of deployed environment and registration center and micro services system
The corresponding target registered center of locating deployed environment, target registered center are one of at least two registration centers.
405, registration center's management equipment loads realization class corresponding with target registered center, starts target registered center.
406, registration center's management equipment obtains the micro services to be registered that the first equipment is sent, by micro services to be registered
It is registered to target registered center.
The specific implementation of step 403 to step 406 in the embodiment of the present application may refer to above-mentioned step shown in Fig. 2
201 to step 204 associated description, details are not described herein again.
In the embodiment of the present application, in the realization component for the registration center that each registration center service provider can be provided
Core classes automatic load function removal, avoid the automatic load of core classes.It can be selected according to deployed environment matching
Registration center adapt to different service discovery mechanisms so as to adapt to different deployed environments, improve micro services system
Adaptability.
Optionally, when the deployed environment locating for the micro services system changes, restart registration center's management equipment.Due to
Deployed environment changes, and service discovery mechanisms may also can change, and restarting registration center's management equipment can again more
The registration center renewed, to support new service discovery mechanisms.
It is above-mentioned that mainly the scheme of the embodiment of the present application is described from the angle of method side implementation procedure.It is understood that
, in order to realize the above functions, it comprises execute the corresponding hardware configuration of each function and/or software module for terminal.This
Field technical staff should be readily appreciated that, unit and algorithm described in conjunction with the examples disclosed in the embodiments of the present disclosure
Step, the present invention can be realized with the combining form of hardware or hardware and computer software.Some function actually with hardware also
It is the mode of computer software driving hardware to execute, the specific application and design constraint depending on technical solution.Profession
Technical staff can specifically realize described function to each using distinct methods, but this realization should not be recognized
It is beyond the scope of this invention.
The embodiment of the present application can carry out the division of functional unit according to above method example to terminal, for example, can be right
The each functional unit of each function division is answered, two or more functions can also be integrated in a processing unit.
Above-mentioned integrated unit both can take the form of hardware realization, can also realize in the form of software functional units.It needs
Illustrate, is schematical, only a kind of logical function partition to the division of unit in the embodiment of the present application, it is practical to realize
When there may be another division manner.
Referring to Fig. 5, Fig. 5 is a kind of structural schematic diagram of service registration device disclosed in the embodiment of the present application.The service
Register device is applied to micro services system, and micro services system includes registration center's management equipment, at least two registration centers and the
One equipment, as shown in figure 5, the service registration device 500 includes acquiring unit 501, determination unit 502, loading unit 503 and note
Volume unit 504, in which:
Acquiring unit 501, for obtaining deployed environment locating for micro services system;
Determination unit 502, for according to locating for the determination of the corresponding relationship of deployed environment and registration center and micro services system
The corresponding target registered center of deployed environment, target registered center is one of at least two registration centers;
Loading unit 503 loads realization class corresponding with target registered center for obtaining, starts target registered center;
Registering unit 504 registers micro services to be registered for obtaining the micro services to be registered of the first equipment transmission
To target registered center.
Optionally, which can also include modification unit 505.
The acquiring unit 501 is also used to before obtaining target deployment environment locating for micro services system, obtains target note
The realization component at volume center;
Unit 505 is modified, the source code for the realization component to target registered center is modified, to remove target note
The automatic load function of the core classes at volume center, obtains the realization component at modified target registered center;Core classes include micro-
The corresponding class of the service type that service system is supported.
Optionally, which can also include loading unit 506.
Loading unit 506, for being repaired in modification unit 505 to the source code of the realization component at target registered center
Change, to remove the automatic load function of the core classes at target registered center, obtains the realization group at modified target registered center
After part, and before acquiring unit 501 obtains target deployment environment locating for micro services system, add at target registered center
Carry the realization component at modified target registered center.
Optionally, micro services to be registered are registered to target registered center by registering unit 504, specifically: it is infused to target
Volume center sends registration request, and registration request includes the parameter information of micro services to be registered, and target registered center is for storing
The parameter information of micro services to be registered.
Optionally, micro services system further includes the second equipment, which can also include transmission unit
507。
The acquiring unit 501, be also used to registering unit 504 by micro services to be registered be registered to target registered center it
Afterwards, the service discovery request that the second equipment is sent is obtained, service discovery request carries the parameter information serviced needed for the second equipment;
Transmission unit 507, for service discovery request to be sent to target registered center.
Optionally, which can also include restarting unit 508.
Restart unit 508, when changing for the deployed environment locating for the micro services system, restarts registration center's management
Equipment.
Optionally, the service discovery mechanisms of at least two registration centers are different.
Implement device shown in fig. 5, matching note can be selected according to deployed environment locating for micro services system
Volume center, then selection starts matching registration center, can be according to different deployed environments using in different registrations
The heart meets the demand of the multi-environment deployment of micro services system.The corresponding program code of service registration method can not be modified
It can be deployed in various environment, without the realization code according to different deployed environment modification registration centers, reduce in incognito
The code revision workload of developer under development mode of being engaged in.
Referring to Fig. 6, Fig. 6 is a kind of structural schematic diagram of registration center's management equipment disclosed in the embodiment of the present application.Such as
Shown in Fig. 6, which includes processor 601 and memory 602, wherein registration center's management equipment
600 can also include bus 603, and processor 601 and memory 602 can be connected with each other by bus 603, and bus 603 can be with
It is Peripheral Component Interconnect standard (Peripheral Component Interconnect, abbreviation PCI) bus or extension industry mark
Quasi- structure (Extended Industry Standard Architecture, abbreviation EISA) bus etc..Bus 603 can divide
For address bus, data/address bus, control bus etc..Only to be indicated with a thick line in Fig. 6, it is not intended that only convenient for indicating
There are a bus or a type of bus.Wherein, registration center's management equipment 600 can also include input-output equipment 604,
Input-output equipment 604 may include display screen, such as liquid crystal display.Memory 602 is used to store one comprising instruction
Or multiple programs;Processor 601 be used to calling the part stored above-mentioned Fig. 2 of instruction execution in the memory 602 into Fig. 4 or
All methods step.
Implement registration center's management equipment shown in fig. 6, can be selected according to deployed environment locating for micro services system
Matching registration center, then selection starts matching registration center, can be used according to different deployed environments
Different registration centers meets the demand of the multi-environment deployment of micro services system.The corresponding program code of service registration method
It modified can not can be deployed in various environment, without the realization generation according to different deployed environment modification registration centers
Code, reduces the code revision workload of the developer under micro services development mode.
The embodiment of the present application also provides a kind of computer storage medium, wherein computer storage medium storage is for electricity
The computer program of subdata exchange, it is as any in recorded in above method embodiment which execute computer
A kind of some or all of service registration method step.
The embodiment of the present application also provides a kind of computer program product, which includes storing computer
The non-transient computer readable storage medium of program, the computer program are operable to execute computer as the above method is real
Apply some or all of any service registration method recorded in example step.
It should be noted that for the various method embodiments described above, for simple description, therefore, it is stated as a series of
Combination of actions, but those skilled in the art should understand that, the present invention is not limited by the sequence of acts described because
According to the present invention, some steps may be performed in other sequences or simultaneously.Secondly, those skilled in the art should also know
It knows, the embodiments described in the specification are all preferred embodiments, and related actions and modules is not necessarily of the invention
It is necessary.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, there is no the portion being described in detail in some embodiment
Point, reference can be made to the related descriptions of other embodiments.
In several embodiments provided herein, it should be understood that disclosed device, it can be by another way
It realizes.For example, the apparatus embodiments described above are merely exemplary, such as the division of the unit, it is only a kind of
Logical function partition, there may be another division manner in actual implementation, such as multiple units or components can combine or can
To be integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual
Coupling, direct-coupling or communication connection can be through some interfaces, the indirect coupling or communication connection of device or unit,
It can be electrical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple
In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme
's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent product
When, it can store in a computer-readable access to memory.Based on this understanding, technical solution of the present invention substantially or
Person says that all or part of the part that contributes to existing technology or the technical solution can body in the form of software products
Reveal and, which is stored in a memory, including some instructions are used so that a computer equipment
(can be personal computer, server or network equipment etc.) executes all or part of each embodiment the method for the present invention
Step.And memory above-mentioned includes: USB flash disk, read-only memory (ROM, Read-Only Memory), random access memory
The various media that can store program code such as (RAM, Random Access Memory), mobile hard disk, magnetic or disk.
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of above-described embodiment is can
It is completed with instructing relevant hardware by program, which can store in a computer-readable memory, memory
May include: flash disk, read-only memory (English: Read-Only Memory, referred to as: ROM), random access device (English:
Random Access Memory, referred to as: RAM), disk or CD etc..
The embodiment of the present application is described in detail above, specific case used herein to the principle of the present invention and
Embodiment is expounded, and the above description of the embodiment is only used to help understand the method for the present invention and its core ideas;
At the same time, for those skilled in the art can in specific embodiments and applications according to the thought of the present invention
There is change place, in conclusion the contents of this specification are not to be construed as limiting the invention.
Claims (10)
1. a kind of service registration method, which is characterized in that the method is applied to micro services system, and the micro services system includes
Registration center's management equipment, at least two registration centers and the first equipment, which comprises
Registration center's management equipment obtains deployed environment locating for the micro services system;
Registration center's management equipment is according to the determination of the corresponding relationship of deployed environment and registration center and the micro services system
The corresponding target registered center of locating deployed environment, the target registered center are the one of at least two registration center
It is a;
Registration center's management equipment loads realization class corresponding with the target registered center, starts in the target registered
The heart;
Registration center's management equipment obtains the micro services to be registered that first equipment is sent, registration center's management
The micro services to be registered are registered to the target registered center by equipment.
2. the method according to claim 1, wherein registration center's management equipment obtains the micro services system
Before the locating target deployment environment of system, the method also includes:
Registration center's management equipment obtains the realization component at the target registered center, to the reality at the target registered center
The source code of existing component is modified, and to remove the automatic load function of the core classes at the target registered center, is modified
The realization component at target registered center afterwards;The core classes include that the service type supported of the micro services system is corresponding
Class.
3. according to the method described in claim 2, it is characterized in that, registration center's management equipment is in the target registered
The source code of the realization component of the heart is modified, and to remove the automatic load function of the core classes at the target registered center, is obtained
After to the realization component at modified target registered center and registration center's management equipment obtains the micro services system
Before the locating target deployment environment of system, the method also includes:
The realization at registration center's management equipment modified target registered center described in the target registered center loaded
Component.
4. described in any item methods according to claim 1~3, which is characterized in that registration center's management equipment will be described
Micro services to be registered are registered to the target registered center, comprising:
Registration center's management equipment sends registration request to the target registered center, the registration request include it is described to
The parameter information of the micro services of registration, the target registered center are used to store the parameter information of the micro services to be registered.
5. according to the method described in claim 4, it is characterized in that, the micro services system further includes the second equipment, the note
After the micro services to be registered are registered to the target registered center by volume centre management equipment, the method also includes:
Registration center's management equipment obtains the service discovery request that second equipment is sent, and the service discovery request is taken
Parameter information with service needed for second equipment;
The service discovery request is sent to the target registered center by registration center's management equipment.
6. described in any item methods according to claim 1~3, which is characterized in that the method also includes:
When the deployed environment locating for the micro services system changes, registration center's management equipment is restarted.
7. described in any item methods according to claim 1~3, which is characterized in that the service of at least two registration center
Discovery mechanism is different.
8. a kind of service registration device, which is characterized in that the service registration device is applied to micro services system, the micro services
System includes registration center's management equipment, at least two registration centers and the first equipment, and the service registration device includes:
Acquiring unit, for obtaining deployed environment locating for the micro services system;
Determination unit, for the portion according to locating for the determination of the corresponding relationship of deployed environment and registration center and the micro services system
The corresponding target registered center of environment is affixed one's name to, the target registered center is one of at least two registration center;
Loading unit loads realization class corresponding with the target registered center for obtaining, starts the target registered center;
Registering unit, the micro services to be registered sent for obtaining first equipment infuse the micro services to be registered
Volume arrives the target registered center.
9. a kind of registration center's management equipment, which is characterized in that including processor and memory, the memory is for storing
One or more programs, one or more of programs are configured to be executed by the processor, and described program includes for holding
Row method as described in any one of claims 1 to 7.
10. a kind of computer readable storage medium, which is characterized in that the computer readable storage medium is for storing electron number
According to the computer program of exchange, wherein the computer program executes computer as described in any one of claim 1~7
Method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811640256.3A CN109547570B (en) | 2018-12-29 | 2018-12-29 | Service registration method, device, registration center management equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811640256.3A CN109547570B (en) | 2018-12-29 | 2018-12-29 | Service registration method, device, registration center management equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109547570A true CN109547570A (en) | 2019-03-29 |
CN109547570B CN109547570B (en) | 2021-07-06 |
Family
ID=65831457
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811640256.3A Active CN109547570B (en) | 2018-12-29 | 2018-12-29 | Service registration method, device, registration center management equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109547570B (en) |
Cited By (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110278284A (en) * | 2019-07-10 | 2019-09-24 | 中国民航信息网络股份有限公司 | A kind of service calling method and device |
CN110381163A (en) * | 2019-07-30 | 2019-10-25 | 普信恒业科技发展(北京)有限公司 | The method and gateway node of gateway node for transmitting service request |
CN110806878A (en) * | 2019-10-30 | 2020-02-18 | 中国联合网络通信集团有限公司 | Service management method, system and storage medium |
CN111309367A (en) * | 2020-02-19 | 2020-06-19 | 北京字节跳动网络技术有限公司 | Method, device, medium and electronic equipment for managing service discovery |
CN111782221A (en) * | 2020-06-29 | 2020-10-16 | 中国电力科学研究院有限公司 | Automatic deployment system and method of power grid dispatching control system |
CN112286503A (en) * | 2020-10-28 | 2021-01-29 | 平安科技(深圳)有限公司 | Multi-registration center micro-service unified management method, device, equipment and medium |
CN112311869A (en) * | 2020-10-28 | 2021-02-02 | 苏州万店掌网络科技有限公司 | Multi-type micro-service registration center management system and method |
CN112738060A (en) * | 2020-12-24 | 2021-04-30 | 平安科技(深圳)有限公司 | Method and device for processing micro-service data, micro-service processing platform and medium |
CN112910943A (en) * | 2019-12-04 | 2021-06-04 | 华为技术有限公司 | Service providing method, device and system |
CN113014666A (en) * | 2021-03-17 | 2021-06-22 | 深圳壹账通智能科技有限公司 | Block chain protocol stack architecture method, system, equipment and storage medium |
CN113347260A (en) * | 2021-06-09 | 2021-09-03 | 广州易行数字技术有限公司 | Micro-service development method based on cloud environment |
CN113746928A (en) * | 2021-09-07 | 2021-12-03 | 中国银行股份有限公司 | Cross-cloud service calling method, device and system |
CN114363403A (en) * | 2021-12-28 | 2022-04-15 | 金蝶医疗软件科技有限公司 | Service access method, system, computer device and storage medium |
CN114500637A (en) * | 2022-02-10 | 2022-05-13 | 广州钛动科技有限公司 | Method, device, equipment and medium for constructing micro-service communication framework |
CN114650317A (en) * | 2020-12-15 | 2022-06-21 | 中国移动通信有限公司研究院 | Micro-service system and micro-service registration, discovery and keep-alive method |
CN115134413A (en) * | 2022-05-16 | 2022-09-30 | 中国人民财产保险股份有限公司 | Registration method of micro service cluster, service request processing method and micro service cluster |
WO2023115579A1 (en) * | 2021-12-24 | 2023-06-29 | 北京小米移动软件有限公司 | Artificial intelligence (ai) service providing method and device |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106991035A (en) * | 2017-04-06 | 2017-07-28 | 北京计算机技术及应用研究所 | A kind of Host Supervision System based on micro services framework |
CN107911430A (en) * | 2017-11-06 | 2018-04-13 | 上海电机学院 | A kind of micro services infrastructure equipment |
US20180136959A1 (en) * | 2016-11-17 | 2018-05-17 | Red Hat, Inc. | Executing code referenced from a microservice registry |
CN108282368A (en) * | 2018-01-24 | 2018-07-13 | 云宏信息科技股份有限公司 | A kind of micro services management system, method and computer storage media |
CN108418862A (en) * | 2018-01-31 | 2018-08-17 | 金蝶软件(中国)有限公司 | Micro services management method and system based on artificial intelligence service cloud platform |
CN108696551A (en) * | 2017-04-06 | 2018-10-23 | 中兴通讯股份有限公司 | The method and apparatus that addressing is asked between system process |
CN109067859A (en) * | 2018-07-20 | 2018-12-21 | 北京航空航天大学 | A kind of double-deck cloud framework system and implementation method towards cross-domain cooperation with service |
-
2018
- 2018-12-29 CN CN201811640256.3A patent/CN109547570B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180136959A1 (en) * | 2016-11-17 | 2018-05-17 | Red Hat, Inc. | Executing code referenced from a microservice registry |
CN106991035A (en) * | 2017-04-06 | 2017-07-28 | 北京计算机技术及应用研究所 | A kind of Host Supervision System based on micro services framework |
CN108696551A (en) * | 2017-04-06 | 2018-10-23 | 中兴通讯股份有限公司 | The method and apparatus that addressing is asked between system process |
CN107911430A (en) * | 2017-11-06 | 2018-04-13 | 上海电机学院 | A kind of micro services infrastructure equipment |
CN108282368A (en) * | 2018-01-24 | 2018-07-13 | 云宏信息科技股份有限公司 | A kind of micro services management system, method and computer storage media |
CN108418862A (en) * | 2018-01-31 | 2018-08-17 | 金蝶软件(中国)有限公司 | Micro services management method and system based on artificial intelligence service cloud platform |
CN109067859A (en) * | 2018-07-20 | 2018-12-21 | 北京航空航天大学 | A kind of double-deck cloud framework system and implementation method towards cross-domain cooperation with service |
Non-Patent Citations (1)
Title |
---|
张晶;黄小锋: "一种基于微服务的应用框架", 《计算机系统应用》 * |
Cited By (23)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110278284A (en) * | 2019-07-10 | 2019-09-24 | 中国民航信息网络股份有限公司 | A kind of service calling method and device |
CN110278284B (en) * | 2019-07-10 | 2021-09-14 | 中国民航信息网络股份有限公司 | Service calling method and device |
CN110381163A (en) * | 2019-07-30 | 2019-10-25 | 普信恒业科技发展(北京)有限公司 | The method and gateway node of gateway node for transmitting service request |
CN110806878A (en) * | 2019-10-30 | 2020-02-18 | 中国联合网络通信集团有限公司 | Service management method, system and storage medium |
CN110806878B (en) * | 2019-10-30 | 2023-07-04 | 中国联合网络通信集团有限公司 | Service management method, system and storage medium |
CN112910943B (en) * | 2019-12-04 | 2024-03-05 | 华为云计算技术有限公司 | Service providing method, device and system |
CN112910943A (en) * | 2019-12-04 | 2021-06-04 | 华为技术有限公司 | Service providing method, device and system |
CN111309367A (en) * | 2020-02-19 | 2020-06-19 | 北京字节跳动网络技术有限公司 | Method, device, medium and electronic equipment for managing service discovery |
CN111309367B (en) * | 2020-02-19 | 2023-07-14 | 北京字节跳动网络技术有限公司 | Method, device, medium and electronic equipment for managing service discovery |
CN111782221A (en) * | 2020-06-29 | 2020-10-16 | 中国电力科学研究院有限公司 | Automatic deployment system and method of power grid dispatching control system |
WO2021203968A1 (en) * | 2020-10-28 | 2021-10-14 | 平安科技(深圳)有限公司 | Method for unified management of micro-services of multiple registration centers, and apparatus, device and medium |
CN112311869A (en) * | 2020-10-28 | 2021-02-02 | 苏州万店掌网络科技有限公司 | Multi-type micro-service registration center management system and method |
CN112286503A (en) * | 2020-10-28 | 2021-01-29 | 平安科技(深圳)有限公司 | Multi-registration center micro-service unified management method, device, equipment and medium |
CN114650317A (en) * | 2020-12-15 | 2022-06-21 | 中国移动通信有限公司研究院 | Micro-service system and micro-service registration, discovery and keep-alive method |
CN112738060A (en) * | 2020-12-24 | 2021-04-30 | 平安科技(深圳)有限公司 | Method and device for processing micro-service data, micro-service processing platform and medium |
CN113014666A (en) * | 2021-03-17 | 2021-06-22 | 深圳壹账通智能科技有限公司 | Block chain protocol stack architecture method, system, equipment and storage medium |
CN113014666B (en) * | 2021-03-17 | 2023-02-28 | 深圳壹账通智能科技有限公司 | Block chain protocol stack architecture method, system, equipment and storage medium |
CN113347260A (en) * | 2021-06-09 | 2021-09-03 | 广州易行数字技术有限公司 | Micro-service development method based on cloud environment |
CN113746928A (en) * | 2021-09-07 | 2021-12-03 | 中国银行股份有限公司 | Cross-cloud service calling method, device and system |
WO2023115579A1 (en) * | 2021-12-24 | 2023-06-29 | 北京小米移动软件有限公司 | Artificial intelligence (ai) service providing method and device |
CN114363403A (en) * | 2021-12-28 | 2022-04-15 | 金蝶医疗软件科技有限公司 | Service access method, system, computer device and storage medium |
CN114500637A (en) * | 2022-02-10 | 2022-05-13 | 广州钛动科技有限公司 | Method, device, equipment and medium for constructing micro-service communication framework |
CN115134413A (en) * | 2022-05-16 | 2022-09-30 | 中国人民财产保险股份有限公司 | Registration method of micro service cluster, service request processing method and micro service cluster |
Also Published As
Publication number | Publication date |
---|---|
CN109547570B (en) | 2021-07-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109547570A (en) | Service registration method, apparatus, registration center's management equipment and storage medium | |
US10282191B2 (en) | Updating web resources | |
CN104158886B (en) | Flow-type performing method for applications | |
CN101616132B (en) | Method for acquiring data, device and system thereof | |
CN109451088A (en) | A kind of data access method and device | |
CN112506617B (en) | Mirror image updating method and device for side car containers in Kubernetes cluster | |
CN110413288A (en) | Using dispositions method, device, server and storage medium | |
CN105208047B (en) | Inserting method and server on distribution system services device | |
CN101808131B (en) | Method for automatically upgrading network terminal edition | |
CN108319463A (en) | A kind of application upgrade method, apparatus | |
CN110968331B (en) | Method and device for running application program | |
JP2012048330A (en) | Cluster system and software deployment method | |
WO2023169175A1 (en) | Request processing method and device, computer equipment, and storage device | |
CN107800814B (en) | Virtual machine deployment method and device | |
CN110704376A (en) | Log file saving method and device | |
CN111221630A (en) | Business process processing method, device, equipment, readable storage medium and system | |
CN109104368A (en) | A kind of request connection method, device, server and computer readable storage medium | |
CN114416508A (en) | Application performance monitoring method and device, storage medium and electronic equipment | |
CN114222003A (en) | Service calling method, system, device, equipment and storage medium | |
CN105897865A (en) | Protocol-independent network file service management system and method | |
CN112698930A (en) | Method, device, equipment and medium for obtaining server identification | |
CN106302639A (en) | A kind of resource downloading method and device | |
CN110730197B (en) | Service discovery method and system | |
CN111400051A (en) | Resource scheduling method, device and system | |
CN114356456A (en) | Service processing method, device, storage medium and electronic equipment |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |