CN109814917A - Micro services dissemination method, device, computer equipment and storage medium - Google Patents

Micro services dissemination method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN109814917A
CN109814917A CN201910040516.1A CN201910040516A CN109814917A CN 109814917 A CN109814917 A CN 109814917A CN 201910040516 A CN201910040516 A CN 201910040516A CN 109814917 A CN109814917 A CN 109814917A
Authority
CN
China
Prior art keywords
micro services
offline
current
service
business
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
CN201910040516.1A
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.)
Ping An Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty Insurance Company of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN201910040516.1A priority Critical patent/CN109814917A/en
Publication of CN109814917A publication Critical patent/CN109814917A/en
Pending legal-status Critical Current

Links

Abstract

This application involves a kind of micro services dissemination method, device, computer equipment and storage mediums.The described method includes: when the new version for receiving current micro services services posting request; obtain the offline scheme of the legacy version service of the current micro services; be provided with the identification information of key business in the offline scheme in advance, the key business is the business for not allowing to shut down at any time;The current task queue of the current micro services is detected with the presence or absence of key business according to the identification information of the key business;If there are the key businesses for the current task queue, the offline duration of delay of the legacy version service is determined according to the current task queue;The legacy version service for controlling the current micro services according to the offline duration of the delay and the offline scheme is offline and new version service is issued.The problems such as loss of data and file corruption can be evaded as far as possible using this method.

Description

