UML (Unified Modeling Language) and iUML-B model generation method with limited natural language requirements

Through the UML and iUML-B model generation methods with limited natural language requirements, the problem of low accuracy of UML modeling caused by natural language ambiguity is solved, the software development efficiency and quality are improved, and the efficiency and accuracy of model generation are achieved.

CN118940749APending Publication Date: 2024-11-12SOUTHWEST JIAOTONG UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410979346.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-22
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

In the prior art, the ambiguity and ambiguity of natural language in software requirements descriptions lead to low accuracy of UML modeling, which in turn reduces modeling efficiency and model quality and increases the cost and time of software development.

Method used

Provide a UML and iUML-B model generation method for restricted natural language requirements. By obtaining restricted natural language requirements text, using restricted natural language regulations method to extract functional requirements text, setting element extraction rules, and generating UML based on element information The state machine model is converted into an iUML-B state machine model, and finally formal verification is performed.

Benefits of technology

It improves model generation efficiency and formal modeling efficiency, simplifies the work burden of demand analysts, improves the overall quality of the model, and alleviates economic and time cost problems in software development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118940749A_ABST
    Figure CN118940749A_ABST
Patent Text Reader

Abstract

The invention relates to a UML (Unified Modeling Language) and iUML-B model generation method limited by natural language requirements. The method comprises the following steps: firstly, acquiring a limited natural language demand text, and extracting a function demand text in the limited natural language demand text by adopting a limited natural language specification method; then, setting an element extraction rule, and extracting primitive information in the function requirement text based on the element extraction rule; then, determining an object state based on the primitive information, and generating a UML state machine model based on the object state; and finally, generating an XML format file based on an XML grammar rule, an element generation rule and the primitive information, and generating an iUML-B state machine model based on the XML format file. The model generation efficiency and the formalized modeling efficiency are improved, the workload of demand analysts is relieved, the modeling process is simplified, and the overall quality of the model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of software engineering, and in particular to a method for generating UML and iUML-B models with limited natural language requirements. Background Art

[0002] With the widespread application of software in different fields, software failure problems have gradually emerged. Software failures not only cause huge economic losses to enterprises, but may also have serious impacts on social security and public trust. Therefore, while controlling software development costs and time, ensuring the security and reliability of systems or software has become an important challenge faced by academia and industry.

[0003] In the prior art, UML, as a standardized modeling language, can help developers identify and solve potential design problems at an early stage, thereby reducing later debugging time and costs. However, due to the fuzziness and ambiguity of natural language in software requirement descriptions, the accuracy of UML modeling is usually not high, which in turn leads to reduced modeling efficiency and a decline in the overall quality of the model.

[0004] Therefore, in the related technology, there is an urgent need for a method that can improve the efficiency and quality of software development. Summary of the invention

[0005] Based on this, it is necessary to provide a UML and iUML-B model generation method with limited natural language requirements that can improve the efficiency and quality of software development in response to the above technical problems.

[0006] In a first aspect, the present application provides a method for generating UML and iUML-B models with limited natural language requirements. The method comprises:

[0007] Obtaining a restricted natural language requirement text, and extracting a functional requirement text from the restricted natural language requirement text using a restricted natural language reduction method;

[0008] Setting element extraction rules, and extracting graphic element information in the functional requirement text based on the element extraction rules;

[0009] Determine the object state based on the graphic element information, and generate a UML state machine model based on the object state;

[0010] An XML format file is generated based on XML grammar rules, element generation rules and the graphic element information, and an iUML-B state machine model is generated based on the XML format file.

[0011] Optionally, in one embodiment of the present application, the restricted natural language specification method includes:

[0012] The restricted natural language requirement text is subjected to Chinese word segmentation, part-of-speech tagging, component grammar analysis, and semantic role tagging to extract the functional requirement text.

[0013] Optionally, in one embodiment of the present application, setting element extraction rules includes:

[0014] Extraction rules for initial state, state, trigger condition, state transition, sub-state machine, and end state are determined based on component grammar analysis and keyword setting.

[0015] Optionally, in an embodiment of the present application, determining the object state based on the graphic element information includes:

[0016] A state, a transition, and a next state are generated based on the primitive information according to the indentation relationship.

[0017] Optionally, in one embodiment of the present application, the XML grammar rules include state data information and structure information, and migration data information and structure information.

[0018] Optionally, in one embodiment of the present application, the method further includes:

[0019] Convert the iUML-B model into the Event-B model and perform formal verification.

[0020] In a second aspect, the present application also provides a UML and iUML-B model generation device with limited natural language requirements. The device comprises:

[0021] A functional requirement text extraction module is used to obtain a restricted natural language requirement text and extract the functional requirement text from the restricted natural language requirement text using a restricted natural language specification method;

[0022] A graphic element information extraction module, used to set element extraction rules and extract graphic element information in the functional requirement text based on the element extraction rules;

[0023] A UML state machine model generation module, used to determine the object state based on the graphic element information, and generate a UML state machine model based on the object state;

[0024] The iUML-B state machine model generation module is used to generate an XML format file based on XML grammar rules, element generation rules and the graphic element information, and to generate an iUML-B state machine model based on the XML format file.

[0025] In a third aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor executes the steps of the methods described in the above embodiments.

[0026] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method described in each of the above embodiments are implemented.

[0027] The UML and iUML-B model generation method of the above-mentioned restricted natural language requirements first obtains the restricted natural language requirement text, and uses the restricted natural language specification method to extract the functional requirement text in the restricted natural language requirement text; then, sets the element extraction rule, and extracts the graphic element information in the functional requirement text based on the element extraction rule; then, determines the object state based on the graphic element information, and generates the UML state machine model based on the object state; finally, generates an XML format file based on the XML grammar rules, the element generation rules and the graphic element information, and generates the iUML-B state machine model based on the XML format file. Efficiently and accurately converting informal natural language requirements into semi-formal or formal software design models not only improves the model generation efficiency and formal modeling efficiency, relieves the workload of demand analysts, but also simplifies the modeling process and improves the overall quality of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 It is an application environment diagram of a UML and iUML-B model generation method with limited natural language requirements in one embodiment;

[0029] Figure 2 It is a flowchart of a method for generating UML and iUML-B models with limited natural language requirements in one embodiment;

[0030] Figure 3 A schematic diagram of transitions between states in one embodiment;

[0031] Figure 4 A schematic diagram of a UML state machine model generation process in one embodiment;

[0032] Figure 5 A schematic diagram of an iUML-B state machine model generation process in one embodiment;

[0033] Figure 6 A schematic diagram of a process of processing a restricted requirement text in an indentation order in one embodiment;

[0034] Figure 7 A structural block diagram of a device for generating UML and iUML-B models with limited natural language requirements in one embodiment;

[0035] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0036] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0037] The UML and iUML-B model generation method with limited natural language requirements provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. Among them, the terminal 102 can be but is not limited to various personal computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.

[0038] In one embodiment, Figure 2 As shown in FIG, a UML and iUML-B model generation method with limited natural language requirements is provided, and the method is applied to Figure 1 The server in the example is used to illustrate the following steps:

[0039] S201: Obtain a restricted natural language requirement text, and extract a functional requirement text from the restricted natural language requirement text using a restricted natural language reduction method.

[0040] In the embodiment of the present application, in the Chinese context, the sentence pattern and sentence structure of the text will have a significant impact on the machine's understanding of semantics. In order to improve the tool generation effect, it is limited and constrained to achieve a better generation effect. First, the restricted natural language requirement text is obtained, and the restricted natural language specification method is used to extract the functional requirement text in the restricted natural language requirement text, that is, the restricted natural language requirement text is arranged in a logical order and the requirement text for generation is extracted according to certain rules.

