CN110149397A - A kind of micro services integration method and device - Google Patents

A kind of micro services integration method and device Download PDF

Info

Publication number
CN110149397A
CN110149397A CN201910420826.6A CN201910420826A CN110149397A CN 110149397 A CN110149397 A CN 110149397A CN 201910420826 A CN201910420826 A CN 201910420826A CN 110149397 A CN110149397 A CN 110149397A
Authority
CN
China
Prior art keywords
service
micro services
access request
distributed
service access
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
CN201910420826.6A
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.)
Hubei Ecarx Technology Co Ltd
Original Assignee
Hubei Ecarx Technology Co 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 Hubei Ecarx Technology Co Ltd filed Critical Hubei Ecarx Technology Co Ltd
Priority to CN201910420826.6A priority Critical patent/CN110149397A/en
Publication of CN110149397A publication Critical patent/CN110149397A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Abstract

The present invention provides a kind of micro services integration method and devices.This method comprises: receiving the service access request of user;The service access request is distributed to the service cluster in services set group by load balancing for the first time, the services set group includes multiple service clusters independent of each other, and each service cluster includes micro services;Logical process is carried out to the service access request being distributed to by the micro services of the service cluster and obtains response data, and the response data is returned into the user;Wherein, centralised storage, and the log of each service cluster of centralised collection are carried out to the shared data between the multiple service cluster independent of each other.The solution of the present invention has been standardized micro services framework, realize the micro services integrated scheme of out-of-the-box, that is, make operator that can directly carry out building for micro services system, the system for effectively integrating, and building of progress micro services has can horizontal dilatation and high concurrent service ability.

Description

