CN113204331A - Business process model-based micro-service design method and system - Google Patents

Business process model-based micro-service design method and system Download PDF

Info

Publication number
CN113204331A
CN113204331A CN202110363701.1A CN202110363701A CN113204331A CN 113204331 A CN113204331 A CN 113204331A CN 202110363701 A CN202110363701 A CN 202110363701A CN 113204331 A CN113204331 A CN 113204331A
Authority
CN
China
Prior art keywords
model
bpmn
engineering
task
service
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
CN202110363701.1A
Other languages
Chinese (zh)
Other versions
CN113204331B (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.)
Wuhan University WHU
Original Assignee
Wuhan University WHU
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 Wuhan University WHU filed Critical Wuhan University WHU
Priority to CN202110363701.1A priority Critical patent/CN113204331B/en
Publication of CN113204331A publication Critical patent/CN113204331A/en
Application granted granted Critical
Publication of CN113204331B publication Critical patent/CN113204331B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • G06F8/22Procedural
    • 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/546Message passing systems or structures, e.g. queues

Abstract

The invention discloses a micro-service design method and a system based on a business process model, which comprises the steps of firstly converting a business process diagram into a BPMN engineering model; then, converting the BPMN engineering model into an SSD engineering model by applying a conversion strategy; then, converting the SSD engineering model into an SSD timing diagram by applying a visualization rule; and finally, analyzing the SD engineering model by using a conversion rule to design the micro-service. The method can automatically generate the microservice design scheme from the BPMN picture, assist designers to quickly design the system and save the design cost; the SD engineering model can be used for automatically generating codes, so that developers are assisted to quickly develop a system meeting the requirements of users, and the development cost is greatly reduced.

Description

Business process model-based micro-service design method and system
Technical Field
The invention belongs to the technical field of computer software (service modeling technology), and particularly relates to a micro-service design method based on a business process model.
Background
As a widely adopted engineering technology, software modeling refers to detailed design before actual software development, drawing a blueprint of a system, and bridging between system requirements and system implementation. Through software modeling, developers can be helped to deeply understand the overall structure of the system, the development period is helped to be shortened, and the development quality is improved.
Generally, whether software is developed as single software or software in a distributed architecture, a designer needs to draw a Business Process Model (BPMN) of a system after communicating with a user. The BPMN model plays an important role in describing service information flow in a system, among personnel, in an operation sequence and the like. On one hand, designers need to think about the logical relationship between the system flow and the data from an upper abstraction level, and comb the functions to be realized by the system, and draw a detailed BPMN model, so that the system architecture can be determined in the prior period, and software which better meets the requirements of users can be developed. On the other hand, the BPMN model can also help developers to better understand the business process and the data flow condition in the system, so that the mutual relation between the business process and different departments or roles can be better understood, and the development quality and the development efficiency of software are improved.
When micro-service design is performed based on the BPMN-based overall business view, support of corresponding automation methods and tools is still lacking at present. Designers often need to refine gradually from the beginning of demand analysis, and develop complicated modeling design manually, which greatly slows down software development speed, and the early software modeling process becomes the bottleneck of software development efficiency.
A Sequence Diagram (SD for short) describes the dynamic interaction capability between objects, and focuses on embodying the time Sequence of message transmission between objects, which can help developers to further understand the logic structure inside the system, thereby implementing the system function more efficiently. For a system based on a micro-service architecture, an SD (secure digital) graph can help a designer to perform fine-grained division of micro-services, so that the system is well deconstructed, and a micro-service system easy to develop and maintain is constructed. Therefore, the invention starts from a BPMN model and carries out microservice design by taking a timing diagram as an intermediary.
Disclosure of Invention
The technical problem to be solved and the task technology provided by the invention are a modeling method which analyzes a BPMN business flow chart drawn by a user, automatically converts the business flow chart into a corresponding time sequence chart, automatically generates a micro-service design scheme based on the generated time sequence chart to help a designer to design a micro-service, and can also automatically generate a micro-service API interface and assist a developer to develop if input and output information of each flow is complete. The method aims to help software designers to quickly perform software modeling, easily divide a micro-service framework and greatly shorten the software development period.
The method adopts the technical scheme that: a micro-service design method based on a business process model comprises the following steps:
step 1: converting the business flow chart into a BPMN engineering model;
the specific implementation comprises the following substeps:
step 1.1: reading the JSON file of the BPMN, analyzing and packaging the JSON file into a corresponding business process model according to different JSON file standards;
step 1.2: converting the analysis conversion strategy into a BPMN engineering model;
for a source file organized by a Gojs standard, converting the BPMN Gojs engineering model obtained in the step 1.1 into a BPMN engineering model by using a Gojs conversion strategy; the Gojs model comprises two elements, namely Link and Node, and the Node element in the Gojs specification encapsulates basic elements in BPMN, including swimming pool, swimming lane, event, task and gateway; link elements in the Gojs specification encapsulate the relationship between basic elements in the BPMN; in the analysis and conversion process of the Gojs model, Node elements are converted into corresponding nodes in the BPMN engineering model, namely swimming pool and lane elements in the original Gojs model are converted into swimming pool and lane objects in the BPMN engineering, events and task elements in the original Gojs model are converted into gateway objects in the BPMN engineering, gateway elements in the original Gojs model are converted into gateway objects in the BPMN engineering, and Link is converted into an element sequence in the connection relation engineering model in the BPMN;
for the source file organized by the Activitis, the BPMN Activiti engineering model obtained in the step 1.1 is converted into a BPMN engineering model by applying an Activiti conversion strategy; the Activiti model is a nested model, and the most important attributes of a node in the model comprise the name type of the node, child nodes contained in the node nesting and all connection relations related to the node; the organization hierarchy of the model is that a BPMN graph comprises a swimming pool which comprises swimming lanes, wherein the swimming lanes comprise events, tasks, gateways and connection relations; in the analysis conversion process, the swimming pool and the swimming lane elements in the original Activiti model of the original model are converted into swimming pool and swimming lane objects in the BPMN engineering through iterative analysis, the events and task elements in the original Activiti model are converted into gateway objects in the BPMN engineering, and the gateway elements in the original Activiti model are converted into gateway objects in the BPMN engineering; converting the hierarchical relationship and the link relationship in the original Activiti to obtain the connection relationship of the corresponding nodes in the BPMN engineering model;
step 2: converting the BPMN engineering model into an SD engineering model;
and step 3: the SD engineering model is converted into an SD external storage model for subsequent self-modification by designers according to requirements;
and 4, step 4: and analyzing the SD engineering model by using a conversion rule to design the micro service.
Preferably, in step 2:
converting the swimming pool lane in the BPMN engineering model obtained in the step 1.2 into a participant in the SD, namely converting the swimming pool and the swimming lane in the BPMN engineering model one by one to obtain one participant in the SD;
for a user task in the BPMN engineering model, switching to a synchronous message and a return message in the SD, wherein the sender of the synchronous message is a participant corresponding to a swim lane in which the user task is positioned, and the receiver of the synchronous message is a participant corresponding to a swimming pool in which the task is positioned; the sender of the return message is a participant corresponding to the swimming pool where the task is located, and the receiver is a participant corresponding to the swimming lane where the user task is located;
for a manual task in the BPMN engineering model, converting to a self-correlation message in the SD, wherein a sender of the self-correlation message is a participant corresponding to a swim lane where the manual task is located, and a receiver of the self-correlation message is a participant corresponding to the swim lane where the manual task is located;
messages converted into SD for service tasks in BPMN engineering model; when the next node of the service task is in the same lane, an asynchronous message is generated, the sender is a participant corresponding to the lane in which the service task is positioned, and the receiver is a participant corresponding to the lane in which the next node is positioned; when the next node of the service task is in the same swim lane, an asynchronous message is generated, the sender is a participant corresponding to the swim lane where the service task is located, and the receiver is a participant corresponding to the swimming pool where the service task is located;
for a script task in the BPMN engineering model, converting to a self-association message in the SD, wherein the sender of the self-association message is a participant corresponding to the swimming pool where the manual task is located; the recipient is a participant corresponding to the pool in which the manual task is located;
converting the unique gateway in the BPMN engineering model into an alt structure in the SD engineering model, and transferring the subsequent tasks into corresponding small branches in the alt structure;
and converting the parallel gateway in the BPMN engineering model into a par structure in the SD engineering model, and placing the subsequent task conversion into a corresponding small branch in the par structure.
Preferably, the specific implementation of step 3 comprises the following sub-steps:
step 3.1: converting the SD engineering model obtained in the step (2) into a JSON model or YAML model of the SD, namely converting participants and messages in the engineering model into the JSON model or YAML model; then, step 3.2 is executed to export and store the generated timing diagram in a file form, so that detailed design can be conveniently carried out subsequently. The user can execute the step 3.3 according to the requirement to export and store the generated sequence diagram in the form of pictures, so that the user can conveniently display and use the sequence diagram;
step 3.2: directly outputting a JSON model or YAML model of the corresponding SD, and further modifying the SD model according to the own needs after a designer obtains the JSON model or YAML model, thereby carrying out system design with finer granularity;
step 3.3: and (3) obtaining the JSON file or YAML file modified in the step (3.2), and converting by using a corresponding SD bottom layer drawing tool to obtain the PNG picture of the SD.
Preferably, the specific implementation of step 4 comprises the following sub-steps:
step 4.1: the SD engineering model obtained in the step 2 is analyzed by using a conversion rule to generate a micro-service code engineering model, namely, for each participant, a corresponding micro-service is generated, then related messages related to the participant, self-related messages, synchronous messages and asynchronous messages are converted to generate an API interface model under the micro-service, and parameters on the messages are correspondingly converted to parameters on an interface;
step 4.2: generating logic codes according to the micro-service code engineering model, wherein each micro-service correspondingly generates a Java file, and an API interface model under the micro-service is correspondingly generated and placed in the Java file to help developers develop;
step 4.3: and packaging the logic code.
The technical scheme adopted by the system of the invention is as follows: a micro-service design system based on a business process model comprises the following modules:
the module I is used for converting the business flow chart into a BPMN engineering model;
the specific implementation comprises the following sub-modules:
the submodule 1.1 is used for reading the JSON file of the BPMN and analyzing and packaging the JSON file into a corresponding business process model according to different JSON file standards;
submodule 1.2, using the following analysis and conversion strategy to convert the model into a BPMN engineering model;
for a source file organized by a Gojs standard, converting the BPMN Gojs engineering model obtained in the submodule 1.1 into a BPMN engineering model by applying a Gojs conversion strategy; the Gojs model comprises two elements, namely Link and Node, and the Node element in the Gojs specification encapsulates basic elements in BPMN, including swimming pool, swimming lane, event, task and gateway; link elements in the Gojs specification encapsulate the relationship between basic elements in the BPMN; in the analysis and conversion process of the Gojs model, Node elements are converted into corresponding nodes in the BPMN engineering model, namely swimming pool and lane elements in the original Gojs model are converted into swimming pool and lane objects in the BPMN engineering, events and task elements in the original Gojs model are converted into gateway objects in the BPMN engineering, gateway elements in the original Gojs model are converted into gateway objects in the BPMN engineering, and Link is converted into an element sequence in the connection relation engineering model in the BPMN;
for the source file organized by the Activitis, the BPMN Activiti engineering model obtained in the sub-module 1.1 is converted into a BPMN engineering model by applying an Activiti conversion strategy; the Activiti model is a nested model, and the most important attributes of a node in the model comprise the name type of the node, child nodes contained in the node nesting and all connection relations related to the node; the organization hierarchy of the model is that a BPMN graph comprises a swimming pool which comprises swimming lanes, wherein the swimming lanes comprise events, tasks, gateways and connection relations; in the analysis conversion process, the swimming pool and the swimming lane elements in the original Activiti model of the original model are converted into swimming pool and swimming lane objects in the BPMN engineering through iterative analysis, the events and task elements in the original Activiti model are converted into gateway objects in the BPMN engineering, and the gateway elements in the original Activiti model are converted into gateway objects in the BPMN engineering; converting the hierarchical relationship and the link relationship in the original Activiti to obtain the connection relationship of the corresponding nodes in the BPMN engineering model;
the module II is used for converting the BPMN engineering model into an SD engineering model;
the module III is used for converting the SD engineering model into an SD external storage model for subsequent self modification by designers according to the requirements;
and the fourth module is used for analyzing the SD engineering model by using the conversion rule to carry out micro-service design.
Preferably, the module two comprises the following sub-modules:
submodule 2.1, configured to convert the swimming pool lane in the BPMN engineering model obtained in submodule 1.2 into a participant in SD, that is, for the swimming pool and the swimming lane in the BPMN engineering model, one participant in SD is obtained through one-to-one conversion;
submodule 2.2, is used for a synchronous message and a return message in the user task switching to SD in BPMN engineering model, wherein the sender of the synchronous message is the participant corresponding to the swim lane where the user task is located, and the receiver is the participant corresponding to the swimming pool where the task is located; the sender of the return message is a participant corresponding to the swimming pool where the task is located, and the receiver is a participant corresponding to the swimming lane where the user task is located;
submodule 2.3, configured to convert, for a manual task in the BPMN engineering model, to a self-association message in the SD, where a sender of the self-association message is a participant corresponding to a swim lane where the manual task is located, and a receiver of the self-association message is a participant corresponding to the swim lane where the manual task is located;
submodule 2.4 for converting to messages in SD for service tasks in BPMN engineering model; when the next node of the service task is in the same lane, an asynchronous message is generated, the sender is a participant corresponding to the lane in which the service task is positioned, and the receiver is a participant corresponding to the lane in which the next node is positioned; when the next node of the service task is in the same swim lane, an asynchronous message is generated, the sender is a participant corresponding to the swim lane where the service task is located, and the receiver is a participant corresponding to the swimming pool where the service task is located;
submodule 2.5, for converting the script task in the BPMN engineering model into the self-association message in the SD, where the sender of the self-association message is the participant corresponding to the swimming pool where the manual task is located; the recipient is a participant corresponding to the pool in which the manual task is located;
the submodule 2.6 is used for converting the unique gateway in the BPMN engineering model into an alt structure in the SD engineering model and converting and placing a subsequent task into a corresponding small branch in the alt structure;
and the submodule 2.7 is used for converting the parallel gateway in the BPMN engineering model into a par structure in the SD engineering model and placing the subsequent task conversion into a corresponding small branch in the par structure.
Preferably, the third module comprises the following sub-modules:
a submodule 3.1, configured to convert the SD engineering model obtained in the module two into a JSON model of SD or a YAML model of SD, that is, convert participants and messages in the engineering model into participants and messages in the JSON model or the YAML model; then the execution sub-module 3.2 exports and stores the generated timing sequence in a file form for facilitating subsequent operation, and a user can execute the sub-module 3.3 to export the generated timing sequence in a picture form for facilitating subsequent display and use as required;
the submodule 3.2 is used for directly outputting a JSON model or YAML model of the corresponding SD, and a designer can further modify the SD model according to the own needs after obtaining the JSON model or YAML model, so that the system design is carried out in a finer granularity;
and the submodule 3.2 is used for obtaining the JSON file or the YAML file modified by the submodule 3.2 and then converting the JSON file or the YAML file into the PNG picture of the SD by using a corresponding SD bottom layer drawing tool.
Preferably, the module four includes the following sub-modules:
submodule 4.1, is used for utilizing SD project model that the analysis module two of the transformation rule gets to produce the micro-service code project model, namely to each participant, will produce a corresponding micro-service, then will be correlated with the relevant message that the participant is concerned, such as self-correlation message, synchronous message, asynchronous message conversion produce a API interface model under the micro-service, the parameter on the message is transformed to the parameter on the interface correspondingly;
the submodule 4.2 is used for generating a logic code according to the micro-service code engineering model, each micro-service correspondingly generates a Java file, and an API interface model under the micro-service is correspondingly generated and placed in the Java file to help a developer to develop;
and the submodule 4.3 is used for packaging the logic code, so that the development steps of developers are simplified, and the development cost is reduced.
The method comprises the steps of firstly reading a BPMN model drawn by a user, then converting the graph to obtain an internal BPMN engineering model, converting the BPMN to obtain an SD engineering model by using a conversion rule, and converting the SD engineering model by using a visualization rule to obtain an SD timing diagram, so that a designer is further assisted to design a micro-service architecture, the designer does not need to finish the whole design process, the design difficulty of the designer is greatly simplified, and the design cost is reduced. In addition, a micro service API interface can be further automatically generated based on input and output information in each flow, and development of developers is assisted, so that the service development period is shortened, and the development cost is reduced.
Drawings
FIG. 1 is an overall flow diagram of a method of an embodiment of the invention;
FIG. 2 is an overall flow of a conversion strategy from a BPMN engineering model to an SD engineering model according to an embodiment of the present invention;
FIG. 3 is a Gojs parsing model organization structure resulting from Gojs source file parsing of an embodiment of the invention;
FIG. 4 is an Activiti parsing model organization structure obtained by the Activiti source file parsing according to the embodiment of the present invention;
FIG. 5 is a data organization structure of a transformed BPMN engineering model according to an embodiment of the present invention;
FIG. 6 illustrates a swimming pool lane transformation strategy from BPMN engineering model to SD engineering model according to an embodiment of the present invention;
FIG. 7 illustrates a user task transformation strategy for transforming the BPMN engineering model into the SD engineering model according to an embodiment of the present invention;
FIG. 8 is a manual task transformation strategy for converting a BPMN engineering model to an SD engineering model, in accordance with an embodiment of the present invention;
FIG. 9 illustrates a service task transformation strategy for converting the BPMN engineering model into the SD engineering model (the next task is not in the same lane) according to an embodiment of the present invention;
FIG. 10 illustrates a service task transformation strategy for converting the BPMN engineering model into the SD engineering model (the next task is in the same lane) according to an embodiment of the present invention;
FIG. 11 is a script task transformation strategy for converting a BPMN engineering model to an SD engineering model according to an embodiment of the present invention;
FIG. 12 is a unique gateway translation strategy for the BPMN engineering model to SD engineering model according to an embodiment of the present invention;
FIG. 13 illustrates a parallel gateway translation strategy for converting a BPMN engineering model to an SD engineering model, in accordance with an embodiment of the present invention;
FIG. 14 is an SD engineering model data organization structure according to an embodiment of the invention;
fig. 15 is a data organization form of the SD JSON model obtained by conversion of the SD engineering model according to the embodiment of the present invention.
FIG. 16 is a data organization of the SDYAML model converted from the SD engineering model according to the embodiment of the present invention;
FIG. 17 is a flow chart of an order placing service for a U.S. subscriber in accordance with an embodiment of the present invention;
fig. 18 is an SD diagram obtained by converting the ordering service flow of the user by using the present invention according to the embodiment of the present invention.
Detailed Description
In order to facilitate the understanding and implementation of the present invention for those of ordinary skill in the art, the present invention is further described in detail with reference to the accompanying drawings and examples, it is to be understood that the embodiments described herein are merely illustrative and explanatory of the present invention and are not restrictive thereof.
Referring to fig. 1, the method for designing a micro-service based on a business process model provided by the present invention includes the following steps:
step 1: converting the business flow chart into a BPMN engineering model;
in this embodiment, the specific implementation of step 1 includes the following substeps:
step 1.1: reading the BPMN original file and analyzing the package. The method supports processing of the BPMN model which accords with the Gojs standard and the Activiti standard, firstly reads an original storage file of the BPMN, analyzes and packages the read original storage file into a corresponding business process model according to the format of the original storage file, analyzes a source file of the Gojs standard to obtain a BPMN Gojs engineering model, and analyzes a source file of the Activiti standard to obtain a BPMN Activiti engineering model.
Step 1.2: and (3) for the source file organized by the Gojs specification, converting the BPMN Gojs engineering model obtained in the step 1.1 into the BPMN engineering model by applying a Gojs conversion strategy. The Gojs model mainly includes Link and Node elements, the Node element in the Gojs specification encapsulates basic elements such as swimming pool, swim lane, event, task, gateway and the like in the BPMN, the Link element in the Gojs specification encapsulates the relationship between the basic elements in the BPMN, and the Gojs analysis model organization structure obtained by analyzing the Gojs source file can be referred to fig. 3. In the analysis and conversion process of the Gojs model, Node elements are converted into corresponding nodes in the BPMN engineering model, namely swimming pool and lane elements in the original Gojs model are converted into swimming pool and lane objects in the BPMN engineering, events and task elements in the original Gojs model are converted into gateway objects in the BPMN engineering, gateway elements in the original Gojs model are converted into gateway objects in the BPMN engineering, and Link is converted into an element sequence in the BPMN engineering model.
And (3) converting the BPMN activti engineering model obtained in the step 1.1 into a BPMN engineering model by applying an activti conversion strategy to the source file organized by the activti. The Activiti model is a nested model, and the most important attributes of a node in the model include attributes such as the name type of the node, child nodes contained in the node nest and all connection relations related to the node. The organization hierarchy of the model is that a BPMN graph comprises a swimming pool, the swimming pool comprises a swimming lane, the swimming lane comprises events, tasks, gateways and connection relations, and the organization structure of an Activiti analysis model obtained by analyzing an Activiti source file can be referred to fig. 4. In the analysis conversion process, the swimming pool and the swimming lane elements in the original Activiti model of the original model are converted into swimming pool and swimming lane objects in the BPMN engineering through iterative analysis, the events and task elements in the original Activiti model are converted into gateway objects in the BPMN engineering, and the gateway elements in the original Activiti model are converted into gateway objects in the BPMN engineering. And converting the hierarchical relationship and the link relationship in the original Activiti to obtain the connection relationship of the corresponding nodes in the BPMN engineering model.
The BPMN engineering model obtained after conversion has a good data organization structure, and is convenient for analyzing and converting the BPMN elements subsequently, the data organization structure of the BPMN engineering model can refer to fig. 5, Pool and lanes in the BPMN are encapsulated by Pool of the engineering model, Task in the BPMN is encapsulated by Task, Event in the BPMN is encapsulated by Event, Gateway in the BPMN is encapsulated by Gateway, and connection relation between basic elements in the BPMN is encapsulated by sequence flow.
Step 2: converting the BPMN engineering model into an SD engineering model;
please see table 1, which is a policy table for converting BPMN engineering model to SD engineering model.
TABLE 1
Figure BDA0003006561640000101
In this embodiment, the specific implementation of step 2 includes:
step 2.1: referring to fig. 6, the swimming pool lanes in the BPMN engineering model obtained in step 1.2 are transformed into participants in SD, i.e. for the swimming pool and the swimming lane in the BPMN engineering model, one participant in SD is transformed in a one-to-one correspondence.
Step 2.2: referring to fig. 7, for a user task in the BPMN engineering model, a synchronization message and a return message are switched to SD, wherein the sender of the synchronization message is the participant corresponding to the swim lane where the user task is located, and the receiver is the participant corresponding to the swimming pool where the task is located. The sender of the return message is the participant corresponding to the swimming pool where the task is located, and the receiver is the participant corresponding to the swim lane where the user task is located.
Step 2.3: referring to fig. 8, for a manual task in the BPMN engineering model to switch to a self-association message in the SD, the sender of the self-association message is the participant corresponding to the swim lane where the manual task is located, and the recipient is the participant corresponding to the swim lane where the manual task is located.
Step 2.4: referring to fig. 9, 10, messages in SD are converted for service tasks in the BPMN engineering model. When the next node of the service task is in the same lane, an asynchronous message is generated, the sender is a participant corresponding to the lane in which the service task is located, and the receiver is a participant corresponding to the lane in which the next node is located. When the next node of the service task is in the same swim lane, an asynchronous message is generated, the sender is a participant corresponding to the swim lane where the service task is located, and the receiver is a participant corresponding to the swimming pool where the service task is located.
Step 2.5: referring to fig. 11, for a scripted task in the BPMN engineering model, a transition is made to a self-association message in the SD, the sender of which is the participant corresponding to the pool in which the manual task is located. The recipient is the participant to the pool in which the manual task is located.
Step 2.6: referring to fig. 12, the unique gateway in the BPMN engineering model is translated to the alt structure in the SD engineering model and the subsequent task translations are placed into the corresponding small branches in the alt structure.
Step 2.7: referring to fig. 13, for a parallel gateway in the BPMN engineering model, it is translated to the par structure in the SD engineering model and the subsequent task translations are placed into the corresponding small branches in the par structure.
And step 3: converting the SD engineering model obtained in the step 2 into an SD external storage model for designers to modify automatically according to requirements, wherein the data organization structure of the SD engineering model can be shown in FIG. 14, Actor encapsulates participants in a timing diagram, Message encapsulates messages in the timing diagram, and Frames encapsulates segments in the timing diagram;
in this embodiment, the specific implementation of step 3 includes the following substeps:
step 3.1: and (3) converting the SD engineering model obtained in the step (2.3) into a JSON model of the SD or a YAML model of the SD, namely converting participants and messages in the engineering model into the JSON model or the YAML model. Then, step 3.2 is executed to export and store the generated timing diagram in a file form for facilitating subsequent operations, or step 3.3 is executed to export the generated timing diagram in a picture form for facilitating subsequent display and use.
Step 3.2: and directly outputting the JSON model or YAML model of the SD corresponding to the SD, and further modifying the SD model according to the own needs after a designer obtains the JSON model or YAML model, thereby carrying out system design with finer granularity. The data organization structure of JSON of SD can be seen in fig. 15, the YAML data organization structure of SD can be seen in fig. 15, the actor array encapsulates participants in the timing graph, the MeaageArray encapsulates messages in the timing graph, the FrameArray encapsulates segments in the timing graph, and the ActivitionArray encapsulates the active periods in the timing graph; data organization structure of YAML for SD see FIG. 16, where Actors encapsulates participants in the timing graph, Params encapsulates parameters of messages in the timing graph, and Lines encapsulates messages in the timing graph.
Step 3.3: and obtaining the 3.2 modified JSON file or YAML file, and then converting by using a corresponding SD bottom layer drawing tool to obtain the PNG picture of the SD.
And 4, step 4: and analyzing the SD engineering model by using a conversion rule to design the micro service.
In this embodiment, the specific implementation of step 4 includes the following sub-steps:
step 4.1: the invention can also use the SD engineering model obtained in the step 2.3 of the conversion rule analysis to generate the micro-service code engineering model, namely, for each participant, a corresponding micro-service is generated, then the related information associated with the participant, such as self-associated information, synchronous information and asynchronous information, is converted to generate an API interface model under the micro-service, and the parameters on the information are correspondingly converted to the parameters on the interface. And assisting the designer to carry out microservice design.
Step 4.2: and generating a logic code according to the micro-service code engineering model, wherein each micro-service correspondingly generates a Java file, and the API interface model under the micro-service is correspondingly generated and placed in the Java file to help developers develop.
Step 4.3: logic codes are packaged, so that development steps of developers are simplified, and development cost is reduced.
The technology of the present invention will be described more fully below with reference to a specific example. The embodiment is a business flow chart of ordering of the U.S. users, and specific business flows refer to fig. 11. The whole process steps are divided into the following steps:
step 1: reading a BPMN original file, analyzing and packaging, wherein the original file is stored by adopting a Gojs standard, and reading and analyzing to obtain a BPMN Gojs engineering model.
Step 2: and analyzing and converting Link and Node elements in the BPMN Gojs engineering model by using the analysis and conversion rule described in the S102 in the embodiment 1 to obtain the BPMN engineering model.
And step 3: the BPMN engineering model was analyzed and the transformation was performed according to the transformation strategy described in example 1. The first step is to analyze the swimming pool lane in the BPMN to be converted into participants by applying the conversion rule in the step 2.1, and five participants of a user, a payment platform, a merchant, a rider and a beauty system are obtained. And in the second step, event tasks in the BPMN are converted by using the events and task conversion rules from the step 2.2 to the step 2.5 to obtain all message streams in the SD, and the converted messages are shown in FIG. 12. And then, the third step is to analyze from the starting node backwards, sort the messages in the converted SD according to the service sequence of the original BPMN, and ensure the consistency of the time sequence in the SD and the original service flow sequence. The fourth part further analyzes the gateway in the original BPMN by using the conversion strategy in the steps 2.6-2.7, namely, the unique gateway in the graph is converted into an alt structure, and the parallel gateway in the graph is converted into a par structure. Finally, an SD engineering model is obtained, and an SD graph corresponding to the SD engineering model is shown in FIG. 12.
And 4, step 4: the micro-service design scheme is automatically generated by applying the SD engineering model, the preliminary micro-service division scheme and the interface required to be provided by the micro-service are shown in the table 2, and designers can further refine the design based on the preliminary design.
TABLE 2
Figure BDA0003006561640000131
Figure BDA0003006561640000141
It should be understood that the above description of the preferred embodiments is given for clarity and not for any purpose of limitation, and that various changes, substitutions and alterations can be made herein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (8)

1. A micro-service design method based on a business process model is characterized by comprising the following steps:
step 1: converting the business flow chart into a BPMN engineering model;
the specific implementation comprises the following substeps:
step 1.1: reading the JSON file of the BPMN, analyzing and packaging the JSON file into a corresponding business process model according to different JSON file standards;
step 1.2: converting the analysis conversion strategy into a BPMN engineering model;
for a source file organized by a Gojs standard, converting the BPMN Gojs engineering model obtained in the step 1.1 into a BPMN engineering model by using a Gojs conversion strategy; the Gojs model comprises two elements, namely Link and Node, and the Node element in the Gojs specification encapsulates basic elements in BPMN, including swimming pool, swimming lane, event, task and gateway; link elements in the Gojs specification encapsulate the relationship between basic elements in the BPMN; in the analysis and conversion process of the Gojs model, Node elements are converted into corresponding nodes in the BPMN engineering model, namely swimming pool and lane elements in the original Gojs model are converted into swimming pool and lane objects in the BPMN engineering, events and task elements in the original Gojs model are converted into gateway objects in the BPMN engineering, gateway elements in the original Gojs model are converted into gateway objects in the BPMN engineering, and Link is converted into an element sequence in the connection relation engineering model in the BPMN;
for the source file organized by the Activitis, the BPMN Activiti engineering model obtained in the step 1.1 is converted into a BPMN engineering model by applying an Activiti conversion strategy; the Activiti model is a nested model, and the most important attributes of a node in the model comprise the name type of the node, child nodes contained in the node nesting and all connection relations related to the node; the organization hierarchy of the model is that a BPMN graph comprises a swimming pool which comprises swimming lanes, wherein the swimming lanes comprise events, tasks, gateways and connection relations; in the analysis conversion process, the swimming pool and the swimming lane elements in the original Activiti model of the original model are converted into swimming pool and swimming lane objects in the BPMN engineering through iterative analysis, the events and task elements in the original Activiti model are converted into gateway objects in the BPMN engineering, and the gateway elements in the original Activiti model are converted into gateway objects in the BPMN engineering; converting the hierarchical relationship and the link relationship in the original Activiti to obtain the connection relationship of the corresponding nodes in the BPMN engineering model;
step 2: converting the BPMN engineering model into an SD engineering model;
and step 3: the SD engineering model is converted into an SD external storage model for subsequent self-modification by designers according to requirements;
and 4, step 4: and analyzing the SD engineering model by using a conversion rule to design the micro service.
2. The method for designing microservice based on business process model according to claim 1, wherein the specific implementation process of step 2 is:
converting the swimming pool lane in the BPMN engineering model obtained in the step 1.2 into a participant in the SD, namely converting the swimming pool and the swimming lane in the BPMN engineering model one by one to obtain one participant in the SD;
for a user task in the BPMN engineering model, switching to a synchronous message and a return message in the SD, wherein the sender of the synchronous message is a participant corresponding to a swim lane in which the user task is positioned, and the receiver of the synchronous message is a participant corresponding to a swimming pool in which the task is positioned; the sender of the return message is a participant corresponding to the swimming pool where the task is located, and the receiver is a participant corresponding to the swimming lane where the user task is located;
for a manual task in the BPMN engineering model, converting to a self-correlation message in the SD, wherein a sender of the self-correlation message is a participant corresponding to a swim lane where the manual task is located, and a receiver of the self-correlation message is a participant corresponding to the swim lane where the manual task is located;
messages converted into SD for service tasks in BPMN engineering model; when the next node of the service task is in the same lane, an asynchronous message is generated, the sender is a participant corresponding to the lane in which the service task is positioned, and the receiver is a participant corresponding to the lane in which the next node is positioned; when the next node of the service task is in the same swim lane, an asynchronous message is generated, the sender is a participant corresponding to the swim lane where the service task is located, and the receiver is a participant corresponding to the swimming pool where the service task is located;
for a script task in the BPMN engineering model, converting to a self-association message in the SD, wherein the sender of the self-association message is a participant corresponding to the swimming pool where the manual task is located; the recipient is a participant corresponding to the pool in which the manual task is located;
converting the unique gateway in the BPMN engineering model into an alt structure in the SD engineering model, and transferring the subsequent tasks into corresponding small branches in the alt structure;
and converting the parallel gateway in the BPMN engineering model into a par structure in the SD engineering model, and placing the subsequent task conversion into a corresponding small branch in the par structure.
3. The method for designing microservice based on business process model according to claim 1, wherein the step 3 is implemented by the following steps:
step 3.1: converting the SD engineering model obtained in the step (2) into a JSON model or YAML model of the SD, namely converting participants and messages in the engineering model into the JSON model or YAML model; then, step 3.2 is executed to export and store the generated timing diagram in a file form, so that detailed design can be conveniently carried out subsequently; the user executes the step 3.3 as required to export and store the generated sequence diagram in the form of pictures, so that the user can conveniently display and use the sequence diagram;
step 3.2: directly outputting a JSON model or YAML model of the corresponding SD, and further modifying the SD model according to the own needs after a designer obtains the JSON model or YAML model, thereby carrying out system design with finer granularity;
step 3.3: and (3) obtaining the JSON file or YAML file modified in the step (3.2), and converting by using a corresponding SD bottom layer drawing tool to obtain the PNG picture of the SD.
4. The micro-service design method based on the business process model as claimed in any one of claims 1 to 3, wherein the specific implementation of step 4 comprises the following sub-steps:
step 4.1: the SD engineering model obtained in the step 2 is analyzed by using a conversion rule to generate a micro-service code engineering model, namely, for each participant, a corresponding micro-service is generated, then related messages related to the participant, self-related messages, synchronous messages and asynchronous messages are converted to generate an API interface model under the micro-service, and parameters on the messages are correspondingly converted to parameters on an interface;
step 4.2: generating logic codes according to the micro-service code engineering model, wherein each micro-service correspondingly generates a Java file, and an API interface model under the micro-service is correspondingly generated and placed in the Java file to help developers develop;
step 4.3: and packaging the logic code.
5. A micro service design system based on a business process model is characterized by comprising the following modules:
the module I is used for converting the business flow chart into a BPMN engineering model;
the specific implementation comprises the following sub-modules:
the submodule 1.1 is used for reading the JSON file of the BPMN and analyzing and packaging the JSON file into a corresponding business process model according to different JSON file standards;
the submodule 1.2 is used for converting the analysis conversion strategy into a BPMN engineering model;
for a source file organized by a Gojs standard, converting the BPMN Gojs engineering model obtained in the submodule 1.1 into a BPMN engineering model by applying a Gojs conversion strategy; the Gojs model comprises two elements, namely Link and Node, and the Node element in the Gojs specification encapsulates basic elements in BPMN, including swimming pool, swimming lane, event, task and gateway; link elements in the Gojs specification encapsulate the relationship between basic elements in the BPMN; in the analysis and conversion process of the Gojs model, Node elements are converted into corresponding nodes in the BPMN engineering model, namely swimming pool and lane elements in the original Gojs model are converted into swimming pool and lane objects in the BPMN engineering, events and task elements in the original Gojs model are converted into gateway objects in the BPMN engineering, gateway elements in the original Gojs model are converted into gateway objects in the BPMN engineering, and Link is converted into an element sequence in the connection relation engineering model in the BPMN;
for the source file organized by the Activitis, the BPMN Activiti engineering model obtained in the sub-module 1.1 is converted into a BPMN engineering model by applying an Activiti conversion strategy; the Activiti model is a nested model, and the most important attributes of a node in the model comprise the name type of the node, child nodes contained in the node nesting and all connection relations related to the node; the organization hierarchy of the model is that a BPMN graph comprises a swimming pool which comprises swimming lanes, wherein the swimming lanes comprise events, tasks, gateways and connection relations; in the analysis conversion process, the swimming pool and the swimming lane elements in the original Activiti model of the original model are converted into swimming pool and swimming lane objects in the BPMN engineering through iterative analysis, the events and task elements in the original Activiti model are converted into gateway objects in the BPMN engineering, and the gateway elements in the original Activiti model are converted into gateway objects in the BPMN engineering; converting the hierarchical relationship and the link relationship in the original Activiti to obtain the connection relationship of the corresponding nodes in the BPMN engineering model;
the module II is used for converting the BPMN engineering model into an SD engineering model;
the module III is used for converting the SD engineering model into an SD external storage model for subsequent self modification by designers according to the requirements;
and the fourth module is used for analyzing the SD engineering model by using the conversion rule to carry out micro-service design.
6. The business process model-based microservice design system of claim 5, wherein the second module comprises the following sub-modules:
submodule 2.1, configured to convert the swimming pool lane in the BPMN engineering model obtained in submodule 1.2 into a participant in SD, that is, for the swimming pool and the swimming lane in the BPMN engineering model, one participant in SD is obtained through one-to-one conversion;
submodule 2.2, is used for a synchronous message and a return message in the user task switching to SD in BPMN engineering model, wherein the sender of the synchronous message is the participant corresponding to the swim lane where the user task is located, and the receiver is the participant corresponding to the swimming pool where the task is located; the sender of the return message is a participant corresponding to the swimming pool where the task is located, and the receiver is a participant corresponding to the swimming lane where the user task is located;
submodule 2.3, configured to convert, for a manual task in the BPMN engineering model, to a self-association message in the SD, where a sender of the self-association message is a participant corresponding to a swim lane where the manual task is located, and a receiver of the self-association message is a participant corresponding to the swim lane where the manual task is located;
submodule 2.4 for converting to messages in SD for service tasks in BPMN engineering model; when the next node of the service task is in the same lane, an asynchronous message is generated, the sender is a participant corresponding to the lane in which the service task is positioned, and the receiver is a participant corresponding to the lane in which the next node is positioned; when the next node of the service task is in the same swim lane, an asynchronous message is generated, the sender is a participant corresponding to the swim lane where the service task is located, and the receiver is a participant corresponding to the swimming pool where the service task is located;
submodule 2.5, for converting the script task in the BPMN engineering model into the self-association message in the SD, where the sender of the self-association message is the participant corresponding to the swimming pool where the manual task is located; the recipient is a participant corresponding to the pool in which the manual task is located;
the submodule 2.6 is used for converting the unique gateway in the BPMN engineering model into an alt structure in the SD engineering model and converting and placing a subsequent task into a corresponding small branch in the alt structure;
and the submodule 2.7 is used for converting the parallel gateway in the BPMN engineering model into a par structure in the SD engineering model and placing the subsequent task conversion into a corresponding small branch in the par structure.
7. The business process model-based microservice design system of claim 5, wherein module three comprises the following sub-modules:
a submodule 3.1, configured to convert the SD engineering model obtained in the module two into a JSON model of SD or a YAML model of SD, that is, convert participants and messages in the engineering model into participants and messages in the JSON model or the YAML model; then the execution submodule 3.2 exports and stores the generated timing diagram in a file form, so that detailed design can be conveniently carried out subsequently; the user executes the sub-module 3.3 according to the requirement to export the generated sequence diagram in the form of pictures, so that the user can conveniently display and use the sequence diagram;
the submodule 3.2 is used for directly outputting a JSON model or YAML model of the corresponding SD, and a designer can further modify the SD model according to the own needs after obtaining the JSON model or YAML model, so that the system design is carried out in a finer granularity;
and the submodule 3.3 is used for obtaining the JSON file or the YAML file modified by the submodule 3.2 and then converting the JSON file or the YAML file into the PNG picture of the SD by using a corresponding SD bottom layer drawing tool.
8. The business process model-based microservice design system of any of claims 5-6, wherein module four comprises the following sub-modules:
the submodule 4.1 is used for generating a micro-service code engineering model by using the SD engineering model obtained in the conversion rule analysis module two, that is, for each participant, a corresponding micro-service is generated, then the related messages, self-related messages, synchronous messages and asynchronous messages related to the participant are converted to generate an API interface model under the micro-service, and the parameters on the messages are correspondingly converted to the parameters on the interface;
the submodule 4.2 is used for generating a logic code according to the micro-service code engineering model, each micro-service correspondingly generates a Java file, and an API interface model under the micro-service is correspondingly generated and placed in the Java file to help a developer to develop;
submodule 4.3 is used for packing the logic code.
CN202110363701.1A 2021-04-02 2021-04-02 Business process model-based micro-service design method and system Active CN113204331B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110363701.1A CN113204331B (en) 2021-04-02 2021-04-02 Business process model-based micro-service design method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110363701.1A CN113204331B (en) 2021-04-02 2021-04-02 Business process model-based micro-service design method and system

Publications (2)

Publication Number Publication Date
CN113204331A true CN113204331A (en) 2021-08-03
CN113204331B CN113204331B (en) 2022-04-15

Family

ID=77026185

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110363701.1A Active CN113204331B (en) 2021-04-02 2021-04-02 Business process model-based micro-service design method and system

Country Status (1)

Country Link
CN (1) CN113204331B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170187785A1 (en) * 2015-12-23 2017-06-29 Hewlett Packard Enterprise Development Lp Microservice with decoupled user interface
CN110276592A (en) * 2019-06-14 2019-09-24 北京科技大学 A kind of micro services system business process variability modelling method and system
WO2020048421A1 (en) * 2018-09-05 2020-03-12 易保网络技术(上海)有限公司 Micro-service procedure processing method and device
CN112486998A (en) * 2020-12-14 2021-03-12 北京航空航天大学 BPMN-based micro-service work flow importing method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170187785A1 (en) * 2015-12-23 2017-06-29 Hewlett Packard Enterprise Development Lp Microservice with decoupled user interface
WO2020048421A1 (en) * 2018-09-05 2020-03-12 易保网络技术(上海)有限公司 Micro-service procedure processing method and device
CN110276592A (en) * 2019-06-14 2019-09-24 北京科技大学 A kind of micro services system business process variability modelling method and system
CN112486998A (en) * 2020-12-14 2021-03-12 北京航空航天大学 BPMN-based micro-service work flow importing method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
何啸等: "一种针对模型转换的图形化建模语言", 《计算机研究与发展》 *
宋扬: "基于微服务及大数据的通号智能维护系统的研发及其应用", 《铁路通信信号工程技术》 *

