CN106648936A - Cooperative processing method and system based on microservices and server - Google Patents

Cooperative processing method and system based on microservices and server Download PDF

Info

Publication number
CN106648936A
CN106648936A CN201611244616.9A CN201611244616A CN106648936A CN 106648936 A CN106648936 A CN 106648936A CN 201611244616 A CN201611244616 A CN 201611244616A CN 106648936 A CN106648936 A CN 106648936A
Authority
CN
China
Prior art keywords
micro services
request
failure
result
service interface
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201611244616.9A
Other languages
Chinese (zh)
Other versions
CN106648936B (en
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.)
TCL Corp
Original Assignee
TCL Corp
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 TCL Corp filed Critical TCL Corp
Priority to CN201611244616.9A priority Critical patent/CN106648936B/en
Publication of CN106648936A publication Critical patent/CN106648936A/en
Application granted granted Critical
Publication of CN106648936B publication Critical patent/CN106648936B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/542Event management; Broadcasting; Multicasting; Notifications
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a cooperative processing method and system based on microservices and a server. The cooperative processing method solves the problem of cooperation of a non-idempotent operation and an idempotent operation between a plurality of services and ensures correctness of data by steps that: a service interface initiates requests to working interfaces of the microservices on a background; then the service interface receives processing results of the microservices, updates request state data of the corresponding microservices according to the processing results, inquires the request state data of all the microservices, judges whether microservices of which processing states are failure states exist and if yes, initiates the requests to the microservices of which the processing states are the failure states again, and the service interface receives processing results of the microservices of which the processing states are the failure states; and then the processing results of all the microservices are integrated and returned to a user request side, hands over the microservices failed in processing to an inquiry interface in an inquiring mode to process, and carries out splitting on function operation and data return.

Description