[0041] S203: Setting element extraction rules, and extracting graphic element information in the functional requirement text based on the element extraction rules.

[0042] In an embodiment of the present application, corresponding element extraction rules are set based on component grammatical analysis and keyword setting, and graphic element information in the functional requirement text is extracted based on the element extraction rules, that is, the elements of specific components in the sentences of the functional requirement text are extracted based on the component grammatical analysis results or keyword extraction methods combined with the extraction rules.

[0043] S205: Determine the object state based on the graphic element information, and generate a UML state machine model based on the object state.

[0044] In the embodiment of the present application, the UML state machine is composed of various states and transitions between states. For any transition of any state machine without parallel or composite states, it can be summarized as follows: Figure 3 The transition between the two states shown. The state machine model is used to explain the dynamic behavior of an entity under different event triggers. It shows how the entity responds to events in different states and describes all possible states of the object in its life cycle. The state covers all states that an object may experience in its life cycle. Its components include states, events, etc. After obtaining the primitive information, the object state is determined based on the primitive information, that is, the current state, transition, and next state. Then, the UML state machine model is generated based on the object state.

[0045] Specifically, define the UML state diagram H = (Q,∑,E,T,q 0 ), where Q is a bounded state set containing n+1 elements, i.e., Q = {q 0 ,q 1 ,…,q n}, Σ refers to the state category involved in the state diagram; E is a set of events, which includes all events that may trigger state transitions, that is, E = {e 0 ,e 1 ,…,e n}; T is a state transition function, expressed as T:Q×E→Q, which means that the state diagram is in a state in Q. When driven by an event in E at a certain moment, the state migrates to another state in Q; q 0∈Q, represents the starting state of the finite state machine. The state machine generally includes states, transitions, trigger events, actions, and monitoring conditions. For the processing of states, in restricted natural languages, it is generally composed of noun phrases NP + verb phrases VP, which express that the entity enters a certain state; for the processing of transitions, the order of states is generally based on the order of natural language sentences, that is, the text in front occurs first, and the text in the back occurs later. If there is a conditional adverbial clause and the number = 1, it is recognized that the state transition exists. For the processing of actions, for common state transitions such as "entity is in state 1 → entity is in state 2", the action between them is "entity = state 2", which is only expressed when converting to a formal model; for the processing of monitoring conditions, if there is no special conditional adverbial clause to explain, that is, there is no special condition, take "entity is in state 1 → entity is in state 2" as an example, the monitoring condition for the entity to transfer from state 1 to state 2 is, "entity == state 1", indicating that the entity can only be converted to state 2 when it is in state 1. This condition is only expressed when converting to a formal model. The above is the processing method of sequential structure. If a state has branch options, that is, the number of conditional clauses is ≥ 2, it is considered that the state transfer has multiple branches. At this time, the line break is used to distinguish, and the corresponding indentation is added according to the number of times this situation occurs to distinguish. The beginning of each line is the conditional clause, followed by the next state. In addition, there are special keywords, which set special processing for texts and symbols such as "return / go to + state verb phrase", "start", "end", "[]", ":". For example Figure 4 As shown, it is a schematic diagram of the UML state machine model generation process.

[0046] S207: Generate an XML format file based on XML grammar rules, element generation rules and the graphic element information, and generate an iUML-B state machine model based on the XML format file.

[0047] In the embodiment of the present application, after the UML state machine model is generated, if the generated result meets expectations, the graphic element information of the UML state machine model is imported into the model conversion tool, and an XML file that meets the iUML-B tool specification is generated by combining the XML grammar rules and the element generation rules, and the converted file is imported into the iUML-B tool to generate the iUML-B state machine model. Among them, the XML grammar rules refer to the xml.etree.ElementTree library in Python. Figure 5 As shown, it is a schematic diagram of the iUML-B state machine model generation process.

