Method and device for automatically designing domain model and storage medium

By automatically generating domain models using large language models, the problem of industry knowledge barriers and modeling technology gaps in domain application software is solved, and efficient, accurate domain model design and standardized output are achieved.

CN120803429APending Publication Date: 2025-10-17SHENZHEN AOZHE NETWORK TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510890191.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-30
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

The development of existing domain application software requires a deep understanding of industry business logic and modeling capabilities. There is a lack of interdisciplinary talents and the costs are high, making it difficult to automatically generate domain models.

Method used

The system automatically generates domain models using a large language model. After the user inputs the name of the business object, the system outputs the domain model, model data flow relationships, and model field definitions in JSON format. The system adopts a step-by-step construction prompt design to ensure the flexibility and accuracy of the generated model.

Benefits of technology

Significantly shorten design cycles, improve design quality and accuracy, reduce reliance on multidisciplinary experts, and provide standardized formats to enhance versatility and compatibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120803429A_ABST
    Figure CN120803429A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a method and equipment for automatically designing a domain model, and a storage medium. The method comprises the following steps: acquiring a plurality of business object names input by a user; constructing a first prompt instruction used for prompting design of the domain models, and inputting the first prompt instruction and the plurality of business object names into the first large language model to obtain JSON description of the domain models corresponding to the business object names and JSON description of a data flow relationship between the domain models; and constructing a second prompt instruction used for prompting design of a model field of the domain model, and inputting the second prompt instruction, the JSON description of the domain model and the JSON description of the data flow relationship related to the domain model into a second large language model to obtain the JSON description of the model field of the domain model. The domain model design is automatically generated through a large language model, a user only needs to input a business object name, a system can automatically output the domain model in a JSON format, a model data flow relation and a model field definition, and the domain model and related description thereof are efficiently output.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to, but are not limited to, the technical field of computer technology, and in particular to a method for automatically designing a domain model, an electronic device, and a computer readable storage medium. BACKGROUND

[0002] Domain application software (referred to as "domain application" for short), such as customer relationship management systems (CRM, Customer Relationship Management), enterprise resource planning systems (ERP, Enterprise Resource Planning), and order management systems (OMS, Order Management System), etc., has significant industry attributes. The successful construction of such systems requires the integration of two types of core capabilities: one is a deep understanding of industry business logic, knowledge system, and operation process; the second is the modeling ability to abstract business requirements into system models. However, the compound talents who are proficient in both industry cognition and modeling technology are not only scarce, but also have extremely high labor costs. Therefore, there is an urgent need for a method for automatically designing a domain model to systematically solve the dual challenges of "industry cognition barriers" and "modeling technology gap". SUMMARY

[0003] Embodiments of the present application provide a method for automatically designing a domain model, an electronic device, and a computer readable storage medium, aiming to improve the modeling efficiency and accuracy of the domain model.

[0004] In a first aspect, embodiments of the present application provide a method for automatically designing a domain model, the method comprising: obtaining a plurality of business object names input by a user; constructing a first prompt instruction for prompting the design of a domain model, inputting the first prompt instruction and a plurality of business object names into a first large language model, and obtaining a JSON description of the domain model corresponding to the business object names and a JSON description of the data flow relationship between the domain models; constructing a second prompt instruction for prompting the design of the model field of the domain model, inputting the second prompt instruction, the JSON description of the domain model, and the JSON description of the data flow relationship related to the domain model into a second large language model, and obtaining a JSON description of the model field of the domain model.

[0005] Embodiments of the present application have at least the following beneficial effects: The embodiment of the application generates a domain model design through a large language model. A user only needs to input a business object name, and the system can automatically output a JSON format domain model, a model data flow relationship and a model field definition. The domain model and its related description are efficiently output. The design period is greatly shortened, the accuracy and rationality of the design are guaranteed, and the design quality is improved. At the same time, the dependence on a compound expert is significantly reduced, and the dual difficulties of industry cognitive barriers and modeling technology gap are solved. In addition, in the above scheme, the design of the step-by-step construction prompt instruction makes the generated domain model more flexible and can quickly adapt to different business needs. The JSON description output provides a standardized format for the storage, transmission and use of the domain model, and enhances the universality and compatibility.

[0006] In a possible implementation of the application, the first prompt instruction includes a domain model structured description specification and a model data relationship structured description specification. The domain model structured description specification is used to specify the JSON description structure of the domain model output by the first large language model. The model data relationship structured description specification is used to specify the JSON description structure of the data flow relationship between the domain models output by the first large language model.

