CN110880091A - Micro-service flow processing method and device - Google Patents

Micro-service flow processing method and device Download PDF

Info

Publication number
CN110880091A
CN110880091A CN201811032496.5A CN201811032496A CN110880091A CN 110880091 A CN110880091 A CN 110880091A CN 201811032496 A CN201811032496 A CN 201811032496A CN 110880091 A CN110880091 A CN 110880091A
Authority
CN
China
Prior art keywords
task
flow
calling
instance
task node
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
CN201811032496.5A
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.)
eBaoTech Corp
Original Assignee
eBaoTech 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 eBaoTech Corp filed Critical eBaoTech Corp
Priority to CN201811032496.5A priority Critical patent/CN110880091A/en
Priority to PCT/CN2019/103985 priority patent/WO2020048421A1/en
Publication of CN110880091A publication Critical patent/CN110880091A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/10Office automation; Time management
    • G06Q10/103Workflow collaboration or project management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/10Office automation; Time management

Abstract

The invention provides a micro-service flow processing method and equipment. The method comprises the following steps: receiving a flow calling request of a user, and starting a flow instance corresponding to the calling request; entering a first task node according to the flow of the flow instance, and calling a first micro service for executing a first target task by the first task node to complete the first target task; storing a first return result for calling the first micro service into a process variable pool of the process instance; and entering a preset second task node of the process instance according to the first return result, and calling a second micro service for executing a second target task by the second task node to complete the second target task. The method realizes the task execution of each branch of the workflow by arranging and aggregating the micro-services.

Description