Micro services dissemination method, device, computer equipment and storage medium
Technical field
This application involves field of computer technology, more particularly to a kind of micro services dissemination method, device, computer equipment And storage medium.
Background technique
One application program can be to be made of multiple small, mutually independent micro services, and micro services are fine-grained only Vertical service.It is one group of mutual cooperation that micro services architecture mode, which is by large-scale, complicated, long-term running application builds, Micro services, each micro services can be disposed independently, can also be by independent extension and flexible.As Internet technology is fast-developing, The publication amount of micro services is continuously increased.
It is that service publication is carried out using script command mode, this mode can will take in traditional service published method The request being carrying out in business is broken in, especially in the framework based on micro services, shuts down distribution scheme pole using above It is possible that the problems such as bringing loss of data or file corruption.
Summary of the invention
Based on this, it is necessary in view of the above technical problems, provide a kind of micro services dissemination method, device, computer equipment And storage medium, Data Data can be evaded as far as possible and lost or the problems such as file corruption.
A kind of micro services dissemination method, this method comprises:
When the new version for receiving current micro services services posting request, the legacy version service of current micro services is obtained Offline scheme is provided with the identification information of key business in offline scheme in advance, and key business is the industry for not allowing to shut down at any time Business;
The current task queue of current micro services is detected with the presence or absence of key business according to the identification information of key business;
If there are key businesses for current task queue, determine that the delay of legacy version service is offline according to current task queue Duration;
Offline and new version service is serviced according to the legacy version that the offline duration of delay and offline scheme control current micro services Publication.
Above-mentioned micro services dissemination method in one of the embodiments, further include:
After the current task queue for obtaining current micro services, control first node completes the legacy version of current micro services Before servicing the service publication of offline and new version, the service request for being sent to first node is obtained;
The service request for being sent to first node is transmitted to second node to handle, first node and second node are The different disposal node in multiple processing nodes of current micro services is carried out jointly.
In one of the embodiments, it is above-mentioned according to current task queue determine legacy version service delay it is offline when It is long, comprising:
The task processing speed value for obtaining current micro services, determines waiting task amount according to current task queue;
The offline duration of delay of legacy version service is determined according to task processing speed value and waiting task amount.
Above-mentioned micro services dissemination method in one of the embodiments, further include:
It is determining to there is the target called and relied on current micro services according to calling service Dependency Specification between preset micro services Calling service dependence between micro services, and current micro services and target micro services;
According to preset service program downtime table, the first plan downtime and the target for obtaining current micro services are micro- Second plan downtime of service;
According to the second plan downtime and calling service dependence adjustment the first plan downtime, wherein When first plan downtime adjusted reaches, the current task of current micro services is detected according to the identification information of key business Queue whether there is key business;
Offline and new version service is serviced according to the legacy version that the offline duration of delay and offline scheme control current micro services Publication, comprising: according to the first plan downtime adjusted, postpone offline duration and the current micro services of offline scheme control Legacy version service offline and new version service publication.
Above-mentioned calling dependence includes the industry between current micro services and target micro services in one of the embodiments, Business processing sequence information;
Above-mentioned plans downtime, packet according to the second plan downtime and calling service dependence adjustment first It includes:
It is if the business processing of current micro services carries out after the business processing of target micro services, the first plan is offline Time is adjusted to the first time after the second plan downtime;
It is if the business processing of current micro services carries out before the business processing of target micro services, the first plan is offline Time is adjusted to the second time before the second plan downtime.
Above-mentioned micro services dissemination method in one of the embodiments, further include:
Determine that business processing depends on the association of current micro services according to calling service Dependency Specification between preset micro services Micro services;
During controlling offline legacy version service and new version service publication, starts preset analog interface, pass through Analog interface simulates current micro services and carries out business processing, obtains analog response as a result, analog response result is returned to association Micro services.
Above-mentioned micro services dissemination method in one of the embodiments, further include:
When after new version service is online, analog interface is closed, the response results of new version service is obtained, new version is taken The response results of business return to association micro services, and real response result is used to indicate association micro services replacement analog response result.
A kind of micro services distributing device, the device include:
Module is obtained, for obtaining current micro services when the new version for receiving current micro services services posting request Legacy version service offline scheme, be provided with the identification information of key business in offline scheme in advance, key business is not permit Perhaps the business shut down at any time;
Whether detection module, the current task queue for detecting current micro services for the identification information according to key business deposit In key business;
Processing module, for, there are when key business, determining legacy version according to current task queue in current task queue The offline duration of the delay of service;
Release module, the legacy version service for controlling current micro services according to the offline duration of delay and offline scheme are offline It services and issues with new version.
A kind of micro services distributing device, comprising:
When the new version for receiving current micro services services posting request, the legacy version service of current micro services is obtained Offline scheme is provided with the identification information of key business in offline scheme in advance, and key business is the industry for not allowing to shut down at any time Business;
The current task queue of current micro services is detected with the presence or absence of key business according to the identification information of key business;
If there are key businesses for current task queue, determine that the delay of legacy version service is offline according to current task queue Duration;
Offline and new version service is serviced according to the legacy version that the offline duration of delay and offline scheme control current micro services Publication.
A kind of computer equipment, including memory and processor, memory are stored with computer program, computer program quilt Processor performs the steps of when executing
When the new version for receiving current micro services services posting request, the legacy version service of current micro services is obtained Offline scheme is provided with the identification information of key business in offline scheme in advance, and key business is the industry for not allowing to shut down at any time Business;
The current task queue of current micro services is detected with the presence or absence of key business according to the identification information of key business;
If there are key businesses for current task queue, determine that the delay of legacy version service is offline according to current task queue Duration;
Offline and new version service is serviced according to the legacy version that the offline duration of delay and offline scheme control current micro services Publication.
A kind of computer readable storage medium is stored thereon with computer program, when computer program is executed by processor It performs the steps of
When the new version for receiving current micro services services posting request, the legacy version service of current micro services is obtained Offline scheme is provided with the identification information of key business in offline scheme in advance, and key business is the industry for not allowing to shut down at any time Business;
The current task queue of current micro services is detected with the presence or absence of key business according to the identification information of key business;
If there are key businesses for current task queue, determine that the delay of legacy version service is offline according to current task queue Duration;
Offline and new version service is serviced according to the legacy version that the offline duration of delay and offline scheme control current micro services Publication.
Above-mentioned micro services dissemination method, device, computer equipment and storage medium are to receive the new of current micro services When versioning service posting request, the offline scheme of the legacy version service of current micro services is obtained, is provided in advance in offline scheme The identification information of key business, key business are the business for not allowing to shut down at any time, are detected according to the identification information of key business The current task queue of current micro services whether there is key business, if current task queue, there are key business, basis is worked as Preceding task queue determines the offline duration of the delay of legacy version service, current in incognito according to the offline duration of delay and the control of offline scheme The legacy version service of business is offline and new version service is issued.In this way, business processing in current task queue can be waited to complete it Control the publication of the new version service of current micro services again afterwards, it can be to avoid the crucial industry for not allowing to shut down at any time being carrying out The problems such as business is interrupted, can evade loss of data or file corruption as far as possible can also evade request interruption, response loss Or the problems such as service disconnection.
Detailed description of the invention
Fig. 1 is the application scenario diagram of micro services dissemination method in one embodiment;
Fig. 2 is the application scenario diagram of micro services dissemination method in another embodiment;
Fig. 3 is the flow diagram of micro services dissemination method in one embodiment;
Fig. 4 is the flow diagram of the request response of step in another embodiment in micro services publication;
Fig. 5 is the flow diagram of micro services dissemination method in another embodiment;
Fig. 6 is the structural block diagram of micro services distributing device in one embodiment;
Fig. 7 is the internal structure chart of computer equipment in one embodiment.
Specific embodiment
It is with reference to the accompanying drawings and embodiments, right in order to which the objects, technical solutions and advantages of the application are more clearly understood The application is further elaborated.It should be appreciated that specific embodiment described herein is only used to explain the application, not For limiting the application.
Micro services dissemination method provided by the present application, can be applied in application environment as shown in Figure 1.Wherein, terminal 102 are communicated with server 104 by network, and terminal 102 can be, but not limited to be various personal computers, notebook electricity Brain, smart phone, tablet computer and portable wearable device, server 104 can be either multiple with independent server The server cluster of server composition is realized.Specifically, server 104 is to receive a micro services (hereinafter referred to as current micro- Service) new version when servicing posting request, obtain the offline scheme of the legacy version service of the micro services, and obtain it is current in incognito The current task queue of business detects current task queue according to the identification information of the key business of acquired offline arrangements With the presence or absence of key business, and if it exists, the offline duration of delay that legacy version service is then determined according to current task queue, according to prolonging Slow offline duration and offline scheme control legacy version service the service publication of offline and new version.Wherein, new version service publication is asked It asks and can be the transmission of terminal 102.In this way, can break in avoid the request that current micro services are carrying out, evade data The problems such as loss, file corruption, request interruption, response loss, service disconnection.
Micro services dissemination method provided by the present application can also be applied in application environment as shown in Figure 2.Such as Fig. 2 institute Show, which includes terminal 202, Platform Server 204 and server cluster 206.Wherein, terminal 202 can be plate The terminals such as computer, laptop, desktop computer.Terminal 202 and Platform Server 204 pass through network connection, platform service Device 304 and server cluster 206 pass through network connection.Platform Server 204 receives the new of the current micro services that terminal 202 is sent The request of versioning service posting request, obtains the offline scheme of the legacy version service of the current micro services, in the offline scheme in advance Identification information configured with key business, key business is the business for not allowing to shut down at any time, according to the mark of key business The current task queue of the current micro services of infomation detection whether there is key business, if current task queue there are key business, The offline duration of delay that legacy version service is then determined according to current task queue is controlled according to the offline duration of delay and offline scheme Legacy version service is offline and new version service is issued.In this way, can be broken in avoid the request that current micro services are carrying out, The problems such as evading loss of data, file corruption, request interruption, response loss, service disconnection.
In one embodiment, as shown in figure 3, providing a kind of micro services dissemination method, it is applied in Fig. 1 in this way Server for or Fig. 2 in server platform be illustrated, comprising the following steps:
Step S302: when the new version for receiving current micro services services posting request, the old of current micro services is obtained The offline scheme of versioning service, is provided with the identification information of key business in offline scheme in advance, key business be do not allow with When the business shut down;
Wherein, the selection of key business can be set according to actual needs, for example, shutdown can be likely to result in data Lose perhaps file corruption business as key business shutdown can also be likely to result in request interruption, response loss or The business of service disconnection is as key business.It can be directed to the respective offline side of legacy version service configuration of each micro services in advance Case configures the identification information of the key business of each micro services in corresponding offline scheme, wherein different micro services Key business can be different.
Step S304: the current task queue of current micro services is detected with the presence or absence of pass according to the identification information of key business Key business;
Here, current task queue, which refers to, has been issued to current micro services and has not carried out what the service request finished was formed Task queue.
Specifically, the current task queue for obtaining current micro services, by the identification information of key business respectively and as predecessor The identification information for each business being engaged in queue carries out matching treatment, if any one in the current task queue or multiple industry The identification information of business and the identification information of key business match, it is determined that current task queue presence does not allow to shut down at any time Key business, if the identification information of whole business and the identification information of key business in current task queue mismatch, Determine that there is no the key businesses for not allowing to shut down at any time in current task queue.
Step S306: if there are key businesses for current task queue, legacy version service is determined according to current task queue The offline duration of delay;
Specifically, when can determine the processing for having handled each business in current task queue according to current task queue It is long, duration is managed according to this determines that the offline duration of delay, the offline duration of the delay are more than or equal to the handling duration.
Step S308: the legacy version service for controlling current micro services according to the offline duration of delay and offline scheme is offline and new Versioning service publication;
Specifically, can be started according to offline scheme pre- when the duration after current time reaches the offline duration of delay If offline script, carry out the legacy version service offline and new version service publication of current micro services.
It in above-mentioned micro services dissemination method, is obtained when the new version for receiving current micro services services posting request The offline scheme of the legacy version service of current micro services is provided with the identification information of key business in offline scheme in advance, crucial Business is the business for not allowing to shut down at any time, and the current task queue of current micro services is detected according to the identification information of key business Legacy version service is determined according to current task queue if there are key businesses for current task queue with the presence or absence of key business The offline duration of delay, offline and new edition is serviced according to the legacy version for postponing offline duration and offline scheme and controlling current micro services This service publication.In this way, business processing in current task queue can be waited to complete the new edition for controlling current micro services again later The publication of this service can be interrupted to avoid the key business for not allowing to shut down at any time being carrying out, can evade as far as possible Loss of data perhaps file corruption the problems such as can also evade request interrupt, response loss or the problems such as service disconnection.
In addition, after the current task queue for obtaining current micro services reception service request can be suspended, or receive Pause processing business request afterwards, (or referred to as online rear) receives business again after the new version service publication of current micro services Request, or the service request that reprocessing receives.
It in one of the embodiments, can be according to T2=T1+ Δ T, which is determined, postpones offline duration, T2When indicating that delay is offline It is long, T1Expression has handled the handling duration of each business in current task queue, and the size of Δ T > 0, Δ T can be according to reality It needs to be determined that.In this way, may further ensure that the request being carrying out to being not disrupted.
Same micro services can also be carried out together by many server nodes sometimes, for example, distributed micro services, more Service can be provided separately in any one service node in server node, can also cooperate with other service nodes and provide clothes Business.For distributed micro services, can using one by one or by the way of the micro services publication of each server node is conducted batch-wise, For example, for there is the distributed micro services of 10 server nodes, can first to one of those or several progress in incognito The new version of business services publication, after the completion of waiting this one or several micro services publication, then carry out another or it is another several The new version of micro services services publication.It, can be by the way of transfer processing in micro services issuing process for this mode Task requests handled.
In one of the embodiments, as shown in figure 4, micro services dissemination method of the invention, can also include micro services Request response of step in publication, the micro services publication in request responding process may include:
Step S402: after the current task queue for obtaining current micro services, control first node is completed currently in incognito The legacy version service of business is offline and new version services before issuing, and obtains the service request for being sent to first node;
Wherein, first node is the current server node for carrying out legacy version and servicing the service publication of offline and new version.It needs To illustrate that it is the process to intercouple that legacy version, which services the service publication of offline and new version, it is not often successively to hold Two capable processes, for example, be not first carried out legacy version service it is offline, then execute new version service publication.
Step S404: being transmitted to second node for the service request for being sent to first node and handle, first node and Second node is the different disposal node carried out in multiple processing nodes of current micro services jointly;
Wherein, second node is one different from first node, and does not carry out legacy version currently and service offline and new version Service the server node of publication.
The scheme of the present embodiment can be applied to distributed micro services, in the present embodiment by the way of transfer processing pair Task requests in service publishing process are handled, in this way, being sent to the service request of first node, do not have to wait first nodes New version service publication is responded again after completing, and can shorten the response time of service request, meanwhile, it can be to avoid obtaining After taking the current task queue of current micro services, the legacy version service that control first node completes current micro services is offline and new Before versioning service publication in this period, service request caused by service request cannot be handled in time handles the problem of being delayed.
Further, the request response of step in the micro services publication in micro services dissemination method of the invention, can be with It include: to send log acquisition request after the new version service of first node is online to second node, receive second node and return Target service log, the target service log be second node execute present node forwarding service request generate business day Will.So, it is ensured that the continuity for the log that first node is recorded.
In one of the embodiments, it is above-mentioned according to current task queue determine legacy version service delay it is offline when It is long, it may include: the task processing speed value for obtaining current micro services, waiting task amount determined according to current task queue; The offline duration of delay of legacy version service is determined according to task processing speed value and waiting task amount.
Wherein, task processing speed value refers to the task treating capacity in the unit time, wherein task processing speed value can root It determines according to the history log of current micro services, specifically, can be determined according to the history log at the task in a specific time period Total amount is managed, with task processing total amount divided by the duration value of the specific time period, obtains task processing speed value.Wherein, at task Reason total amount, which can be, to summarize task production and consumption amount and is calculated according to reporting to log asynchronous in specific time period, when specific Section can be chosen according to actual needs.
Wherein, the offline duration of delay of legacy version service is determined according to task processing speed value and waiting task amount, is had Body, divided by task processing speed value, obtain having handled whole business in current task queue according to waiting task amount Required handling duration, the handling duration can be equal to by postponing offline duration.But preferably, postponing offline duration greater than at this Manage duration.
In one embodiment, as shown in figure 5, providing a kind of micro services dissemination method, it is applied in Fig. 1 in this way Server for or Fig. 2 in server platform be illustrated, comprising the following steps:
Step S502: when the new version for receiving current micro services services posting request, the old of current micro services is obtained The offline scheme of versioning service, is provided with the identification information of key business in offline scheme in advance, key business be do not allow with When the business shut down;
Step S504: according to calling service Dependency Specification between preset micro services it is determining exist with current micro services call according to Calling service dependence between bad target micro services, and current micro services and target micro services;
Wherein, there is the business processing for calling the target micro services relied on to can be current micro services with current micro services to exist After the business processing of target micro services, i.e., the business processing of current micro services depends on the business processing of target micro services, with Current micro services, which exist, calls the target micro services relied on to be also possible to the business processing of current micro services in target micro services It is carried out before business processing, i.e. business processing of the business processing of target micro services dependent on current micro services.
Step S506: according to preset service program downtime table, the of the legacy version service of current micro services is obtained Second plan downtime of one plan downtime and target micro services;
Step S508: when according to the second plan downtime and offline the first plan of calling service dependence adjustment Between;
Step S510: it when the first plan downtime after the adjustment reaches, is detected according to the identification information of key business The current task queue of current micro services whether there is key business;
Step S512: if there are key businesses for current task queue, legacy version service is determined according to current task queue Postpone offline duration;
Step S514: worked as according to the first plan downtime, the offline duration of delay and the control of offline scheme adjusted The legacy version service of preceding micro services is offline and new version service is issued.
Specifically, can after the adjustment first plan downtime after timing duration up to or under delay When line duration, offline service with new version of legacy version service is controlled according to offline scheme and is issued.
In this embodiment scheme, it is associated impact evaluation in conjunction with the offline plan target of each micro services, it can be as far as possible The downline association that ground reduces micro services influences.
Above-mentioned calling dependence may include between current micro services and target micro services in one of the embodiments, Business processing order information;Above-mentioned plans according to the second plan downtime and calling service dependence adjustment first Downtime, if may include: that the business processings of current micro services carries out after the business processing of target micro services, by the One plan downtime is adjusted to the first time after the second plan downtime;If the business processing of current micro services is in mesh It is carried out before marking the business processing of micro services, then the be adjusted to the first plan downtime before the second plan downtime Two times.
In view of micro services publication generally requires certain time-consuming, and business processing has certain successive place between micro services Sequence is made in order, for example, micro services A → micro services B → micro services C → micro services D is passed if micro services B executes new version service publication The mode of system, when the processing node of current business reaches micro services B, after the service of micro services B new version such as needing to complete and handle Micro services C can be just sent to be handled, the handling duration of this meeting deferred traffic.For this purpose, this hair in one of the embodiments, Bright micro services dissemination method can also include: to determine business processing according to calling service Dependency Specification between preset micro services Association micro services dependent on current micro services;During controlling offline legacy version service and new version service publication, open Preset analog interface is moved, current micro services are simulated by analog interface and carry out business processing, obtains analog response as a result, by mould Quasi- response results return to association micro services.
Using the scheme of the present embodiment, if current micro services are micro services B, it are in legacy version and service offline and new edition During this service is issued, micro services C will execute business and need to rely on micro services B, then can star preset simulation and connect Mouthful, micro services B is simulated by the analog interface and carries out business processing, obtains analog response as a result, the analog response result is sent out Give micro services C, in this way, the micro services C and micro services D in the downstream micro services B can carry out business processing, can be with business quickening at Reason process.
Further, the micro services dissemination method of invention can also include: to close mould when after new version service is online Quasi- interface obtains the real response of new version service as a result, real response result is returned to association micro services, real response knot Fruit is used to indicate association micro services replacement analog response result.
In addition, above-mentioned micro services dissemination method in one of the embodiments, can also include: obtain it is current in incognito The exception response information of the association micro services of business;When the exception response information meets preset condition, starts preset simulation and connect Mouthful, the business processing of association micro services is simulated by analog interface, obtains analog response result.
Wherein, exception response information may include that exception response number is excessive or request response time overlength, or default Condition can be set according to actual needs, for example, exception response number is more than that preset times threshold value or request response time are super Cross preset time threshold.
Scheme through this embodiment, can be associated with micro services it is offline when monitor in time, be also convenient for continuing it is subsequent into Journey.
It should be understood that although each step in the flow chart of Fig. 2-5 is successively shown according to the instruction of arrow, These steps are not that the inevitable sequence according to arrow instruction successively executes.Unless expressly stating otherwise herein, these steps Execution there is no stringent sequences to limit, these steps can execute in other order.Moreover, at least one in Fig. 2-5 Part steps may include that perhaps these sub-steps of multiple stages or stage are not necessarily in synchronization to multiple sub-steps Completion is executed, but can be executed at different times, the execution sequence in these sub-steps or stage is also not necessarily successively It carries out, but can be at least part of the sub-step or stage of other steps or other steps in turn or alternately It executes.
In one embodiment, as shown in fig. 6, providing a kind of micro services distributing device, comprising: obtain module 601, inspection Survey module 602, processing module 603 and release module 604, in which:
Module 601 is obtained, for obtaining currently in incognito when the new version for receiving current micro services services posting request The offline scheme of the legacy version service of business, is provided with the identification information of key business in offline scheme in advance, and key business is not The business for allowing to shut down at any time;
Detection module 602, the current task queue for detecting current micro services for the identification information according to key business are It is no that there are key businesses;
Processing module 603, for, there are when key business, determining old edition according to current task queue in current task queue The offline duration of the delay of this service;
Release module 604, for controlling the legacy version service of current micro services according to the offline duration of delay and offline scheme The service publication of offline and new version.
Micro services distributing device can also include request forwarding module in one of the embodiments, which forwards mould Block is used for after the current task queue that detection module 602 detects current micro services whether there is key business, control first Before node completes the offline service publication with new version of legacy version service of current micro services, the industry for being sent to first node is obtained Business request, is transmitted to second node for the service request for being sent to first node and handles, first node and second node are The different disposal node in multiple processing nodes of current micro services is carried out jointly.
Processing module 603 obtains the task processing speed value of current micro services in one of the embodiments, according to current Task queue determines waiting task amount, and the delay of legacy version service is determined according to task processing speed value and waiting task amount Offline duration.
In one of the embodiments, detection module 602 can be also used for according to calling service between preset micro services according to Rely information, it is determining to exist between the target micro services called and relied on, and current micro services and target micro services with current micro services Calling service dependence, according to preset service program downtime table, the first plan for obtaining current micro services is offline The second plan downtime of time and target micro services, according to the second plan downtime and calling service dependence tune Whole first plan downtime;And when the first plan downtime arrival of detection module 602 after the adjustment, according to key business Identification information detect the current task queues of current micro services with the presence or absence of key business;Release module 604 can be according to tune The legacy version service that the first plan downtime, the offline duration of delay and offline scheme after whole control current micro services is offline It services and issues with new version.
Calling dependence in one of the embodiments, includes the business processing between current micro services and target micro services Order information;Detection module 602 current micro services business processing when being carried out after the business processing of target micro services, will First plan downtime is adjusted to the first time after the second plan downtime, exists in the business processing of current micro services When being carried out before the business processing of target micro services, the first plan downtime is adjusted to before the second plan downtime Second time.
Micro services distributing device can also include association control module in one of the embodiments, which controls mould Block is used to determine that business processing is micro- dependent on the association of current micro services according to calling service Dependency Specification between preset micro services Service starts preset analog interface, passes through simulation during controlling offline legacy version service and new version service publication Interface simulates current micro services and carries out business processing, obtains analog response as a result, analog response result is returned to association in incognito Business.
Association control module is also used to close simulation when new version services online rear and connect in one of the embodiments, Mouthful, the response results of new version service are obtained, the response results of new version service are returned into association micro services, real response knot Fruit is used to indicate association micro services replacement analog response result.
Specific about micro services distributing device limits the restriction that may refer to above for micro services dissemination method, This is repeated no more.Modules in above-mentioned micro services distributing device can come fully or partially through software, hardware and combinations thereof It realizes.Above-mentioned each module can be embedded in the form of hardware or independently of in the processor in computer equipment, can also be with software Form is stored in the memory in computer equipment, executes the corresponding operation of the above modules in order to which processor calls.
In one embodiment, a kind of computer equipment is provided, which can be server, internal junction Composition can be as shown in Figure 7.The computer equipment includes processor, memory and the network interface connected by system bus. Wherein, the processor of the computer equipment is for providing calculating and control ability.The memory of the computer equipment includes non-easy The property lost storage medium, built-in storage.The non-volatile memory medium is stored with operating system, computer program and database.It should Built-in storage provides environment for the operation of operating system and computer program in non-volatile memory medium.The computer equipment Network interface be used to communicate with external terminal by network connection.To realize one when the computer program is executed by processor Kind micro services dissemination method.
It will be understood by those skilled in the art that structure shown in Fig. 7, only part relevant to application scheme is tied The block diagram of structure does not constitute the restriction for the computer equipment being applied thereon to application scheme, specific computer equipment It may include perhaps combining certain components or with different component layouts than more or fewer components as shown in the figure.
In one embodiment, a kind of computer equipment, including memory and processor are provided, which is stored with Computer program, the computer program perform the steps of when being executed by processor
When the new version for receiving current micro services services posting request, the legacy version service of current micro services is obtained Offline scheme is provided with the identification information of key business in offline scheme in advance, and key business is the industry for not allowing to shut down at any time Business;
The current task queue of current micro services is detected with the presence or absence of key business according to the identification information of key business;
If there are key businesses for current task queue, determine that the delay of legacy version service is offline according to current task queue Duration;
Offline and new version service is serviced according to the legacy version that the offline duration of delay and offline scheme control current micro services Publication.
In one embodiment, it is also performed the steps of when computer program is executed by processor current in incognito in detection After the current task queue of business whether there is key business, control first node is completed under the legacy version service of current micro services Before line and new version service publication, the service request for being sent to first node is obtained;The business for being sent to first node is asked It asks and is transmitted to second node and is handled, first node and second node are the multiple processing nodes for carrying out current micro services jointly In different disposal node.
In one embodiment, computer program be executed by processor realize it is above-mentioned determined according to current task queue it is old When the step of the offline duration of delay of versioning service, implements following steps: obtaining the task processing speed of current micro services Value, determines waiting task amount according to current task queue;Old edition is determined according to task processing speed value and waiting task amount The offline duration of the delay of this service.
In one embodiment, also performed the steps of when computer program is executed by processor according to it is preset in incognito Calling service Dependency Specification between business, it is determining to there are the target micro services and current micro services called and relied on current micro services Calling service dependence between target micro services;According to preset service program downtime table, current micro services are obtained First plan downtime and target micro services second plan downtime;According to the second plan downtime and business Call dependence adjustment the first plan downtime, wherein when the first plan downtime after the adjustment reaches, according to pass The identification information of key business detects the current task queue of current micro services with the presence or absence of key business;According to the offline duration of delay The legacy version service offline and new version service publication of current micro services is controlled with offline scheme, comprising: according to adjusted the The legacy version that one plan downtime, the offline duration of delay and offline scheme control current micro services services offline and new version Service publication.
In one embodiment, above-mentioned calling dependence may include the industry between current micro services and target micro services Business processing sequence information;It is above-mentioned according to the second plan downtime and business tune that computer program is executed by processor realization When planning the step of downtime with dependence adjustment first, following steps are implemented: if at the business of current micro services Reason carried out after the business processing of target micro services, then by first plan downtime be adjusted to the second plan downtime it First time afterwards;If the business processing of current micro services carries out before the business processing of target micro services, by the first meter It draws downtime and is adjusted to the second time before the second plan downtime.
In one embodiment, also performed the steps of when computer program is executed by processor according to it is preset in incognito Calling service Dependency Specification determines that business processing depends on the association micro services of current micro services between business;In control legacy version service During the service publication of offline and new version, start preset analog interface, by analog interface simulate current micro services into Row business processing obtains analog response as a result, analog response result is returned to association micro services.
In one embodiment, it is also performed the steps of when computer program is executed by processor in new version service When after line, analog interface is closed, the response results of new version service is obtained, the response results of new version service is returned into association Micro services, real response result are used to indicate association micro services replacement analog response result.
In one embodiment, a kind of computer readable storage medium is provided, computer program is stored thereon with, is calculated Machine program performs the steps of when being executed by processor
When the new version for receiving current micro services services posting request, the legacy version service of current micro services is obtained Offline scheme is provided with the identification information of key business in offline scheme in advance, and key business is the industry for not allowing to shut down at any time Business;
The current task queue of current micro services is detected with the presence or absence of key business according to the identification information of key business;
If there are key businesses for current task queue, determine that the delay of legacy version service is offline according to current task queue Duration;
Offline and new version service is serviced according to the legacy version that the offline duration of delay and offline scheme control current micro services Publication.
In one embodiment, it is also performed the steps of when computer program is executed by processor current in incognito in detection After the current task queue of business whether there is key business, control first node is completed under the legacy version service of current micro services Before line and new version service publication, the service request for being sent to first node is obtained;The business for being sent to first node is asked It asks and is transmitted to second node and is handled, first node and second node are the multiple processing nodes for carrying out current micro services jointly In different disposal node.
In one embodiment, computer program be executed by processor realize it is above-mentioned determined according to current task queue it is old When the step of the offline duration of delay of versioning service, implements following steps: obtaining the task processing speed of current micro services Value, determines waiting task amount according to current task queue;Old edition is determined according to task processing speed value and waiting task amount The offline duration of the delay of this service.
In one embodiment, also performed the steps of when computer program is executed by processor according to it is preset in incognito Calling service Dependency Specification between business, it is determining to there are the target micro services and current micro services called and relied on current micro services Calling service dependence between target micro services;According to preset service program downtime table, current micro services are obtained First plan downtime and target micro services second plan downtime;According to the second plan downtime and business Call dependence adjustment the first plan downtime, wherein when the first plan downtime after the adjustment reaches, according to pass The identification information of key business detects the current task queue of current micro services with the presence or absence of key business;According to the offline duration of delay The legacy version service offline and new version service publication of current micro services is controlled with offline scheme, comprising: according to adjusted the The legacy version that one plan downtime, the offline duration of delay and offline scheme control current micro services services offline and new version Service publication.
In one embodiment, above-mentioned calling dependence may include the industry between current micro services and target micro services Business processing sequence information;It is above-mentioned according to the second plan downtime and business tune that computer program is executed by processor realization When planning the step of downtime with dependence adjustment first, following steps are implemented: if at the business of current micro services Reason carried out after the business processing of target micro services, then by first plan downtime be adjusted to the second plan downtime it First time afterwards;If the business processing of current micro services carries out before the business processing of target micro services, by the first meter It draws downtime and is adjusted to the second time before the second plan downtime.
In one embodiment, also performed the steps of when computer program is executed by processor according to it is preset in incognito Calling service Dependency Specification determines that business processing depends on the association micro services of current micro services between business;In control legacy version service During the service publication of offline and new version, start preset analog interface, by analog interface simulate current micro services into Row business processing obtains analog response as a result, analog response result is returned to association micro services.
In one embodiment, it is also performed the steps of when computer program is executed by processor in new version service When after line, analog interface is closed, the response results of new version service is obtained, the response results of new version service is returned into association Micro services, real response result are used to indicate association micro services replacement analog response result.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, the computer program can be stored in a non-volatile computer In read/write memory medium, the computer program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, To any reference of memory, storage, database or other media used in each embodiment provided herein, Including non-volatile and/or volatile memory.Nonvolatile memory may include read-only memory (ROM), programming ROM (PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory.Volatile memory may include Random access memory (RAM) or external cache.By way of illustration and not limitation, RAM is available in many forms, Such as static state RAM (SRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate sdram (DDRSDRAM), enhancing Type SDRAM (ESDRAM), synchronization link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic ram (DRDRAM) and memory bus dynamic ram (RDRAM) etc..
Each technical characteristic of above embodiments can be combined arbitrarily, for simplicity of description, not to above-described embodiment In each technical characteristic it is all possible combination be all described, as long as however, the combination of these technical characteristics be not present lance Shield all should be considered as described in this specification.
The several embodiments of the application above described embodiment only expresses, the description thereof is more specific and detailed, but simultaneously It cannot therefore be construed as limiting the scope of the patent.It should be pointed out that coming for those of ordinary skill in the art It says, without departing from the concept of this application, various modifications and improvements can be made, these belong to the protection of the application Range.Therefore, the scope of protection shall be subject to the appended claims for the application patent.

Claims (10)

1. a kind of micro services dissemination method, which comprises
When the new version for receiving current micro services services posting request, the legacy version service of the current micro services is obtained Offline scheme, is provided with the identification information of key business in the offline scheme in advance, and the key business is not allow at any time The business of shutdown;
It whether there is crucial industry according to the current task queue that the identification information of the key business detects the current micro services Business;
If there are the key businesses for the current task queue, determine that the legacy version takes according to the current task queue The offline duration of the delay of business;
The legacy version service for controlling the current micro services according to the offline duration of the delay and the offline scheme is offline and new Versioning service publication.
2. micro services dissemination method according to claim 1, which is characterized in that the method also includes:
After the current task queue for detecting the current micro services is with the presence or absence of key business, control first node completes institute Before the offline service publication with new version of legacy version service for stating current micro services, the business for being sent to the first node is obtained Request;
The service request for being sent to first node is transmitted to second node to handle, the first node and second section Point is the different disposal node in the multiple processing nodes for carry out jointly the current micro services.
3. micro services dissemination method according to claim 1 or 2, which is characterized in that described according to the current task team Column determine the offline duration of delay of the legacy version service, comprising:
The task processing speed value for obtaining the current micro services, determines waiting task amount according to current task queue;
The offline duration of delay of the legacy version service is determined according to the task processing speed value and the waiting task amount.
4. micro services dissemination method according to claim 1 or 2, which is characterized in that the method also includes:
It is determining to there is the target called and relied on the current micro services according to calling service Dependency Specification between preset micro services Calling service dependence between micro services and the current micro services and the target micro services;
According to preset service program downtime table, the first plan downtime and the mesh of the current micro services are obtained Mark the second plan downtime of micro services;
Plan downtime according to the second plan downtime and calling service dependence adjustment described first, Wherein, when the first plan downtime after the adjustment reaches, according to the detection of the identification information of the key business The current task queue of current micro services whether there is key business;
The legacy version service for controlling the current micro services according to the offline duration of the delay and the offline scheme is offline It services and issues with new version, comprising: according to the first plan downtime, the offline duration of the delay and institute adjusted State the legacy version service offline and new version service publication that offline scheme controls the current micro services.
5. micro services dissemination method according to claim 4, which is characterized in that the calling dependence includes described works as Business processing order information between preceding micro services and the target micro services;
It is described offline according to the second plan downtime and calling service dependence adjustment first plan Time, comprising:
If the business processing of the current micro services carries out after the business processing of the target micro services, by described first Plan downtime is adjusted to the first time after the second plan downtime;
If the business processing of the current micro services carries out before the business processing of the target micro services, by described first Plan downtime is adjusted to the second time before the second plan downtime.
6. micro services dissemination method according to claim 4, which is characterized in that the method also includes:
Determine that business processing depends on the association of the current micro services according to calling service Dependency Specification between preset micro services Micro services;
During the control legacy version services offline and described new version service publication, start preset analog interface, The current micro services are simulated by the analog interface and carry out business processing, obtain analog response as a result, the simulation is rung Should result return to the association micro services.
7. micro services dissemination method according to claim 6, which is characterized in that the method also includes:
When after new version service is online, the analog interface is closed, the response results of the new version service are obtained, it will The response results of the new version service return to the association micro services, and the real response result is used to indicate the association Micro services replace the analog response result.
8. a kind of micro services distributing device, which is characterized in that described device includes:
Module is obtained, for obtaining the current micro services when the new version for receiving current micro services services posting request Legacy version service offline scheme, be provided with the identification information of key business, the key industry in the offline scheme in advance Business is the business for not allowing to shut down at any time;
Detection module, the current task queue for detecting the current micro services according to the identification information of the key business are It is no that there are key businesses;
Processing module, in the current task queue there are when the key business, it is true according to the current task queue The offline duration of delay of the fixed legacy version service;
Release module, for controlling the legacy version of the current micro services according to the offline duration of the delay and the offline scheme Service the service publication of offline and new version.
9. a kind of computer equipment, including memory and processor, the memory are stored with computer program, feature exists In the step of processor realizes any one of claims 1 to 7 the method when executing the computer program.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program The step of method described in any one of claims 1 to 7 is realized when being executed by processor.
CN201910040516.1A 2019-01-16 2019-01-16 Micro services dissemination method, device, computer equipment and storage medium Pending CN109814917A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910040516.1A CN109814917A (en) 2019-01-16 2019-01-16 Micro services dissemination method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910040516.1A CN109814917A (en) 2019-01-16 2019-01-16 Micro services dissemination method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN109814917A true CN109814917A (en) 2019-05-28

Family

ID=66604410

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910040516.1A Pending CN109814917A (en) 2019-01-16 2019-01-16 Micro services dissemination method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109814917A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110705956A (en) * 2019-08-30 2020-01-17 中国人民财产保险股份有限公司 Project coordination method and device based on micro-service architecture and storage medium
CN112350856A (en) * 2020-10-27 2021-02-09 中国联合网络通信集团有限公司 Distributed service sign-off method and equipment
CN112632032A (en) * 2020-12-18 2021-04-09 华人运通(上海)云计算科技有限公司 Data migration method and device, storage medium and terminal equipment
WO2021093671A1 (en) * 2019-11-13 2021-05-20 深圳前海微众银行股份有限公司 Task processing method, system, apparatus and device, and computer readable storage medium
CN115208738A (en) * 2022-06-07 2022-10-18 珠海金智维信息科技有限公司 RPA upgrading system, method and device based on micro-service architecture

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103346914A (en) * 2013-07-03 2013-10-09 曙光信息产业(北京)有限公司 Method and device for topological structure update of distributed file system
CN106850746A (en) * 2016-12-23 2017-06-13 微梦创科网络科技(中国)有限公司 The method and device of smooth service upgrading
CN107528931A (en) * 2016-06-22 2017-12-29 中兴通讯股份有限公司 A kind of adaptive keeping method of IP address based on user behavior, apparatus and system
CN107809445A (en) * 2016-08-31 2018-03-16 阿里巴巴集团控股有限公司 Service request handling system, method and apparatus
CN107948284A (en) * 2017-11-24 2018-04-20 泰康保险集团股份有限公司 A kind of service inserting method, equipment and system based on micro services framework
CN108615139A (en) * 2018-03-15 2018-10-02 阿里巴巴集团控股有限公司 A kind of business rule inserting method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103346914A (en) * 2013-07-03 2013-10-09 曙光信息产业(北京)有限公司 Method and device for topological structure update of distributed file system
CN107528931A (en) * 2016-06-22 2017-12-29 中兴通讯股份有限公司 A kind of adaptive keeping method of IP address based on user behavior, apparatus and system
CN107809445A (en) * 2016-08-31 2018-03-16 阿里巴巴集团控股有限公司 Service request handling system, method and apparatus
CN106850746A (en) * 2016-12-23 2017-06-13 微梦创科网络科技(中国)有限公司 The method and device of smooth service upgrading
CN107948284A (en) * 2017-11-24 2018-04-20 泰康保险集团股份有限公司 A kind of service inserting method, equipment and system based on micro services framework
CN108615139A (en) * 2018-03-15 2018-10-02 阿里巴巴集团控股有限公司 A kind of business rule inserting method and device

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110705956A (en) * 2019-08-30 2020-01-17 中国人民财产保险股份有限公司 Project coordination method and device based on micro-service architecture and storage medium
WO2021093671A1 (en) * 2019-11-13 2021-05-20 深圳前海微众银行股份有限公司 Task processing method, system, apparatus and device, and computer readable storage medium
CN112350856A (en) * 2020-10-27 2021-02-09 中国联合网络通信集团有限公司 Distributed service sign-off method and equipment
CN112632032A (en) * 2020-12-18 2021-04-09 华人运通(上海)云计算科技有限公司 Data migration method and device, storage medium and terminal equipment
CN115208738A (en) * 2022-06-07 2022-10-18 珠海金智维信息科技有限公司 RPA upgrading system, method and device based on micro-service architecture
CN115208738B (en) * 2022-06-07 2023-06-27 珠海金智维信息科技有限公司 RPA upgrading system, method and device based on micro-service architecture

Similar Documents

Publication Publication Date Title
CN109814917A (en) Micro services dissemination method, device, computer equipment and storage medium
CN109474578A (en) Message method of calibration, device, computer equipment and storage medium
CN109558162A (en) Application issued method, apparatus, computer equipment and storage medium
CN105260485B (en) A kind of method and apparatus of data load
RU2631769C2 (en) Method and device for determining objective of information processing
CN101387953A (en) Collaboration software development system and method
CN110209681A (en) Block chain data enter chain method, apparatus, computer equipment and storage medium
WO2020238250A1 (en) Capital chain information tracing method and system, and server and readable storage medium
CN109144799A (en) Integrated testing method, apparatus, computer equipment and storage medium
CN108933994B (en) Short message distribution processing method and device, computer equipment and storage medium
CN113505520A (en) Method, device and system for supporting heterogeneous federated learning
CN110109656A (en) Interface analogy method, device, computer equipment and storage medium
CN109284227A (en) A kind of automation method for testing pressure and device calculate equipment and storage medium
CN115150471B (en) Data processing method, apparatus, device, storage medium, and program product
CN108427635A (en) Quickly method, server and the computer readable storage medium of test web page
CN111539683A (en) Contract signing method, device, equipment and medium
CN108228812A (en) Adaptive host node switching method and device
CN109359034A (en) A kind of operation system test method, computer readable storage medium and terminal device
CN109522060A (en) The restoring method and terminal device of business scenario
CN109787963A (en) Business handling method, apparatus, computer equipment and storage medium
US11157690B2 (en) Techniques for asynchronous execution of computationally expensive local spreadsheet tasks
US10162913B2 (en) Simulation device and simulation method therefor
RU2698766C1 (en) Method and device for transmitting, sending and receiving information
CN109377266A (en) Business datum tracking and management method, device, computer equipment and storage medium
CN108846951A (en) Automatic vending machine long-range control method, device, storage medium and system

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