[0007] In a possible implementation of the application, inputting the first prompt instruction and a plurality of business object names into a first large language model to obtain a JSON description of a domain model corresponding to the business object name and a JSON description of a data flow relationship between domain models includes: Inputting the first prompt instruction and a plurality of business object names into a first large language model to obtain a target result, the target result being obtained by merging the JSON description of the domain model and the JSON description of the data flow relationship between the domain models; Before constructing a second prompt instruction for prompting a model field of the designed domain model, the method further includes: Generating a data flow graph according to the target result and displaying the data flow graph to the user, the data flow graph including a plurality of domain model nodes and a data flow between the plurality of domain model nodes; Receiving an instruction of the user confirming the data flow graph.

[0008] In a possible implementation of the application, the first prompt instruction further includes a JSON description of an existing domain model and a JSON description of a data flow relationship between the existing domain models.

[0009] In a possible implementation of the present application, the second prompt instruction comprises a model field structured description specification, and the model field structured description specification is used to specify a JSON description structure of a model field of the domain model output by the second large language model.

[0010] In a possible implementation of the present application, after obtaining the JSON description of the model field of the domain model, the method further comprises: generating a user interface of the domain model according to the JSON description of the model field of the domain model; displaying the user interface of the domain model to the user.

[0011] In a possible implementation of the present application, the inputting the second prompt instruction, the JSON description of the domain model and the JSON description of the data flow relationship related to the domain model into the second large language model to obtain the JSON description of the model field of the domain model comprises: inputting the second prompt instruction, the JSON description of the domain model and the JSON description of the data flow relationship related to the domain model into the second large language model, determining a reference field of the domain model according to the JSON description of the data flow relationship related to the domain model by the second large language model, and determining a subtable field of the domain model according to the JSON description of the domain model.

[0012] In a second aspect, the embodiments of the present application further provide a device for automatically designing a domain model, and the device comprises: a obtaining module, configured to obtain a plurality of business object names input by a user; a first processing module, configured to construct a first prompt instruction for prompting to design a domain model, input the first prompt instruction and the plurality of business object names into a first large language model, and obtain a JSON description of a domain model corresponding to the business object names and a JSON description of a data flow relationship between the domain model; a second processing module, configured to construct a second prompt instruction for prompting to design a model field of the domain model, input the second prompt instruction, the JSON description of the domain model and the JSON description of the data flow relationship related to the domain model into a second large language model, and obtain a JSON description of a model field of the domain model.

[0013] In a third aspect, the embodiments of the present application further provide an electronic device, comprising: at least one processor; at least one memory configured to store at least one program; and at least one of the programs is executed by at least one of the processors to execute the method for automatically designing a domain model in the first aspect.

[0014] In a fourth aspect, the embodiments of the present application further provide a computer readable storage medium storing computer executable instructions for executing the method for automatically designing a domain model according to the first aspect.

[0015] The beneficial effects of any of the second to fourth aspects can be referred to the description of the beneficial effects of the first aspect, which will not be repeated here.

[0016] It should be understood that the foregoing general description and the following detailed description are only examples, and are not limiting to the present application. BRIEF DESCRIPTION OF DRAWINGS

[0017] Figure 1 A system architecture diagram for automatically designing a domain model according to the embodiments of the present application; Figure 2 A flowchart of a method for automatically designing a domain model according to the embodiments of the present application Figure 1 Figure 3 A flowchart of a method for automatically designing a domain model according to the embodiments of the present application Figure 2 Figure 4 A flowchart of a method for automatically designing a domain model according to the embodiments of the present application Figure 3 Figure 5a A diagram of a first prompt instruction according to the embodiments of the present application; Figure 5b A diagram of a domain model structured description specification according to the embodiments of the present application; Figure 5c A diagram of a model data relationship structured description specification according to the embodiments of the present application; Figure 5d A diagram of a target result according to the embodiments of the present application; Figure 5e A diagram of a data flow graph according to the embodiments of the present application; Figure 5f A diagram of a second prompt instruction according to the embodiments of the present application; Figure 5g A diagram of a structured description of a model field according to the embodiments of the present application; Figure 5h A diagram of a customer model interface according to the embodiments of the present application; Figure 6 A diagram of an electronic device according to the embodiments of the present application. DETAILED DESCRIPTION

[0018] ​​​In order to make the purposes, technical methods and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application and not to limit the present application.

[0019] It should be noted that although the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that in the flow chart. In the description of the specification and claims and the above description of the drawings, "at least one" means one or more, the meaning of multiple (or multiple items) is two or more, greater than, less than, more than, etc. is not included in the number, above, below, within, etc. is understood to include the number. If there is a description of "first", "second", etc. is only used to distinguish technical features for the purpose, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features or implicitly indicating the relationship between the indicated technical features.