A kind of micro services integration method and device
Technical field
The present invention relates to Internet technical field, especially a kind of micro services integration method and device.
Background technique
Micro services framework is a kind of using single application program as the method for a set of small service exploitation independent.? In micro services framework, every kind of application program is all run in the process of oneself, and passes through lightweight communication mechanism (usually HTTP The API (Application Programming Interface, application programming interface) of resource) it is communicated.These clothes Business is constructed around business function, can carry out independent deployment by full-automatic deployment mechanisms.Also, these services can be used Different programming languages are write, and use different data storage technologies, as long as these services all support mutual communication to assist View.In this way, would not be impacted to total system when being updated upgrading to single service.
Although there are various micro services Integration Modes on the market at present, does not occur one kind also and really do To the integrated scheme of the system of out-of-the-box (that is, operator is allowed directly to be built according to scheme, and being effectively integrated).It is existing Some micro services Integration Modes need developer to carry out installation, debugging, the replacement of each micro services tool, during which can encounter all The mutual function of such as tool repeats, tool is unsatisfactory for demand, there are performance bottleneck, can not unify that tool management is many to ask Topic.
Therefore, there is an urgent need to a kind of unified micro services integrated schemes of out-of-the-box, to support the reality of micro services framework Row.
Summary of the invention
In view of the above problems, it proposes on the present invention overcomes the above problem or at least be partially solved in order to provide one kind State the micro services integration method and device of problem.
One side according to an embodiment of the present invention provides a kind of micro services integration method, comprising:
Receive the service access request of user;
The service access request is distributed to the service cluster in services set group, the clothes by load balancing for the first time Cluster group of being engaged in includes multiple service clusters independent of each other, and each service cluster includes micro services;
Logical process is carried out to the service access request being distributed to by the micro services of the service cluster to be rung Data are answered, and the response data is returned into the user;
Wherein, centralised storage is carried out to the shared data between the multiple service cluster independent of each other, and concentrated Formula collects the log of each service cluster.
Optionally, the services set being distributed to the service access request by load balancing for the first time in services set group Group, comprising:
Viscous session is used when being distributed by load balancing for the first time to the service access request, is guaranteed same The service access request of user is dispensed to the same service cluster.
Optionally, the quantity for the same micro services for including in each service cluster is multiple;
After the service cluster that the service access request is distributed in services set group by load balancing for the first time, The micro services integration method further include:
The micro services being distributed to the service access request by load balancing again in the service cluster.
Optionally, the service access request is distributed to by the micro services in the service cluster by load balancing again, Include:
Viscous session is used when being distributed by load balancing again to the service access request, is guaranteed same The service access request of user is dispensed to the same micro services.
Optionally, before the micro services that the service access request is distributed in the service cluster, the micro services are whole Conjunction method further include:
The service access request is authenticated according to the parameter that the service access request carries, to verify the clothes The legitimacy for access request of being engaged in.
Optionally, synchronous process is changed into asynchronous process by using message queue component by each service cluster, To decouple the association requested access in micro services process between each step.
Optionally, when the micro services of the service cluster carry out logical process to the service access request, pass through the clothes The internal database and/or caching of business cluster carry out data storage and query.
Optionally, each micro services provide service interface by RESTful frame or gRPC frame.
According to another aspect of an embodiment of the present invention, a kind of micro services integrating apparatus is additionally provided, comprising:
First load balancer, suitable for receiving the service access request of user, and by load balancing for the first time by the clothes Business access request is distributed to the service cluster in services set group;
The services set group, including multiple service clusters independent of each other, each service cluster include micro services;It is described Each service cluster is suitable for carrying out the service access request that is distributed to logical process and obtains response data, and by the sound Data are answered to return to the user;
Centralized data base, suitable for storing the shared data between the multiple service cluster independent of each other;And
Centralized log module, suitable for collecting the log of each service cluster.
Optionally, each service cluster includes:
Second load balancer, suitable for being asked the service access for being distributed to the service cluster by load balancing again It asks and is distributed to gateway;
The gateway, suitable for the parameter that is carried according to the service access request that is distributed to the service access request It is authenticated, to verify the legitimacy of the service access request;
Registration center, suitable for responding the behaviour of the gateway after the gateway authenticates the service access request Make the micro services service access request being distributed in the service cluster;
The micro services obtain response data suitable for carrying out logical process to the service access request being distributed to, and The response data is returned into the user;And
Internal database and/or caching, suitable for patrolling in the micro services the service access request being distributed to When collecting processing, data storage and query is carried out for the micro services.
The micro services integration method and device that the embodiment of the present invention proposes, after receiving the service access request of user, The service cluster being first distributed to service access request by load balancing in services set group.Services set group is by multiple phases Mutually independent service cluster composition, is convenient for horizontal dilatation.Each stand-alone service cluster is formed by micro services assembled package, can The complete function of cloud service is provided.Then, after distributing service access request, micro services by service cluster are to being distributed to Service access request carry out logical process and obtain response data, and response data is returned into user.It is carried out in service cluster When processing, centralised storage, and each service cluster of centralised collection are carried out to the shared data between multiple service cluster Log.In this way, standardize micro services framework, realizes the micro services integrated scheme of out-of-the-box, that is, make to operate Person can directly carry out building for micro services system, and the system for carrying out effectively integrating for micro services, and building has and horizontal can expand Appearance and high concurrent service ability.
The above description is only an overview of the technical scheme of the present invention, in order to better understand the technical means of the present invention, And it can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can It is clearer and more comprehensible, the followings are specific embodiments of the present invention.
According to the following detailed description of specific embodiments of the present invention in conjunction with the accompanying drawings, those skilled in the art will be brighter The above and other objects, advantages and features of the present invention.
Detailed description of the invention
By reading the following detailed description of the preferred embodiment, various other advantages and benefits are common for this field Technical staff will become clear.The drawings are only for the purpose of illustrating a preferred embodiment, and is not considered as to the present invention Limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:
Fig. 1 shows the flow chart of micro services integration method according to an embodiment of the invention;
Fig. 2 shows the flow charts of micro services integration method according to another embodiment of the present invention;
Fig. 3 shows the structural schematic diagram of micro services integrating apparatus according to an embodiment of the invention;And
Fig. 4 shows the structural representation of the service cluster in micro services integrating apparatus according to another embodiment of the present invention Figure.
Specific embodiment
Exemplary embodiments of the present disclosure are described in more detail below with reference to accompanying drawings.Although showing the disclosure in attached drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure It is fully disclosed to those skilled in the art.
In order to solve the above technical problems, the embodiment of the present invention proposes a kind of micro services integration method.Fig. 1 is shown according to this Invent the flow chart of the micro services integration method of an embodiment.Referring to Fig. 1, this method at least may comprise steps of S102 extremely Step S106.
Step S102 receives the service access request of user.
Service access request is distributed to the service cluster in services set group by load balancing for the first time by step S104, The services set group includes multiple service clusters independent of each other, and each service cluster includes micro services.
Step S106 carries out logical process to the service access request being distributed to by the micro services of service cluster and is rung Data are answered, and response data is returned into user;Wherein, the shared data between multiple service clusters independent of each other is carried out Centralised storage, and the log of each service cluster of centralised collection.
The micro services integration method that the embodiment of the present invention proposes is logical first after receiving the service access request of user Service access request is distributed to the service cluster in services set group by overload equilibrium.Services set group is by multiple mutually indepedent Service cluster composition, be convenient for horizontal dilatation.Each stand-alone service cluster is formed by micro services assembled package, it is possible to provide cloud Hold the complete function of service.Then, the service after distributing service access request, by the micro services of service cluster to being distributed to Access request carries out logical process and obtains response data, and response data is returned to user.When service cluster is handled, Centralised storage, and the log of each service cluster of centralised collection are carried out to the shared data between multiple service cluster. In this way, standardize micro services framework, realizes the micro services integrated scheme of out-of-the-box, that is, keep operator straight Building for row micro services system is tapped into, the system for carrying out effectively integrating for micro services, and building has can horizontal dilatation and height Concurrent services ability.
In above step S102, the service access request of user can be the micro services provided server and access Http request.
In above step S104, can using be configured with Nginx (Engine X, engine X) agency, Haproxy agency or Service access request is distributed to the service cluster in services set group by the first load balancer of F5 hardware.By using load Balanced device, it is ensured that the service access request of user is all distributed to the service cluster still survived, and makes each independent service Cluster load balance avoids single service cluster pressure excessive, meets high concurrent processing capability requirements.It " still survives herein Service cluster ", which refers to still to have, may be in response to request and provide the service cluster of service processing ability.
Services set group includes multiple having identical function and mutually independent service cluster each other, each independence Service cluster both provide the complete function of cloud service.By so set, when the service for needing dilatation services set group When ability, it can both pass through vertical dilatation, that is, the dilatation processing capacity in each independent service cluster can also pass through water Flat dilatation, that is, increase the number of independent service cluster, the promotion of Lai Jinhang processing capacity.
Each independent service cluster may include multiple internal micro services.These micro services for example can be weather lookup Service, navigation Service, music service etc..These micro services are generally split according to function, and service cluster is to these inside Micro services are combined a system made of encapsulation, are a minimal set units of global function service.Each micro services can be with Service interface is provided by RESTful frame or gRPC frame.REST (Representational State Transfer, table State character state transfer) refer to one group of framework constraint condition and principle, meet these constraint conditions and principle application program or Design is exactly RESTful.Compared to the WWW Web service interaction schemes of other mainstreams, the software architecture based on RESTful frame It is more succinct, more have levels, it is easier to realize the mechanism such as caching.External http interface is provided for micro services by RESTful frame, Micro services can be realized with simpler light weight.GRPC is general high-performance RPC (the Remote Procedure of Google open source Call, remote procedure call) frame, it supports to write using data exchange agreement Protocol Buffers (agreement buffering) Service definition supports more multilingual expansion platform and possesses powerful Binary Serialization tool set.It is micro- by gRPC frame Service provides RPC service, and the micro services application on a server can be made to call directly on another different server Micro services application, to more easily realize Distributed Application and service.
In a kind of optional embodiment every time, if it is desired to guarantee that same user accesses the same service cluster (or same server) can then use viscous session when being distributed by load balancing for the first time to service access request (Sticky Session) guarantees that the service access request of the same user is dispensed to the same service cluster.Specifically, may be used To open viscous session on the first load balancer, in this way, for the same Client-initiated access request, once by After Nginx, Haproxy or F5 proxy server, user identifier cookie will be added automatically, then next will keep same The request of one user accesses the same independent service cluster of rear end always.
Mentioned above, each service cluster includes the micro services of multiple and different functions.In a kind of optional embodiment, In order to increase availability, the service cluster where preventing some micro services delay machine and leading to it is unavailable, in each service cluster The quantity of the micro services for the same function of including can be multiple.
After the request that first load balancer forwards reaches independent service cluster, the independent service cluster energy It is enough completely to service user's request.Preferably, load balancing again can also be passed through inside each independent service cluster The service access request for entering the service cluster is distributed again, service access request is distributed in the service cluster Micro services, to facilitate the configuration of multiple domain name, more resource paths.Specifically, can be used be configured with Nginx agency, Second load balancer of Haproxy agency or F5 hardware carries out the distribution of load balancing again.
In a kind of optional embodiment, if it is desired to guarantee same user access every time the same micro services (or Same machine), then viscous session can be used when being distributed by load balancing again to service access request, guaranteed The service access request of the same user is dispensed to the same micro services.Specifically, it can be opened on the second load balancer Viscous session is opened, in this way, taking for the same Client-initiated access request once acting on behalf of by Nginx, Haproxy or F5 It is engaged in after device, user identifier cookie will be added automatically, then after next accessing the request for keeping the same user always The same micro services (ISP) at end.
In a kind of optional embodiment, the service access request for entering service cluster is being distributed to the service cluster In micro services before, can also according to service access request carry parameter the service access request is authenticated, with school The legitimacy of service access request is tested, to increase the safety of access operation.What service access request mentioned herein carried Parameter may include using public key appKey and token token, using public key appKey and current time stamp and signature sign At least one Deng.Signature mentioned herein is appKey, carries out hmac to band parameter network address using private key appSecret (Hashed Message Authentication Code, hashed message authentication code)/sha256 (Secure Hash Algorithm 256, Secure Hash Algorithm 256) encryption after signature.
In one embodiment, can operation by gateway to be authenticated to service access request, for example, by using AnyRouter (software gateway).The quantity of gateway can be to be multiple, to promote the processing capacity of gateway.
In a kind of specific embodiment, the service access request of user is distributed to services set by the first load balancer After group, which is distributed to gateway for the service access request of user by its second internal load balancer, makes each A gateway load-balancing avoids single gateway pressure excessive.Gateway is authenticated and is passed through to the service access request being distributed to Afterwards, the micro services being distributed to the service access request of user by registration center in the service cluster.
In above step S106, the micro services in service cluster carry out logical process simultaneously to the service access request being distributed to User is returned data to, to realize cloud service.Herein, logical process, which refers to, asks service access according to scheduled service logic Seek the processing operation of progress.
In the micro services framework of the embodiment of the present invention, centralization DB (Database, database) is used, for more Shared data between a service cluster independent of each other carries out centralised storage.One can be only disposed in a general computer room Centralized DB.In the micro services framework of the embodiment of the present invention, centralized log Log collection system is additionally used, for collecting The log of each service cluster printing, consequently facilitating the later period checking and saving.Specifically, centralized log Log collection system The realization such as log collection tool can be used, the log of collection is saved to such as SD card (Secure Digital Memory Card, safe digital memory card) etc. in memories.
The day for being stored in centralized DB by the data for sharing multiple service clusters, and each service cluster being printed Will is collected in centralized Log collection system, and each independent service cluster is all received with centralization DB and centralization Log respectively Collecting system communication, standardize micro services framework, and improves the overall performance of micro services framework.
Further, in a kind of optional embodiment, the micro services in service cluster carry out service access request When logical process, data storage and query can also be carried out by the internal database and/or caching of the service cluster, thus plus Fast service response speed.
In embodiments of the present invention, it is also provided with internal database DB in each independent service cluster, for tying The storage of structure data.Even if inside DB provides read-only function for each micro services in the service cluster and some low volume datas are lost Also unconcerned data are lost to save.It is also provided with inner buffer in each independent service cluster, which is should Each micro services provide caching function in service cluster, and the high speed for cluster internal configuration is read, to accelerate service response Speed.Inner buffer generally can be by redis (Remote Dictionary Server, long-range Dictionary server) storage system It realizes.
It, can also be in each independent service cluster in order to further enhance the overall system performance of micro services framework Portion replaces database using caching to carry out the lookup of data, to accelerate search speed, improves treatment effeciency.
It, can also be inside each independent service cluster, by optimizing respectively in incognito in a kind of optional embodiment Method of calling between business carrys out lifting system performance.For example, client load can be used by eureka service discovery framework Balance policy allows each micro services to call directly each other.
It, can also be by the way that the database inside each independent service cluster be set in another optional embodiment It is set to read and write abruption and carrys out lifting system performance.
It, can also be inside each independent service cluster, by using message in another optional embodiment Synchronous process is become asynchronous process by queue element, and decoupling requests access to the association that each step is mutual in micro services process, from And lifting system performance.Message queue component can be for example RabbitMQ etc..RabbitMQ is to realize advanced message queue The open source message broker software of agreement (Advanced Message Queuing Protocol, AMQP) is (also known as message-oriented Middleware), it can be used for solving the coupled problem of micro services by message queue.
A variety of implementations of the links of embodiment illustrated in fig. 1 are described above, specific embodiment will be passed through below The realization process of micro services integration method of the invention is discussed in detail.
Fig. 2 shows the flow diagrams of the micro services integration method of a specific embodiment according to the present invention.Institute referring to fig. 2 Show, this method may comprise steps of S202 to step S210.
Step S202 receives the http request for the access micro services that user sends.
In the present embodiment, which is, for example, to inquire weather.
Http request is distributed to the service cluster in services set group, the clothes by load balancing for the first time by step S204 Cluster group of being engaged in includes multiple service clusters independent of each other, and each service cluster includes multiple micro services.
In this step, carried out using the first load balancer for being configured with Nginx agency, Haproxy agency or F5 hardware The request distribution of load balancing for the first time.
The http request for entering the service cluster is distributed in the service cluster by step S206 by load balancing again Gateway.
In this step, using be configured with Nginx act on behalf of Haproxy agency or F5 hardware the second load balancer carry out again The request of secondary load balancing is distributed.Gateway is embodied as AnyRouter.
Step S208 after gateway is authenticated and passed through to the http request being distributed to, is asked http by registration center Seek the micro services being distributed in the service cluster.
In this step, gateway applies public key appKey and token token, using public key by what http request uploaded At least one appKey and current time stamp and signature sign etc. verify the legitimacy of http request.Signature mentioned herein For appKey, using private key appSecret to the signature carried out with parameter network address after hmac/sha256 encryption.
Step S210, micro services carry out logical process to the http request that is distributed to and obtain response data, and by number of responses According to returning to user.
In step S210, when micro services carry out logical process to the http request being distributed to, pass through the service cluster Internal database and/or caching carry out data storage and query.
In the present embodiment, user access micro services during the entire process of, to multiple service cluster independent of each other it Between shared data carry out centralised storage, and the log of each service cluster of centralised collection.
Micro services integrated scheme provided in this embodiment acts on behalf of front end user request by using Open-Source Tools, and combines Leading micro services frame, is packaged micro services in industry, and micro services of having standardized framework is provided with directive significance Micro services integrated scheme, has reached micro services, can horizontal dilatation, high concurrent, the target of High Availabitity.
Based on the same inventive concept, above-mentioned for supporting the embodiment of the invention also provides a kind of micro services integrating apparatus Micro services integration method provided by any one embodiment or combinations thereof.Fig. 3 shows according to an embodiment of the invention micro- The structural schematic diagram of service assembly device 300.Referring to Fig. 3, the device 300 at least may include: the first load balancer 310, Services set group 320, centralized data base 330 and centralized log module 340.
It now introduces between each composition of the micro services integrating apparatus 300 of the embodiment of the present invention or the function and each section of device Connection relationship:
First load balancer 310 will be serviced suitable for receiving the service access request of user, and by load balancing for the first time Access request is distributed to the service cluster in services set group 320.The service access request of user mentioned herein can be visit Ask the http request for the micro services that server provides.First load balancer 310 can be to be configured with Nginx agency, Haproxy The load balancer of agency or F5 hardware.
Services set group 320 connect with the first load balancer 310, including multiple service clusters independent of each other 321, Each service cluster includes micro services 3211.Each service cluster 321 carries out logical process to the service access request being distributed to Response data is obtained, and response data is returned into user.
Each independent service cluster 321 may include multiple internal micro services 3211.These micro services for example can be Weather lookup service, navigation Service, music service etc..These micro services are generally split according to function, and service cluster 321 is A system made of encapsulation is combined to these inside micro services 3211, is a minimal set list of global function service Position.Each micro services 3211 can provide service interface by RESTful frame or gRPC frame.Specifically, can pass through RESTful frame provides external http interface, or provides RPC service by gRPC frame
Centralized data base 330 is connect with services set group 320, is suitable for storing multiple service cluster independent of each other Between shared data.
Centralized log module 340, connect with services set group 320, suitable for collecting the log of each service cluster.
Each independent service cluster 321 is all led to centralized data base 330 and centralized log module 340 respectively News.
Further, the first load balancer 310 is further adapted for:
Viscous session is used when being distributed by load balancing for the first time to service access request, guarantees the same user Service access request be dispensed to the same service cluster 321.
In an alternative embodiment, shown in Figure 4, each service cluster 321 can also include that the second load is equal Weighing apparatus 3212, suitable for the service access request for entering service cluster 321 is distributed to the service cluster by load balancing again Micro services 3211 in 321.Second load balancer 3212 can be to be configured with Nginx agency, Haproxy agency or F5 hardware Load balancer.
Further, the second load balancer 3212 is further adapted for:
Viscous session is used when being distributed by load balancing again to service access request, guarantees the same user Service access request be dispensed to the same micro services 3211.
In an alternative embodiment, with continued reference to Fig. 4, each service cluster 321 can also include 3213 He of gateway Registration center 3214.
Gateway 3213 can be AnyRouter, and quantity can have multiple.At this point, the second load balancer 3212 by bearing again It carries equilibrium and the service access request for being distributed to the service cluster 321 is distributed to gateway 3213.Gateway 3213 is according to being distributed to The parameter that service access request carries authenticates the service access request, to verify the legitimacy of the service access request. The parameter that service access request mentioned herein carries can be using public key appKey and token token, using public key At least one appKey and current time stamp and signature sign etc..Signature mentioned herein is appKey, using private key AppSecret is to the signature carried out after hmac/sha256 encryption with parameter network address.In gateway 3213 to service access request After being authenticated and being passed through, service access request is distributed to the service cluster by the operation of 3214 response gateway 3213 of registration center Micro services 3211 in 321.
In an alternative embodiment, with continued reference to Fig. 4, each service cluster 321 can also include internal database 3215 and/or caching 3216.When micro services 3211 carry out logical process to the service access request being distributed to, internal database 3215 and/or caching 3216 for micro services 3211 carry out data storage and query.
According to the combination of any one above-mentioned alternative embodiment or multiple alternative embodiments, the embodiment of the present invention can reach It is following the utility model has the advantages that
The micro services integration method and device that the embodiment of the present invention proposes, after receiving the service access request of user, The service cluster being first distributed to service access request by load balancing in services set group.Services set group is by multiple phases Mutually independent service cluster composition, is convenient for horizontal dilatation.Each stand-alone service cluster is formed by micro services assembled package, can The complete function of cloud service is provided.Then, after distributing service access request, micro services by service cluster are to being distributed to Service access request carry out logical process and obtain response data, and response data is returned into user.It is carried out in service cluster When processing, centralised storage, and each service cluster of centralised collection are carried out to the shared data between multiple service cluster Log.In this way, standardize micro services framework, realizes the micro services integrated scheme of out-of-the-box, that is, make to operate Person can directly carry out building for micro services system, and the system for carrying out effectively integrating for micro services, and building has and horizontal can expand Appearance and high concurrent service ability.
It is apparent to those skilled in the art that the specific work of the system of foregoing description, device and unit Make process, can refer to corresponding processes in the foregoing method embodiment, for brevity, does not repeat separately herein.
In addition, each functional unit in each embodiment of the present invention can be physically independent, can also two or More than two functional units integrate, and can be all integrated in a processing unit with all functional units.It is above-mentioned integrated Functional unit both can take the form of hardware realization, can also be realized in the form of software or firmware.
Those of ordinary skill in the art will appreciate that: if the integrated functional unit is realized and is made in the form of software It is independent product when selling or using, can store in a computer readable storage medium.Based on this understanding, Technical solution of the present invention is substantially or all or part of the technical solution can be embodied in the form of software products, The computer software product is stored in a storage medium comprising some instructions, with so that calculating equipment (such as Personal computer, server or network equipment etc.) various embodiments of the present invention the method is executed when running described instruction All or part of the steps.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (ROM), random access memory Device (RAM), the various media that can store program code such as magnetic or disk.
Alternatively, realizing that all or part of the steps of preceding method embodiment can be (all by the relevant hardware of program instruction Such as personal computer, the calculating equipment of server or network equipment etc.) it completes, described program instruction can store in one In computer-readable storage medium, when described program instruction is executed by the processor of calculating equipment, the calculating equipment is held The all or part of the steps of row various embodiments of the present invention the method.
Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention., rather than its limitations;To the greatest extent Present invention has been described in detail with reference to the aforementioned embodiments for pipe, those skilled in the art should understand that: at this Within the spirit and principle of invention, it is still possible to modify the technical solutions described in the foregoing embodiments or right Some or all of the technical features are equivalently replaced;And these are modified or replaceed, and do not make corresponding technical solution de- From protection scope of the present invention.