Micro-service flow processing method and device
Technical Field
The present invention relates to the field of computer networks, and more particularly, to a method and an apparatus for processing a micro service flow.
Background
The task execution framework in the workflow is an important component in enterprise informatization. The existing task execution often needs the permutation and combination of a plurality of task steps, and codes are written to carry out the design of specific conditions and branches.
At present, workflow design mainly focuses on the task execution condition of one execution node, lacks comprehensive consideration on task execution of a plurality of nodes, and cannot realize visual viewing of the running state.
Disclosure of Invention
The invention provides a micro-service flow processing method and device, which can integrate and arrange various restful APIs in a micro-service calling mode, and realize functions which cannot be provided by a single application program interface API under the condition of not writing codes.
Some embodiments of the present invention provide a method for processing a flow of a microservice, which may include: receiving a flow calling request of a user, and starting a flow instance corresponding to the calling request; entering a first task node according to the flow of the flow instance, and calling a first micro service for executing a first target task by the first task node to complete the first target task; storing a first return result for calling the first micro service into a process variable pool of the process instance; and entering a preset second task node of the process instance according to the first return result, and calling a second micro service for executing a second target task by the second task node to complete the second target task.
Some embodiments of the present invention also provide a computer device, which may include: a processor; and a memory for storing computer instructions adapted to be loaded by the processor to perform the above-described method of flow processing of microservices.
Some embodiments of the present invention also provide a computer readable medium storing computer readable instructions adapted to be loaded by a processor to execute the above-mentioned method for processing the flow of the microservice.
Drawings
FIG. 1 is a diagram illustrating a method for processing a flow of a microservice according to an embodiment of the present invention.
FIG. 2 illustrates a flow process diagram for a microservice according to an embodiment of the invention.
Fig. 3 shows a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The invention will now be described in detail with reference to exemplary embodiments thereof, some of which are illustrated in the accompanying drawings. The following description refers to the accompanying drawings, in which like numerals refer to the same or similar elements throughout the different views unless otherwise specified. The aspects described in the following exemplary embodiments do not represent all aspects of the present invention. Rather, these aspects are merely examples of systems and methods according to various aspects of the present invention as recited in the appended claims.
Referring to fig. 1, fig. 1 is a schematic diagram illustrating a method for processing a flow of a microservice according to an embodiment of the present invention, where the method 100 may include: the steps 110, 120, 130 and 140 will be described below with reference to specific examples.
Step 110, receiving a flow calling request of a user, and starting a flow instance corresponding to the calling request.
In the embodiment of the invention, the starting of the flow is triggered by a call request of a user. After receiving a flow calling request of a user, starting a flow instance corresponding to the calling request. The workflow may be saved to the flow server after the definition is complete. The process server starts the corresponding process instance each time the user calls the request. The workflow stored in the flow server may be invoked multiple times, and accordingly, multiple flow instances may be generated.
Step 120, entering a first task node according to the flow of the flow instance itself, and calling a first micro service for executing a first target task by the first task node to complete the first target task.
It should be noted that the first task node in step 120 may be any task node in the workflow, and such description of the first task node is used herein only for convenience of description. Similarly, the second task node, the third task node, and the like may also be any task node in the workflow, and they may implement functions similar to or different from those of the first task node. Similarly, the above may also apply to the terms first microservice, first target task, first return result, and so forth.
Prior to step 110, may include: a task sequence of the workflow is determined. Workflow may be a multitasking execution sequence. Each task node of the workflow flow represents a task processing step, and a plurality of tasks correspond to a plurality of task nodes. The workflow may be implemented by flow designer aided design. In the process designer, a graphical flow chart can be obtained in a dragging mode, and a corresponding workflow can be obtained through the graphical flow chart. In some embodiments, the workflow may be implemented by apache activiviti. The realization of workflow is carried out through activiti, and the BPMN standard can be supported.
After the process instance is started, the first task node is entered, and the first task node calls a first micro service for executing a first target task of the first task node, so that the first target task is completed. The microservice may run in a "program of its own" and may communicate with a hypertext Transfer Protocol (HTTP) type Application Programming Interface (API) through a lightweight device. Thus, the execution of the task steps can be completed by invoking a micro-service of the hypertext transfer protocol HTTP type.
In some embodiments, the microservice may be a microservice deployed on other servers. The first microservice for executing the first target task may be invoked by way of a restful api. The Restful API, which may refer to an application or software design having a Rest style, wherein Rest, collectively referred to as a Representational State Transfer, describes an architectural style network system, such as a web application. Rest may refer to a set of architectural constraints and principles that an application or design meeting may be considered Restful. Compared with the traditional mode that the task node is realized by executing the local code, the implementation mode provided by the invention realizes the function of the task node through the external micro-service, can integrate and arrange the micro-services deployed in different external servers through the API, and realizes the function which can not be realized by a single API under the condition of not writing the code locally.
Step 130, storing the first return result of calling the first micro service into the process variable pool of the process instance.
After the process instance is started, a process variable pool corresponding to the process instance is generated, the process variable pool is valid within the range of the process instance, and data placed in the process variable pool can be called as a process variable. Variables in the process variable pool can be set or acquired, and specifically, can be arbitrarily set or acquired in any node of the workflow as long as the variables are placed in the process variable pool.
In step 130, the first returned result after the first microservice is invoked may be a result satisfying a predetermined format requirement. The first returned result may be set into the process variable pool to become a variable of the process variable pool. After becoming a variable in the process variable pool, as described above, the variable can be set or called in any task node of the workflow, that is, the calling result in the last task node can be used as an input parameter of the subsequent task node.
Step 140, entering a predetermined second task node of the process instance according to the first return result, and calling, by the second task node, a second micro-service for executing a second target task to complete the second target task.
In some embodiments, entering the predetermined second task node of the process instance according to the first return result in step 140 may include: and taking the first return result in the process variable pool as an input parameter of a preset second task node of the process instance. The second microservice, similar to the first microservice, may be deployed on another server, and makes microservice calls by way of a restful API.
In some embodiments, after step 140, the method of the present invention may further comprise: and storing a second return result for calling the second micro service into the flow variable pool of the flow instance so as to be called by other task nodes.
It should be noted that, after the step S140, execution of other task nodes related to the returned result of the second task node may also be included, and a specific implementation process of the execution is similar to the foregoing invocation, and is not described herein again.
In some embodiments, the method of the present invention may further comprise: entering a third task node according to the self flow of the flow example, and calling a third micro service for executing a third target task by the third task node to complete the third target task; and storing the third return result of the third micro service into the process variable pool of the process instance. The third task node may be another task node in parallel with the first task node, or may be another task node in parallel with the second task node.
In some embodiments, the method of the present invention may further comprise: and acquiring a second return result and a third return result in the flow variable pool as output results of the flow instance. That is, any variable of the process variable pool may be obtained as an output result of the process instance.
In some embodiments, the method of the present invention may include viewing an execution state of a task node of a flow instance, e.g., an execution state of a plurality of task nodes, through a flow history graph. In one embodiment, the execution state diagram of the process instance may be obtained by the process-instance/{ process instanceid }/diagram restful api of the process engine. According to the viewing mode provided by the invention, the visual viewing of the execution states of the plurality of task nodes of the workflow can be realized.
As shown in fig. 2, the process may include a first task node 210, a second task node 220, and a third task node 230, wherein after the first task node 210 calls the microservice 2100, a first return result is obtained and placed in a process variable pool; entering the first return result into the second task node 220 as an input parameter, calling the micro service 2200 by the second task node 220 to obtain a second return result, and placing the second return result into the process variable pool; the third task node 230 may be a task node in parallel with the first task node 210, which obtains a third call result by calling the micro service 2300, and puts it into the flow variable pool. To this end, the variables in the process variable pool include a first returned result, a second returned result, and a third returned result, and one, two, or three of the variables may be selected as the output result of the process instance.
The following description will be given with reference to a specific example.
There is a micro-service of S1, inquiring basic information of the teacher according to the teacher 'S ID, the basic information including the teacher' S name and identification number. S2, inquiring basic information of the student according to the ID of the student, wherein the information comprises the name and the identification number of the student. And S3, inquiring the ID set of the taught students according to the IDs of the teachers.
Now to implement a function, the teacher and the students taught by the teacher are queried by the ID to return the identity number of the owner (including the teacher and the students). According to the scheme provided by the invention, a work flow can be defined, and the work flow exists in the following nodes:
the process begins.
1. Receiving a teacher ID parameter, calling a teacher basic information query service S1, and placing the teacher identity card number returned by the query microservice S1 into a process variable pool;
2. receiving a teacher ID parameter, calling a student ID set query service S3, and calling a student ID set of a teacher' S professor to place into a process variable pool;
3. receiving ID set parameters, corresponding to each ID in the set, calling a student information checking service S2 according to the ID, and placing the identity card number of each student returned by the service S2 into a process variable pool;
4. and taking out the identity card number of the teacher and the identity card number of the student from the flow variable pool as a final result.
The flow ends.
The flow processing method of the micro-service, provided by the invention, aggregates various restful services deployed in an external machine through flow arrangement, and realizes the function which cannot be realized by a single restful API under the condition of not writing codes.
The embodiment of the invention also provides computer equipment. As shown in fig. 3, the computer apparatus 300 may include: a processor 321, an input/output (I/O) device 322, a memory 323, a database 324, and a display 325.
The processor 321 may be one or more known processing devices that can load computer instructions stored in the memory 323 for implementing the methods described above to cause a computer apparatus to perform the methods described above.
The I/O devices 322 may be configured to allow data to be received and/or transmitted. The I/O devices 322 may include one or more digital and/or analog communication devices that allow the computer device 300 to communicate with other machines and devices. Computer device 300 may also include one or more databases 324, or be communicatively coupled to one or more databases 324 via a network. For example, database 324 may be any suitable database suitable for performing the associated data processing of the above-described methods.
The display 325 may include a display screen that may be used to display the output of the input/output device 322 as well as intermediate results in the processing of the data.
The present invention also provides a computer-readable storage medium having stored thereon computer instructions which, when executed by a processor, implement the above-described method of flow processing for microservices.
Through the above description of the embodiments, those skilled in the art will clearly understand that the present invention can be implemented by combining software and a hardware platform. With this understanding in mind, all or part of the technical solutions of the present invention that contribute to the background art may be embodied in the form of a software product, which can be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, a smart phone, or a network device, etc.) to execute the methods according to the embodiments or some parts of the embodiments.
The terms and expressions used in the specification of the present invention have been set forth for illustrative purposes only and are not meant to be limiting. It will be appreciated by those skilled in the art that changes could be made to the details of the above-described embodiments without departing from the underlying principles thereof. The scope of the invention is, therefore, indicated by the appended claims, in which all terms are intended to be interpreted in their broadest reasonable sense unless otherwise indicated.