[0020] In the embodiments of the present application, the association relationship of the associated objects described by "and / or" represents that there can be three kinds of relationships, for example, A and / or B can represent the cases of A alone, A and B together, and B alone. Wherein A, B can be singular or plural. The character " / " generally represents that the associated objects before and after are in an "or" relationship. "At least one of the following" and the like means any combination of these items, including any combination of single or multiple items. For example, at least one of a, b and c can represent: a alone, b alone, c alone, a and b together, a and c together, b and c together, or a and b and c together, wherein a, b, c can be single or multiple.

[0021] In the embodiments of the present application, the words "exemplary" or "for example" are used to mean serving as an example, instance, or illustration. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Rather, the use of the words "exemplary" or "for example" is intended to present related concepts in a specific manner.

[0022] Domain application software (referred to as "domain application" for short), such as customer relationship management systems (CRM, Customer Relationship Management), enterprise resource planning systems (ERP, Enterprise Resource Planning), and order management systems (OMS, Order Management System), etc., has significant industry attributes. The successful construction of such systems requires the integration of two core capabilities: one is a deep understanding of industry business logic, knowledge system and operation process; the second is the modeling ability to abstract business requirements into system models. However, the compound talents who are proficient in both industry cognition and modeling technology are not only scarce, but also have high labor costs. Therefore, an automatic domain model design method is urgently needed to systematically solve the dual challenges of "industry cognition barriers" and "modeling technology gap".

[0023] Based on the above-mentioned problems, the embodiment of the present application provides a method for automatically designing a domain model, an electronic device and a computer readable storage medium. By using a large language model to automatically generate a domain model design, a user only needs to input a business object name, and the system can automatically output a JSON format domain model, a model data flow relationship and a model field definition. The domain model and its related description are efficiently output, which not only greatly shortens the design cycle, but also guarantees the accuracy and rationality of the design, and improves the design quality. At the same time, the dependence on compound experts is significantly reduced, and the dual difficulties of industry cognition barriers and modeling technology gap are broken. In addition, the design of the step-by-step construction prompt instruction in the above-mentioned scheme makes the generated domain model more flexible and can quickly adapt to different business requirements. The output in the form of JSON description provides a standardized format for the storage, transmission and use of the domain model, and enhances the universality and compatibility.

[0024] In order to better understand and illustrate the scheme of the embodiments of the present application, some technical terms involved in the embodiments of the present application are simply explained below.

[0025] The domain model is a system model formed by abstract modeling of business logic, knowledge system and operation process in a specific industry domain, and is a core element of domain application software construction. It converts industry requirements into a form that can be processed and understood by a computer through the structured description of key information such as business objects, data flow relationships between objects and model fields. The domain model not only accurately maps industry business rules and processes, but also provides a basic framework for the development and operation of domain application software, and the design quality directly affects the adaptability and functionality of the application software to industry requirements.

[0026] Large Language Model (LLM), also known as Large Language Model, is an artificial intelligence model based on deep learning technology, with strong language understanding, generation and processing capabilities.

[0027] Prompt word is a piece of text describing the task input by the user when interacting with the large language model.

[0028] Data flow diagram is a graphical tool used to describe and visualize the data processing flow of information systems. It is used in system analysis and design stages, especially in structured design and object-oriented design, to help understand the functions, components and data interaction between them.

[0029] In order to better understand the scheme provided by the embodiments of the present application, the scheme will be described below in conjunction with a specific application scenario.

[0030] Please refer to Figure 1 , a system architecture diagram for automatically designing a domain model suitable for the embodiments of the present application. It can be understood that the method for automatically designing a domain model provided by the embodiments of the present application can be applied to but not limited to the application scenarios shown in Figure 1 .

[0031] As shown in Figure 1 , the system architecture for automatically designing a domain model in this example can include but is not limited to a server 10, a terminal 20 and a database 30. The server 10, the terminal 20 and the database 30 can interact through a network 40.

[0032] The terminal 20 sends a plurality of service object names input by a user to the server 10; the server 10 acquires the plurality of service object names input by the user; the server 10 constructs a first prompt instruction for prompting a design domain model, inputs the first prompt instruction and the plurality of service object names into a first large language model, and obtains a JSON description of the domain model corresponding to the service object names and a JSON description of a data flow relationship between the domain models; the server 10 constructs a second prompt instruction for prompting a model field of the design domain model, inputs the second prompt instruction, the JSON description of the domain model, and the JSON description of the data flow relationship related to the domain model into a second large language model, and obtains a JSON description of the model field of the domain model; and the server 10 stores the JSON description of the domain model, the JSON description of the data flow relationship, and the JSON description of the model field into the database 30. The server 10 serializes the JSON description of the domain model (containing entity structure), the JSON graph of the data flow relationship (containing node interaction), and the metadata JSON of the model field (containing field type / constraint), and sends them to the terminal 20 through the HTTP protocol. After receiving the three structured data, the terminal 20 calls a local JSON parser (such as the JSON.parse of JavaScript) to complete deserialization, and then integrates the three data into a visual domain model through a model mapping engine, and displays the entity hierarchy in a tree diagram and the data flow in a flowchart on the front-end interface, and dynamically presents the field attributes through a pop-up window.