[0048] In the above-mentioned UML and iUML-B model generation method of restricted natural language requirements, first, the restricted natural language requirement text is obtained, and the functional requirement text in the restricted natural language requirement text is extracted by the restricted natural language specification method; then, the element extraction rule is set, and the graphic element information in the functional requirement text is extracted based on the element extraction rule; then, the object state is determined based on the graphic element information, and the UML state machine model is generated based on the object state; finally, an XML format file is generated based on the XML grammar rules, the element generation rules and the graphic element information, and the iUML-B state machine model is generated based on the XML format file. Efficiently and accurately converting informal natural language requirements into semi-formal or formal software design models not only improves the model generation efficiency and formal modeling efficiency, relieves the workload of demand analysts, but also simplifies the modeling process and improves the overall quality of the model.

[0049] In one embodiment of the present application, the restricted natural language specification method includes:

[0050] The restricted natural language requirement text is subjected to Chinese word segmentation, part-of-speech tagging, component grammar analysis, and semantic role tagging to extract the functional requirement text.

[0051] In one embodiment of the present application, a restricted natural language is a natural language that imposes restrictions on natural language to construct one or a group of natural language subsets with certain expressive power, simple grammar, and easy disambiguation. Restricted natural language is a natural language subset that is subject to certain restrictions in terms of lexical, syntactic, and semantic aspects, and it can reduce or eliminate ambiguity from multiple aspects. The restricted natural language specification method refers to the use of NLP technology to process restricted natural language so that computers can understand, interpret, and perform tasks in human language, that is, extract functional requirement texts. The key technologies of natural language processing include Chinese word segmentation, part-of-speech tagging, component grammatical analysis, semantic role tagging, etc. In addition, in the extraction process, the general natural language constraint rules used are shown in the following table.

[0052]

[0053] In one embodiment of the present application, setting element extraction rules includes:

[0054] Extraction rules for initial state, state, trigger condition, state transition, sub-state machine, and end state are determined based on component grammar analysis and keyword setting.

[0055] In one embodiment of the present application, in order to extract corresponding elements from the functional requirement text and automatically generate a UML state machine model, the extraction rules of the initial state, state, trigger condition, state transition, sub-state machine, and end state are determined based on component syntax analysis and keyword settings. The specific element extraction rules are shown in the following table.

[0056]

[0057] In one embodiment of the present application, determining the object state based on the primitive information includes:

[0058] A state, a transition, and a next state are generated based on the primitive information according to the indentation relationship.

[0059] In one embodiment of the present application, the indentation relationship is the key to identifying whether a state is connected to multiple states. The text can be divided into three parts according to the indentation relationship. According to the indentation relationship, based on the logical expression order in the graphic element information, the state, transition, and next state are generated. When a state corresponds to multiple transitions, each transition will generate a corresponding state transition after the transition. In particular, for composite states, a set of "[]" symbols will be defined as the start and end of the sub-state machine. The first sentence before the ":" in the "[]" is the name of the sub-state machine (it may also be absent), such as "[Acceleration state:...]" in which "Acceleration state" is the name of the sub-state machine. If you need to express parallel states, you can add multiple sub-state machines to a single sub-state machine for expression. For example Figure 6 The figure shows a schematic diagram of the processing of the restricted requirement text in the order of indentation relationship.

[0060] In one embodiment of the present application, the XML grammar rules include state data information and structure information, and migration data information and structure information.

[0061] In one embodiment of the present application, the XML grammar rules include data information and structural information of the state, and data information and structural information of the migration, wherein the data information and structural information of the state mainly include the id, name, and style information of the state, and the data information and structural information of the migration mainly include the id, name, source state and target state of the migration, and the triggering event of the migration.

[0062] In one embodiment of the present application, the method further includes:

[0063] Convert the iUML-B model into the Event-B model and perform formal verification.