Claims (15)

1. A method for processing a micro service flow is characterized in that the method comprises the following steps:
receiving a flow calling request of a user, and starting a flow instance corresponding to the calling request;
entering a first task node according to the flow of the flow instance, and calling a first micro service for executing a first target task by the first task node to complete the first target task;
storing a first return result for calling the first micro service into a process variable pool of the process instance;
and entering a preset second task node of the process instance according to the first return result, and calling a second micro service for executing a second target task by the second task node to complete the second target task.
2. The method of claim 1, wherein the first microservice is a microservice deployed at another server.
3. The method of claim 1, wherein invoking the first micro-service for performing the first target task comprises:
a first microservice for executing a first target task is called by way of the Restful API.
4. The method of claim 1, wherein entering a predetermined second task node of the process instance based on the first returned result comprises:
and taking the first return result as an input parameter of a preset second task node of the process instance.
5. The method of claim 1, wherein variables in the process variable pool can be set.
6. The method of claim 1, wherein the process variable pool is valid within the scope of the present process instance.
7. The method of claim 6, further comprising:
and storing a second return result for calling the second micro service into the flow variable pool of the flow example so as to be called by other task nodes.
8. The method of claim 7, further comprising:
entering a third task node according to the flow of the flow instance, and calling a third micro service for executing a third target task by the third task node to complete the third target task;
and storing a third return result for calling the third micro service into the process variable pool of the process instance.
9. The method of claim 8, further comprising:
and acquiring a second return result and a third return result in the process variable pool as output results of the process instance.
10. The method of claim 1, further comprising:
before receiving a flow call request of a user, determining a task sequence of a workflow.
11. The method of claim 10, wherein the task sequence can be designed with the aid of a flow designer.
12. The method of claim 10, wherein the workflow is implemented based on activiti.
13. The method of claim 1, further comprising:
and checking the execution state of the task node of the process instance through the process history graph.
14. A computer device, comprising:
a processor; and
a memory for storing computer instructions adapted to be loaded by the processor to perform the method of any of claims 1 to 13.
15. A computer readable medium storing computer readable instructions adapted to be loaded by a processor to perform the method of any of claims 1 to 13.
CN201811032496.5A 2018-09-05 2018-09-05 Micro-service flow processing method and device Pending CN110880091A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201811032496.5A CN110880091A (en) 2018-09-05 2018-09-05 Micro-service flow processing method and device
PCT/CN2019/103985 WO2020048421A1 (en) 2018-09-05 2019-09-02 Micro-service procedure processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811032496.5A CN110880091A (en) 2018-09-05 2018-09-05 Micro-service flow processing method and device