[0033] It can be understood that the above is only an example, and the present embodiment is not limited thereto.

[0034] The terminal includes, but is not limited to, a smart phone (such as an Android phone, an iOS phone, etc.), a mobile phone simulator, a tablet computer, a notebook computer, a digital broadcast receiver, a MID (Mobile Internet Device), a PDA (Personal Digital Assistant), a smart voice interaction device, a smart home appliance, a vehicle-mounted terminal, etc.

[0035] The server can be a standalone physical server, a server cluster or a distributed system composed of multiple physical servers, a cloud server or a server cluster providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs (Content Delivery Networks), and basic cloud computing services such as big data and artificial intelligence platforms.

[0036] The aforementioned networks may include, but are not limited to, wired networks and wireless networks. Wired networks include local area networks, metropolitan area networks, and wide area networks, and wireless networks include Bluetooth, Wi-Fi, and other wireless communication networks. The specific network type may be determined based on actual application scenarios and is not limited here.

[0037] See Figure 2 , which is a flow chart of a method for automatically designing a domain model provided in an embodiment of the present application Figure 1 The method can be executed by any electronic device, such as a server; as an optional implementation, the method can be executed by a server in a system for automatically designing a domain model. For the convenience of description, in the following description of some optional embodiments, the server will be used as an example to illustrate the execution subject of the method. Figure 2 As shown, the method for automatically designing a domain model provided by an embodiment of the present disclosure includes the following steps: Step S101: Acquire multiple business object names input by a user.

[0038] It should be understood that the business object name refers to the business entity name corresponding to the domain model to be designed, such as the core entities "customer", "contact", and "visit record" in the CRM system.

[0039] Step S102: construct a first prompt instruction for prompting the design of a domain model, input the first prompt instruction and multiple business object names into the first language model, and obtain a JSON description of the domain model corresponding to the business object name and a JSON description of the data flow relationship between the domain models.

[0040] It should be understood that the first prompt instruction is used to guide the first large language model to convert multiple input business object names into structured domain model information according to specific specifications and logic. In a specific example, the first prompt instruction informs the first large language model of its role as a "business architect" and its task of designing domain models and data flow relationships based on business object names.

[0041] In one possible implementation, the first prompt instruction includes a domain model structured description specification and a model data relationship structured description specification. The domain model structured description specification is used to standardize the JSON description structure of the domain model output by the first language model; the model data relationship structured description specification is used to standardize the JSON description structure of the data flow relationship between domain models output by the first language model.

[0042] Specifically, the domain model structured description specification is mainly used to constrain and standardize the structural framework of the domain model JSON description output by the first large language model. This specification defines in detail the key elements that must be included in the domain model JSON description and their organization methods, such as model name, core attribute field, basic behavior characteristics, and other structured information. Through this standardized constraint, the domain model description output by the large language model can be ensured to have a unified format and complete semantic information, providing a standardized input basis for subsequent model field design. The model data relationship structured description specification focuses on the JSON description structure of the data flow relationship between the domain models output by the first large language model. This specification clearly specifies how to express the association relationship between different business objects, including but not limited to association type (such as one-to-one, one-to-many, and many-to-many), association direction, and association field. This structured description not only clearly presents the data flow relationship between business entities, but also provides clear data architecture guidance for subsequent database design and system integration. It should be noted that these two specifications together constitute the core framework of the first prompt instruction, ensuring that the domain model information output by the large language model has complete internal structure definition and clear external association relationship description through a double constraint mechanism.

[0043] In one possible implementation, the first prompt instruction further includes a JSON description of an existing domain model and a JSON description of data flow relationships between existing domain models. Specifically, these two can provide benchmark information of the existing models and their associated relationships. By integrating existing model descriptions, new designs can inherit verified business rules and data architecture, avoiding repeated modeling or conflicts, ensuring seamless compatibility between new and old models. This design not only standardizes the output structure, but also reuses historical assets, improving design efficiency and system consistency, reducing the risk of reconstruction, and providing reliable support for the iterative upgrade of enterprise-level systems.

[0044] Step S103, a second prompt instruction for prompting the design of the model field of the domain model is constructed, and the second prompt instruction, the JSON description of the domain model, and the JSON description of the data flow relationship related to the domain model are input into the second large language model to obtain the JSON description of the model field of the domain model.