Claims (10)

1. a kind of micro services integration method characterized by comprising
Receive the service access request of user;
The service access request is distributed to the service cluster in services set group, the services set by load balancing for the first time Group includes multiple service clusters independent of each other, and each service cluster includes micro services;
Logical process is carried out to the service access request being distributed to by the micro services of the service cluster and obtains number of responses According to, and the response data is returned into the user;
Wherein, centralised storage is carried out to the shared data between the multiple service cluster independent of each other, and centralization is received Collect the log of each service cluster.
2. micro services integration method according to claim 1, which is characterized in that by load balancing for the first time by the service Access request is distributed to the service cluster in services set group, comprising:
Viscous session is used when being distributed by load balancing for the first time to the service access request, guarantees the same user Service access request be dispensed to the same service cluster.
3. micro services integration method according to claim 1, which is characterized in that include in each service cluster is same The quantity of micro services is multiple;
After the service cluster that the service access request is distributed in services set group by load balancing for the first time, also wrap It includes:
The micro services being distributed to the service access request by load balancing again in the service cluster.
4. micro services integration method according to claim 3, which is characterized in that by load balancing again by the service Access request is distributed to the micro services in the service cluster, comprising:
Viscous session is used when being distributed by load balancing again to the service access request, guarantees the same user Service access request be dispensed to the same micro services.
5. micro services integration method according to claim 3, which is characterized in that be distributed to by the service access request Before micro services in the service cluster, further includes:
The service access request is authenticated according to the parameter that the service access request carries, is visited with verifying the service Ask the legitimacy of request.
6. micro services integration method according to any one of claims 1-5, which is characterized in that each service cluster By using message queue component, synchronous process is changed into asynchronous process, is requested access in micro services process with decoupling and is respectively walked Association between rapid.
7. micro services integration method according to any one of claims 1-5, which is characterized in that the service cluster it is micro- When service carries out logical process to the service access request, carried out by the internal database and/or caching of the service cluster Data storage and query.
8. micro services integration method according to any one of claims 1-5, which is characterized in that each micro services pass through RESTful frame or gRPC frame provide service interface.
9. a kind of micro services integrating apparatus characterized by comprising
First load balancer visits the service suitable for receiving the service access request of user, and by load balancing for the first time Ask the service cluster that request is distributed in services set group;
The services set group, including multiple service clusters independent of each other, each service cluster include micro services;It is described each Service cluster is suitable for carrying out the service access request that is distributed to logical process and obtains response data, and by the number of responses According to returning to the user;
Centralized data base, suitable for storing the shared data between the multiple service cluster independent of each other;And
Centralized log module, suitable for collecting the log of each service cluster.
10. micro services integrating apparatus according to claim 9, which is characterized in that each service cluster includes:
Second load balancer, suitable for the service access request point of the service cluster will be distributed to by load balancing again It is sent to gateway;
The gateway, the parameter suitable for being carried according to the service access request being distributed to carry out the service access request Authentication, to verify the legitimacy of the service access request;
Registration center, the operation suitable for after the gateway authenticates the service access request, responding the gateway will The service access request is distributed to the micro services in the service cluster;
The micro services obtain response data suitable for carrying out logical process to the service access request that is distributed to, and by institute It states response data and returns to the user;And
Internal database and/or caching, suitable for being carried out at logic in the micro services to the service access request being distributed to When reason, data storage and query is carried out for the micro services.
CN201910420826.6A 2019-05-20 2019-05-20 A kind of micro services integration method and device Pending CN110149397A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910420826.6A CN110149397A (en) 2019-05-20 2019-05-20 A kind of micro services integration method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910420826.6A CN110149397A (en) 2019-05-20 2019-05-20 A kind of micro services integration method and device