Based on the collaboration processing method of micro services, system and server
Technical field
The present invention relates to distributed system technical field, more particularly to based on the collaboration processing method of micro services, system and Server.
Background technology
Micro services are an emerging software architectures, and a large-scale single application program and service are split as dozens of Support micro services, the strategy of a micro services can allow work to become more easy, its expansible single component rather than whole Individual application heap, so as to meet service-level agreement.
However, asynchronous, such as the A service requests B service that the cooperative association between each service becomes because of a variety of causes A task is completed, and the operation of this service does not possess idempotence.If that occurring mistake upon request, A is serviced just Whether unclear service completes, because B service functions do not possess idempotence, so A services can not again be sent out and please grasp to B services Make.Such as, B services are an operations of deducting fees, if previous operation is successful, but are simply returning to appearance when A is serviced Estimating barrier causes A services not receive success message, if A services again send to B services equally ask so if occur The existing situation deducted fees more.Therefore with idempotent operation also there is the urgent need to resolve that cooperates in the non-idempotent in micro services.
Thus prior art could be improved and improve.
The content of the invention
In view of above-mentioned the deficiencies in the prior art part, it is an object of the invention to provide the collaborative process side based on micro services The micro services of processing failure are given query interface and are processed by method, system and server by way of inquiry, and by feature operation Come back for splitting with data, exist can avoid when non-idempotent is operated it is inconsistent due to repeating caused data, in idempotent Service request number of times can be then reduced in operation, mitigates load pressure.
In order to achieve the above object, this invention takes technical scheme below:
A kind of collaboration processing method based on micro services, it comprises the steps:
A, service interface to the working interface of the micro services on backstage initiates request;
B, the service interface receive the result of the micro services, and update the request of correspondence micro services according to result Status data;
The solicited status data of C, all micro services of inquiry, and the micro services that process state is failure are judged whether, if so, Then execution step D;If it is not, then execution step E;
D, initiate request again to the micro services that process state is failure, the service interface receives all process states for failure Micro services result;
E, the result of all micro services of integration are back to user's request end.
In the described collaboration processing method based on micro services, step is also included before step A:
A01, service interface carry out data prediction, and obtain a default identifier as key, by the key, each in incognito The solicited status data of business and result are stored in the lump in database.
In the described collaboration processing method based on micro services, step is also included after step A01, before step A:
A02, by the initial request status data of all micro services be set to process in, initial treatment result is set to sky, and deposits In entering database;
Whether A03, judgement malfunction when being stored in database, if so, then directly return and process mistake to request end;If it is not, then continuing Execution step A.
In the described collaboration processing method based on micro services, step A is specifically included:
The service interface selects a micro services in the micro services of backstage, and to its working interface request is initiated, and will be described close Key is sent in the lump to the micro services.
In the described collaboration processing method based on micro services, step B includes step:
B1, the service interface receive the result of the selected micro services;
B2, the service interface update the solicited status data of the selected micro services according to the result for receiving, and return Step A is returned, continues to initiate request to the working interface of next micro services, until all micro services are carried out finishing.
In the described collaboration processing method based on micro services, step C includes step:
C1, the query interface that the service interface is called by the key request;
C2, the query interface inquire about the solicited status data of all micro services, and judge whether processing failure in incognito Business;
If C3, there are the micro services that process state is failure, according to the key inquire about all process states be failure in incognito Business, and execution step D;If there is no the micro services that process state is failure, execution step E.
In the described collaboration processing method based on micro services, step D includes step:
D1, thereto process state are that the working interface of the micro services of failure initiates request again;
D2, the service interface receive the result that the micro services that the process state is failure are returned;
D3, return to step D1, continue to initiate request, Zhi Daosuo to the working interface of the micro services that next process state is failure There are the micro services that process state is failure to be carried out finishing.
A kind of cooperative processing system based on micro services, it includes:
First request initiation module, request is initiated for controlling service interface to the working interface of the micro services on backstage;
First receives update module, for controlling the result that service interface receives the micro services, and according to result Update the solicited status data of correspondence micro services;
Enquiry module, for inquiring about the solicited status data of all micro services, and judges whether that process state is failure Micro services;
Second request initiation module, for when there are the micro services that process state is failure, state being processed for failure to each Micro services initiate request, and the process for control micro services that all process states of service interface reception are failure again As a result;
Data return module, and the result for integrating all micro services is back to user's request end.
In the described cooperative processing system based on micro services, also include:
Pretreatment module, for controlling service interface data prediction is carried out, and obtains a default identifier as key, by institute State key, the solicited status data of each micro services and result to be stored in the lump in database;
Initialization module, in being set to process by the initial request status data of all micro services, initial treatment result sets Sky is set to, and is stored in database;
Whether judge module, malfunction during for judging and be stored in database, if so, then directly returns and processes mistake to request end, if Otherwise control service interface and initiate request to the working interface of the micro services on backstage.
A kind of server, it includes cooperative processing system as above based on micro services.
Compared to prior art, the present invention provide based in the collaboration processing method of micro services, system and server, institute State the collaboration processing method based on micro services and request is initiated to the working interface of the micro services on backstage by service interface;Institute afterwards The result that service interface receives the micro services is stated, and the solicited status number of correspondence micro services is updated according to result According to, the solicited status data of all micro services of inquiry, and the micro services that process state is failure are judged whether, if so, then Initiate request again to the micro services that process state is failure, the service interface receive all process states be failure in incognito The result of business;The result for integrating all micro services afterwards is back to user's request end, will place by way of inquiry The micro services of reason failure give query interface process, and feature operation and data are come back for split, and there is non-idempotent operation When, can avoid inconsistent due to repeating caused data, and in idempotent operation service request number of times can be then reduced, and mitigate negative Carry pressure.
Description of the drawings
The flow chart of the collaboration processing method based on micro services that Fig. 1 is provided for the present invention.
Step S101, S102, the flow process of S103 in the collaboration processing method based on micro services that Fig. 2 is provided for the present invention Figure.
The flow chart of step S20 in the collaboration processing method based on micro services that Fig. 3 is provided for the present invention.
The flow chart of step S30 in the collaboration processing method based on micro services that Fig. 4 is provided for the present invention.
The flow chart of step S40 in the collaboration processing method based on micro services that Fig. 5 is provided for the present invention.
The structured flowchart of the cooperative processing system based on micro services that Fig. 6 is provided for the present invention.
First receives the structured flowchart of update module in the collaborative process based on micro services that Fig. 7 is provided for the present invention.
The structured flowchart of enquiry module in the collaborative process based on micro services that Fig. 8 is provided for the present invention.
The structured flowchart of the second request initiation module in the collaborative process based on micro services that Fig. 9 is provided for the present invention.
Specific embodiment
In view of the shortcomings of non-idempotent operation cannot cooperate with idempotent operation room between multiple services in prior art, the present invention Purpose be to provide based on the collaboration processing method of micro services, system and server, by processing failure by way of inquiry Micro services give query interface process, and feature operation and data are come back for split, existing when non-idempotent is operated to keep away Exempt from inconsistent due to repeating caused data, in idempotent operation service request number of times can be then reduced, mitigate load pressure.
To make the purpose of the present invention, technical scheme and effect clearer, clear and definite, develop simultaneously referring to the drawings embodiment pair The present invention is further described.It should be appreciated that specific embodiment described herein is not used to only to explain the present invention Limit the present invention.
Fig. 1 is referred to, what the present invention was provided is comprised the steps based on the collaboration processing method of micro services:
S10, service interface to the working interface of the micro services on backstage initiates request;
S20, the service interface receive the result of the micro services, and update asking for correspondence micro services according to result Seek status data;
The solicited status data of S30, all micro services of inquiry, and the micro services that process state is failure are judged whether, if It is, then execution step S40;If it is not, then execution step S50;
S40, initiate request again to the micro services that process state is failure, the service interface receives all process states to lose The result of the micro services for losing;
S50, the result of all micro services of integration are back to user's request end.
After micro services concept is proposed, generally single application program is split into multiple micro services, carry out independent horizontal line Extension so that work is easier, when an operation is related to multiple backstage micro services and is, the present invention is by service interface to many The working interface of individual micro services initiates request, wherein the working interface is the interface for providing service, for example deduct fees interface, order Interface, display interface etc., multiple micro services process upon receiving a request respective request work and will accordingly process knot Fruit is back to service interface, i.e., each micro services is processed according to respective request content, what such as the first micro services were received Request content be generate the request content that order, the second micro services receive be carry out paying deduct fees, the 3rd micro services are received please Content is sought to show payment result etc., and corresponding result is back into service interface, service interface is according to process knot Fruit updates the solicited status data of each micro services, and the solicited status data may be updated as successfully according to the result for returning Success, failure failed either according to actual conditions can or other solicited status data.
The solicited status data for inquiring about all micro services by using query interface afterwards are lost to judge whether to process The micro services for losing, if not existing, i.e., the solicited status data of all micro services are success, then directly integrate it is all in incognito The result of business(Alternatively referred to as request results data)User's request end is back to, such as when the first micro services, second in incognito When business and the 3rd micro services process successful, directly order data, data of deducting fees and payment result display data are back to User's request end, such as certain shopping app etc., inform that user this time operates success;And when the micro services that there is processing failure When, successful micro services are now processed without the need for performing again, only resend to the micro services that all process states are failure Request, the micro services of processing failure process again respective request work and return corresponding result to service interface, then The result for integrating all micro services is back to user's request end, such as when the first micro services and the second micro services are processed into Work(, during the 3rd micro services processing failure, then individually to the 3rd micro services initiates again request, and not to the first micro services and second Micro services initiate request, and to avoid repeatedly generating order and repeat to deduct fees, the 3rd micro services perform returned after being disposed again Result to service interface, the result data for now integrating three micro services Twice requests process are back to user's request end, I.e. order data, data of deducting fees and payment result show miss data, then user can learn that it is only to prop up that now deducted fees Pay result and show failure, without the need for initiating delivery operation again.Status data is obtained by way of inquiry, by the micro- of processing failure Query interface process is given in service, exist can avoid when non-idempotent is operated it is inconsistent due to repeating caused data, plus The strong robustness of distributed system, at the same when operation be related to be idempotent operation micro services when, also can be by inquiry User performs again the micro services of processing failure in the case of not retransmitting request, reduce service request number of times, reduces repetitive requests The load pressure for bringing.
Further, Fig. 2 is seen also, step is also included before step S10:
S101, service interface carry out data prediction, and obtain a default identifier as key, and by the key, each is micro- The solicited status data of service and result are stored in the lump in database.
When a certain operation need to be carried out, service interface can be transferred data to from user's request end, or according to transmission data Other data in reading system, such as when carrying out delivery operation, user's request end can transmit payment amount, pay the number such as card number According to service interface, service interface carries out such as cleaning to these data, filters pretreatment, preparation request micro services working interface Required previous work.And service interface also obtains a default identifier as key, in the present embodiment, the pre- bidding Symbol is known to be stored in local GUID, it is 128 integers, the possibility that this identifier repeats is minimum, For identifier of the distribution with uniqueness, with reference to the GUID, each micro services solicited status data and place Reason result is stored in database, and used as core data, certainly also expansible other data are together stored in database.
Further, after the step S101 step, is also included before step S10:
S102, by the initial request status data of all micro services be set to process in, initial treatment result is set to sky, and deposits In entering database;
Whether S103, judgement malfunction when being stored in database, if so, then directly return and process mistake to request end;If it is not, then continuing Execution step S10.
After service interface has carried out data prediction and obtains GUID as key, by each When the solicited status data of micro services and result are together stored in database, request is not now also initiated, then needing will be all The initial request status data of micro services is disposed as processing in process, and initial treatment result is set into sky Null, and being stored in database, if being now stored in database error, directly returns and processes wrong information to request end, no Any subsequent treatment is carried out, follow-up initiation request flow process is normally performed if not malfunctioning, this asks the point before starting Referred to as affairs point, due to being possible to can process loss of data, therefore must have affairs before each true request starts Point record, it is to avoid unknown situation caused by loss of data, follow-up status data detection etc. are all related to affairs point.
Preferably, the step 10 is specifically included:The service interface selects a micro services in the micro services on backstage, Request is initiated to its working interface, and the key is sent in the lump to the micro services.
Meanwhile, Fig. 3 is seen also, step S20 includes step:
S21, the service interface receive the result of the selected micro services;
S22, the service interface update the solicited status data of the selected micro services according to the result for receiving, and return Step S10 is returned, continues to initiate request to the working interface of next micro services, until all micro services are carried out finishing.
The previous work needed for above-mentioned request working interface is completed, and primary data is included into solicited status data and place Reason result is stored in after database, and service interface thereto initiate to ask by the working interface of a micro services, for example to first in incognito The order interface of business initiates request, and request generates order, by the key is in the lump now that GUID is sent to the One micro services, are easy to subsequent query to work, the request work of the generation order of the first micro services process afterwards, and after processing is completed Result is back into service interface, service interface updates the solicited status data of the first micro services, i.e. step according to result Initial request status data in S102, according to result by initial value processing be updated to success or Failed or other status datas, for representing that affairs point processes state, afterwards return to step S11, that is, continue to the next one The working interface of micro services initiates request, for example, continue to initiate request to the interface of deducting fees of the second micro services, asks payment of deducting fees, Second micro services process the request work and returning result, and service interface updates second in incognito equally after result is received The status data of business, by that analogy, the above-mentioned request of repetition, process, more returning result, new state data process, until all of Micro services are carried out finishing, and can now obtain the solicited status data after all micro services update and the result for returning.
After all of micro services are performed both by finishing, inquiry transaction dotted state, i.e. each micro services by the way of inquiry Solicited status data, specifically, refer to Fig. 4, step S30 includes step:
S31, the query interface that the service interface is called by the key request;
S32, the query interface inquire about the solicited status data of all micro services, and judge whether processing failure in incognito Business;
If S33, there are the micro services that process state is failure, according to the key inquire about all process states be failure in incognito Business, and execution step S40;If there is no the micro services that process state is failure, execution step S50.
After all of micro services are carried out finishing, and the solicited status data of all micro services update, pass through The key is the query interface that GUID asks service interface, and query interface inquires about each affairs point, and reads Affairs dotted state, had affairs point to record before initiating to each micro services request as mentioned above, and each micro services is being processed After the completion of can update respective solicited status data, the i.e. state of each affairs point, the present invention by return real data it Before, the solicited status data of all micro services are first inquired about, the micro services of processing failure are judged whether, by the shape of request operation State comes back for segmentation with real data, it is to avoid data change caused by due to processing mistake.
When there are no the micro services of processing failure, i.e., all affairs dotted states are success, then directly integrate all The result of micro services is back to user's request end;When there are the micro services that process state is failure, according to being previously sent The GUID inquiry sent in the lump during request carrys out the micro services of all of processing failure, and to all processing failures Micro services resend request, for example, inquire the second micro services with the key by query interface and the 3rd micro services are located Reason failure, that is, simultaneously payment result shows failure for failure of deducting fees, and the generation order success that the first micro services are processed, now to the Two micro services and the 3rd micro services initiate again request, make the second micro services and the 3rd micro services re-execute one time it is respective please Work and returning result are asked, the result data that Twice requests process finally is integrated and is back to user's request end, no matter second in incognito Business and the 3rd micro services process success or failure in secondary request, and the order data of the first micro services also only changes once, no The returned data of the first micro services can be changed because of the second micro services and the 3rd re-executing for micro services, cause to repeatedly generate Order, and the data that user also can pass through to finally return that judge that specifically which micro services perform error, mistake of for example deducting fees, Now user can again initiate request of deducting fees, and without the need for generating repetition order again, improve treatment effeciency.
Similarly, when the micro services that there is processing failure need to initiate it again request, as shown in figure 5, the step Rapid S40 includes step:
S41, thereto process state are that the working interface of the micro services of failure initiates request again;
S42, the service interface receive the result that the micro services that the process state is failure are returned;
S43, return to step S41, continue to initiate request to the working interface of the micro services that next process state is failure, until All process states are that the micro services of failure are carried out finishing.
The micro services of all request processing failures are inquired by query interface, and thereto a processing failure is in incognito Business again initiate request, for example again to the working interface of the second micro services deduct fees interface initiate again request, second in incognito Business secondary reception to deduct fees request when perform request work of deducting fees again, due to the front status of fail therefore secondary of being once processed as The data deducted fees during execution not do not change, will not be inconsistent due to repeating the data that cause non-idempotent operation, and second Micro services again return to after processing is completed result to service interface, according to result service interface selection holding or more The solicited status data of new second micro services, the working interface that the 3rd micro services to next processing failure are continued afterwards is initiated Request, repeat said process, until the micro services of all processing failures are performed both by finishing, obtain after secondary request it is all in incognito The solicited status data of business and result.Processed by individually giving query interface by the micro services of failure, be prevented effectively from Due to there is non-idempotent operation in micro services, the caused error in data when repeating is solved non-between multiple services Idempotent operation cooperates with process with idempotent operation, it is ensured that data correctness.Can then reduce service request in idempotent operation simultaneously Number of times, mitigates load pressure.
According to the collaboration processing method based on micro services as above, the present invention is correspondingly provided based on the association of micro services System is dealt with, as shown in fig. 6, the cooperative processing system based on micro services includes the first request initiation module 10, first Receive update module 20, the request initiation module 40, data of enquiry module 30, second and return module 50, pretreatment module 60, initial Change module 70 and judge module 80, the first request initiation module 10, first receive update module 20, enquiry module 30, the Two request initiation modules 40, data return module 50 and are sequentially connected, and the enquiry module 40 is also connected with data and returns module 50, institute State pretreatment module 60, initialization module 70 and judge module 80 to be sequentially connected, the judge module 80 is also connected with the first request Initiation module 10.
Wherein, the first request initiation module 10 is used to control working interface of the service interface to the micro services on backstage Play request;The first reception update module 20 is used to controlling the result that service interface receives the micro services, and according to Result updates the solicited status data of correspondence micro services;Select in the multiple micro services in backstage specifically for controlling service interface One of micro services, initiate request to its working interface, and the key is sent in the lump to the micro services;The inquiry Module 30 is used to inquire about the solicited status data of all micro services, and judges whether the micro services that process state is failure; The second request initiation module 40 is used for when there are the micro services that process state is failure, is failure to each process state Micro services initiate request, and the process for control micro services that all process states of service interface reception are failure again As a result;The result that the data return module 50 for integrating all micro services is back to user's request end;The pre- place Reason module 60 is used to controlling service interface carrying out data prediction, and obtains a default identifier as key, by the key, The solicited status data of each micro services and result are stored in the lump in database;The initialization module 70 is used for will be all During the initial request status data of micro services is set to process, the initial treatment result is set to sky, and is stored in database; Whether malfunction when the judge module 80 is stored in database for judgement, if so, then directly return and process mistake to request end, if Otherwise control service interface and initiate request to the working interface of the micro services on backstage.Due to retouching in detail in said method embodiment The some embodiments are stated, the corresponding embodiment of said method is specifically referred to.
Further, Fig. 7 is seen also, described first receives update module 20 includes the first receiving unit 201 and the One updating block 202, first receiving unit 201 connects the first updating block 202, and first receiving unit 201 is used for Control service interface receives the result of the selected micro services;First updating block 202 connects for controlling service Mouth updates the solicited status data of the selected micro services according to the result for receiving, and continues to next micro services Working interface initiates request, until all micro services are carried out finishing.Due to having described the portion in detail in said method embodiment Divide specific embodiment, specifically refer to the corresponding embodiment of said method.
Further, Fig. 8 is referred to, the enquiry module 30 includes request unit 301, inquiry judging unit 302 and place Reason unit 303, the request unit 301, inquiry judging unit 302 and processing unit 303 are sequentially connected, the request unit 301 are used to call the query interface of the service interface by the key request;The inquiry judging unit 302 is used to control Query interface inquires about the solicited status data of all micro services, and judges whether the micro services of processing failure;The process If unit 303 is used for the presence of the micro services that process state is failure, it is failure to inquire about all process states according to the key Micro services, and request is initiated again to the micro services that process state is failure;If there are no the micro services that process state is failure, The result for then integrating all micro services is back to request end.Due to having described the part tool in said method embodiment in detail Body embodiment, specifically refers to the corresponding embodiment of said method.
Further, Fig. 9 is seen also, the second request initiation module 40 includes that initiation unit 401, second connect Receive the updating block 403 of unit 402 and second, the initiation unit 401, the second receiving unit 402 and the second updating block 403 according to Secondary connection, the initiation unit 401 is used for the micro services that process state thereto is failure and initiates request again;Described Two receiving units 402 are used to control the result that service interface receives the micro services return that the process state is failure;It is described Second updating block 403 receives the solicited status data that the micro services are updated after result for controlling service interface, after Continue to the working interface of the micro services that next process state is failure and initiate request, until all process states are the micro- of failure Service is carried out finishing.Due to having described some embodiments in detail in said method embodiment, specifically refer to above-mentioned The corresponding embodiment of method.
According to the cooperative processing system based on micro services as above, the present invention correspondingly provides a kind of server, its Including the cooperative processing system based on micro services as above, due to above to the collaborative process system based on micro services System has been described in detail, and is not described further herein.
In sum, the present invention provide based on the collaboration processing method of micro services, system and server in, it is described to be based on The collaboration processing method of micro services initiates request by service interface to the working interface of the micro services on backstage;The service afterwards The result of micro services described in interface, and the solicited status data of correspondence micro services, inquiry are updated according to result The solicited status data of all micro services, and the micro services that process state is failure are judged whether, if so, then to process shape State is that the micro services of failure initiate request again, and the service interface receives the process of the micro services that all process states are failure As a result;The result for integrating all micro services afterwards is back to user's request end, by processing failure by way of inquiry Micro services give query interface process, and feature operation and data are come back for split, and existing when non-idempotent is operated to avoid It is inconsistent due to repeating caused data, service request number of times can be then reduced in idempotent operation, mitigate load pressure.
It is understood that for those of ordinary skills, with technology according to the present invention scheme and its can send out Bright design in addition equivalent or change, and all these changes or replace the guarantor that should all belong to appended claims of the invention Shield scope.