Publications (1)

Publication Number Publication Date
CN110880091A true CN110880091A (en) 2020-03-13

Family

ID=69721497

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811032496.5A Pending CN110880091A (en) 2018-09-05 2018-09-05 Micro-service flow processing method and device

Country Status (2)

Country Link
CN (1) CN110880091A (en)
WO (1) WO2020048421A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111858001A (en) * 2020-07-15 2020-10-30 武汉众邦银行股份有限公司 Workflow processing method based on micro-service architecture system
CN112463141A (en) * 2020-11-25 2021-03-09 北京航空航天大学 BPMN-based micro-service workflow deployment method
CN113298343A (en) * 2021-03-31 2021-08-24 阿里巴巴新加坡控股有限公司 Task generation method, task execution method and device

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112738339B (en) * 2020-12-29 2022-09-23 杭州东信北邮信息技术有限公司 Service instance lossless capacity expansion and reduction method under telecommunication domain micro-service architecture
CN113204331B (en) * 2021-04-02 2022-04-15 武汉大学 Business process model-based micro-service design method and system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104574183A (en) * 2015-02-05 2015-04-29 中国农业银行股份有限公司 Cross-system information processing method and cross-system information processing device
CN106897810A (en) * 2015-12-17 2017-06-27 北京奇虎科技有限公司 Method for processing business and system, workflow engine and system, operation system
US20170331812A1 (en) * 2016-05-11 2017-11-16 Oracle International Corporation Microservices based multi-tenant identity and data security management cloud service
CN107483538A (en) * 2017-07-06 2017-12-15 聚好看科技股份有限公司 A kind of method and apparatus that access request bag is handled on the node of micro services cluster
US20180159747A1 (en) * 2016-12-05 2018-06-07 General Electric Company Automated feature deployment for active analytics microservices
CN108268271A (en) * 2016-12-29 2018-07-10 华为技术服务有限公司 The upgrade method and update device of micro services
US20180234523A1 (en) * 2017-02-15 2018-08-16 Sap Se Dynamic orchestration of microservices
CN108418862A (en) * 2018-01-31 2018-08-17 金蝶软件(中国)有限公司 Micro services management method and system based on artificial intelligence service cloud platform

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7324976B2 (en) * 2004-07-19 2008-01-29 Amazon Technologies, Inc. Automatic authorization of programmatic transactions
US10140350B2 (en) * 2015-11-09 2018-11-27 Dassault Systemes Americas Corp. Bi-directional synchronization of data between a product lifecycle management (PLM) system and a source code management (SCM) system
CN105868970B (en) * 2016-03-25 2020-01-31 联想(北京)有限公司 authentication method and electronic equipment
CN107886321B (en) * 2017-10-17 2020-05-08 维沃移动通信有限公司 Payment method and mobile terminal

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104574183A (en) * 2015-02-05 2015-04-29 中国农业银行股份有限公司 Cross-system information processing method and cross-system information processing device
CN106897810A (en) * 2015-12-17 2017-06-27 北京奇虎科技有限公司 Method for processing business and system, workflow engine and system, operation system
US20170331812A1 (en) * 2016-05-11 2017-11-16 Oracle International Corporation Microservices based multi-tenant identity and data security management cloud service
US20180159747A1 (en) * 2016-12-05 2018-06-07 General Electric Company Automated feature deployment for active analytics microservices
CN108268271A (en) * 2016-12-29 2018-07-10 华为技术服务有限公司 The upgrade method and update device of micro services
US20180234523A1 (en) * 2017-02-15 2018-08-16 Sap Se Dynamic orchestration of microservices
CN107483538A (en) * 2017-07-06 2017-12-15 聚好看科技股份有限公司 A kind of method and apparatus that access request bag is handled on the node of micro services cluster
CN108418862A (en) * 2018-01-31 2018-08-17 金蝶软件(中国)有限公司 Micro services management method and system based on artificial intelligence service cloud platform

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111858001A (en) * 2020-07-15 2020-10-30 武汉众邦银行股份有限公司 Workflow processing method based on micro-service architecture system
CN111858001B (en) * 2020-07-15 2021-02-26 武汉众邦银行股份有限公司 Workflow processing method based on micro-service architecture system
CN112732432A (en) * 2020-07-15 2021-04-30 武汉众邦银行股份有限公司 Cross-application workflow processing method
CN112732432B (en) * 2020-07-15 2021-07-06 武汉众邦银行股份有限公司 Cross-application workflow processing method
CN112463141A (en) * 2020-11-25 2021-03-09 北京航空航天大学 BPMN-based micro-service workflow deployment method
CN112463141B (en) * 2020-11-25 2021-12-14 北京航空航天大学 BPMN-based micro-service workflow deployment method
CN113298343A (en) * 2021-03-31 2021-08-24 阿里巴巴新加坡控股有限公司 Task generation method, task execution method and device
CN113298343B (en) * 2021-03-31 2023-11-14 阿里巴巴新加坡控股有限公司 Task generation method, task execution method and device