[0045] In a possible implementation, the second prompt instruction includes a model field structured description specification, which is used to specify a JSON description structure of a model field of a domain model output by the second large language model. Specifically, the model field structured description specification is a standardized template defining a field description, including an organization manner of key elements such as a field name, a data type, a constraint condition (such as whether to be filled in, a value range), a correlation relationship (such as a foreign key reference), and the like. Through such a structured specification, not only can it be ensured that the output field description has a unified data format, but also the business semantics and technical attributes of the field can be explicitly defined, thereby providing accurate metadata basis for subsequent database design, interface development and business logic implementation. Implementation of the specification significantly improves the accuracy and consistency of field design, and reduces the data connection cost during system integration.

[0046] In a possible implementation, the second prompt instruction, the JSON description of the domain model, and the JSON description of the data flow relationship related to the domain model are input into the second large language model to obtain the JSON description of the model field of the domain model, specifically including: inputting the second prompt instruction, the JSON description of the domain model, and the JSON description of the data flow relationship related to the domain model into the second large language model, determining a reference field of the domain model according to the JSON description of the data flow relationship related to the domain model by the second large language model, and determining a subtable field of the domain model according to the JSON description of the domain model.

[0047] For example, in the specific implementation process, the system inputs the second prompt instruction, the JSON description of the domain model, and the JSON description of the data flow relationship related to the domain model into the second large language model. The prompt instruction explicitly specifies the standardization requirements and business rule constraints of field design, and provides clear generation criteria for the model. Based on the input data flow relationship JSON description, the second large language model can accurately identify the correlation patterns between different business entities, such as one-to-many, many-to-many, and the like, and then determine the reference fields (such as foreign key fields) that need to be included in each domain model to realize the data correlation between entities. At the same time, in combination with the business entity core attributes and business rules defined in the JSON description of the domain model, the model can further analyze the subtable field structure that needs to be expanded, such as splitting the detail items in the one-to-many relationship into independent subtable fields, to ensure the completeness of the data structure and the accuracy of the business logic. This process realizes the automatic conversion from abstract data flow relationship to specific field design, significantly improving the efficiency and quality of domain modeling.

[0048] See Figure 3 A flowchart of a method for automatically designing a domain model provided by an embodiment of the present application Figure 2The method can be executed by any electronic device, such as a server, and the like; as an optional implementation, the method can be executed by a server in a system for automatically designing a domain model, and for the convenience of description, the server will be taken as an example in the description of some optional embodiments below. Figure 3 As shown in FIG. 1, the method for automatically designing a domain model provided by the embodiments of the present disclosure includes the following steps: Step S201, obtaining a plurality of business object names input by a user.

[0049] Step S202, constructing a first prompt instruction for prompting a design domain model, inputting the first prompt instruction and the plurality of business object names into a first large language model, and outputting a target result by the first large language model, wherein the target result is obtained by merging a JSON description of the domain model and a JSON description of a data flow relationship between the domain models.

[0050] Specifically, the first large language model generates the JSON description of the domain model and the JSON description of the data flow relationship between the domain models corresponding to the plurality of business object names according to the input first prompt instruction and the plurality of business object names; and then merges the JSON description of the domain model and the JSON description of the data flow relationship between the domain models to output the target result.

[0051] Optionally, the first prompt instruction further includes an output result specification, which is used to uniformly constrain the merged output format of the JSON description of the domain model and the JSON description of the data flow relationship between the domain models.

[0052] Step S203, generating a data flow graph according to the target result, and showing the data flow graph to the user, wherein the data flow graph includes a plurality of domain model nodes and a data flow between the plurality of domain model nodes.

[0053] It should be understood that the generated data flow graph can be sent to a terminal to show the domain model nodes and the data flow to the user in a visual manner, so that the user can intuitively see the relationship between the elements, which is convenient for understanding and confirmation. Such visualization helps the user to find potential problems or unreasonable places, so as to make corrections in the confirmation link, so that the fields containing references and sub-tables generated by the subsequent large model are more in line with the business logic and user requirements.

[0054] Step S204, receiving an instruction for confirming the data flow graph by the user.

[0055] It should be understood that the user can issue a confirmation instruction after confirming that the data flow graph is correct.

[0056] Step S205, after the user confirms the data flow diagram, a second prompt instruction for prompting the model fields of the design domain model is constructed, the second prompt instruction, the JSON description of the domain model, and the JSON description of the data flow relationship related to the domain model are input into the second large language model, and a JSON description of the model fields of the domain model is obtained.

[0057] Step S206, a user interface of the domain model is generated according to the JSON description of the model fields of the domain model, and the user interface of the domain model is displayed to the user.

[0058] Specifically, based on the model field JSON description of the domain model, the system can automatically generate a corresponding user interface prototype. This process intelligently maps the field types, constraints, and business semantics into form components (such as input boxes, drop-down menus, etc.), and automatically layouts the interface elements according to the association between fields. The generated UI interface intuitively displays the core attributes and interaction logic of the business entity, supports real-time preview and adjustment of field display order and interaction mode, effectively shortens the period from model design to front-end development, and improves the consistency and efficiency of system implementation.

[0059] The following will take the domain model design of a customer relationship management system (CRM, Customer Relationship Management) as an example to further illustrate the method for automatically designing a domain model provided by the embodiments of the present application.

[0060] Please refer to Figure 4 , the flowchart of the method for automatically designing a domain model provided by the embodiments of the present application is shown. Figure 3 . Among them, the method can be executed by any electronic device, such as a server, etc.; as an optional implementation manner, the method can be executed by a server in a system for automatically designing a domain model, for the convenience of description, in the description of some optional embodiments below, the server will be taken as an example to illustrate the execution subject of the method. As Figure 4 shown, the method for automatically designing a domain model provided by the embodiments of the present application includes the following steps: Step S301, the user inputs the business object name, including "customer", "contact person" and "visit record".

[0061] Step S302, a first prompt instruction for prompting the design of the domain model is constructed (for reference Figure 5aAs shown in FIG. 6, the instruction explicitly defines the role of the first large language model as a business architect with specific professional skills, and lists common business system types (such as CRM, ERP, OMS), so that the first large language model is clear about its professional scope and capability requirements in this scenario; at the same time, it provides the JSON description of the existing domain model (modelsJson) and the JSON description of the data flow relationship between the existing domain models ({relationsJson}) as a reference for comparison. The instruction also explicitly defines the main task of the first large language model as designing the domain model, which needs to be designed in combination with the existing model, relationship and user description, and gives specific design steps: it is required that the model ignores the existing model and relationship when designing, to ensure that it is not limited by the existing model, and can be designed from a more pure perspective based on the user description and the given JSON Schema. In addition, the instruction contains the domain model structured description specification (${modelSchemaJson}), which is used to standardize the structure of the output domain model JSON description, so that the model design conforms to specific specifications and requirements; at the same time, it contains the model data relationship structured description specification (${relationSchemaJson}), which is used to standardize the structure of the output domain model data flow relationship JSON description, to ensure that the interaction and data flow between models conform to the regulations. Finally, the instruction requires that the domain model structure and model relationship structure designed according to the specific JSON Schema be merged according to the specified JSON Schema (${descsToModelsResultSchemaJson) to generate the final domain model related content that meets the requirements, to ensure that the overall output conforms to the specific structure and specification.

[0062] For example, the domain model structured description specification (${modelSchemaJson) can refer to Figure 5b As shown in FIG. 6, the model data relationship structured description specification (${relationSchemaJson) can refer to Figure 5c As shown in FIG. 6.

[0063] It should be understood that Figure 5aThe first prompt instruction shown in the background part clearly defines the role of the first large language model in the task as a business architect, and clearly defines the capabilities of the business architect, so that the first large language model focuses on the knowledge and capabilities related to the specific role, and outputs more professional and more suitable results. The background part in the first prompt instruction gives an example of the existing model and relationship description to improve the accuracy of the output of the first large language model. The purpose part directly tells the first large language model the specific task it needs to perform, while specifying the specific steps of designing the domain model according to the user's description, and specifying the type or format of the output through the relevant JSON Schema, so that the first large language model clearly knows the output form expected by the user, making the output more in line with the user's expectations and use scenarios.

[0064] Step S303, input the first prompt instruction and the business object name input by the user into the first large language model, and output a target result in JSON format through the first large language model. The target result is obtained by merging the JSON format domain model structure and the model relationship structure output according to the specification.

[0065] For example, the target result can refer to Figure 5d as shown.

[0066] Step S304, generate a data flow diagram according to the target result and show the data flow diagram to the user.

[0067] It should be understood that the generated data flow diagram visually displays the domain model nodes and data flow, so that the user can intuitively see the relationship between the elements and facilitate understanding and confirmation. This visualization helps users to discover potential problems or unreasonable places, so as to make corrections in the confirmation link, so that the subsequent large model generated fields containing references and subtables are more in line with business logic and user needs. The generated data flow diagram can refer to Figure 5e as shown.

[0068] Step S305, construct a second prompt instruction for prompting the model fields of the designed domain model (for example, refer to Figure 5fThe instruction explicitly indicates the role of the first large language model as a business architect with specific professional skills and lists common business system types (such as CRM, ERP, OMS) to limit its professional field and capability range, making the subsequent output of the second large language model more consistent with the professional perspective and capability requirements of the business architect. The instruction indicates that the model will receive two JSON inputs (${modelJson} and ${relationsJson}), which describe the single model itself and its data flow relationship, respectively. This part is determined based on the field model structure and model relationship structure designed according to the specific JSON Schema in the previous steps, which provides the context and expected format of the input data for the model. The instruction explicitly states that the task goal is to design fields based on existing models and relationships, and the final output is a field array that conforms to a specific JSON Schema. The task is broken down into four specific steps to ensure that the model executes in logical order: 1. Ignore existing fields: avoid duplication and focus on incremental fields; 2. Generate reference fields: determine foreign keys or associated fields based on data flow relationships; 3. Generate sub-tables and other fields: extend the model structure (such as nested tables or business extension fields); 4. Force output to conform to the predefined JSON Schema to ensure structural consistency.

[0069] The second prompt instruction requires the second large language model to output results according to the structured description specification of the model fields. Taking the customer model as an example, the structured description of its model fields can refer to Figure 5g .

[0070] Step S306, input the second prompt instruction, the JSON description of the field model, and the JSON description of the data flow relationship related to the field model into the second large language model, to obtain the JSON description of the model fields of the field model.

[0071] Taking the customer model as an example, based on the JSON description of its model fields, the interface shown in Figure 5h can be obtained.

[0072] It should be understood that after all the model fields are designed, the complete field model design is complete.

[0073] The embodiment of the present application automatically generates the domain model design through a large language model. The user only needs to enter the business object name, and the system can automatically output the domain model, model data flow relationship and model field definition in JSON format, and efficiently output the domain model and its related descriptions, which not only greatly shortens the design cycle, but also ensures the accuracy and rationality of the design and improves the design quality. At the same time, it significantly reduces the dependence on compound experts and breaks the dual dilemma of industry cognitive barriers and modeling technology gaps. In addition, in the above scheme, the design of step-by-step construction of prompt instructions makes the generated domain model more flexible and can quickly adapt to different business needs; the output method of describing the output in JSON provides a standardized format for the storage, transmission and use of the domain model, enhancing versatility and compatibility.

[0074] The present application also provides an apparatus for automatically designing a domain model, the apparatus comprising: The acquisition module is used to obtain multiple business object names input by the user; A first processing module is configured to construct a first prompt instruction for prompting the design of a domain model, input the first prompt instruction and a plurality of business object names into a first language model, and obtain a JSON description of the domain model corresponding to the business object name and a JSON description of the data flow relationship between the domain models; The second processing module is used to construct a second prompt instruction for prompting the design of the model field of the domain model, input the second prompt instruction, the JSON description of the domain model and the JSON description of the data flow relationship related to the domain model into the second largest language model, and obtain the JSON description of the model field of the domain model.

[0075] See Figure 6 , an embodiment of the present application further provides an electronic device, the electronic device 1100 including: at least one processor 1101; At least one memory 1102, configured to store at least one program; At least one program is executed by at least one processor 1101 to implement the method for automatically designing a domain model according to any of the aforementioned embodiments.

[0076] An embodiment of the present application also provides a computer program product, including a computer program or computer instructions, which are stored in a computer-readable storage medium. A processor of an electronic device reads the computer program or computer instructions from the computer-readable storage medium, and the processor executes the computer program or computer instructions, so that the electronic device executes the method for automatically designing a domain model of any of the aforementioned embodiments.

[0077] The embodiment of the present application further provides a computer readable storage medium storing computer executable instructions, and the computer executable instructions are used for executing the method for automatically designing the field model.

[0078] It should be understood that, in the embodiments of the present application, the processor can be a central processing unit (CPU), and the processor can also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.

[0079] In addition, the processor can include one or a combination of central processing units (CPUs), baseband processors, digital signal processors (DSPs), microprocessor units (MPUs), microcontroller units (MCUs), graphics processing units (GPUs), field programmable gate arrays (FPGAs), artificial intelligence processors (AI processors) or neural network processors (Neural Processing Units, NPUs).

[0080] It should also be understood that the memory in the embodiments of the present application can be volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory. Where the nonvolatile memory is, it can be read-only memory (ROM), programmable ROM (PROM), erasable PROM (EPROM), electrically EPROM (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), which acts as external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double-data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and direct rambus RAM (DR RAM). It is noted that the systems and methods described herein are intended to include all such memory types and any other suitable type of memory.

[0081] The above-described embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, the above-described embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the processes or functions described in the embodiments of the present application are wholly or partially generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through a wired or wireless (such as infrared, wireless, microwave, etc.) manner. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. containing one or more available medium collections. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium. The semiconductor medium can be a solid state disk.

[0082] It should be understood that the size of the sequence number of each process described above in various embodiments of the present application does not mean the order of execution, and the execution order of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0083] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be realized in electronic hardware, or a combination of computer software and electronic hardware. Whether the functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. A person skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application. Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described system, device and unit can refer to the corresponding processes in the foregoing method embodiments, which will not be described here.

[0084] In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other manners. For example, the division of the above-described device embodiment is merely an example, and there can be other division manners. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections between different units, or the among different units, can be indirect couplings or communication connections through some interfaces, devices or units, and can be in electrical, mechanical or other forms.

[0085] The units described as separated components can or can not be physically separated, and the components displayed as units can or can not be physical units, i.e., can be located in one place, or can be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purposes of the embodiments. In addition, each functional unit in the embodiments of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. When the above functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or substantially or part of the technical solutions or the part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the embodiments of the present application. The foregoing storage medium includes: U disk, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk, and various program codes that can be stored in the medium.

[0086] The above is a specific description of the preferred embodiments of the present application, but the present application is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or replacements without departing from the spirit of the present application, and these equivalent modifications or replacements are all included in the scope defined by the claims of the present application.

Claims

1. A method for automatically designing a domain model, characterized in that: The method comprises: Get multiple business object names entered by the user; Constructing a first prompt instruction for prompting the design of a domain model, inputting the first prompt instruction and the plurality of business object names into a first language model, and obtaining a JSON description of the domain model corresponding to the business object name and a JSON description of the data flow relationship between the domain models; Construct a second prompt instruction for prompting the design of a model field of a domain model, input the second prompt instruction, the JSON description of the domain model, and the JSON description of the data flow relationship related to the domain model into the second largest language model to obtain a JSON description of the model field of the domain model.

2. The method according to claim 1, characterized in that The first prompt instruction includes a domain model structured description specification and a model data relationship structured description specification; The domain model structured description specification is used to standardize the JSON description structure of the domain model output by the first language model; The model data relationship structured description specification is used to standardize the JSON description structure of the data flow relationship between the domain models output by the first language model.

3. The method according to claim 2, characterized in that The step of inputting the first prompt instruction and the plurality of business object names into a first language model to obtain a JSON description of a domain model corresponding to the business object name and a JSON description of a data flow relationship between the domain models includes: Inputting the first prompt instruction and the plurality of business object names into a first large language model to obtain a target result, wherein the target result is obtained by merging the JSON description of the domain model and the JSON description of the data flow relationship between the domain models; Before constructing the second prompt instruction for prompting the model field of the design domain model, also include: generating a data flow graph according to the target result, and presenting the data flow graph to the user, wherein the data flow graph includes a plurality of domain model nodes and data flows between the plurality of domain model nodes; Receive an instruction from the user to confirm the data flow graph.

4. The method according to claim 2, characterized in that The first prompt instruction also includes a JSON description of an existing domain model and a JSON description of a data flow relationship between existing domain models.

5. The method according to claim 1, wherein The second prompt instruction includes a model field structured description specification, and the model field structured description specification is used to standardize the JSON description structure of the model field of the domain model output by the second language model.

6. The method according to claim 1, characterized in that After obtaining the JSON description of the model fields of the domain model, it also includes: Generate a user interface for the domain model based on the JSON description of the model fields of the domain model; A user interface presenting the domain model to the user.

7. The method according to claim 1, characterized in that The step of inputting the second prompt instruction, the JSON description of the domain model, and the JSON description of the data flow relationship related to the domain model into the second language model to obtain the JSON description of the model field of the domain model includes: The second prompt instruction, the JSON description of the domain model, and the JSON description of the data flow relationship related to the domain model are input into the second largest language model, and the reference field of the domain model is determined according to the JSON description of the data flow relationship related to the domain model through the second largest language model, and the sub-table field of the domain model is determined according to the JSON description of the domain model.

8. A device for automatically designing a domain model, characterized in that: The device comprises: The acquisition module is used to obtain multiple business object names input by the user; A first processing module is configured to construct a first prompt instruction for prompting the design of a domain model, input the first prompt instruction and the plurality of business object names into a first large language model, and obtain a JSON description of the domain model corresponding to the business object name and a JSON description of the data flow relationship between the domain models; The second processing module is used to construct a second prompt instruction for prompting the design of the model field of the domain model, input the second prompt instruction, the JSON description of the domain model and the JSON description of the data flow relationship related to the domain model into the second largest language model, and obtain the JSON description of the model field of the domain model.

9. An electronic device, characterized in that: include: at least one processor; at least one memory for storing at least one program; At least one of the programs is executed by at least one of the processors to perform the method for automatically designing a domain model according to any one of claims 1 to 7.

10. A computer-readable storage medium storing computer-executable instructions, characterized in that: The computer-executable instructions are used to execute the method for automatically designing a domain model according to any one of claims 1 to 7.

Citation Information

Cited By

  • Page generation method and system

    CN121957594A