Claims (10)

1. a kind of collaboration processing method based on micro services, it is characterised in that comprise the steps:
A, service interface to the working interface of the micro services on backstage initiates request;
B, the service interface receive the result of the micro services, and update the request of correspondence micro services according to result Status data;
The solicited status data of C, all micro services of inquiry, and the micro services that process state is failure are judged whether, if so, Then execution step D;If it is not, then execution step E;
D, initiate request again to the micro services that process state is failure, the service interface receives all process states for failure Micro services result;
E, the result of all micro services of integration are back to user's request end.
2. the collaboration processing method based on micro services according to claim 1, it is characterised in that before step A also Including step:
A01, service interface carry out data prediction, and obtain a default identifier as key, by the key, each in incognito The solicited status data of business and result are stored in the lump in database.
3. the collaboration processing method based on micro services according to claim 2, it is characterised in that after step A01, Also include step before step A:
A02, by the initial request status data of all micro services be set to process in, initial treatment result is set to sky, and deposits In entering database;
Whether A03, judgement malfunction when being stored in database, if so, then directly return and process mistake to request end;If it is not, then continuing Execution step A.
4. the collaboration processing method based on micro services according to claim 2, it is characterised in that step A is specifically wrapped Include:
The service interface selects a micro services in the micro services of backstage, and to its working interface request is initiated, and will be described close Key is sent in the lump to the micro services.
5. the collaboration processing method based on micro services according to claim 4, it is characterised in that step B includes step Suddenly:
B1, the service interface receive the result of the selected micro services;
B2, the service interface update the solicited status data of the selected micro services according to the result for receiving, and return Step A is returned, continues to initiate request to the working interface of next micro services, until all micro services are carried out finishing.
6. the collaboration processing method based on micro services according to claim 2, it is characterised in that step C includes step Suddenly:
C1, the query interface that the service interface is called by the key request;
C2, the query interface inquire about the solicited status data of all micro services, and judge whether processing failure in incognito Business;
If C3, there are the micro services that process state is failure, according to the key inquire about all process states be failure in incognito Business, and execution step D;If there is no the micro services that process state is failure, execution step E.
7. the collaboration processing method based on micro services according to claim 1, it is characterised in that step D includes step Suddenly:
D1, thereto process state are that the working interface of the micro services of failure initiates request again;
D2, the service interface receive the result that the micro services that the process state is failure are returned;
D3, return to step D1, continue to initiate request, Zhi Daosuo to the working interface of the micro services that next process state is failure There are the micro services that process state is failure to be carried out finishing.
8. a kind of cooperative processing system based on micro services, it is characterised in that include:
First request initiation module, request is initiated for controlling service interface to the working interface of the micro services on backstage;
First receives update module, for controlling the result that service interface receives the micro services, and according to result Update the solicited status data of correspondence micro services;
Enquiry module, for inquiring about the solicited status data of all micro services, and judges whether that process state is failure Micro services;
Second request initiation module, for when there are the micro services that process state is failure, state being processed for failure to each Micro services initiate request, and the process for control micro services that all process states of service interface reception are failure again As a result;
Data return module, and the result for integrating all micro services is back to user's request end.
9. the cooperative processing system based on micro services according to claim 8, it is characterised in that also include:
Pretreatment module, for controlling service interface data prediction is carried out, and obtains a default identifier as key, by institute State key, the solicited status data of each micro services and result to be stored in the lump in database;
Initialization module, in being set to process by the initial request status data of all micro services, initial treatment result sets Sky is set to, and is stored in database;
Whether judge module, malfunction during for judging and be stored in database, if so, then directly returns and processes mistake to request end, if Otherwise control service interface and initiate request to the working interface of the micro services on backstage.
10. a kind of server, it is characterised in that including collaborative process system as claimed in claim 8 or 9 based on micro services System.
CN201611244616.9A 2016-12-29 2016-12-29 Cooperative processing method, system and server based on microservice Active CN106648936B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611244616.9A CN106648936B (en) 2016-12-29 2016-12-29 Cooperative processing method, system and server based on microservice

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611244616.9A CN106648936B (en) 2016-12-29 2016-12-29 Cooperative processing method, system and server based on microservice