[0064] In one embodiment of the present application, the iUML-B model is further converted into an Event-B model and formal verification is performed. Specifically, the corresponding Event-B model is obtained through model conversion in RODIN. RODIN is an integrated development environment (IDE) designed for the Event-B formal method, which aims to support correctness modeling and verification of complex systems. The core of RODIN is to provide an environment that enables users to create, modify and verify Event-B models. The main steps of formal verification in RODIN are roughly divided into the following steps:

[0065] 1. Modeling: Create a preliminary model of the system in RODIN using the Event-B language. This usually consists of a series of "machines" and "contexts". The machine is responsible for defining the dynamic behavior of the system, and the context defines global static data, such as constants and collections.

[0066] 2. Specification writing: Writing invariants and guards in the machine to express the properties that the system must satisfy. Axioms are defined in the context to determine the properties of constants and sets.

[0067] 3. Generate Proof Obligations: RODIN automatically generates proof obligations from the model. These are assertions that must be proven to be true, to ensure, for example, that invariants are always true under all state changes.

[0068] 4. Proof: Use the built-in prover of RODIN to analyze and prove the proof obligation. This process is usually completed automatically. Manual proof is required only when the automatic proof fails. If there is a proof obligation that cannot be passed, it means that the model needs to be adjusted.

[0069] 5. Iterative refinement: Based on the problems found during the proof, the machine or context is iteratively refined. This may involve operations such as adding new variables, events, or modifying existing invariants.

[0070] In this embodiment, by converting the iUML-B model into the Event-B model and performing formal verification, the correctness and consistency of the model can be proved.

[0071] The following is a specific example to illustrate the specific implementation steps of the UML and iUML-B model generation method of the restricted natural language requirements of the present application. First, S301, obtain the restricted natural language requirement text, and use the restricted natural language specification method to extract the functional requirement text in the restricted natural language requirement text. S303, perform Chinese word segmentation, part-of-speech tagging, component grammar analysis, and semantic role tagging on the restricted natural language requirement text to extract the functional requirement text.

[0072] Then, S305, set element extraction rules, and extract the graphic element information in the functional requirement text based on the element extraction rules. S307, determine the extraction rules of the initial state, state, trigger condition, state transition, sub-state machine, and end state based on component syntax analysis and keyword setting.

[0073] Then, S309, determine the object state based on the graphic element information, and generate a UML state machine model based on the object state. S311, generate a state, a transition, and a next state based on the graphic element information according to the indentation relationship.

[0074] Finally, S313, an XML format file is generated based on the XML grammar rules, element generation rules and the graphic element information, and an iUML-B state machine model is generated based on the XML format file. S315, the XML grammar rules include data information and structure information of the state, data information and structure information of the migration. S317, the iUML-B model is converted into an Event-B model, and formal verification is performed.

[0075] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0076] Based on the same inventive concept, the embodiment of the present application also provides a UML and iUML-B model generation device for limited natural language requirements for implementing the UML and iUML-B model generation method for limited natural language requirements involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of the UML and iUML-B model generation device for limited natural language requirements provided below can refer to the limitations of the UML and iUML-B model generation method for limited natural language requirements above, and will not be repeated here.

[0077] In one embodiment, Figure 7As shown, a UML and iUML-B model generation device 700 for limited natural language requirements is provided, comprising: a functional requirement text extraction module 701, a graphic element information extraction module 703, a UML state machine model generation module 705 and an iUML-B state machine model generation module 707, wherein:

[0078] The function requirement text extraction module 701 is used to obtain the restricted natural language requirement text and extract the function requirement text in the restricted natural language requirement text by using the restricted natural language specification method.

[0079] The graphic element information extraction module 703 is used to set element extraction rules and extract graphic element information in the functional requirement text based on the element extraction rules.

[0080] The UML state machine model generation module 705 is used to determine the object state based on the graphic element information, and generate a UML state machine model based on the object state.