Also Published As

Publication number Publication date
WO2020048421A1 (en) 2020-03-12

Similar Documents

Publication Publication Date Title
CN110880091A (en) Micro-service flow processing method and device
US20130060596A1 (en) Easy Process Modeling Platform
CN101625738A (en) Method and device for generating context-aware universal workflow application
CN113434910A (en) Business data chaining method and device
CN110224899B (en) TCP application call chain acquisition method and device
CN112256318B (en) Construction method and equipment for dependent product
US9380000B2 (en) Deploying and modifying a service-oriented architecture deployment environment model
CN111158800B (en) Method and device for constructing task DAG based on mapping relation
CN112149838A (en) Method, device, electronic equipment and storage medium for realizing automatic model building
US20210034574A1 (en) Systems and methods for verifying performance of a modification request in a database system
CN105871960B (en) Method, device and equipment for calling data sharing
CN112364187B (en) Automobile accessory database building method, device and equipment based on big data
CN112035676B (en) User operation behavior knowledge graph construction method and device
CN112306471A (en) Task scheduling method and device
US9710495B2 (en) Business rules manager
CN116257438A (en) Updating method of interface test case and related equipment
CN114978686A (en) Digital asset chaining method and device
US11188548B2 (en) Profile data store automation via bots
CN105930431A (en) Method, device and system for accessing database
DE102015122028A1 (en) Method and device for updating contacts
US10796284B2 (en) Collaborative scheduling
CN111160403A (en) Method and device for multiplexing and discovering API (application program interface)
CN111324472B (en) Method and device for judging garbage items of information to be detected
CN113987107A (en) Dialogue method and device based on behavior tree, electronic equipment and storage medium
CN115237632A (en) Micro-service calling relation management method and device

Legal Events

Date Code Title Description
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination