Conversion method and device of use case, electronic equipment and storage medium
Through the analysis of label information and node relationships, the conversion between brain graph and text use cases is realized, solving the problem of single form of use case management in the prior art, and improving the flexibility and efficiency of use case management.
Patent Information
- Application Number
- CN202410952844.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-16
- Publication Date
- 2024-11-15
AI Technical Summary
In the prior art, the use case management method is single, and the conversion between text-form use cases and brain-graphic use cases cannot be achieved.
By obtaining the brain map or text to be converted, determining the core nodes using label information and node relationships, and then converting the brain map use case or text use case into another form. The specific steps include: determining the core node based on the tag information and the parent-child relationship, classifying the node content, connecting the node content according to the specified symbols, and forming text or brain diagram use cases.
It realizes the two-way conversion between brain graphs and text use cases, provides the ability to manage use cases in various forms, and improves the work efficiency of software testing engineers.
Smart Images

Figure CN118964176A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, electronic device and storage medium for converting a use case. Background Art
[0002] The traditional test case management method is in text form, such as using Excel or other forms of list cases. Currently, there are also test cases edited in the form of mind maps. Mind maps are a visual means of expressing the relationship between things. Mind maps are very suitable for showing the relationship between test function levels.
[0003] However, the use case management or writing tools in the related art all implement the management of use cases in a single way and cannot achieve the conversion between text-based use cases and mind map use cases. Summary of the invention
[0004] The present application provides a method, device, electronic device and storage medium for converting a use case, so as to solve the problem in the prior art that the management method of use cases is single and the conversion between text-based use cases and mind map use cases cannot be realized.
[0005] In a first aspect, an embodiment of the present application provides a method for converting a use case, including:
[0006] Acquire a mind map to be converted, wherein each node in the mind map to be converted is configured with label information, and the label information is used to indicate the type of the node;
[0007] Determine a core node among the nodes based on the label information and the parent-child relationship between the nodes in the mind map to be converted;
[0008] Based on the core nodes and the parent-child relationships, determining the mind map use cases corresponding to the core nodes;
[0009] Based on the label information of each node in each of the mind map use cases and the node content of each node, the mind map use case is converted into a text use case.
[0010] Optionally, determining a core node among the nodes based on the label information and the parent-child relationship between the nodes in the to-be-converted mind map includes:
[0011] Determine a candidate node in the to-be-converted mind map whose label information is a first specified type;
[0012] A leaf node among the candidate nodes is determined as the core node based on the parent-child relationship.
[0013] Optionally, determining the mind map use case where each core node is located based on the core node and the parent-child relationship includes:
[0014] Determine the descendant nodes of the core node and each intermediate node between the core node and a target node, wherein the target node is a node whose label information is of a second specified type;
[0015] Determining label information and node contents of the intermediate node, the core node, and the descendant node is a mind map use case.
[0016] Optionally, based on the label information of each node in each of the mind map use cases and the node content of each node, converting the mind map use case into a text use case includes:
[0017] Classify the nodes in the mind map use case using the label information of the nodes to obtain multiple classification results;
[0018] Classifying the node contents belonging to the same classification result to obtain classified contents;
[0019] The classification contents of the mind map use cases belonging to the same label information are taken as a column, and the classification contents of the same mind map use case are taken as a row, to obtain the text use case.
[0020] Optionally, classifying the node contents belonging to the same classification result to obtain classified contents includes:
[0021] In order from parent to child, the node contents belonging to the same classification result are connected according to designated symbols to obtain the classification content.
[0022] Optionally, after determining the mind map use cases corresponding to each core node based on the core node and the parent-child relationship, the method further includes:
[0023] Determining a first identifier for each of the mind map use cases;
[0024] After converting the mind map use cases into text use cases based on the label information of each node in each mind map use case and the node content of each node, the method further includes:
[0025] Configuring a second identifier for each of the text use cases;
[0026] The first identifier is associated with the second identifier of the text use case converted from the mind map use case corresponding to the first identifier.
[0027] In a second aspect, an embodiment of the present application provides a method for converting a use case, including:
[0028] Acquire a text to be converted, wherein the text to be converted includes label information and use case content corresponding to each text use case under each label information, wherein the label information is used to indicate the type of the use case content;
[0029] Determine each text use case in the text to be converted;
[0030] Determine nodes and node contents in the mind map use case based on the use case content of the text use case according to the label information;
[0031] The text use case is converted into a mind map use case based on the nodes and node contents.
[0032] Optionally, determining nodes and node contents in the mind map use case based on the use case content of the text use case according to the label information includes:
[0033] Splitting the first use case content in the text use case, and using each split result as the first node in the mind map use case and the node content of the first node, wherein the first use case content is the use case content corresponding to the label information of the first specified type;
[0034] Determine a core node in the first node of each of the mind map use cases;
[0035] The second use case content in each text use case is used as a child node of the core node and the node content of the child node, wherein the second use case content is the use case content corresponding to the label information of the second specified type;
[0036] The first node and the subnode are determined to be nodes in a mind map use case, and the node content of the first node and the node content of the subnode are determined to be node content in the mind map use case.
[0037] Optionally, the first use case content includes a plurality of node contents, the node contents are connected by designated symbols, and the converting the text use case into a mind map use case based on the nodes and the node contents includes:
[0038] The node where the node content before the designated symbol is located is taken as the parent node of the node where the node content after the designated symbol is located, and the parent-child relationship between the nodes is determined;
[0039] The nodes with the same node content in the parent-child relationship are merged to obtain the mind map use case.
[0040] In a third aspect, an embodiment of the present application provides a use case conversion device, including:
[0041] A first acquisition module is used to acquire a mind map to be converted, wherein each node in the mind map to be converted is configured with label information, and the label information is used to indicate the type of the node;
[0042] A first determination module is used to determine a core node among the nodes based on the label information and the parent-child relationship between the nodes in the mind map to be converted;
[0043] A second determination module is used to determine the mind map use case corresponding to each core node based on the core node and the parent-child relationship;
[0044] A conversion module is used to convert the mind map use case into a text use case based on the label information of each node in each mind map use case and the node content of each node.
[0045] In a fourth aspect, an embodiment of the present application provides a use case conversion device, including:
[0046] A second acquisition module is used to acquire a text to be converted, wherein the text to be converted includes label information and a use case content corresponding to each text use case under each label information, wherein the label information is used to indicate the type of the use case content;
[0047] A third determination module is used to determine each text use case in the text to be converted;
[0048] A fourth determination module, configured to determine nodes and node contents in a mind map use case based on the use case content of the text use case based on the label information;
[0049] The second conversion module is used to convert the text use case into a mind map use case based on the nodes and node contents.
[0050] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;
[0051] The memory is used to store computer programs;
[0052] The processor is used to execute the program stored in the memory to implement the conversion method of the use case described in the first aspect or the second aspect.
[0053] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the conversion method of the use case described in the first aspect or the second aspect.
[0054] The above technical solution provided by the embodiment of the present application has the following advantages compared with the prior art: the method provided by the embodiment of the present application, by obtaining the mind map to be converted, each node in the mind map to be converted is configured with label information, and the label information is used to indicate the type of the node; based on the label information and the parent-child relationship between the nodes in the mind map to be converted, the core node in the node is determined; based on the core node and the parent-child relationship, the mind map use case corresponding to each core node is determined; based on the label information of each node in each mind map use case and the node content of each node, the mind map use case is converted into a text use case. In this way, by configuring label information on the nodes in the mind map, each mind map use case in the mind map can be determined by the label information, and then the label information and the node content of the nodes in the mind map use case are used to convert the mind map use case to obtain a text use case, thereby realizing the conversion between the mind map and the text use case, and managing the use case in a variety of forms. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0056] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0057] Figure 1 An application scenario diagram of a method for converting a use case provided in an embodiment of the present application;
[0058] Figure 2 A flowchart of a method for converting a use case provided in an embodiment of the present application;
[0059] Figure 3 A schematic diagram of a mind map use case provided for an embodiment of the present application;
[0060] Figure 4 A schematic diagram of a text use case provided for an embodiment of the present application;
[0061] Figure 5 A flowchart of a method for converting a use case provided in another embodiment of the present application;
[0062] Figure 6 A schematic diagram of a mind map use case provided for another embodiment of the present application;
[0063] Figure 7 A structural diagram of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0064] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0065] According to an embodiment of the present application, a method for converting a use case is provided. Optionally, in the embodiment of the present application, the method for converting the use case can be applied to Figure 1 In the hardware environment composed of the terminal 101 and the server 102 shown in FIG. Figure 1 As shown, the server 102 is connected to the terminal 101 via a network, and can be used to provide services (such as application services, etc.) for the terminal or a client installed on the terminal. A database can be set on the server or independently of the server to provide data storage services for the server 102. The above-mentioned network includes but is not limited to: a wide area network, a metropolitan area network or a local area network, and the terminal 101 is not limited to a PC, a mobile phone, a tablet computer, etc.
[0066] The method for converting the use case of the embodiment of the present application may be executed by the server 102, or by the terminal 101, or by both the server 102 and the terminal 101. The terminal 101 may execute the method for converting the use case of the embodiment of the present application, or the client installed thereon.
[0067] Taking the conversion method of the use case of the terminal executing the embodiment of the present application as an example, Figure 2 is a flow chart of a conversion method of an optional use case according to an embodiment of the present application, such as Figure 2 As shown, the process of the method may include the following steps:
[0068] Step 201: Obtain a mind map to be converted, wherein each node in the mind map to be converted is configured with label information, and the label information is used to indicate the type of the node.
[0069] In some embodiments, a mind map is a graphical thinking tool that can be used to help users organize and express ideas, concepts or information. The mind map to be converted can be created in advance by the user. When creating the mind map to be converted, a label information is configured for each mind map node.
[0070] The label information includes the use case name, use case level, preconditions, test steps, expected results, etc. The use case name in the mind map may be a node name in the mind map, wherein the node name is used to distinguish only the type of the node.
[0071] For example, the brain map to be converted can be found in Figure 3 As shown, the node names include directory nodes, name nodes, other nodes, etc. Among them, other nodes are usually places for users to write essays, which will be ignored in the process of analyzing use cases.
[0072] Step 202: Determine a core node among the nodes based on the label information and the parent-child relationship between the nodes in the mind map to be converted.
[0073] In some embodiments, a mind map analysis tool may be used to analyze all nodes in the mind map to be converted, and determine directory nodes, other nodes, and name nodes therein.
[0074] The directory node is the parent node of the name node. Furthermore, when there are multiple name nodes, they may include name nodes of multiple mind map use cases. Therefore, they need to be further distinguished.
[0075] In an optional embodiment, determining a core node among the nodes based on the label information and the parent-child relationship between the nodes in the mind map to be converted includes:
[0076] Determine a candidate node in the to-be-converted mind map whose label information is a first specified type;
[0077] A leaf node among the candidate nodes is determined as the core node based on the parent-child relationship.
[0078] In some embodiments, the first specified type may be, but is not limited to, a name node, such as Figure 3 In the example, "fixed assets", "copyright", "advertising income" and so on are all name nodes, and they are determined as candidate nodes. There is also a parent-child relationship between the candidate nodes. For example, the "office supplies" node is the parent node of the "fixed assets" node and the child node of the "purchase contract" node. Through this parent-child relationship, the core node that is a leaf node among the candidate nodes can be determined. Figure 3 In the data center, the core nodes include the "fixed assets" node, the "low-value consumables" node, the "copyright" node, the "advertising revenue" node, etc.
[0079] in, Figure 3 In the example, although "fixed assets" is not a leaf node of the mind map, it is a leaf node only in terms of "name"; although "office supplies" is also a name node, it is not a leaf node, so it is not a core node of a use case.
[0080] By determining the core nodes, it is possible to obtain the mind map use cases including the number of core nodes in the mind map to be converted.
[0081] Step 203: Based on the core nodes and the parent-child relationships, determine the mind map use cases corresponding to each core node.
[0082] In some embodiments, after a core node is determined, a search is performed with the core node as the center in the direction of its parent node and child nodes to determine all contents included in the mind map use case where the core node is located.
[0083] In an optional embodiment, determining the mind map use case where each core node is located based on the core node and the parent-child relationship includes:
[0084] Determine the descendant nodes of the core node and each intermediate node between the core node and a target node, wherein the target node is a node whose label information is of a second specified type;
[0085] Determining label information and node contents of the intermediate node, the core node, and the descendant node is a mind map use case.
[0086] In some embodiments, the second designated type may be but is not limited to a directory node, and the descendant node of the directory node is usually a name node. By searching from the core node to the previous generation, that is, searching in the direction of its parent node, after searching for the nearest directory node, all information between the core node and the directory node is determined as the content of a use case, and by searching from the core node to its descendants, that is, searching in the direction of its child nodes, all node information after the core node is determined as the content of the use case where the core node is located.
[0087] For example, see Figure 3 The content of the "Income Contract" intermediate node between the core node "Advertising Income" and the directory node "Edit Contract" and the child nodes "1. Fill in XXX information 2. Fill in XXX information 3. Click the Submit button" are all the content of the use case where the core node "Advertising Income" is located. The information of all nodes after the core node "Advertising Income" belongs to the content of the use case where this core node is located. For example, "You can see an advertising income contract on the contract list page" is the node content of the core node "Advertising Income"; the content of the two nodes "Buy a membership" and "Synchronize data to XX system" are all the content of the core node "Membership Income".
[0088] Step 204: based on the label information of each node in each of the mind map use cases and the node content of each node, convert the mind map use cases into text use cases.
[0089] In some embodiments, after determining the label information of each node of each mind map use case and its node content, all obtained node contents can be assembled into a text use case to achieve conversion from the mind map use case to the text use case.
[0090] In an optional embodiment, based on the label information of each node in each of the mind map use cases and the node content of each node, the mind map use case is converted into a text use case, including:
[0091] Classify the nodes in the mind map use case using the label information of the nodes to obtain multiple classification results;
[0092] Classifying the node contents belonging to the same classification result to obtain classified contents;
[0093] The classification contents of the mind map use cases belonging to the same label information are taken as a column, and the classification contents of the same mind map use case are taken as a row, to obtain the text use case.
[0094] In some embodiments, nodes in the mind map use case may be classified based on different label information. For example, nodes with consistent label information may be classified into one category. Figure 3 In the example, the name node can be divided into one category, the preconditions, test steps, expected results, etc. can be divided into one category respectively. The use case level can be determined by the level of the core node in the mind map use case. If the core node is not configured with a use case level, the highest level in the mind map use case can be selected as the use case level.
[0095] For example, Figure 3 The level of the use case "Purchase Contract - Office Supplies - Fixed Assets" is P2, not P1; the use case "Purchase Contract - Copyright" has no use case level information.
[0096] After determining the above information, the label information can be used as the header of the text use case, the content of each mind map use case can be used as a row, and the classification content of the mind map use case can be configured under the corresponding label information to obtain the text use case.
[0097] In the case where there are multiple node contents with the same tag information, the multiple node contents can be classified, for example, Figure 3 The "purchase contract", "office supplies" and "fixed assets" in the example are all node contents of the name node, which can be classified and the classified contents can be set in the same tag information, namely, the name.
[0098] In an optional embodiment, classifying the node contents belonging to the same classification result to obtain classified contents includes:
[0099] In order from parent to child, the node contents belonging to the same classification result are connected according to designated symbols to obtain the classification content.
[0100] In some embodiments, the node contents belonging to the same classification result can be stored in a preset format, and the node contents are connected by a specified symbol, the node content of the parent node is set before the specified symbol, and the node content of the child node is set after the specified symbol. When there are more node contents, they are all set according to this principle. The specified symbol can be, but is not limited to, a separator.
[0101] Will Figure 3 After the mind map use case shown in the figure is transformed, we can get the following Figure 4 Text example shown.
[0102] Furthermore, when the mind map use case changes, in order to facilitate timely updating of its corresponding text use case, a correspondence between the mind map use case and the text use case can be established. The use case conversion method also includes:
[0103] Determining a first identifier for each of the mind map use cases;
[0104] After converting the mind map use cases into text use cases based on the label information of each node in each mind map use case and the node content of each node, the method further includes:
[0105] Configuring a second identifier for each of the text use cases;
[0106] The first identifier is associated with the second identifier of the text use case converted from the mind map use case corresponding to the first identifier.
[0107] In some embodiments, due to the uniqueness of the core node in the mind map use case, the identifier of the core node can be used as the first identifier of the mind map use case. During the mind map use case conversion process, the converted text use case can be configured with a second identifier, and then the mind map use case and the text use case including the same content can be associated. In this way, after the mind map use case changes, the text use case corresponding to the changed mind map use case can be found through the association relationship, so as to update it.
[0108] The second identifier may be randomly generated for each text case during the process of converting the text case.
[0109] The use case conversion method of the present application requires that each mind map node must select a label information (corresponding to the elements of the use case, such as the use case name, use case level, preconditions, test steps, expected results, etc.) when writing the mind map use case. There are no restrictions on the hierarchy of the nodes in the mind map, the front and back of the labels, and repeated labels. It not only ensures the standardization of the writing of mind maps, so that there is a basis for converting text; it also retains the flexibility of the writing of mind maps. The use case in the form of labeled mind maps can be converted into text use cases. Text use cases are the work output form of test engineers. They support one-click conversion to text use cases, which improves the work efficiency of software test engineers without having to write use cases twice.
[0110] Based on the same concept, a method for converting a use case is provided in the embodiment of the present application. The specific implementation of the method can be found in the description of the above method embodiment, and the repeated parts will not be repeated. Figure 5 As shown, the method mainly includes:
[0111] Step 501: Acquire a text to be converted, wherein the text to be converted includes tag information and use case content corresponding to each text use case under each tag information, wherein the tag information is used to indicate the type of the use case content.
[0112] In some embodiments, the text to be converted may be in a table format, label information is set in the title row of the converted text, and the use case content of each text use case is set under each label information.
[0113] See also Figure 4 The text to be converted is shown, where ID, name, level, preset conditions, etc. are all label information; each line under the title line is the use case content.
[0114] Step 502: Determine a use case for each text in the text to be converted.
[0115] In some embodiments, since the text to be converted is in a table format, each row of data and label information in the table is a text example. Figure 4 The text to be converted shown includes six text use cases with IDs 1841101-1841106.
[0116] Step 503: Determine the nodes and node contents in the mind map use case based on the label information and the use case content of the text use case.
[0117] In some embodiments, since the label information indicates the type of the use case content, each label information can be used as a node in the mind map use case to distinguish the use case content through multiple nodes. Since there is a corresponding relationship between the label information and the use case content in the text to be converted, after the node of the mind map use case is determined, the use case content corresponding to the label information can be determined as the node content.
[0118] In an optional embodiment, determining nodes and node contents in a mind map use case based on the use case content of the text use case according to the tag information includes:
[0119] Splitting the first use case content in the text use case, and using each split result as the first node in the mind map use case and the node content of the first node, wherein the first use case content is the use case content corresponding to the label information of the first specified type;
[0120] Determine a core node in the first node of each of the mind map use cases;
[0121] Determine that the label information of the second specified type is a child node of the core node, and use the second use case content in each text use case as the node content of the child node of the core node, where the second use case content is the use case content corresponding to the label information of the second specified type;
[0122] The first node and the subnode are determined to be nodes in a mind map use case, and the node content of the first node and the node content of the subnode are determined to be node content in the mind map use case.
[0123] In some embodiments, for use case contents with the same tag information, they are often classified when writing the text to be converted, so that one tag information may include node contents of multiple nodes. Therefore, such use case contents need to be split.
[0124] The first specified type may be a name, such as Figure 4 As shown, taking the first text use case as an example, the first use case content of its "name" includes "purchase contract-office supplies-fixed assets". By splitting it, three first nodes can be obtained. These three first nodes are all name nodes, and the node contents of the first nodes are "purchase contract", "office supplies" and "fixed assets" respectively.
[0125] The storage format of the first node in the first use case content is usually connected by a specified symbol and stored in the order of parent node first and then child node. Therefore, it can be determined that the last first node in the first use case content is a core node.
[0126] The second specified type may be information in the tag information other than the first specified type, for example, Figure 4 The pre-conditions, test steps, etc. in the second specified type are determined as the child node of the core node, and the second use case content corresponding to the second specified type is used as the node content of the child node. Figure 4 The first text use case in the test step is a subnode of fixed assets, and the content of the test step "1. Fill in XXX information 2. Fill in XXX information 3. Click the submit button" is the node content of the subnode.
[0127] Step 504: Convert the text use case into a mind map use case based on the nodes and node contents.
[0128] In some embodiments, by determining each node and node content in a mind map, the text use case can be converted into a mind map use case according to the parent-child relationship between nodes and the node content.
[0129] In an optional embodiment, the first use case content includes a plurality of node contents, the node contents are connected by designated symbols, and the converting the text use case into a mind map use case based on the nodes and the node contents includes:
[0130] The node where the node content before the designated symbol is located is taken as the parent node of the node where the node content after the designated symbol is located, and the parent-child relationship between the nodes is determined;
[0131] The nodes with the same node content in the parent-child relationship are merged to obtain the mind map use case.
[0132] In some embodiments, the first nodes in the same tag information of different text use cases may be the same. To make the mind map more concise, nodes with the same node content may be merged so that the mind map use cases present a tree structure.
[0133] For example, Figure 4 In the first text case and the second text case, the purchase contract and office supplies are both the first nodes, and the parent-child relationship between the two is the same, both of which are the parent nodes of the purchase contract as office supplies. Based on this, the nodes corresponding to the two text cases can be merged, such as Figure 6 As shown, in the mind map, only one node is set for procurement contracts and office supplies, and low-value consumables and fixed assets are both child nodes of office supplies.
[0134] In a specific embodiment, the conversion method of the use case may include:
[0135] Step 1: Convert the directory in the text use case to the use case in the mind map. Since the directory tree of the text contains the same information as the directory node of the mind map, the directory tree of the text can be directly converted to the directory tree of the mind map.
[0136] Step 2: Read the text use cases in the directory and split each "use case name" according to the "-" symbol (a conventional symbol). Then merge and display the texts with the same content at the same level, and draw the structure of the mind map based on this.
[0137] Step 3: List the other elements of the use case after the name node and arrange them in sequence.
[0138] Step 4: Write the use cases split according to the above rules into the data structure of the mind map. This process uses the standard mind map analysis method.
[0139] Step 5: Write a mapping table between use cases and mind maps.
[0140] In this way, in the process of converting text to mind map, the use of separators can be more intelligent, and separators can be automatically identified and split according to the specific text content; text use cases that have no related information can be divided according to the agreed characters and drawn into a mind map, that is, the flat data is converted into a mind map. The reading and review of use cases are more intuitive, which will significantly improve the communication efficiency between test engineers and other roles.
[0141] Based on the same concept, a use case conversion device is provided in the embodiment of the present application. The specific implementation of the device can refer to the description of the method embodiment part, and the repeated parts will not be repeated. The device mainly includes:
[0142] A first acquisition module is used to acquire a mind map to be converted, wherein each node in the mind map to be converted is configured with label information, and the label information is used to indicate the type of the node;
[0143] A first determination module is used to determine a core node among the nodes based on the label information and the parent-child relationship between the nodes in the mind map to be converted;
[0144] A second determination module is used to determine the mind map use case corresponding to each core node based on the core node and the parent-child relationship;
[0145] A conversion module is used to convert the mind map use case into a text use case based on the label information of each node in each mind map use case and the node content of each node.
[0146] Optionally, the first determining module includes:
[0147] A first sub-determination module is used to determine the candidate nodes whose label information in the to-be-converted mind map is a first specified type;
[0148] The second sub-determination module is used to determine a leaf node among the candidate nodes as the core node based on the parent-child relationship.
[0149] Optionally, the second determination module includes:
[0150] A third sub-determination module is used to determine the descendant nodes of the core node and each intermediate node between the core node and a target node, wherein the target node is a node whose label information is of a second specified type;
[0151] The fourth sub-determination module is used to determine that the label information and node content of the intermediate node, the core node and the descendant node are mind map use cases.
[0152] Optional, conversion module, including:
[0153] A classification submodule, used for classifying the nodes in the mind map use case according to the label information of the nodes to obtain multiple classification results;
[0154] A classification submodule, used for classifying the node contents belonging to the same classification result to obtain classified contents;
[0155] The conversion submodule is used to take the classification contents of the mind map use cases belonging to the same label information as a column and the classification contents of the same mind map use case as a row to obtain the text use case.
[0156] Optional, categorized submodules, including:
[0157] In order from parent to child, the node contents belonging to the same classification result are connected according to designated symbols to obtain the classification content.
[0158] Optionally, also include:
[0159] A fifth determining submodule, configured to determine a first identifier of each of the mind map use cases;
[0160] A configuration submodule, configured to configure a second identifier for each of the text use cases;
[0161] The associating submodule is used to associate the first identifier with the second identifier of the text use case converted from the mind map use case corresponding to the first identifier.
[0162] Based on the same concept, a use case conversion device is provided in the embodiment of the present application. The specific implementation of the device can refer to the description of the method embodiment part, and the repeated parts will not be repeated. The device mainly includes:
[0163] A second acquisition module is used to acquire a text to be converted, wherein the text to be converted includes label information and a use case content corresponding to each text use case under each label information, wherein the label information is used to indicate the type of the use case content;
[0164] A third determination module is used to determine each text use case in the text to be converted;
[0165] A fourth determination module, configured to determine nodes and node contents in a mind map use case based on the use case content of the text use case based on the label information;
[0166] The second conversion module is used to convert the text use case into a mind map use case based on the nodes and node contents.
[0167] Optionally, the fourth determination module includes:
[0168] A splitting submodule, used to split the first use case content in the text use case, and use each split result as the first node in the mind map use case and the node content of the first node, wherein the first use case content is the use case content corresponding to the label information of the first specified type;
[0169] A sixth determination submodule, used to determine a core node in the first node of each of the mind map use cases;
[0170] A seventh determination submodule is used to use the second use case content in each text use case as a child node of the core node and the node content of the child node, wherein the second use case content is the use case content corresponding to the label information of the second specified type;
[0171] The eighth determination submodule is used to determine that the first node and the subnode are nodes in the mind map use case, and determine that the node content of the first node and the node content of the subnode are node contents in the mind map use case.
[0172] Optionally, the first use case content includes a plurality of node contents, the node contents are connected by designated symbols, and the second conversion module includes:
[0173] A ninth determination submodule, used to determine the parent-child relationship between the nodes by taking the node where the node content before the designated symbol is located as the parent node of the node where the node content after the designated symbol is located adjacent to the node;
[0174] The merging submodule is used to merge the nodes with the same node content in the parent-child relationship to obtain the mind map use case.
[0175] Based on the same concept, an electronic device is also provided in the embodiment of the present application, such as Figure 7 As shown, the electronic device mainly includes: a processor 701, a memory 702 and a communication bus 703, wherein the processor 701 and the memory 702 communicate with each other through the communication bus 703. The memory 702 stores a program executable by the processor 701, and the processor 701 executes the program stored in the memory 702 to implement the following steps:
[0176] Acquire a mind map to be converted, wherein each node in the mind map to be converted is configured with label information, and the label information is used to indicate the type of the node;
[0177] Determine a core node among the nodes based on the label information and the parent-child relationship between the nodes in the mind map to be converted;
[0178] Based on the core nodes and the parent-child relationships, determining the mind map use cases corresponding to the core nodes;
[0179] Based on the label information of each node in each of the mind map use cases and the node content of each node, the mind map use case is converted into a text use case. Or,
[0180] Acquire a text to be converted, wherein the text to be converted includes label information and use case content corresponding to each text use case under each label information, wherein the label information is used to indicate the type of the use case content;
[0181] Determine each text use case in the text to be converted;
[0182] Determine nodes and node contents in the mind map use case based on the use case content of the text use case according to the label information;
[0183] The text use case is converted into a mind map use case based on the nodes and node contents.
[0184] The communication bus 703 mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus 703 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0185] The memory 702 may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Alternatively, the memory may also be at least one storage device located away from the processor 701.
[0186] The above-mentioned processor 701 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc., and can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0187] In another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program runs on a computer, the computer executes the conversion method of the use case described in the above embodiment.
[0188] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instruction is loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instruction can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instruction is transmitted from a website site, a computer, a server or a data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, a data center, etc. that contains one or more available media integration. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape, etc.), an optical medium (such as a DVD) or a semiconductor medium (such as a solid-state hard disk), etc.
[0189] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0190] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A method for converting a use case, characterized in that: include: Acquire a mind map to be converted, wherein each node in the mind map to be converted is configured with label information, and the label information is used to indicate the type of the node; Determine a core node among the nodes based on the label information and the parent-child relationship between the nodes in the mind map to be converted; Based on the core nodes and the parent-child relationships, determining the mind map use cases corresponding to the core nodes; Based on the label information of each node in each of the mind map use cases and the node content of each node, the mind map use case is converted into a text use case.
2. The method for converting a use case according to claim 1, characterized in that: Determining a core node among the nodes based on the label information and the parent-child relationship between the nodes in the mind map to be converted includes: Determine a candidate node in the to-be-converted mind map whose label information is a first specified type; A leaf node among the candidate nodes is determined as the core node based on the parent-child relationship.
3. The method for converting a use case according to claim 1, characterized in that: The determining, based on the core nodes and the parent-child relationship, the mind map use case where each core node is located includes: Determine the descendant nodes of the core node and each intermediate node between the core node and a target node, wherein the target node is a node whose label information is of a second specified type; Determining label information and node contents of the intermediate node, the core node, and the descendant node is a mind map use case.
4. The method for converting a use case according to claim 1, characterized in that: Based on the label information of each node in each of the mind map use cases and the node content of each node, the mind map use case is converted into a text use case, including: Classify the nodes in the mind map use case using the label information of the nodes to obtain multiple classification results; Classifying the node contents belonging to the same classification result to obtain classified contents; The classification contents of the mind map use cases belonging to the same label information are taken as a column, and the classification contents of the same mind map use case are taken as a row, to obtain the text use case.
5. The method for converting a use case according to claim 4, characterized in that: The node contents belonging to the same classification result are classified to obtain classified contents, including: In order from parent to child, the node contents belonging to the same classification result are connected according to designated symbols to obtain the classification content.
6. The method for converting a use case according to claim 1, characterized in that: After determining the mind map use cases corresponding to each core node based on the core node and the parent-child relationship, the method further includes: Determining a first identifier for each of the mind map use cases; After converting the mind map use cases into text use cases based on the label information of each node in each mind map use case and the node content of each node, the method further includes: Configuring a second identifier for each of the text use cases; The first identifier is associated with the second identifier of the text use case converted from the mind map use case corresponding to the first identifier.
7. A method for converting a use case, characterized in that: include: Acquire a text to be converted, wherein the text to be converted includes label information and use case content corresponding to each text use case under each label information, wherein the label information is used to indicate the type of the use case content; Determine each text use case in the text to be converted; Determine nodes and node contents in the mind map use case based on the use case content of the text use case according to the label information; The text use case is converted into a mind map use case based on the nodes and node contents.
8. The method for converting a use case according to claim 7, characterized in that: Determining nodes and node contents in the mind map use case based on the use case content of the text use case according to the label information includes: Splitting the first use case content in the text use case, and using each split result as the first node in the mind map use case and the node content of the first node, wherein the first use case content is the use case content corresponding to the label information of the first specified type; Determine a core node in the first node of each of the mind map use cases; The second use case content in each text use case is used as a child node of the core node and the node content of the child node, wherein the second use case content is the use case content corresponding to the label information of the second specified type; The first node and the subnode are determined to be nodes in a mind map use case, and the node content of the first node and the node content of the subnode are determined to be node content in the mind map use case.
9. The method for converting a use case according to claim 8, characterized in that: The first use case content includes a plurality of node contents, the node contents are connected by designated symbols, and the converting of the text use case into a mind map use case based on the nodes and the node contents includes: Taking the node where the node content before the designated symbol is located as the parent node of the node where the node content after the designated symbol is located, and determining the parent-child relationship between the nodes; The nodes with the same node content in the parent-child relationship are merged to obtain the mind map use case.
10. A conversion device for use cases, characterized in that: include: A first acquisition module is used to acquire a mind map to be converted, wherein each node in the mind map to be converted is configured with label information, and the label information is used to indicate the type of the node; A first determination module is used to determine a core node among the nodes based on the label information and the parent-child relationship between the nodes in the mind map to be converted; A second determination module is used to determine the mind map use case corresponding to each core node based on the core node and the parent-child relationship; A conversion module is used to convert the mind map use case into a text use case based on the label information of each node in each mind map use case and the node content of each node.
11. A conversion device for use cases, characterized in that: include: A second acquisition module is used to acquire a text to be converted, wherein the text to be converted includes label information and a use case content corresponding to each text use case under each label information, wherein the label information is used to indicate the type of the use case content; A third determination module is used to determine each text use case in the text to be converted; A fourth determination module, configured to determine nodes and node contents in a mind map use case based on the use case content of the text use case based on the label information; The second conversion module is used to convert the text use case into a mind map use case based on the nodes and node contents.
12. An electronic device, characterized in that: include: A processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; The memory is used to store computer programs; The processor is used to execute the program stored in the memory to implement the method for converting the use case described in any one of claims 1 to 6 or the method for converting the use case described in any one of claims 7 to 9.
13. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for converting the use case described in any one of claims 1 to 6 and the method for converting the use case described in any one of claims 7 to 9 are implemented.
