Automation field driven modeling method based on large model
Through the combination of large models and Prompt templates, the automation field drives the modeling process, solving the problem of many people and long processes in the event storm method, improving modeling efficiency and credibility, and reducing costs.
Patent Information
- Application Number
- CN202411287516.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2024-12-06
AI Technical Summary
Existing field-driven modeling methods such as event storms require multiple people to participate, long process, rely on the host's experience and arbitrary results, resulting in high time and labor costs.
Using large models combined with pre-set Prompt templates, the field-driven modeling process is automated, and the field-driven modeling process is reduced by determining product vision, analyzing business scenarios, extracting decision-making commands and field events, identifying field objects, demarcating bounded contexts and splitting microservices. and time cost.
Improves the efficiency and credibility of field-driven modeling, reduces time and labor costs, and achieves more accurate and available modeling results.
Smart Images

Figure CN119089290A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of domain driven modeling, and in particular relates to an automated domain driven modeling method based on a large model. Background Art
[0002] Large language models emerged around 2018 and quickly gained a place in the field of natural language processing. These models usually have billions or more parameters, are trained based on large amounts of text data, and are designed to simulate human language expression and comprehension abilities. The main principle is to convert input text into a language that can be understood and generated by the machine through neural networks and natural language processing technology.
[0003] Prompt engineering is a fast, flexible, and low-cost method for applying large language models. It guides the model to generate specific outputs by designing precise prompts. A prompt is a piece of text that guides the model to generate expected answers or outputs. Prompts generally include four parts: instructions are specific tasks that you want the model to perform; context provides background information to help guide the model to respond better; input data tells the model what data needs to be processed; and output instructions specify the type or format of the model's output. The quality of the prompt is an important factor in the performance of large language models in processing downstream tasks. Optimizing the design of the input prompt can enable the model to better understand the user's intentions, thereby providing more accurate and expected answers.
[0004] Domain-Driven Design (DDD) is a design method that focuses on complex domain modeling. It closely integrates the design and implementation of software systems with business experts, and builds high-quality software systems that meet business needs by deeply understanding the core concepts and rules of the business domain. Its core goal is to build a system that closely corresponds to the business domain, making the business logic clearer, maintainable, and extensible.
[0005] Generally speaking, the general process of domain-driven design includes four steps: domain decomposition, domain modeling, detailed design, and technical implementation. Among them, domain decomposition and domain modeling are the most critical, and are completed by agile teams composed of technical experts in the technical field and technical experts. The results of their collaboration are ultimately reflected in the domain model; detailed design and technical implementation are implemented in code by technical experts according to the results of domain modeling, and the code is interpreted and refactored based on the understanding of the model, so as to achieve agile iteration of software products in the face of changes in business needs.
[0006] The current domain-driven modeling method relies on experts in the technical field and technical experts to complete it through event storming. Taking the domain-driven modeling of an online leave and attendance management application as an example, the event storming modeling process is as follows: (1) Preparation: prepare colored stickers, pens and paper, a large enough room, etc. There should be no chairs in the room, because during the event storming process, we hope that everyone will concentrate on it, rather than sitting in a chair and relaxing. Invite project team members such as domain experts, DDD experts, architects, product managers, project managers, developers, testers, and UI designers.
[0007] (2) Sort out domain events and decision commands: An event is something that has already happened and is important. An event must be a fait accompli and something that the business is concerned about. Usually the moderator will prepare the first event (which can be any event in the system) and then post it on the wall. Questions will guide team members participating in the event storm to continuously add newly discovered events to the wall. Events should maintain the overall chronological order: things that happened first are posted on the left, and things that happened later are posted on the right. Decision commands generate events, which can be understood as actions that generate events and correspond to events one by one. Specifically, the moderator prepares the first event: "Leave application submitted" and posts it on the wall; team members begin to think about other events and decision commands related to the event and add them to the wall; possible events include "approval passed", "approval failed", "leave data verification", etc. Decision commands include "submit leave application", "submit to superiors for approval step by step", "verify leave data", etc.
[0008] (3) Extract domain objects: Analyze and find out the entities and value objects that initiate or generate these commands or domain events, and aggregate the commands and events related to the entities or value objects into entities. Specifically, for leave management, team members analyze and find out possible entities such as "leave request form", "approval rules", "attendance rules" and value objects such as "leave requester", "leave type", "leave days", etc.
[0009] (4) Constructing aggregates: From the entities in the previous step, first find the aggregate root, and then find the entities and value objects that are closely dependent on the aggregate root. Specifically, the team members select "leave form" as the aggregate root from the entities in the previous step, and further find the entities and value objects that are closely dependent on the aggregate root of "leave form", such as "person applying for leave", "type of leave", "number of days of leave", etc.
[0010] (5) Define bounded contexts: Merge aggregates with high business relevance and divide bounded contexts. Specifically, team members create a bounded context called "Leave Management". The "Leave Management" bounded context contains the "Leave Form" aggregate root and its associated entities and value objects.
[0011] (6) Microservice splitting: Taking into account a variety of external factors, such as single responsibility, separation of agile and stable business, non-functional requirements (such as elastic scaling, version release frequency and security requirements), software package size, team communication efficiency and technical heterogeneity, the entire service is split into microservices. Specifically, team members create an independent "leave approval service" to handle the approval process of leave applications, and an independent "attendance statistics service" to handle the verification and statistics of attendance data.
[0012] However, event storming also has the following problems: (1) The event storming model is heavy and requires the collective participation of members of different roles, involving many people and a long process.
[0013] (2) The key to the success of event storming lies in convergence logic, which is extremely dependent on the experience and judgment of the host. The final result is naturally somewhat random. Summary of the invention
[0014] In view of the problems existing in the prior art, the present invention applies the big model to the domain-driven modeling process, utilizing the big model's super ability and flexibility to handle complex problems, combined with the pre-set Prompt template, to a certain extent solves the problem of large number of personnel and long process when performing domain-driven modeling using the traditional event storming method, and also makes the domain-driven modeling results credible and usable, greatly reducing time and labor costs.
[0015] Technical solution of the present invention An automated domain-driven modeling method based on a large model comprises the following steps: Step S1: Based on the basic background of the application project, combined with the prompt template, use the big model to determine the product vision; Step S2: Based on the product vision and combined with the prompt template, use the big model to analyze the business scenario, extract the business process, and identify all decision commands and domain events of the business logic from the business process; Step S3: Based on the decision commands and domain events extracted during the business process analysis, combined with the prompt template, extract the domain objects that generate these business behaviors, namely entities and value objects. Use the big model to analyze the dependencies between entities to form aggregates, and define bounded contexts for aggregates, thus completing domain modeling; Step S4: Based on the domain modeling results, combined with the Prompt template, the large model is used to comprehensively consider various external factors to split the microservices; Furthermore, the basic background of the application project in step S1 refers to descriptive text including project objectives and complete project functions; Furthermore, the Prompt template described in step S1 has the following specific contents: Among them, <Basic Background Description Text> is the basic background of the application project. The text combination of the above paragraphs (target users, core values, name, core functions, competitor names and differentiated competitive points) generated by the large model is the product vision of the application project <Project Product Vision>.
[0016] Furthermore, the use of the big model to extract the business process in step S2 refers to taking the product vision determined in step S1 as input, requiring the big model to explore the possible operations of users of different roles from the user's perspective, and to restore all business scenarios from front-end operations to back-end business logic as much as possible; Furthermore, the Prompt template described in step S2 has the following specific contents: Furthermore, the method for extracting decision commands and domain events in the business logic in step S2 is to use a natural language processing method to extract words in the form of "verb + noun" from the input business scenario text as commands, and convert the above "verb + noun" into the form of "noun + be + verb" as events, and output the results in JSON list format; The command in step S2 refers to an action, which can be initiated by a user, a third-party system call, or a timer trigger, etc. The command is usually in the form of "verb + noun"; the event in step S2 refers to the result of an action, which has an important impact on the system, such as generating some data internally, triggering some process or some change in the state of things, sending some information externally, etc. The event is usually in the form of "noun + object + verb"; Furthermore, the entity in step S3 refers to a domain object that has a unique identifier and whose identifier remains consistent after various state changes; the value object in step S3 refers to an object identified by an object attribute value, which combines multiple related attributes into a conceptual whole, is used to describe a specific aspect of the domain, and is an object without an identifier. Furthermore, the composition aggregate in step S3 refers to the large model finding all the domain objects found in the previous steps, first finding the aggregate root, and then placing the domain objects closely related to the aggregate root in the aggregate where the aggregate root is located; Furthermore, the division of bounded contexts in step S3 refers to dividing aggregates that jointly complete a business function and are unambiguous into a bounded context by using a large model based on factors such as business and semantic boundaries. Furthermore, the Prompt template described in step S3 has the following specific contents: Furthermore, the various external factors described in step S4 include non-business factors such as singleness of responsibility, separation of agile and stable businesses, non-functional requirements (such as elastic scaling, version release frequency and security requirements), software package size, team communication efficiency and technical heterogeneity; Furthermore, the Prompt template described in step S4 has the following specific contents: Beneficial Effects The present invention applies the big model to the process of domain-driven modeling, taking advantage of the big model's super ability and flexibility to handle complex problems, combined with a pre-set prompt template, to a certain extent solves the problem of large number of personnel and long process when performing domain-driven modeling using the traditional event storming method, and also makes the domain-driven modeling results credible and usable, greatly reducing time and labor costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 A flowchart of an automated domain-driven modeling method based on a large model according to an embodiment of the present invention; Figure 2 A flowchart of determining a product vision in step S1 of an embodiment of the present invention; Figure 3 This is a flowchart of analyzing a business scenario in step S2 of an embodiment of the present invention; Figure 4 Flow chart of domain modeling for step S3 of an embodiment of the present invention. DETAILED DESCRIPTION
[0018] like Figure 1 As shown in the figure, the specific steps of an automated domain-driven modeling method based on a large model are: Step S1: Based on the basic background of the application project, combined with the prompt template, use the big model to determine the product vision; Step S2: Based on the product vision and combined with the prompt template, use the big model to analyze the business scenario, extract the business process, and identify all decision commands and domain events of the business logic from the business process; Step S3: Based on the decision commands and domain events extracted during the business process analysis, combined with the prompt template, extract the domain objects that generate these business behaviors, namely entities and value objects. Use the big model to analyze the dependencies between entities to form aggregates, and define bounded contexts for aggregates, thus completing domain modeling; Step S4: Based on the domain modeling results, combined with the Prompt template, the large model is used to comprehensively consider various external factors to split the microservices; Step S1: Determine the product vision. The specific process is as follows: Figure 2 shown.
[0019] An automated domain-driven modeling method based on a large model, wherein the basic background of the application project in step S1 refers to descriptive text including project goals and complete project functions.
[0020] Taking an online leave and attendance management application as an example, the basic background of the project input is "The goal of the project is to realize online leave and attendance management. The functional description is as follows: the leave applicant fills out a leave application and submits it for approval. The application is verified according to the identity of the leave applicant, the leave type and the number of days of leave. According to the approval rules, it is submitted to the superior for approval step by step. If it is approved step by step, the approval is completed. Otherwise, it is returned to the applicant if it fails. According to the attendance rules, after the leave data is verified, the attendance data is verified and the attendance statistics are output." The Prompt template described in step S1 has the following specific contents: Replace the text slot <Basic Background Description Text> in the template with the basic background of the online leave and attendance management application mentioned above, and you can get the project product vision: "The target users of the product are internal and external personnel; the core value of the product is online leave, automatic attendance statistics and external personnel management; the name of the product is online leave and attendance system; the core functions of the product are online leave, automatic attendance statistics, support for leave on both internal and external networks, and management of leave and regular attendance analysis for internal and external personnel; the name of the product's competitive product is HR system; the differentiated competitive point of the product is that it can be used on both internal and external networks, and can achieve equal management of internal and external personnel." Step S2 analyzes the business scenario. The specific process is as follows: Figure 3 shown.
[0021] The use of the big model to extract the business process in step S2 refers to taking the product vision determined in step S1 as input and requiring the big model to restore all business scenarios from front-end operations to back-end business logic as much as possible according to the operations or processes of using the product by different user roles; the specific content of the prompt template in step S2 is as follows: Replace the text slot <Project Product Vision> in the template with the product vision of the online leave and attendance management application mentioned above, and you can get a JSON list of business scenarios for the product, such as ["Leave requester logs in to the system", "Create a leave request", "Modify a leave request", "Submit for approval"].
[0022] The method for extracting decision commands and domain events in the business logic described in step S2 is to use the natural language processing method to extract words in the form of "verb + noun" from the input business scenario text as commands, and convert the above "verb + noun" into the form of "noun + be + verb" as events, and output the results in JSON list format. For example, commands such as "create leave request" and "modify leave request" can be extracted from the above leave request scenario, and correspondingly, events such as "leave request created" and "leave request modified" can be extracted.
[0023] Among them, the decision command refers to an action, which can be initiated by the user, or a third-party system call or timer trigger, etc. The command is usually in the form of "verb + noun"; the domain event refers to the result of a certain action. The event will have an important impact on the system, such as generating certain data internally, triggering a certain process or a certain change in the status of things, sending certain information externally, etc. The event is usually in the form of "noun + be + verb".
[0024] Step S3: Domain modeling. The specific process is as follows: Figure 4 shown.
[0025] The Prompt template described in step S3 has the following specific contents: The entity in step S3 refers to a domain object with a unique identifier, and its identifier remains consistent after various state changes; a value object refers to an object identified by the value of an object attribute, which combines multiple related attributes into a conceptual whole, is used to describe a specific aspect of the domain, and is an object without an identifier. Nouns in business processes are usually entities and value objects. Using the big model, entities such as "leave request" and "personnel" and value objects such as "approval rules" can be extracted from the business process description text of the above leave.
[0026] The composition aggregation described in step S3 refers to the large model finding all the domain objects found in the previous steps, first finding the aggregate root, and then placing the domain objects closely related to the aggregate root in the aggregate where the aggregate root is located. For example, a leave application is an aggregate root, and the approval opinions, approval rules and leave applications are closely related and divided into the leave application aggregation. After analysis, three aggregations of leave, personnel organization relationship and attendance can be established in the end. Among them, the leave application aggregation has value objects such as leave application, approval opinion entity and approval rule. The personnel organization relationship aggregation has entities such as personnel and organization relationship. The attendance aggregation has entities such as card swiping details, attendance details and attendance statistics.
[0027] The division of bounded contexts in step S3 means that on the basis of dividing aggregations, the big model is used to divide the aggregations that jointly complete a business function and are unambiguous into a bounded context according to factors such as business and semantic boundaries. Since the personnel organization relationship aggregation and the leave aggregation jointly complete the business function of leave, both are within the bounded context of leave. The attendance aggregation constitutes the attendance statistics bounded context alone. The big model divides the business into two bounded contexts, leave and attendance statistics, and establishes two domain models for leave and attendance.
[0028] The various external factors described in step S4 include single responsibility, separation of agile and stable business, non-functional requirements (such as elastic scaling, version release frequency and security requirements), software package size, team communication efficiency and technical heterogeneity. The specific contents of the prompt template described in step S4 are as follows: According to the bounded context JSON format data of the online leave and attendance management application extracted above, the big model splits the business into two microservices, leave and attendance, according to the principle of single responsibility. The microservices are represented in JSON dictionary format, describing which aggregations are contained in each microservice. The leave microservice contains two aggregations, personnel organization relationship and leave, and the attendance microservice contains the attendance aggregation.
Claims
1. An automated domain-driven modeling method based on a large model, characterized in that: The following steps are involved: Step S1: Based on the basic background of the application project, combined with the prompt template, use the big model to determine the product vision; The basic background of the application project refers to descriptive text including project objectives and complete project functions; Step S2: Based on the product vision and combined with the prompt template, use the big model to analyze the business scenario, extract the business process, and identify all decision commands and domain events of the business logic from the business process; Step S3: Based on the decision commands and domain events extracted during the business process analysis, combined with the prompt template, the domain objects that generate these business behaviors, namely entities and value objects, are extracted; the dependency relationships between entities are analyzed using the big model to form aggregations, and bounded contexts are defined for the aggregations, thus completing domain modeling; The entity refers to a domain object that has a unique identifier and whose identifier remains consistent after various state changes; the value object refers to an object identified by the object attribute value, which combines multiple related attributes into a conceptual whole, is used to describe a specific aspect of the domain, and is an object without an identifier; Step S4: Based on the domain modeling results, combined with the Prompt template, the large model is used to comprehensively consider various external factors to split the microservices.
2. The method for automated domain-driven modeling based on a large model as claimed in claim 1, characterized in that: The Prompt template described in step S1 has the following specific contents: Among them, <Basic Background Description Text> is the basic background of the application project, and the text combination of the above paragraphs generated by the large model is the product vision of the application project <Project Product Vision>.
3. The method for automated domain-driven modeling based on a large model as claimed in claim 1, characterized in that: The use of the big model to extract the business process in step S2 refers to taking the product vision determined in step S1 as input, requiring the big model to explore the possible operations of users of different roles from the user's perspective, and to restore all business scenarios from front-end operations to back-end business logic as much as possible; The specific contents of the Prompt template are as follows: Among them, <Project Product Vision> is the product vision determined in step S1.
4. The method for automated domain-driven modeling based on a large model as claimed in claim 1, characterized in that: The method for extracting decision commands and domain events in the business logic in step S2 is to use the natural language processing method to extract words in the form of "verb + noun" from the input business scenario text as commands, and convert the above "verb + noun" into the form of "noun + be + verb" as events, and output the results in JSON list format; Among them, the command described in step S2 refers to a certain action, which can be initiated by the user, or a third-party system call or timer trigger, etc. The command is in the form of "verb + noun"; the event described in step S2 refers to the result of a certain action, and the event will have an important impact on the system, such as generating certain data internally, triggering a certain process or a certain change in the status of things, sending certain information externally, etc. The event is in the form of "noun + being + verb".
5. The method for automated domain-driven modeling based on a large model as claimed in claim 1, characterized in that: The composition of the aggregate described in step S3 refers to the large model finding all the domain objects found in the previous steps, first finding the aggregate root, and then placing the domain objects closely related to the aggregate root in the aggregate where the aggregate root is located; the division of the bounded context refers to the use of the large model on the basis of dividing the aggregate, according to factors such as business and semantic boundaries, to divide the aggregates that jointly complete a business function and are unambiguous into a bounded context.
6. The method for automated domain-driven modeling based on a large model as claimed in claim 1, characterized in that: The Prompt template described in step S3 has the following specific contents: 。 7. The method for automated domain-driven modeling based on a large model as claimed in claim 1, characterized in that: The various external factors described in step S4 include single responsibility, separation of agile and steady-state businesses, non-functional requirements, software package size, team communication efficiency, and technical heterogeneity.
8. The method for automated domain-driven modeling based on a large model as claimed in claim 1, characterized in that: The Prompt template described in step S4 has the following specific contents:
Citation Information
Patent Citations
Micro-service decomposition method based on domain-driven design and service panoramic event storm
CN113326028A
Rapid implementation method for enabling AI intelligent quality inspection by applying large language model
CN116862309A
Customized micro-service splitting method based on large model
CN118012503A
Project optimization problem rapid modeling method and system based on large language model
CN118151910A
Multi-modal event intelligent sensing method based on large model prompt project
CN118172531A
Cited By
Low-code platform-based application model generation method, equipment and medium
CN119556910A
A method, device, and medium for generating an application model based on a low-code platform
CN119556910B
DDD-based software automatic design method and apparatus, and electronic device
CN121934820A