Publications (2)

Publication Number Publication Date
CN106648936A true CN106648936A (en) 2017-05-10
CN106648936B CN106648936B (en) 2020-09-22

Family

ID=58836673

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611244616.9A Active CN106648936B (en) 2016-12-29 2016-12-29 Cooperative processing method, system and server based on microservice

Country Status (1)

Country Link
CN (1) CN106648936B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109062599A (en) * 2018-09-11 2018-12-21 郑州云海信息技术有限公司 The management method and device of code update under micro services framework
CN109491765A (en) * 2018-10-09 2019-03-19 阿里巴巴集团控股有限公司 To the processing method and processing device of cross-domain service request
CN109726009A (en) * 2018-05-31 2019-05-07 中国平安人寿保险股份有限公司 Big data calculation method, device, equipment and computer readable storage medium
CN110442481A (en) * 2019-07-10 2019-11-12 阿里巴巴集团控股有限公司 Method for processing business, Service Component container and electronic equipment
CN111241112A (en) * 2019-12-27 2020-06-05 山大地纬软件股份有限公司 Micro-service call supervision system and method for guaranteeing idempotent
CN112839110A (en) * 2021-03-05 2021-05-25 紫光云技术有限公司 Method for realizing network communication fault tolerance in distributed system
CN113515403A (en) * 2021-06-23 2021-10-19 平安科技(深圳)有限公司 Micro-service state checking method, computer device and storage medium
CN115018325A (en) * 2022-06-10 2022-09-06 中国银行股份有限公司 Service processing method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9098536B1 (en) * 2012-02-10 2015-08-04 Pivotal Software, Inc. Mirrored database upgrade using state machine
CN105491039A (en) * 2015-11-27 2016-04-13 国网信息通信产业集团有限公司 Distributed software sharing system
CN105808414A (en) * 2016-03-08 2016-07-27 联想(北京)有限公司 Log processing method and log processing electronic equipment
CN105959390A (en) * 2016-06-13 2016-09-21 乐视控股(北京)有限公司 Unified management system and method of micro services
CN105959138A (en) * 2016-04-29 2016-09-21 深圳前海大数点科技有限公司 Micro-service dynamic disposition system and method based on cloud calculation

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9098536B1 (en) * 2012-02-10 2015-08-04 Pivotal Software, Inc. Mirrored database upgrade using state machine
CN105491039A (en) * 2015-11-27 2016-04-13 国网信息通信产业集团有限公司 Distributed software sharing system
CN105808414A (en) * 2016-03-08 2016-07-27 联想(北京)有限公司 Log processing method and log processing electronic equipment
CN105959138A (en) * 2016-04-29 2016-09-21 深圳前海大数点科技有限公司 Micro-service dynamic disposition system and method based on cloud calculation
CN105959390A (en) * 2016-06-13 2016-09-21 乐视控股(北京)有限公司 Unified management system and method of micro services

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
CHINESE915: "微服务架构下的数据一致性保证(一)", 《HTTPS://BLOG.CSDN.NET/CHINESE915/ARTICLE/DETAILS/80124426》 *

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109726009B (en) * 2018-05-31 2024-04-12 中国平安人寿保险股份有限公司 Big data computing method, device, equipment and computer readable storage medium
CN109726009A (en) * 2018-05-31 2019-05-07 中国平安人寿保险股份有限公司 Big data calculation method, device, equipment and computer readable storage medium
CN109062599A (en) * 2018-09-11 2018-12-21 郑州云海信息技术有限公司 The management method and device of code update under micro services framework
CN109062599B (en) * 2018-09-11 2021-11-26 郑州云海信息技术有限公司 Management method and device for code update under micro-service architecture
CN109491765B (en) * 2018-10-09 2021-07-30 创新先进技术有限公司 Method and device for processing cross-domain service request
CN109491765A (en) * 2018-10-09 2019-03-19 阿里巴巴集团控股有限公司 To the processing method and processing device of cross-domain service request
CN110442481A (en) * 2019-07-10 2019-11-12 阿里巴巴集团控股有限公司 Method for processing business, Service Component container and electronic equipment
CN110442481B (en) * 2019-07-10 2023-09-22 创新先进技术有限公司 Service processing method, service component container and electronic equipment
CN111241112A (en) * 2019-12-27 2020-06-05 山大地纬软件股份有限公司 Micro-service call supervision system and method for guaranteeing idempotent
CN112839110A (en) * 2021-03-05 2021-05-25 紫光云技术有限公司 Method for realizing network communication fault tolerance in distributed system
CN112839110B (en) * 2021-03-05 2023-03-10 紫光云技术有限公司 Method for realizing problem processing based on network overtime in distributed system
CN113515403A (en) * 2021-06-23 2021-10-19 平安科技(深圳)有限公司 Micro-service state checking method, computer device and storage medium
CN113515403B (en) * 2021-06-23 2021-11-16 平安科技(深圳)有限公司 Micro-service state checking method, computer device and storage medium
CN115018325A (en) * 2022-06-10 2022-09-06 中国银行股份有限公司 Service processing method and device
CN115018325B (en) * 2022-06-10 2024-05-24 中国银行股份有限公司 Service processing method and device

