CN117057318A - Domain model generation method, device, equipment and storage medium - Google Patents

Domain model generation method, device, equipment and storage medium Download PDF

Info

Publication number
CN117057318A
CN117057318A CN202311041512.8A CN202311041512A CN117057318A CN 117057318 A CN117057318 A CN 117057318A CN 202311041512 A CN202311041512 A CN 202311041512A CN 117057318 A CN117057318 A CN 117057318A
Authority
CN
China
Prior art keywords
text
model
information
text information
displaying
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311041512.8A
Other languages
Chinese (zh)
Inventor
张联华
王首峰
欧阳晔
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Asiainfo Technologies China Inc
Original Assignee
Asiainfo Technologies China Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Asiainfo Technologies China Inc filed Critical Asiainfo Technologies China Inc
Priority to CN202311041512.8A priority Critical patent/CN117057318A/en
Publication of CN117057318A publication Critical patent/CN117057318A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/04817Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance using icons
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Artificial Intelligence (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application provides a domain model generation method, device, equipment and storage medium, and relates to the technical fields of natural language processing, large models and domain models. The method comprises the following steps: acquiring text information input in a text editing box through natural language in response to an operation of generating a domain model; displaying model text of the class diagram determined based on the text information; and displaying the field model generated based on the model text. The implementation of the application can determine the model text conforming to the plant UML specification based on the acquired natural language text information, specifically, the text information can be analyzed by utilizing a large language model or a regular expression, the model text is determined based on the analysis result, and then an object model is generated through the model text; accordingly, the model text of the class diagram can be directly edited based on the plant UML technology, and the class diagram is displayed in real time, so that the operation logic is simple, the efficiency is high, and the maintainability of service functions can be effectively improved.

Description

Domain model generation method, device, equipment and storage medium
Technical Field
The application relates to the technical fields of natural language processing, large models and domain models, in particular to a domain model generation method, a device, equipment and a storage medium.
Background
In the field of BSS (business support system), CRM (customer relationship management system), ioT (Internet of Things ) and other business application design, when a business application is developed, a domain model (which may be an object model) of the business application needs to be designed. Then, according to the designed field model, designing a corresponding database or related business service codes; a low code tool or script can also be used to automatically convert the designed domain model into related codes, such as SQL script or O/Rming related codes and service codes.
The existing field model design tool mainly drags icons of objects required by a field model into a design interface in a dragging mode, establishes association between the two objects in a scribing mode, and performs operations of adding attributes, modifying the attributes and the like on the selected objects through a command button so as to realize the design of the field model. However, the icon editing mode can complete editing of a single object by dragging the icons, establishing the relation among the objects and editing the attributes of the objects, so that the operation is complex, the efficiency of field model design is reduced, and the maintainability of service functions is poor.
Disclosure of Invention
The embodiment of the application provides a method, a device, equipment and a storage medium for generating a field model, which can solve the problems that the design of the existing field model is required to be completed in an icon editing mode, the operation is complex, and the design efficiency is low. In order to achieve the object, embodiments of the present application provide the following solutions.
According to an aspect of an embodiment of the present application, there is provided a domain model generating method, including:
acquiring text information input in a text editing box through natural language in response to an operation of generating a domain model;
displaying model text of a class diagram determined based on the text information;
and displaying a domain model generated based on the model text.
In one possible implementation manner, the displaying the model text of the class diagram determined based on the text information includes:
analyzing the text information to obtain command information and corresponding parameters;
and displaying the model text of the class diagram determined by the command information and the corresponding parameters in a model text editing area.
In one possible implementation manner, the extracting, by a preset regular expression, command information and corresponding parameters from the text information includes:
detecting whether the text information comprises command information or not through a regular expression corresponding to the command information;
and if the command information is determined to be included, extracting parameters corresponding to the command information from the text information through a regular expression corresponding to the parameters corresponding to the command information, wherein the parameters comprise at least one of names and attributes.
In one possible implementation, the domain model includes a class diagram; the editing mode indicated by the command information comprises at least one mode of adding, deleting and modifying classes of the class diagram;
the displaying the domain model generated based on the model text includes:
and editing the class in the class diagram according to the editing mode indicated by the command information and the corresponding parameters.
In one possible implementation manner, the displaying the model text of the class diagram determined by the command information and the corresponding parameters in the model text editing area includes:
searching a method matched with the command information and the corresponding parameters, and calling the method to generate or modify the model text in the model text area.
In one possible implementation manner, the acquiring text information input in the text editing box through natural language includes:
and acquiring input information based on the received input mode selection instruction, and displaying text information corresponding to the input information in the text editing box, wherein the input mode comprises at least one of voice input, keyboard input, handwriting input and OCR scanning recognition input.
The application provides a domain model generating device, comprising:
the text information analysis module is used for responding to the operation of generating the field model and acquiring text information input in a text editing box through natural language;
the model text display module is used for displaying model texts of class diagrams determined based on the text information;
and the domain model display module is used for displaying a domain model generated based on the model text.
The application provides an electronic device comprising a memory, a processor and a computer program stored on the memory, characterized in that the processor executes the computer program to carry out the steps of the method as described above.
According to a further aspect of embodiments of the present application, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method as described above.
The technical scheme provided by the embodiment of the application has the beneficial effects that:
the domain model generation method provided by the application can be applied to the design scene of the business function, particularly, when responding to the operation of generating the domain model, the text information input in the text editing box through the natural language can be obtained, and then the model text of the class diagram determined based on the text information and the domain model generated based on the model text can be displayed on the operation interface. In the embodiment of the application, when responding to the operation of generating the domain model, text information input through natural language is displayed through a text editing box, a model text is determined according to the text information, and the domain model is obtained by utilizing the model text. Therefore, the embodiment of the application can obtain the model text through text information input in natural language, and generate the domain model through the model text, so that the design instruction related to the domain model can be quickly converted into the domain model, the operation of dragging, editing and the like of an image is not required to be implemented by an operation object, the generation operation of the domain model can be effectively simplified, the generation speed of the domain model is improved, the efficiency of business application design is further improved, and the maintainability of business functions is effectively improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following description will simply refer to the drawings that are required to be used in the description of the embodiments of the present application.
FIG. 1 is a schematic diagram of an operator interface of a prior art domain model design tool;
FIG. 2 is an interface schematic diagram of a model text editing box of a domain model design tool according to an embodiment of the present application;
FIG. 3 is an interface schematic diagram of a domain model according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a foreground interface of a domain model design tool according to an embodiment of the present application;
FIG. 5 is a flowchart of a domain model generating method according to an embodiment of the present application;
FIG. 6 is a flowchart of another embodiment of a domain model generating method provided by the present application;
FIG. 7 is a flowchart of initializing an editing interface according to an embodiment of the present application;
FIG. 8 is a flow chart of an embodiment of an input text message editing domain model provided by the present application;
FIG. 9 is a flowchart of an embodiment of a speech input text information editing domain model provided by the present application;
FIG. 10 is a schematic diagram of a new Customer (a class name of a class diagram) graph in a class diagram provided by the present application;
FIG. 11 is a schematic diagram of a custom new attribute, custom name, in a class diagram according to the present application;
FIG. 12 is a schematic diagram of a relationship between a new custom and a new CustAddress (a class name of a class diagram) in a class diagram provided by the present application;
FIG. 13 is a schematic diagram showing the modification of the relationship names of a Customer and a CustAddress to a relationship name of a custAddress (a relationship name) in a class diagram according to the present application;
FIG. 14 is a block diagram of a domain model generating apparatus according to an embodiment of the present application;
fig. 15 is a block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Embodiments of the present application are described below with reference to the drawings in the present application. It should be understood that the embodiments described below with reference to the drawings are exemplary descriptions for explaining the technical solutions of the embodiments of the present application, and the technical solutions of the embodiments of the present application are not limited.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless expressly stated otherwise, as understood by those skilled in the art. It will be further understood that the terms "comprises" and "comprising," when used in this specification, specify the presence of stated features, information, data, steps, operations, elements, and/or components, but do not preclude the presence or addition of other features, information, data, steps, operations, elements, components, and/or groups thereof, all of which may be included in the present specification. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. The term "and/or" as used herein indicates at least one of the items defined by the term, e.g. "a and/or B" indicates implementation as "a", or as "a and B".
As shown in fig. 1, the existing domain model design tool operation interface is divided into a toolbar area, a drawing area, a command button area, and a property editing area. The tool bar area displays icons of various objects in the field model, the drawing area is used for drawing the field model, the command button area displays various command buttons, and the attribute editing area displays related attribute editing columns according to the selected command buttons so as to edit the attributes of the objects. When the field model is edited, a required icon is dragged into a drawing area in a dragging mode, a connection line is selected between two objects to establish the association between the objects, operations such as adding attributes, modifying the attributes and the like are performed on the selected objects through a command button of a command button area, and various information of the objects is edited through a form of the attribute editing area.
However, this editing approach has the following drawbacks:
1. the front end of the design tool used is a cured design, requiring significant time and effort in front end design, development and debugging. Such as a page to be divided into tool areas, drawing areas, property editing areas, etc. Along with the change of the requirements, such as adding classes, adding relation types and the like, the front-end page needs to be correspondingly adjusted, and the consumption of manpower and material resources in version iteration is high;
2. there is a lot of front-end and back-end development work that serves the drag function addition. Because the process of graphic drag, graphic element selection, mouse entering, mouse leaving, graphic element moving and other events in the graphic are needed to be realized in the design process of the field model, and the local refreshing of the graphic is supported, a design tool needs to use a drawing technology with a relatively complex front end, and the writing and debugging of the event processing logic are also very time and energy-consuming;
3. the use process facing the user is not friendly enough. In use, a user creates or modifies a class or a relation among classes in a class diagram, and the operation is complicated by dragging a toolbar graph, clicking a graphic element, editing attributes in a form, clicking a button and the like;
4. data and interfaces are not sufficiently straightforward to transfer, requiring translation and adaptation. Rendering the content of the field model such as the front end object, which is not matched with the data format of the actual field model stored in the background, and cannot be directly used, and the format conversion is needed through hard coding;
5. the maintainability of the business function is low, and the logic is complex. For rendering the front-end object, the data of the front-end rendering graph needs to be saved in the practical field model stored in the background, which causes the following problems:
a) Waste of storage space;
b) Logic for processing the rendering data of the front end is mixed in the service related logic processing code, so that the real service processing logic is polluted;
c) The front-end rendering data and the background actual field model data may be inconsistent, making the system difficult to maintain.
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the following detailed description of the embodiments of the present application will be given with reference to the accompanying drawings.
The technical solutions of the embodiments of the present application and technical effects produced by the technical solutions of the present application are described below by describing several exemplary embodiments. It should be noted that the following embodiments may be referred to, or combined with each other, and the description will not be repeated for the same terms, similar features, similar implementation steps, and the like in different embodiments.
In order to solve the problems, the application constructs a new domain model design tool, as shown in fig. 2, 3 and 4. The foreground interface of the domain model design tool includes a model text edit box for displaying a model text (a region corresponding to a box in fig. 4 (1)) and a model display box for displaying a domain model (a region corresponding to a box in fig. 4 (2)), and text edit boxes (a region corresponding to a box in fig. 4 (3)) are further provided below the model text edit box and the model display box, through which text information input is displayed.
In one embodiment, the generated domain model is an object model, and the object model may be any one of a class diagram or a sequence diagram, and may also be other types of service model diagrams.
Specifically, the class diagram may be a class diagram using UML (Unified Modeling Language ), and the sequence table may be a sequence table using UML. The field model of the application can be a class diagram, and correspondingly, the generated model text is a model text conforming to the plant Uml specification, and the field model design tool can directly edit the model text of the class diagram based on the plant Uml technology and display the class diagram corresponding to the class diagram model text in real time.
By using the method provided by the application, the generation of the field model can be realized without drawing toolbars and icons, only one multi-line text box is needed, the direct editing is realized, and the tool development efficiency is higher. And, the canvas supporting drag and drag of mouse interaction is not needed, the response to a mouse event is not needed, and only one static image display area is needed to display the image of the field model rendered according to the model text. And the method can edit the domain model (such as class diagram) by directly editing the characters of different parts of the model text without the need of a form to display and edit the objects (such as class names, class attributes and relations) of the domain model.
In one embodiment, a confirmation icon is arranged at one end of the text editing box, the text editing box displays the input text information for editing the model text, a confirmation instruction (such as clicking the confirmation icon or pressing an enter key) is received, the content of the corresponding position in the model text is updated according to the text information, and the modification field model is correspondingly refreshed based on the updating result.
The embodiment of the application provides a domain model generating method which is applied to the domain model design tool described in the above embodiment, as shown in fig. 5, and comprises steps S101-S103.
S101: in response to an operation of generating the domain model, text information input in a text editing box through natural language is acquired.
Optionally, the main body for executing the domain model generating method can be a mobile phone, a computer, a cloud platform and other devices capable of being used for generating the domain model; the operation object can design a field model corresponding to the business function by inputting text information of natural language on the corresponding device.
Optionally, the operation of generating the domain model may be an instruction of opening a domain model design tool, or may be an operation of inputting text information or other operations for instructing to generate the domain model, where after the object for executing the domain model generating method confirms that the operation object executes the operation of generating the domain model, the input text information is acquired in response to the operation.
Optionally, acquiring text information input in the text editing box through natural language includes: and acquiring input information based on the received input mode selection instruction, and displaying text information corresponding to the input information in a text editing box, wherein the input mode comprises at least one of voice input, keyboard input, handwriting input and OCR scanning recognition input.
In one embodiment, the operator clicks on an area of the text editing box for displaying text information, the device determines that a keyboard input selection instruction is detected, receives text information entered by the operator via the keyboard, and displays the text information in the text editing box for viewing and modification by a user. And after receiving a confirmation instruction input by the operation object, modifying the displayed model text by using the text information.
In another embodiment, a microphone icon is arranged at the right end of the text editing box, the operation object can initiate a voice input instruction by clicking the microphone icon, the device determines that a voice input selection instruction is detected, and voice information of the operation object is collected through a microphone, and the voice information is recognized to obtain text information. After voice information is collected, a voice-to-text service is called, and voice content is converted into text content and displayed in a text editing box.
Specifically, when recognizing the voice information, the object sending the voice information can be detected, and if the object is not a preset sounding object, the recognition of the voice information is abandoned.
Alternatively, the text information of the present application may be formed of a natural language by which the model text is edited.
S102: model text of the class diagram determined based on the text information is displayed.
Optionally, displaying the model text of the class diagram determined based on the text information includes: analyzing the text information to obtain command information and corresponding parameters; and displaying the model text of the class diagram determined by the command information and the corresponding parameters in a model text editing area.
In one embodiment, the model text editing area is a model text editing box, the position of the model text to be generated or modified in the model text editing box is determined according to the command information and the corresponding parameters, and the content in the model text editing box is updated based on the position.
Optionally, the domain model is a class diagram, the command information obtained by analyzing the text information is an editing mode (including at least one of adding, deleting and modifying) of the class, and the corresponding parameters include a class name and a class attribute.
Optionally, the manner of parsing the text information includes any one of parsing by a preset parsing model or extracting by a regular expression. Among other things, parsing models include ChatGPT (chat bot developed by OpenAI), spaCy, textBlob, and other tools or Large Language Models (LLM) that can be used to identify and parse natural language.
Optionally, after analyzing the text information to obtain command information and corresponding parameters, searching a method which is matched with the command information and the corresponding natural parameters one by one, and obtaining a required model text by calling the method. The generation and editing of the model text are realized by pre-storing various methods for editing the model text and calling the corresponding methods.
S103: and displaying the field model generated based on the model text.
Optionally, the domain model and the model text are displayed side by side on a display interface of the device, and in order to facilitate the operation object to view, the corresponding domain model is synchronously displayed according to the update condition of the model text.
In one embodiment, the domain model includes a class diagram; the editing mode indicated by the command information comprises at least one mode of adding, deleting and modifying the class of the class diagram; displaying a domain model generated based on model text, comprising: editing modes indicated by the command information and corresponding parameters edit classes in the class diagram.
When the method and the device respond to the operation of generating the domain model, text information input through natural language is acquired through a text editing box, a model text is determined according to the text information, and the domain model is obtained through the model text. Therefore, the embodiment of the application can obtain the model text through text information input in natural language, and generate the domain model through the model text, so that the design instruction related to the domain model can be quickly converted into the domain model, the operation of dragging, editing and the like of an image is not required to be implemented by an operation object, the generation operation of the domain model can be effectively simplified, the generation speed of the domain model is improved, the efficiency of business application design is further improved, and the maintainability of business functions is effectively improved.
Optionally, the present application further provides a domain model generating method, as shown in fig. 6 to fig. 13, where the method includes:
s201: and acquiring input information based on the received input mode selection instruction, and displaying text information corresponding to the input information in a text editing box.
Optionally, the input mode includes at least one of voice input, keyboard input, handwriting input, OCR scanning recognition input. And starting a corresponding text information acquisition tool according to the received input mode selection instruction, acquiring input information by using the text information acquisition tool, and acquiring text information related to the editing of the model text from the input information.
In one embodiment, the device for executing the domain model generating method is connected with or provided with a microphone, and after receiving a voice input selection instruction (such as clicking a microphone icon at the right end of a text editing box), voice information of an operation object is obtained through the microphone, and voice content is converted into text information through a voice recognition tool or calling a voice-to-text service. The text information is displayed in a text editing box.
When recognizing the voice information, the method can detect whether the voice information comprises a preset voice instruction (such as vocabulary matched with the object in the voice model) or not besides recognizing the object sending the voice information, and if the voice information comprises the preset voice instruction, the voice information is converted into text information; if not, not converting to text information.
Alternatively, after the input information is acquired, the text information may be identified by identification information (such as an identifier) in the input information, or may be identified according to typesetting, character size, character color, and the like of the input information.
S202: model text of the class diagram determined based on the text information is displayed.
Optionally, displaying the model text of the class diagram determined based on the text information includes: analyzing the text information to obtain command information and corresponding parameters; and displaying the model text of the class diagram determined by the command information and the corresponding parameters in a model text editing area.
Wherein, parse text information, include: generating an analysis request comprising text information, sending the analysis request to a preset analysis model, and acquiring command information and corresponding parameters according to feedback information of the preset analysis model; or extracting command information and corresponding parameters from the text information through a preset regular expression.
Optionally, the preset parsing model is a large language model (LLM, large Language Model). After obtaining the text information, generating an analysis request taking the text information as a parameter, and sending the request to a preset analysis model (such as ChatGPT) to call an API (Application Programming Interface ) of the preset analysis model to analyze the text information, thereby obtaining command information and corresponding parameters.
Optionally, the obtained command information and the corresponding parameters are displayed in a preset data structure. Specifically, the preset data structure may be a json structure, and examples of the preset data structure are as follows:
in one embodiment, the preset parsing model is ChatGPT, the text information input to the text editing box is "please help me add a new class of Pivot type, the class name is Customer", and the parsing request generated by taking the text information as a parameter is:
the obtained content is as follows:
and calling the API of the ChatGPT through the analysis request to obtain an analysis result of the text information.
Optionally, the regular expression for extracting the command information and the corresponding parameters is expressed in the form of codes, and after the regular expression is obtained as text information, the corresponding codes are selected to extract the command information and the corresponding parameters from the text information.
Optionally, extracting the command information and the corresponding parameters from the text information through a preset regular expression includes: detecting whether the text information comprises command information or not through a regular expression corresponding to the command information; and if the command information is determined to be included, extracting parameters corresponding to the command information from the text information through a regular expression corresponding to the parameters corresponding to the command information, wherein the parameters comprise at least one of names and attributes.
In one embodiment, the domain model is a class diagram, the regular expression is represented in code, and the code segments of the regular expression are as follows:
when the text information is analyzed, the code is executed, whether a command keyword defined by the create_class_commands exists in the text information is searched for by utilizing a regular expression representing the command information in the code, if so, a command of a newly added class is determined, and then the newly added class, the class name and the attribute are searched for by utilizing the related regular expression.
Optionally, displaying the model text of the class diagram determined by the command information and the corresponding parameters in a model text editing area, including: searching a method matched with the command information and the corresponding parameters, and calling the method to generate or modify the model text in the model text area.
In one embodiment, a plurality of methods are pre-stored, the analyzed command information and the corresponding parameters are represented by a preset data structure, and a matching method is searched through the information in the preset data structure and the information of the method. Specifically, the method may be an if else method, for example:
the preset data structure is a json structure, and the matching method is obtained through the one-to-one correspondence between actionName in the json structure and actionName in the method, wherein the method comprises the following steps: createNewClass ('Customer', 'Pivot')): the method adds a text content corresponding to a class in the model text:
class Customer<<Pivot>>{
}
a graph updated based on the text content is shown in fig. 10.
S203: and displaying the field model generated based on the model text.
Optionally, the domain model comprises a class diagram; the editing mode indicated by the command information comprises at least one mode of adding, deleting and modifying the class of the class diagram; displaying a domain model generated based on model text, comprising: editing modes indicated by the command information and corresponding parameters edit classes in the class diagram. The domain model can also be a sequence table and other graphs which can be used for representing the domain model, and the type of the domain model can be set according to actual requirements.
The process of generating the domain model by text information according to the present application will be described below by taking the domain model as a class diagram.
Example 1
The text information is 'please help me delete Customer class', after the operation object presses the enter key or clicks the confirm button behind the text box, the device calls the analysis service, analyzes the text information, and determines the method to be called as the method of deleting class according to the analyzed information: deleteClass (String name), calling the method to delete text content corresponding to the custom class in the model text: class custom … { … }, and updating class diagrams corresponding to the model text, wherein custom classes no longer appear in the class diagrams.
Example 2
The text information is 'please help me delete attribute customerName' of the Customer class, after the operation object presses the enter key or clicks the confirmation button behind the text box, the device calls the analysis service, analyzes the text information, and determines the method to be called as the method for deleting the class according to the analyzed information: the method is called to delete the text content corresponding to the attribute customerName in the Customer class in the model text: { field } customerName: … { … }, and updating the class diagram corresponding to the model text, the Customer class in the class diagram will not have a customerName attribute.
Example 3
The text information is 'please help me add a String type attribute to the class Customer, the attribute name is customerName', after the operation object presses the enter key or clicks the confirm button behind the text box, the device calls the analysis service, analyzes the text information, and determines the method to be called as the newly added class attribute according to the analyzed information: the method is called to add text content corresponding to the attribute in a custom class of model text, and the custom class of model text is called by addlassattribute (String className, string attributeName, string attributeType):
class Customer<<Pivot>>{
{field}customerName:String
}
and updating class diagrams corresponding to the model texts, wherein the corresponding updated graphs are shown in fig. 11.
Example 4
The text information is 'please help me add one-to-many relation to class Customer and CustAddress, the relation name is address', after the operation object presses the enter key or clicks the confirm button behind the text box, the device calls the analysis service, analyzes the text information, and determines the method to be called as the new class relation according to the analyzed information: the addslassrelay (String firstClassName, string secondClassName, string relationType, string relationName) invokes the method to add text content corresponding to the one-to-many relationship between the custom class and the CustAddress class in the model text:
the Customer "1" - > "1...
Example 5
The text information is 'please help me change the relation name of class Customer and CustAddress name as address into custAddress', after the operation object presses the enter key or clicks the confirm button behind the text box, the device calls the analysis service, analyzes the text information, and determines the method to be called as the method for modifying the class relation according to the analyzed information: the method is called to modify text contents corresponding to the relation between the Customer class and the CustAddress class in the model text (String firstClassName, string secondClassName, string relationName, string newRelationName):
the Customer "1" - > "1." CustAddress: custAddress, and updating the class diagram corresponding to the model text, the corresponding updated diagram is shown in fig. 13.
It should be noted that, in the alternative embodiment of the present application, the related data (such as the first identifier, the second identifier, the computing resource, etc.) needs to be licensed or agreed upon by the user when the above embodiment of the present application is applied to a specific product or technology, and the collection, use and processing of the related data need to comply with the relevant laws and regulations and standards of the relevant country and region. That is, in the embodiment of the present application, if data related to the subject is involved, the data needs to be obtained through the subject authorization consent and in accordance with the relevant laws and regulations and standards of the country and region.
According to an aspect of the present application, the present application provides a domain model generating apparatus, as shown in fig. 14, the domain model generating apparatus 300 includes a text information parsing module 310, a model text display module 320, and a domain model display module 330, wherein the text information parsing module 310 is configured to obtain text information input in a text editing box through natural language in response to an operation of generating a domain model; a model text display 320 for displaying model text of the class diagram determined based on the text information; the domain model display module 330 is configured to display a domain model generated based on the model text.
Optionally, displaying the model text of the class diagram determined based on the text information includes: analyzing the text information to obtain command information and corresponding parameters; and displaying the model text of the class diagram determined by the command information and the corresponding parameters in a model text editing area.
Optionally, parsing the text information includes:
generating an analysis request comprising the text information, sending the analysis request to a preset analysis model, and acquiring command information and corresponding parameters according to feedback information of the preset analysis model;
or extracting command information and corresponding parameters from the text information through a preset regular expression.
Optionally, the extracting the command information and the corresponding parameters from the text information through the preset regular expression includes:
detecting whether the text information comprises command information or not through a regular expression corresponding to the command information;
and if the command information is determined to be included, extracting parameters corresponding to the command information from the text information through a regular expression corresponding to the parameters corresponding to the command information, wherein the parameters comprise at least one of names and attributes.
Optionally, the domain model includes a class diagram; the editing mode indicated by the command information comprises at least one mode of adding, deleting and modifying classes of the class diagram;
the displaying the domain model generated based on the model text includes:
and editing the class in the class diagram according to the editing mode indicated by the command information and the corresponding parameters.
Optionally, displaying the model text of the class diagram determined by the command information and the corresponding parameters in a model text editing area includes:
searching a method matched with the command information and the corresponding parameters, and calling the method to generate or modify the model text in the model text area.
Optionally, the acquiring text information input in the text editing box through natural language includes:
and acquiring input information based on the received input mode selection instruction, and displaying text information corresponding to the input information in the text editing box, wherein the input mode comprises at least one of voice input, keyboard input, handwriting input and OCR scanning recognition input.
In an alternative embodiment, there is provided an electronic apparatus, as shown in fig. 15, the electronic apparatus 4000 shown in fig. 15 including: a processor 4001 and a memory 4003. Wherein the processor 4001 is coupled to the memory 4003, such as via a bus 4002. Optionally, the electronic device 4000 may further comprise a transceiver 4004, the transceiver 4004 may be used for data interaction between the electronic device and other electronic devices, such as transmission of data and/or reception of data, etc. It should be noted that, in practical applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 is not limited to the embodiment of the present application.
The processor 4001 may be a CPU (Central Processing Unit ), general purpose processor, DSP (Digital Signal Processor, data signal processor), ASIC (Application Specific Integrated Circuit ), FPGA (Field Programmable Gate Array, field programmable gate array) or other programmable logic device, transistor logic device, hardware components, or any combination thereof. Which may implement or perform the various exemplary logic blocks, modules and circuits described in connection with this disclosure. The processor 4001 may also be a combination that implements computing functionality, e.g., comprising one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
Bus 4002 may include a path to transfer information between the aforementioned components. Bus 4002 may be a PCI (Peripheral Component Interconnect, peripheral component interconnect standard) bus or an EISA (Extended Industry Standard Architecture ) bus, or the like. The bus 4002 can be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
Memory 4003 may be, but is not limited to, ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, RAM (Random Access Memory ) or other type of dynamic storage device that can store information and instructions, EEPROM (Electrically Erasable Programmable Read Only Memory ), CD-ROM (Compact Disc Read Only Memory, compact disc Read Only Memory) or other optical disk storage, optical disk storage (including compact discs, laser discs, optical discs, digital versatile discs, blu-ray discs, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium that can be used to carry or store a computer program and that can be Read by a computer.
The memory 4003 is used for storing a computer program for executing an embodiment of the present application, and is controlled to be executed by the processor 4001. The processor 4001 is configured to execute a computer program stored in the memory 4003 to realize the steps shown in the foregoing method embodiment.
The electronic device may be any electronic product that can perform man-machine interaction with an object, for example, a personal computer, a tablet computer, a smart phone, a personal digital assistant (Personal Digital Assistant, PDA), a game console, an interactive internet protocol television (Internet Protocol Television, IPTV), a smart wearable device, and the like.
The electronic device may also include a network device and/or an object device. Wherein the network device includes, but is not limited to, a single network server, a server group made up of multiple network servers, or a cloud based on cloud computing (CloudComputing) made up of a large number of hosts or network servers.
The network in which the electronic device is located includes, but is not limited to, the internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (Virtual Private Network, VPN), and the like.
Embodiments of the present application provide a computer readable storage medium having a computer program stored thereon, which when executed by a processor, implements the steps of the foregoing method embodiments and corresponding content.
The terms "first," "second," "third," "fourth," "1," "2," and the like in the description and in the claims and in the above figures, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate, such that the embodiments of the application described herein may be implemented in other sequences than those illustrated or otherwise described.
It should be understood that, although various operation steps are indicated by arrows in the flowcharts of the embodiments of the present application, the order in which these steps are implemented is not limited to the order indicated by the arrows. In some implementations of embodiments of the application, the implementation steps in the flowcharts may be performed in other orders as desired, unless explicitly stated herein. Furthermore, some or all of the steps in the flowcharts may include multiple sub-steps or multiple stages based on the actual implementation scenario. Some or all of these sub-steps or phases may be performed at the same time, or each of these sub-steps or phases may be performed at different times, respectively. In the case of different execution time, the execution sequence of the sub-steps or stages can be flexibly configured according to the requirement, which is not limited by the embodiment of the present application.
The foregoing is merely an optional implementation manner of some of the implementation scenarios of the present application, and it should be noted that, for those skilled in the art, other similar implementation manners based on the technical ideas of the present application are adopted without departing from the technical ideas of the scheme of the present application, and the implementation manner is also within the protection scope of the embodiments of the present application.

Claims (10)

1. A domain model generation method, characterized by comprising:
acquiring text information input in a text editing box through natural language in response to an operation of generating a domain model;
displaying model text of a class diagram determined based on the text information;
and displaying a domain model generated based on the model text.
2. The method of claim 1, wherein displaying model text of a class diagram determined based on the text information comprises:
analyzing the text information to obtain command information and corresponding parameters;
and displaying the model text of the class diagram determined by the command information and the corresponding parameters in a model text editing area.
3. The method of claim 2, wherein said parsing the text information comprises:
generating an analysis request comprising the text information, sending the analysis request to a preset analysis model, and acquiring command information and corresponding parameters according to feedback information of the preset analysis model;
or extracting command information and corresponding parameters from the text information through a preset regular expression.
4. The method of claim 3, wherein the extracting the command information and the corresponding parameters from the text information by the preset regular expression includes:
detecting whether the text information comprises command information or not through a regular expression corresponding to the command information;
and if the command information is determined to be included, extracting parameters corresponding to the command information from the text information through a regular expression corresponding to the parameters corresponding to the command information, wherein the parameters comprise at least one of names and attributes.
5. The method of claim 2, wherein the domain model comprises a class diagram; the editing mode indicated by the command information comprises at least one mode of adding, deleting and modifying classes of the class diagram;
the displaying the domain model generated based on the model text includes:
and editing the class in the class diagram according to the editing mode indicated by the command information and the corresponding parameters.
6. The method of claim 4, wherein displaying the model text of the class diagram determined with the command information and the corresponding parameters in a model text editing area comprises:
searching a method matched with the command information and the corresponding parameters, and calling the method to generate the model text in the model text area.
7. The method of claim 1, wherein the obtaining text information entered in a text editing box in natural language comprises:
and acquiring input information based on the received input mode selection instruction, and displaying text information corresponding to the input information in the text editing box, wherein the input mode comprises at least one of voice input, keyboard input, handwriting input and OCR scanning recognition input.
8. A domain model generation apparatus, the apparatus comprising:
the text information analysis module is used for responding to the operation of generating the field model and acquiring text information input in a text editing box through natural language;
the model text display module is used for displaying model texts of class diagrams determined based on the text information;
and the domain model display module is used for displaying a domain model generated based on the model text.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory, characterized in that the processor executes the computer program to carry out the steps of the method of any one of claims 1-7.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method according to any of claims 1-7.
CN202311041512.8A 2023-08-17 2023-08-17 Domain model generation method, device, equipment and storage medium Pending CN117057318A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311041512.8A CN117057318A (en) 2023-08-17 2023-08-17 Domain model generation method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311041512.8A CN117057318A (en) 2023-08-17 2023-08-17 Domain model generation method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117057318A true CN117057318A (en) 2023-11-14

Family

ID=88668870

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311041512.8A Pending CN117057318A (en) 2023-08-17 2023-08-17 Domain model generation method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117057318A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117289841A (en) * 2023-11-24 2023-12-26 浙江口碑网络技术有限公司 Interaction method and device based on large language model, storage medium and electronic equipment
CN117708347A (en) * 2023-12-14 2024-03-15 北京英视睿达科技股份有限公司 Method and system for outputting multi-mode result by large model based on API (application program interface) endpoint

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117289841A (en) * 2023-11-24 2023-12-26 浙江口碑网络技术有限公司 Interaction method and device based on large language model, storage medium and electronic equipment
CN117708347A (en) * 2023-12-14 2024-03-15 北京英视睿达科技股份有限公司 Method and system for outputting multi-mode result by large model based on API (application program interface) endpoint

Similar Documents

Publication Publication Date Title
CN111045655B (en) Page rendering method and device, rendering server and storage medium
CN108279964B (en) Method and device for realizing covering layer rendering, intelligent equipment and storage medium
CN117057318A (en) Domain model generation method, device, equipment and storage medium
CN108108342B (en) Structured text generation method, search method and device
US11727200B2 (en) Annotation tool generation method, annotation method, electronic device and storage medium
KR101951719B1 (en) A web reporting design system with programming event handling by using graphic interface
CN111240669B (en) Interface generation method and device, electronic equipment and computer storage medium
CN109145272B (en) Text rendering and layout method, device, equipment and storage medium
CN107977155B (en) Handwriting recognition method, device, equipment and storage medium
CN111813409A (en) Code generation method, device, equipment and storage medium of interactive interface
CN108958731B (en) Application program interface generation method, device, equipment and storage medium
US10691429B2 (en) Converting whiteboard images to personalized wireframes
CN113378579A (en) Method, system and electronic equipment for voice input of structured data
JP7309811B2 (en) Data annotation method, apparatus, electronics and storage medium
CN106776994B (en) Application method and system of engineering symbols in engineering report forms and web pages
CN112667517A (en) Method, device, equipment and storage medium for acquiring automatic test script
CN115469849B (en) Service processing system, method, electronic equipment and storage medium
CN113656028B (en) UI component code generation method, device and equipment, and CRUD page generation method, device and equipment
CN115631374A (en) Control operation method, control detection model training method, device and equipment
US20180300301A1 (en) Enhanced inking capabilities for content creation applications
CN114443022A (en) Method for generating page building block and electronic equipment
CN114222317A (en) Data processing method and device, electronic equipment and storage medium
CN115756452A (en) Target page code generation method, device, storage medium and program product
CN113419711A (en) Page guiding method and device, electronic equipment and storage medium
CN113138760A (en) Page generation method and device, electronic equipment and medium

Legal Events

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