[0081] The iUML-B state machine model generation module 707 is used to generate an XML format file based on XML grammar rules, element generation rules and the graphic element information, and to generate an iUML-B state machine model based on the XML format file.

[0082] In one embodiment of the present application, the functional requirement text extraction module is also used to:

[0083] The restricted natural language requirement text is subjected to Chinese word segmentation, part-of-speech tagging, component grammar analysis, and semantic role tagging to extract the functional requirement text.

[0084] In one embodiment of the present application, the primitive information extraction module is further used to:

[0085] Extraction rules for initial state, state, trigger condition, state transition, sub-state machine, and end state are determined based on component grammar analysis and keyword setting.

[0086] In one embodiment of the present application, the UML state machine model generation module is further used to:

[0087] A state, a transition, and a next state are generated based on the primitive information according to the indentation relationship.

[0088] In one embodiment of the present application, the XML grammar rules include state data information and structure information, and migration data information and structure information.

[0089] The UML and iUML-B model generation device with restricted natural language requirements further includes a formal verification module. In one embodiment of the present application, the formal verification module is used to:

[0090] Convert the iUML-B model into the Event-B model and perform formal verification.

[0091] Each module in the above-mentioned UML and iUML-B model generation device with limited natural language requirements can be fully or partially implemented by software, hardware and their combination. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0092] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 8 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a UML and iUML-B model generation method with limited natural language requirements is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0093] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0094] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.

[0095] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0096] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0097] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0098] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0099] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0100] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for generating UML and iUML-B models with limited natural language requirements, characterized in that: The method comprises: Obtaining a restricted natural language requirement text, and extracting a functional requirement text from the restricted natural language requirement text using a restricted natural language reduction method; Setting element extraction rules, and extracting graphic element information in the functional requirement text based on the element extraction rules; Determine the object state based on the graphic element information, and generate a UML state machine model based on the object state; An XML format file is generated based on XML grammar rules, element generation rules and the graphic element information, and an iUML-B state machine model is generated based on the XML format file.

2. The method for generating UML and iUML-B models with restricted natural language requirements according to claim 1, characterized in that: The restricted natural language specification method comprises: The restricted natural language requirement text is subjected to Chinese word segmentation, part-of-speech tagging, component grammar analysis, and semantic role tagging to extract the functional requirement text.

3. The method for generating UML and iUML-B models with restricted natural language requirements according to claim 1, characterized in that: The setting element extraction rule comprises: Extraction rules for initial state, state, trigger condition, state transition, sub-state machine, and end state are determined based on component grammar analysis and keyword setting.

4. The method for generating UML and iUML-B models with restricted natural language requirements according to claim 1, characterized in that: Determining the object state based on the primitive information includes: A state, a transition, and a next state are generated based on the primitive information according to the indentation relationship.

5. The method for generating UML and iUML-B models with restricted natural language requirements according to claim 1, characterized in that: The XML grammar rules include state data information and structure information, and migration data information and structure information.

6. The method for generating UML and iUML-B models with restricted natural language requirements according to claim 1, characterized in that: The method further comprises: Convert the iUML-B model into the Event-B model and perform formal verification.

7. A UML and iUML-B model generation device with limited natural language requirements, characterized in that: The device comprises: A functional requirement text extraction module is used to obtain a restricted natural language requirement text and extract the functional requirement text from the restricted natural language requirement text using a restricted natural language specification method; A graphic element information extraction module, used to set element extraction rules and extract graphic element information in the functional requirement text based on the element extraction rules; A UML state machine model generation module, used to determine the object state based on the graphic element information, and generate a UML state machine model based on the object state; The iUML-B state machine model generation module is used to generate an XML format file based on XML grammar rules, element generation rules and the graphic element information, and to generate an iUML-B state machine model based on the XML format file.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Cited By

  • Method and device for automatically generating state machine model based on demand matrix

    CN119829900A