Also Published As

Publication number Publication date
CN106648936B (en) 2020-09-22

Similar Documents

Publication Publication Date Title
CN106648936A (en) Cooperative processing method and system based on microservices and server
JP6355141B2 (en) Online payment method, system, and apparatus
CN103312549B (en) A kind of office management method and device and system
CN104077362A (en) Online mass data processing system and method
CN107818460B (en) Payment method and device
CN112446786A (en) Abnormal transaction processing method and device, electronic equipment and readable storage medium
CN110363556B (en) Method, server, client and system for determining user problem
CN108734454A (en) Reimbursement processing method and system
CN108632211B (en) Binding method and device of intelligent equipment
CN106056436A (en) Data fallback method, device and system
CN107038025B (en) SOA architecture-based system calling method and device
CN111127088A (en) Method, device, computer equipment and storage medium for realizing final consistency
CN108667726B (en) Transaction system and secondary routing control method
CN113297329A (en) Transaction processing method, device, equipment, storage medium and program product
CN106034148B (en) Rapid information interaction method, local server, remote server and system
CN110717756B (en) Payment data processing device and method based on contract
CN106933655A (en) Event execution method and device
CN115131144A (en) Information processing method and device for business system for transaction
CN108735278B (en) Instruction transmission method and application suitable for rehabilitation equipment
CN113535358A (en) Task processing method and device
CN111754348A (en) Scene combined transaction method and device
CN112819479A (en) Order state processing method and device, storage medium and server
CN110008010A (en) System call method, device, equipment and readable storage medium storing program for executing
CN113052687A (en) Transaction routing distribution method and related device
CN116418873A (en) Service processing method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 516006 TCL technology building, No.17, Huifeng Third Road, Zhongkai high tech Zone, Huizhou City, Guangdong Province

Applicant after: TCL Technology Group Co.,Ltd.

Address before: 516006 Guangdong province Huizhou Zhongkai hi tech Development Zone No. nineteen District

Applicant before: TCL RESEARCH AMERICA Inc.

GR01 Patent grant
GR01 Patent grant