Publications (1)

Publication Number Publication Date
CN110149397A true CN110149397A (en) 2019-08-20

Family

ID=67592242

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910420826.6A Pending CN110149397A (en) 2019-05-20 2019-05-20 A kind of micro services integration method and device

Country Status (1)

Country Link
CN (1) CN110149397A (en)

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110602115A (en) * 2019-09-19 2019-12-20 郑明达 Security decision method and system based on micro-service
CN110944067A (en) * 2019-12-27 2020-03-31 华为技术有限公司 Load balancing method and server
CN111225030A (en) * 2019-12-16 2020-06-02 航天信息股份有限公司 Method and system for selecting micro-service based on trust evaluation strategy
CN111291360A (en) * 2020-01-21 2020-06-16 中电福富信息科技有限公司 Big data authority management method and system based on service governance
CN111638972A (en) * 2020-05-07 2020-09-08 北京仁科互动网络技术有限公司 Request response method, system, equipment and storage medium based on micro-service
CN111880908A (en) * 2020-06-28 2020-11-03 北京沃东天骏信息技术有限公司 Distributed transaction processing method and device and storage medium
CN112346899A (en) * 2020-11-06 2021-02-09 北京北信源软件股份有限公司 Method and device for optimizing microservice performance
CN112448848A (en) * 2020-11-13 2021-03-05 上海电器科学研究所(集团)有限公司 Automatic capacity expansion method based on micro-service
CN112506630A (en) * 2020-12-01 2021-03-16 国科晋云技术有限公司 Multi-domain service platform architecture
CN112671882A (en) * 2020-12-18 2021-04-16 上海安畅网络科技股份有限公司 Same-city double-activity system and method based on micro-service
CN112738220A (en) * 2020-12-28 2021-04-30 杭州迪普科技股份有限公司 Management method, load balancing method and load balancing device of server cluster
CN112769828A (en) * 2021-01-11 2021-05-07 深圳市洪堡智慧餐饮科技有限公司 Asynchronous microservice method based on sanic
CN112968943A (en) * 2021-02-01 2021-06-15 国网安徽省电力有限公司 Electric power is platform in coordination
CN113032000A (en) * 2021-03-22 2021-06-25 四川众信佳科技发展有限公司 Intelligent operation data management device and method and computer system
CN113381947A (en) * 2021-04-15 2021-09-10 北京开元华创信息技术有限公司 Data exchange all-in-one machine
WO2021179493A1 (en) * 2020-03-09 2021-09-16 平安科技(深圳)有限公司 Microservice-based load balancing method, apparatus and device, and storage medium
CN114928635A (en) * 2021-02-02 2022-08-19 嘉联支付有限公司 Micro-service calling method and related equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105812488A (en) * 2016-05-06 2016-07-27 深圳前海大数点科技有限公司 Cloud computing distributed service cluster system and method of using the system
CN108270818A (en) * 2016-12-30 2018-07-10 中国移动通信集团公司 A kind of micro services architecture system and its access method
CN108933807A (en) * 2017-05-27 2018-12-04 广州市呼百应网络技术股份有限公司 A kind of layer-stepping project service platform
CN109672612A (en) * 2018-12-13 2019-04-23 中国电子科技集团公司电子科学研究院 API gateway system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105812488A (en) * 2016-05-06 2016-07-27 深圳前海大数点科技有限公司 Cloud computing distributed service cluster system and method of using the system
CN108270818A (en) * 2016-12-30 2018-07-10 中国移动通信集团公司 A kind of micro services architecture system and its access method
CN108933807A (en) * 2017-05-27 2018-12-04 广州市呼百应网络技术股份有限公司 A kind of layer-stepping project service platform
CN109672612A (en) * 2018-12-13 2019-04-23 中国电子科技集团公司电子科学研究院 API gateway system

Cited By (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110602115A (en) * 2019-09-19 2019-12-20 郑明达 Security decision method and system based on micro-service
CN110602115B (en) * 2019-09-19 2022-03-29 郑明达 Security decision method and system based on micro-service
CN111225030A (en) * 2019-12-16 2020-06-02 航天信息股份有限公司 Method and system for selecting micro-service based on trust evaluation strategy
CN110944067A (en) * 2019-12-27 2020-03-31 华为技术有限公司 Load balancing method and server
CN111291360A (en) * 2020-01-21 2020-06-16 中电福富信息科技有限公司 Big data authority management method and system based on service governance
CN111291360B (en) * 2020-01-21 2023-05-26 中电福富信息科技有限公司 Big data authority management method and system based on service management
WO2021179493A1 (en) * 2020-03-09 2021-09-16 平安科技(深圳)有限公司 Microservice-based load balancing method, apparatus and device, and storage medium
CN111638972A (en) * 2020-05-07 2020-09-08 北京仁科互动网络技术有限公司 Request response method, system, equipment and storage medium based on micro-service
CN111638972B (en) * 2020-05-07 2023-09-01 北京仁科互动网络技术有限公司 Request response method, system, equipment and storage medium based on micro-service
CN111880908A (en) * 2020-06-28 2020-11-03 北京沃东天骏信息技术有限公司 Distributed transaction processing method and device and storage medium
CN112346899B (en) * 2020-11-06 2024-02-09 北京北信源软件股份有限公司 Micro-service performance optimization method and device
CN112346899A (en) * 2020-11-06 2021-02-09 北京北信源软件股份有限公司 Method and device for optimizing microservice performance
CN112448848A (en) * 2020-11-13 2021-03-05 上海电器科学研究所(集团)有限公司 Automatic capacity expansion method based on micro-service
CN112506630A (en) * 2020-12-01 2021-03-16 国科晋云技术有限公司 Multi-domain service platform architecture
CN112671882A (en) * 2020-12-18 2021-04-16 上海安畅网络科技股份有限公司 Same-city double-activity system and method based on micro-service
CN112671882B (en) * 2020-12-18 2022-03-01 上海安畅网络科技股份有限公司 Same-city double-activity system and method based on micro-service
CN112738220A (en) * 2020-12-28 2021-04-30 杭州迪普科技股份有限公司 Management method, load balancing method and load balancing device of server cluster
CN112738220B (en) * 2020-12-28 2023-02-28 杭州迪普科技股份有限公司 Management method, load balancing method and load balancing equipment of server cluster
CN112769828A (en) * 2021-01-11 2021-05-07 深圳市洪堡智慧餐饮科技有限公司 Asynchronous microservice method based on sanic
CN112769828B (en) * 2021-01-11 2022-12-02 广西洪堡智链科技有限公司 Asynchronous microservice method based on sanic
CN112968943A (en) * 2021-02-01 2021-06-15 国网安徽省电力有限公司 Electric power is platform in coordination
CN114928635A (en) * 2021-02-02 2022-08-19 嘉联支付有限公司 Micro-service calling method and related equipment
CN113032000A (en) * 2021-03-22 2021-06-25 四川众信佳科技发展有限公司 Intelligent operation data management device and method and computer system
CN113381947A (en) * 2021-04-15 2021-09-10 北京开元华创信息技术有限公司 Data exchange all-in-one machine

Similar Documents

Publication Publication Date Title
CN110149397A (en) A kind of micro services integration method and device
WO2020228505A1 (en) Method, device, and system for selecting mobile edge computing node
JP7252356B2 (en) MOBILE EDGE COMPUTING NODE SELECTION METHOD, APPARATUS AND SYSTEM AND COMPUTER PROGRAM
Hosseinioun et al. aTask scheduling approaches in fog computing: A survey
US10044622B2 (en) Load balancing for a virtual networking system
US9021245B2 (en) Applying settings in a cloud computing environment based on geographical region
US11616831B1 (en) Point to node in a multi-tiered middleware environment
US11095716B2 (en) Data replication for a virtual networking system
US20090327460A1 (en) Application Request Routing and Load Balancing
US7953887B2 (en) Asynchronous automated routing of user to optimal host
US20070073829A1 (en) Partitioning data across servers
US9276860B2 (en) Distributed data center technology
US9065832B2 (en) Method and apparatus for automated network connectivity for managed application components within a cloud
EP2633667A2 (en) System and method for on the fly protocol conversion in obtaining policy enforcement information
US10826981B2 (en) Processing requests with updated routing information
US9354940B2 (en) Provisioning tenants to multi-tenant capable services
US20180091631A1 (en) Systems and methods for writing prioritized http/2 data to a socket buffer
CN109819055A (en) Method that is a kind of while supporting Ribbon and Eureka to realize load balancing
CN110661780A (en) Wireless city data sharing method and system based on SAAS application
CN103546504B (en) Load-balancing device virtualization system and method based on application layer isolation
WO2012034397A1 (en) Method and system for implementing content delivery network interconnection
EP3170089B1 (en) Brokering data access requests and responses
CN114285857A (en) Load balancing method, device and system
US10958580B2 (en) System and method of performing load balancing over an overlay network
Rocha et al. CNS-AOM: design, implementation and integration of an architecture for orchestration and management of cloud-network slices

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190820