Also Published As

Publication number Publication date
CN113204331B (en) 2022-04-15

Similar Documents

Publication Publication Date Title
CN102541541B (en) Interface creating method and device
CN111666526A (en) Page generation method, device, equipment and storage medium
CN113268319A (en) Business process customization and distributed process scheduling method based on micro-service architecture
CN102662766B (en) Microblog and social networking information synchronizing system and synchronizing method based on Web Element mechanism
US20100138808A1 (en) Embedded system design device and a method thereof using a target independent model
CN111597484B (en) UI dynamic generation method
EP0961968A1 (en) Method and system for generating software code
CN103513976B (en) Service flowpath modelling approach and device
CN110764752B (en) System and method for realizing graphic service arrangement of Restful service
CN111158690B (en) Desktop application framework, construction method, desktop application running method and storage medium
CN112311664A (en) Industrial Internet data interaction method and system and industrial gateway
CN101695080A (en) Execution method of BPMN composition service and execution device thereof
CN113204331B (en) Business process model-based micro-service design method and system
CN113111109A (en) Interface warehousing analysis access method of data source
Yu et al. Towards a model driven approach to automatic bpel generation
CN102438021B (en) Processing method and device for telecommunications service development
CN112799734B (en) Flow management method, image processing method, and corresponding platform and device thereof
CN113111108A (en) File data source warehousing analysis access method
Manev et al. Facilitation of IoT software maintenance via code analysis and generation
CN113111111A (en) Multi-data source database access method
CN109918050B (en) Software requirement description rule language and conversion method
CN103176830A (en) Method for generating C++code based on combination of class diagram and activity diagram
CN111522546B (en) Page generation method, related device and front-end page
CN116521155B (en) Method for dynamically generating Restful interface based on JSON description
Hufnagel et al. Framework for a model-based, cross-domain system interconnection in automation technology

Legal Events

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