A method, device and equipment for restoring a structure diagram
By identifying and searching the root node of the structure tree, the uneditable structure diagram file is automatically restored, which solves the problem that the structure diagram file cannot be edited in the existing technology, achieves savings in time and labor costs, and meets business needs.
Patent Information
- Application Number
- CN202111280092.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-29
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2041-10-29
AI Technical Summary
In the existing technology, structural diagram files are usually not editable after being exported to image format or PDF, causing users to manually re-create the entire structural diagram file when modifications are needed, which consumes a lot of time and labor costs and makes it difficult to meet business needs.
By obtaining the non-editable structure diagram file, identifying the node set and the guide line set, determining the root node of the structure tree, and searching the node set combined with the guide line, the structure diagram file that supports editing is obtained, and the automatic restoration process is realized.
It reduces the user's manual operations, saves time and labor costs, improves efficiency, meets business needs, and automatically restores uneditable structure diagram files to editable files.
Smart Images

Figure CN113901760B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method, device and equipment for restoring a structure graph. Background Art
[0002] With the rapid development of information technology, the demand for office automation and smart office is increasing. As a critical link in office automation and smart office, document restoration has become a hot topic in the industry in recent years. Document restoration specifically refers to restoring a document from an uneditable format to an editable format.
[0003] A typical application of document restoration is the restoration of structure diagram files. Specifically, after a structure diagram is created, it can usually be exported as a structure diagram file in a picture format or a portable document format (PDF) for easy use. For example, the structure diagram file in the above picture format can be inserted into a presentation for demonstration, or sent to a user as an attachment.
[0004] The above-mentioned structure diagram files in image format or PDF format are usually not editable. When a user (for example, a user who receives an attachment) modifies a structure diagram file, it is usually necessary to manually restore the structure diagram file in image format or PDF format to an editable file. This requires a lot of time and manpower costs, and it is difficult to meet business needs. Summary of the invention
[0005] The present application provides a structure diagram restoration method, device and equipment, which can save time and manpower costs and easily meet business needs.
[0006] The technical solutions provided by this application are as follows:
[0007] In a first aspect, the present application provides a structure graph restoration method, the method comprising:
[0008] Acquire a first structure diagram file, where the file format of the first structure diagram file is a first format, and the first format does not support editing;
[0009] Identify the first structure diagram file, obtain a node set and a guide line set, the node set includes nodes of at least one structure tree in the first structure diagram file, and the guide line set includes guide lines of at least one structure tree in the first structure diagram file;
[0010] Determine a root node of the at least one structure tree, take the root node as a starting point, search the node set in combination with the guide line set, and obtain the at least one structure tree;
[0011] A second structure diagram file is obtained according to the at least one structure tree, wherein the file format of the second structure diagram file is a second format, and the second format supports editing.
[0012] Optionally, determining the root node of the at least one structure tree includes:
[0013] A node specified by a user is received, and the node is determined as a root node of the at least one structure tree.
[0014] Optionally, determining the root node of the at least one structure tree includes:
[0015] Presenting a selection control to the user;
[0016] Determine the node selected by the user through the selection control as the root node of the at least one structure tree; or,
[0017] Receive the attributes of the root node configured by the user;
[0018] The root node of the at least one structure tree is determined from the node set according to the attribute of the root node.
[0019] Optionally, the first structure diagram file includes a plurality of structure trees, and determining a root node of at least one of the structure trees includes:
[0020] Receiving a node specified by a user, and determining the node as a root node of a first structure tree;
[0021] The node in the first subset of the node set that is closest to the root node of the first structure tree is determined as the root node of the second structure tree, and the first subset is the nodes in the node set excluding the nodes of the first structure tree.
[0022] Optionally, taking the root node as a starting point, searching the node set in combination with the guide line set to obtain the at least one structure tree includes:
[0023] Taking the root node of the first structure tree as a starting point, searching the node set in combination with the guide line set, and obtaining the first structure tree;
[0024] The root node of the second structure tree is combined with the guide line set to search for a first subset of the node set to obtain the second structure tree.
[0025] Optionally, searching the node set to obtain the at least one structure tree includes:
[0026] Search the node set to obtain a third structure tree and a fourth structure tree;
[0027] The step of obtaining a second structure diagram file according to the at least one structure tree comprises:
[0028] In response to a splicing operation triggered by a user, splicing the third structure tree and the fourth structure tree to obtain a fifth structure tree;
[0029] According to the fifth structure tree, a second structure diagram file is obtained.
[0030] In a second aspect, the present application provides a structure graph restoration device, the device comprising:
[0031] An acquisition module, used for acquiring a first structure diagram file, wherein the file format of the first structure diagram file is a first format, and the first format does not support editing;
[0032] an identification module, used for identifying the first structure diagram file, obtaining a node set and a guide line set, wherein the node set includes nodes of at least one structure tree in the first structure diagram file, and the guide line set includes guide lines of at least one structure tree in the first structure diagram file;
[0033] A root node determination module, used to determine the root node of the at least one structure tree;
[0034] A search module is used to take the root node as a starting point, search the node set in combination with the guide line set, and obtain the at least one structure tree;
[0035] The restoration module is used to obtain a second structure diagram file according to the at least one structure tree, wherein the file format of the second structure diagram file is a second format, and the second format supports editing.
[0036] Optionally, the root node determination module is specifically configured to receive a node specified by a user, and determine the node as the root node of the at least one structure tree.
[0037] Optionally, the root node determination module is specifically used to:
[0038] Presenting a selection control to the user;
[0039] Determine the node selected by the user through the selection control as the root node of the at least one structure tree; or,
[0040] Receive the attributes of the root node configured by the user;
[0041] The root node of the at least one structure tree is determined from the node set according to the attribute of the root node.
[0042] Optionally, the first structure diagram file includes multiple structure trees, and the root node determination module is specifically used to receive a node specified by a user and determine the node as the root node of the first structure tree; determine the node in the first subset of the node set that is closest to the root node of the first structure tree as the root node of the second structure tree, and the first subset is the nodes in the node set excluding the nodes of the first structure tree.
[0043] Optionally, the search module is specifically used to:
[0044] Taking the root node of the first structure tree as a starting point, searching the node set in combination with the guide line set, and obtaining the first structure tree;
[0045] The root node of the second structure tree is combined with the guide line set to search for a first subset of the node set to obtain the second structure tree.
[0046] Optionally, the search module is specifically used to search the node set to obtain a third structure tree and a fourth structure tree;
[0047] The restoration module is used to respond to a splicing operation triggered by a user, splice the third structure tree and the fourth structure tree to obtain a fifth structure tree; and obtain a second structure diagram file according to the fifth structure tree.
[0048] In a third aspect, the present application provides a device comprising a memory and a processor; the memory is used to store programs; the processor is used to execute the programs in the memory so that the device performs any method described in any one of the first aspects.
[0049] In a fourth aspect, the present application provides a computer-readable medium having instructions stored thereon, which, when executed by one or more processors, enables a device to perform any of the methods described in the first aspect above.
[0050] In a fifth aspect, the present application provides a computer program product, which includes computer instructions, which are stored in a computer-readable storage medium and are suitable for being read and executed by a processor, so that a computer device having the processor executes any of the methods described in the first aspect above.
[0051] It can be seen that this application has the following beneficial effects:
[0052] The present application provides a structure diagram restoration method, which first identifies a first structure diagram file of a first format that does not support editing, obtains a node set and a guide line set, the node set includes nodes of at least one structure tree in the first structure diagram file, and the guide line set includes guide lines of at least one structure tree in the first structure diagram file; then, determines the root node of at least one structure tree, takes the root node as the starting point, combines the guide lines, searches for the node set, and then obtains at least one structure tree, and then obtains a second structure diagram file of a second format that supports editing based on the obtained at least one structure tree. It can be seen that the method can automatically restore the first structure diagram file that does not support editing to the second structure diagram file that supports editing, thereby reducing a large number of manual operations for users, saving time and labor costs, and easily meeting business needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 A schematic diagram of an exemplary application scenario provided for an embodiment of the present application;
[0054] Figure 2 A flowchart of a structure diagram restoration method provided in an embodiment of the present application;
[0055] Figure 3 A schematic diagram of a first structure diagram file provided in an embodiment of the present application;
[0056] Figure 4A A schematic diagram of an interface for determining a root node provided in an embodiment of the present application;
[0057] Figure 4B A schematic diagram of an interface for selecting a root node provided in an embodiment of the present application;
[0058] Figure 4C A schematic diagram of an interface for determining a root node provided in an embodiment of the present application;
[0059] Figure 4D A schematic diagram of an interface for determining a root node provided in an embodiment of the present application;
[0060] Figure 5 A schematic diagram of obtaining a structure tree provided in an embodiment of the present application;
[0061] Figure 6 A schematic diagram of determining a root node of a structure tree provided in an embodiment of the present application;
[0062] Figure 7 A schematic diagram of restoring a structure tree into multiple structure trees provided in an embodiment of the present application;
[0063] Figure 8 A schematic diagram of an interface for splicing multiple structure trees provided in an embodiment of the present application;
[0064] Fig. 9 A schematic diagram of a structure diagram restoration device provided in an embodiment of the present application;
[0065] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0066] Fig.11 A schematic diagram of the structure of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0067] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0068] First, the technical terms involved in the embodiments of the present application are introduced.
[0069] The structure tree may include a mind map structure tree, a product structure tree, a data structure tree, etc. The structure tree can visualize abstract transactions. For example, through a mind map structure tree, a user can clearly express abstract thinking, and the audience can also more accurately understand the abstract thinking expressed by the user based on the mind map structure tree. For another example, through a product structure tree, a user can clearly express the composition of a product, etc. Based on this, the structure tree is widely used in office scenarios, such as making a work plan into a structure tree. The embodiments of the present application do not specifically limit the types and application scenarios of the structure tree.
[0070] Generally, the structure tree can be exported as a structure diagram file in picture format or PDF format for easy use, such as communicating and discussing with other users on the structure tree in the structure diagram file. However, when it is necessary to modify part of the structure tree in the structure diagram file, since the structure diagram file in picture format or PDF format is usually not editable, the user needs to re-make the entire structure tree in the structure diagram file. In this way, in the process of the user re-making the structure diagram file, a lot of time and manpower costs are needed, which is difficult to meet business needs.
[0071] In view of this, an embodiment of the present application provides a structure diagram restoration method, which can be performed by an electronic device. The electronic device can be a terminal or a server. The terminal includes but is not limited to smart wearable devices, smart phones, tablet computers, laptop personal computers, desktop personal computers and other devices, and the server can be a cloud server, such as a central server in a central cloud computing cluster, or an edge server in an edge cloud computing cluster. The server can also be a server in a local data center.
[0072] Specifically, the electronic device obtains a first structure diagram file, the file format of the first structure diagram file is a first format, and the first format does not support editing, then identifies the first structure diagram file, obtains a node set and a guide line set, the node set includes nodes of at least one structure tree in the first structure diagram file, and the guide line set includes guide lines of at least one structure tree in the first structure diagram file. Then the electronic device determines the root node of at least one structure tree, takes the root node as the starting point, searches the node set in combination with the guide line set, obtains at least one structure tree, and obtains a second structure diagram file based on the obtained at least one structure tree, the file format of the second structure diagram file is a second format, and the second format supports editing.
[0073] In the method, the electronic device can automatically restore the first structure diagram file that does not support editing to the second structure diagram file that supports editing. In this way, the user can modify the structure tree in the second structure diagram file based on the second structure diagram file without having to re-create the entire structure tree in the entire structure diagram file, thereby reducing a large number of manual operations for the user, saving time and labor costs, and easily meeting business needs.
[0074] In order to make the technical solution of the present application clearer and easier to understand, the application scenario of the structure diagram restoration method provided in the embodiment of the present application is introduced below. Figure 1 A schematic diagram of an exemplary application scenario provided for an embodiment of the present application.
[0075] In some examples, the electronic device 10 may provide a human-computer interaction interface 100 to the user, and the user may select a first structure diagram file based on the human-computer interaction interface 100. Specifically, the human-computer interaction interface includes a selection control 101 and a restore control 102. When the user needs to modify the structure tree in the first structure diagram file, the user may browse the directory of the first structure diagram file through the selection control 101, and trigger the selection operation of the first structure diagram file by clicking on the first structure diagram file, and the electronic device 10 obtains the first structure diagram file based on the selection operation. Then the user triggers the restore operation of the first structure diagram file through the restore control 102, and the electronic device 10 processes the first structure diagram file based on the restore operation.
[0076] In some embodiments, the electronic device 10 may send the first structure diagram file to the server 20 based on the restore operation triggered by the user, and the server 20 may restore the first structure diagram file to obtain the second structure diagram file, and then the server 20 may return the second structure diagram file to the electronic device 10. Of course, in other embodiments, the electronic device 10 may also restore the first structure diagram file alone, and restore the first structure diagram file to the second structure diagram file. When the electronic device 10 restores the first structure diagram file alone, it indicates that the electronic device 10 can run offline.
[0077] The second structure diagram file supports editing, and the user can preview the second structure diagram file through the electronic device 10, and modify the structure tree in the second structure diagram file based on the second structure diagram file. In this way, a large number of manual operations are reduced for the user, saving time and labor costs, and meeting business needs.
[0078] In order to make the technical solution of the present application clearer and easier to understand, the structural diagram restoration method provided by the embodiment of the present application is introduced from the perspective of the electronic device 10. Figure 2 As shown, this figure is a flow chart of a structure diagram restoration method provided by an embodiment of the present application. The method includes:
[0079] S201: The electronic device 10 obtains a first structure diagram file.
[0080] The file format of the first structure diagram file is a first format, and the first format does not support editing. For example, the first format may be a picture format, a PDF format, etc. The first structure diagram file may be a structure diagram file to be restored. For example, the first structure diagram file may be a structure diagram file that still needs to be further modified after being exported to a picture format or a PDF format.
[0081] In some embodiments, the electronic device 10 may receive a first structure diagram file sent by a user through a terminal (such as a mobile phone), and thus, the electronic device 10 may obtain the first structure diagram file. In other embodiments, the electronic device 10 has a storage function, and the first structure diagram file may be a file stored in the electronic device 10. Based on this, the electronic device 10 may obtain the first structure diagram file based on the user's selection operation on the first structure diagram file.
[0082] The embodiment of the present application does not specifically limit the manner in which the electronic device 10 obtains the first structure diagram file, and those skilled in the art may select a suitable manner to enable the electronic device 10 to obtain the first structure diagram file according to actual needs.
[0083] S202: The electronic device 10 identifies the first structure diagram file and obtains a node set and a guide line set.
[0084] The first structure diagram file includes at least one structure tree. Figure 3 A schematic diagram of a first structure diagram file provided in an embodiment of the present application. The first structure diagram file includes multiple structure trees, such as a first structure tree 310 and a second structure tree 320.
[0085] Taking the first structure tree 310 as an example, the first structure tree 310 includes a plurality of nodes, such as node A1, node A2, node A3, node A4 and node A5. Among them, node A1 is a root node, node A2 is a node of the next level of node A1, and node A3, node A4 and node A5 are nodes of the next level of node A2. The first idea map structure tree 310 also includes a plurality of guide lines, such as guide line B1, guide line B2, guide line B3 and guide line B4, guide line B1 is a guide line between node A1 and node A2, guide line B2 is a guide line between node A2 and node A3, guide line B3 is a guide line between node A2 and node A4, and guide line B4 is a guide line between node A2 and node A5.
[0086] The electronic device 10 can identify the first structure diagram file to obtain a node set and a guide line set of the first structure diagram file, wherein the node set includes nodes of at least one structure tree in the first structure diagram file, and the guide line set includes guide lines of at least one structure tree in the first structure diagram file.
[0087] In some embodiments, the electronic device 10 can identify the first structure graph file based on a pre-trained node recognition model to obtain a node set of the first structure graph file. The node recognition model can be trained by training samples, and the training samples include historical structure graph files marked with node positions.
[0088] Similarly, the electronic device 10 can also identify the first structure diagram file based on the pre-obtained guide line recognition model to obtain the guide line set of the first structure diagram file. The guide line recognition model obtains the guide line set by semantically segmenting the image of the structure tree in the first structure diagram file. For example, the pixels of the guide lines are used as the foreground of the semantic segmentation and are represented by "1" in the binary image, and the pixels other than the guide lines are used as the background of the semantic segmentation and are represented by "0" in the binary image. In this way, after semantically segmenting the image of the structure tree in the first structure diagram file, white guide lines and black background can be obtained, and the guide lines can be represented by multiple coordinate points. Among them, the node recognition model can be a model obtained based on deep learning training, and the guide line recognition model can also be a model obtained based on deep learning training.
[0089] S203: The electronic device 10 determines a root node of at least one structure tree, takes the root node as a starting point, combines a guide line set, searches a node set, and obtains at least one structure tree.
[0090] The electronic device 10 can determine at least one root node of a structure tree from the node set of the first structure diagram file. Figure 4A As shown, this figure is a schematic diagram of an interface for determining a root node provided by an embodiment of the present application. The interface includes a preview area 410 and a selection control 420. The electronic device 10 can preview the first structure diagram file in the preview area 410, and the selection control 420 is used by the user to determine the root node.
[0091] like Figure 4B As shown, this figure is a schematic diagram of an interface for selecting a root node provided in an embodiment of the present application. The electronic device 10 can receive an operation triggered by the user based on the selection control, and provide a selection box for the user, through which the user can select the root node of the structure tree in the first structure diagram file. In other embodiments, the electronic device 10 can also receive an operation triggered by the user through a shortcut key, and provide a selection box for the user. For example, when the electronic device 10 detects that the user presses the "Alt" key and the "Z" key on the keyboard at the same time, it provides a selection box for the user.
[0092] like Figure 4C As shown, the figure is a schematic diagram of an interface for determining a root node provided by an embodiment of the present application, and the interface includes a preview area 410. The electronic device 10 can preview the first structure diagram file in the preview area 410, and based on the recognition result (e.g., node set) of the first structure diagram file, preview the nodes of the structure tree in the first structure diagram file in the preview area 410. Then, the electronic device 10 can receive a user's selection operation on a node of the structure tree in the first structure diagram file in the preview area 410, and determine that the node selected by the user is the root node of the structure tree in the first structure diagram file.
[0093] like Figure 4D As shown, the figure is a schematic diagram of an interface for determining a root node provided by an embodiment of the present application, and the interface includes a preview area 410, a configuration area 430, and a submission control 440. The electronic device 10 can preview the first structure diagram file in the preview area 410, and present the properties of the nodes of the structure tree in the first structure diagram file in the preview area 410, such as the number of the node, the content of the node, the position of the node, etc. The configuration area 430 is used to receive the properties of the root node configured by the user. After completing the configuration of the properties of the root node, the user can submit the properties of the configured root node to the electronic device 10 through the submission control 440, and the electronic device 10 determines the root node of the structure tree in the first structure diagram file based on the properties of the root node configured by the user.
[0094] For ease of understanding, the above example of the first structure diagram file including the first structure tree and the second structure tree is continued for introduction. In some embodiments, the electronic device 10 may determine the node specified by the user as the root node of at least one structure tree. Figure 3 In the first structure diagram file shown, the user can specify the root node of the first structure tree 310 and the root node of the second structure tree 320 of the first structure diagram file respectively, or the user can only specify the root node of the first structure 310 of the first structure diagram file. The electronic device 10 can obtain the structure tree in two different implementations, which are described below.
[0095] In a first implementation manner, the user may specify the root nodes of all structure trees in the first structure diagram file.
[0096] The way in which the user specifies the root node of the structure tree in the first structure diagram file can be found in the above Figure 4A-4D After the user specifies the root nodes of all structure trees in the first structure diagram file, the electronic device 10 can determine the root node of each structure tree in the first structure diagram file. Then the electronic device 10 can search the node set based on the root node and the guide line set of each structure tree in the first structure diagram file to obtain each structure tree in the first structure diagram file.
[0097] Continuing from the above Figure 3 In the example shown, the user specifies the root nodes of all structure trees in the first structure diagram file. The user may specify the root node of the first structure tree and the root node of the second structure tree in the first structure diagram file.
[0098] In some examples, the electronic device 10 may start from the root node of the first structure tree specified by the user, combine the guide line set, search the node set, and obtain the first structure tree. Figure 5 As shown, this figure is a schematic diagram of obtaining a structure tree provided in an embodiment of the present application.
[0099] After the user specifies the root node A1 of the first structure tree, the electronic device 10 can take the root node A1 as the starting point, and determine at least one guide line connected to the root node A1 in the guide line set. For example, the electronic device 10 can determine the guide line B1 connected to the root node A1. Then the electronic device 10 can search the node set to determine the nodes connected to each guide line. For example, the electronic device 10 can determine the node A2 connected to the guide line B1 from the node set. Similarly, the electronic device 10 can again take the node A2 as the starting point, determine the guide line B2, the guide line B3 and the guide line B4 connected to the node A2, and then determine the node A3 connected to the guide line B2, the node A4 connected to the guide line B3, and the node A5 connected to the guide line B4, to obtain the first structure tree.
[0100] Similarly, the electronic device 10 may also take the root node of the second structure tree as a starting point, combine the guide line set, search the node set, and obtain the second structure tree.
[0101] Of course, the electronic device 10 can also search the node set in parallel based on the root node of the first structure tree, the root node of the second structure tree and the guide line set to obtain the first structure tree and the second structure tree. In this way, the electronic device 10 can obtain each structure tree with higher efficiency, save the time required to restore the first structure diagram file, and improve the restoration efficiency.
[0102] In a second implementation manner, the user may specify the root node of a portion of the structure tree in the first structure diagram file.
[0103] The way in which the user specifies the root node of the structure tree in the first structure diagram file can be found in the above Figure 4A-4D The introduction of the partial structure tree in the first structure diagram file will not be repeated here. After the user specifies the root node of the partial structure tree in the first structure diagram file, the electronic device 10 can determine the root node of the partial structure tree in the first structure diagram file. Then, based on the root node of the partial structure tree, the electronic device 10 can determine the node in the subset of the node set that is closest to the root node of the partial structure tree as the root node of the remaining partial structure tree. The partial structure tree can be a first structure tree, that is, a structure tree with a root node specified by the user; the remaining structure tree can be a second structure tree, that is, a structure tree with no root node specified by the user.
[0104] Continuing from the above Figure 3 In the example shown, the user specifies the root node of the partial structure tree in the first structure diagram file, which may be the root node of the first structure tree specified by the user. Then, after the electronic device 10 determines the root node of the first structure tree, the node closest to the root node of the first structure tree may be determined in the first subset of the node set as the root node of the second structure tree. The first subset is the nodes in the node set except the nodes of the first structure tree.
[0105] like Figure 6 As shown in FIG. 1 , the figure is a schematic diagram of determining the root node of a structure tree provided by an embodiment of the present application. The node set of the first structure diagram file includes nodes A1-A8 and C1-C5, wherein the first subset of the node set is nodes C1-C5, and the root node of the first structure tree specified by the user is node A1. Figure 6 It can be seen that the node C1 is closest to the root node A1 of the first structure tree, and thus the electronic device 10 can use the node C1 as the root node of the second structure tree.
[0106] In some examples, after the electronic device 10 determines the root node A1 of the first structure tree and the root node C1 of the second structure tree, it can refer to the example introduced in the first implementation manner to obtain the first structure tree and the second structure tree.
[0107] In other examples, after determining the root node A1 of the first structure tree, the electronic device 10 may first use the root node of the first structure tree as a starting point, combine the guide line set, search the node set, and obtain the first structure tree. Then, the electronic device 10 uses the root node of the second structure tree as a starting point, combines the guide line set, searches the first subset of the node set, and obtains the second structure tree. In this example, the user only needs to specify the root node of part of the structure tree, which further reduces the user's manual operations and reduces labor costs.
[0108] It should be noted that the above method in which the electronic device 10 determines the root node of at least one structure tree is merely an example. In other embodiments, the electronic device 10 may also determine the root node of the structure tree based on the position of the nodes of the structure tree in the first structure diagram file after identifying the first structure diagram file; the electronic device 10 may also perform semantic understanding on the contents of the nodes of the structure tree in the first structure diagram file, and then determine the root node of the structure tree.
[0109] S204: The electronic device 10 obtains a second structure diagram file according to at least one structure tree.
[0110] In some embodiments, after the electronic device 10 obtains at least one structure tree, it can obtain a second structure diagram file according to the at least one structure tree, and the file format of the second structure diagram file is a second format, and the second format supports editing. In this way, the user can modify the structure tree in the second structure diagram file based on the second structure diagram file, without having to re-produce all the structure trees in the entire structure diagram file, thereby reducing a large number of manual operations for the user, saving time and labor costs, and easily meeting business needs.
[0111] In some embodiments, due to recognition errors of the electronic device 10 or poor quality of the first structure diagram file (for example, the image is not clear, resulting in disconnected guide lines between nodes), a structure diagram may be restored to multiple structure diagrams. Figure 7 As shown, this figure is a schematic diagram of restoring a structure tree into multiple structure trees provided by an embodiment of the present application.
[0112] from Figure 7It can be seen that the guide line B1 of the first structure tree 310 is disconnected, so the electronic device 10 obtains the third structure tree 710 and the fourth structure tree 720 after searching the node set. In order to splice the third structure tree 710 and the fourth structure tree 720 into the fifth structure tree 730, the electronic device 10 can remind the user whether the third structure tree 710 and the fourth structure tree 720 need to be spliced after obtaining the third structure tree 710 and the fourth structure tree 720.
[0113] like Figure 8 As shown, this figure is a schematic diagram of an interface for splicing multiple structure trees provided by an embodiment of the present application. The electronic device 10 can receive a splicing operation triggered by a user. For example, the user can connect the node A2 of the third structure tree 710 and the node A1 of the fourth structure tree through a guide line to trigger a splicing operation on the third structure tree 710 and the fourth structure tree 720. Then the electronic device 10 can splice the third structure tree 710 and the fourth structure tree 720 according to the splicing operation to obtain a fifth structure tree 730. Among them, the structure of the fifth structure tree 730 is the same as that of the first structure tree 310.
[0114] It can be seen that in this embodiment, even if there is a recognition error of the electronic device 10 or the quality of the first structure diagram file is poor, the electronic device 10 can also splice multiple structure trees based on the splicing operation triggered by the user to obtain a structure tree consistent with the structure of the original structure tree. Compared with remaking the original structure tree, the splicing operation is easier for the user to trigger. For the user, it is only necessary to connect the nodes using guide lines, which reduces the user's manual operation.
[0115] It should be noted that, in the above embodiment, only the first structure diagram file includes two structure trees as an example. In other embodiments, the first structure diagram file may also include only one structure tree, or may include more structure trees, such as three or five structure trees. When the first structure diagram file includes one or more tree structures, please refer to the introduction of the above embodiment, which will not be described in detail here.
[0116] Fig. 9 A schematic diagram of a structure graph restoration device provided in an embodiment of the present application, the structure graph restoration device 900 includes:
[0117] An acquisition module 901 is used to acquire a first structure diagram file, where the file format of the first structure diagram file is a first format, and the first format does not support editing;
[0118] An identification module 902 is used to identify the first structure diagram file, obtain a node set and a guide line set, wherein the node set includes nodes of at least one structure tree in the first structure diagram file, and the guide line set includes guide lines of at least one structure tree in the first structure diagram file;
[0119] A root node determination module 903, configured to determine a root node of the at least one structure tree;
[0120] A search module 904 is configured to use the root node as a starting point and combine the guide line set to search the node set to obtain the at least one structure tree;
[0121] The restoration module 905 is used to obtain a second structure diagram file according to the at least one structure tree, where the file format of the second structure diagram file is a second format, and the second format supports editing.
[0122] Optionally, the root node determination module 903 is specifically configured to receive a node specified by a user, and determine the node as the root node of the at least one structure tree.
[0123] Optionally, the root node determination module 903 is specifically configured to:
[0124] Presenting a selection control to the user;
[0125] Determine the node selected by the user through the selection control as the root node of the at least one structure tree; or,
[0126] Receive the attributes of the root node configured by the user;
[0127] The root node of the at least one structure tree is determined from the node set according to the attribute of the root node.
[0128] Optionally, the first structure diagram file includes multiple structure trees, and the root node determination module 903 is specifically used to receive a node specified by a user and determine the node as the root node of the first structure tree; determine the node in the first subset of the node set that is closest to the root node of the first structure tree as the root node of the second structure tree, and the first subset is the nodes in the node set excluding the nodes of the first structure tree.
[0129] Optionally, the search module 904 is specifically configured to:
[0130] Taking the root node of the first structure tree as a starting point, searching the node set in combination with the guide line set, and obtaining the first structure tree;
[0131] The root node of the second structure tree is combined with the guide line set to search for a first subset of the node set to obtain the second structure tree.
[0132] Optionally, the search module 904 is specifically used to search the node set to obtain a third structure tree and a fourth structure tree;
[0133] The restoration module 905 is used for responding to a splicing operation triggered by a user, splicing the third structure tree and the fourth structure tree to obtain a fifth structure tree; and obtaining a second structure diagram file according to the fifth structure tree.
[0134] Fig.10 The schematic diagram of the structure of an electronic device 10 is shown. For example, the electronic device 10 may be a mobile phone, a computer, a digital broadcast terminal, a message transceiver device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0135] Reference Fig.10 The electronic device 10 may include one or more of the following components: a processing component 1002 , a memory 1004 , a power component 1006 , a multimedia component 1008 , an audio component 1010 , an input / output (I / O) interface 4012 , a sensor component 1014 , and a communication component 1016 .
[0136] The processing component 1002 generally controls the overall operation of the electronic device 10, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 1002 may include one or more processors 1020 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 1002 may include one or more modules to facilitate the interaction between the processing component 1002 and other components. For example, the processing component 1002 may include a multimedia module to facilitate the interaction between the multimedia component 1008 and the processing component 1002.
[0137] The memory 1004 is configured to store various types of data to support operations on the electronic device 10. Examples of such data include instructions for any application or method operating on the electronic device 10, contact data, phone book data, messages, pictures, videos, etc. The memory 1004 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0138] The power supply assembly 1006 provides power to the various components of the electronic device 10. The power supply assembly 1006 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 10.
[0139] The multimedia component 1008 includes a screen that provides an output interface between the electronic device 10 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1008 includes a front camera and / or a rear camera. When the electronic device 10 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0140] The audio component 1010 is configured to output and / or input audio signals. For example, the audio component 1010 includes a microphone (MIC), and when the electronic device 10 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 1004 or sent via the communication component 1016. In some embodiments, the audio component 1010 also includes a speaker for outputting audio signals.
[0141] The I / O interface provides an interface between the processing component 1002 and the peripheral interface module, which may be a keyboard, a click wheel, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0142] The sensor assembly 1014 includes one or more sensors for providing various aspects of status assessment for the electronic device 10. For example, the sensor assembly 1014 can detect the open / closed state of the electronic device 10, the relative positioning of components, such as the display and keypad of the electronic device 10, and the sensor assembly 1014 can also detect the position change of the electronic device 10 or a component of the electronic device 10, the presence or absence of user contact with the electronic device 10, the orientation or acceleration / deceleration of the electronic device 10, and the temperature change of the electronic device 10. The sensor assembly 1014 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 1014 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1014 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0143] The communication component 1016 is configured to facilitate wired or wireless communication between the electronic device 10 and other devices. The electronic device 10 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 1016 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1016 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0144] In an exemplary embodiment, the electronic device 10 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal electronics (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the following methods:
[0145] Acquire a first structure diagram file, where the file format of the first structure diagram file is a first format, and the first format does not support editing;
[0146] Identify the first structure diagram file, obtain a node set and a guide line set, the node set includes nodes of at least one structure tree in the first structure diagram file, and the guide line set includes guide lines of at least one structure tree in the first structure diagram file;
[0147] Determine a root node of the at least one structure tree, take the root node as a starting point, search the node set in combination with the guide line set, and obtain the at least one structure tree;
[0148] A second structure diagram file is obtained according to the at least one structure tree, wherein the file format of the second structure diagram file is a second format, and the second format supports editing.
[0149] Optionally, determining the root node of the at least one structure tree includes:
[0150] A node specified by a user is received, and the node is determined as a root node of the at least one structure tree.
[0151] Optionally, determining the root node of the at least one structure tree includes:
[0152] Presenting a selection control to the user;
[0153] Determine the node selected by the user through the selection control as the root node of the at least one structure tree; or,
[0154] Receive the attributes of the root node configured by the user;
[0155] The root node of the at least one structure tree is determined from the node set according to the attribute of the root node.
[0156] Optionally, the first structure diagram file includes a plurality of structure trees, and determining a root node of at least one of the structure trees includes:
[0157] Receiving a node specified by a user, and determining the node as a root node of a first structure tree;
[0158] The node in the first subset of the node set that is closest to the root node of the first structure tree is determined as the root node of the second structure tree, and the first subset is the nodes in the node set excluding the nodes of the first structure tree.
[0159] Optionally, taking the root node as a starting point, searching the node set in combination with the guide line set to obtain the at least one structure tree includes:
[0160] Taking the root node of the first structure tree as a starting point, searching the node set in combination with the guide line set, and obtaining the first structure tree;
[0161] The root node of the second structure tree is combined with the guide line set to search for a first subset of the node set to obtain the second structure tree.
[0162] Optionally, searching the node set to obtain the at least one structure tree includes:
[0163] Search the node set to obtain a third structure tree and a fourth structure tree;
[0164] The step of obtaining a second structure diagram file according to the at least one structure tree comprises:
[0165] In response to a splicing operation triggered by a user, splicing the third structure tree and the fourth structure tree to obtain a fifth structure tree;
[0166] According to the fifth structure tree, a second structure diagram file is obtained.
[0167] Fig.11 A schematic diagram of the structure of a server 20 provided for an embodiment of the present application. The server 20 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1122 (for example, one or more processors) and memory 1132, and one or more storage media 1130 (for example, one or more mass storage devices) storing application programs 1142 or data 1144. Among them, the memory 1132 and the storage medium 1130 may be short-term storage or permanent storage. The program stored in the storage medium 1130 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 1122 may be configured to communicate with the storage medium 1130 to execute a series of instruction operations in the storage medium 1130 on the server 20.
[0168] The server 20 may also include one or more power supplies 1126, one or more wired or wireless network interfaces 1150, one or more input and output interfaces 1158, one or more keyboards 1156, and / or one or more operating systems 1141, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0169] In addition, an embodiment of the present application also provides a computer-readable medium having instructions stored thereon, which, when executed by one or more processors, enables the device to execute the above-mentioned method for implementing the structure diagram restoration method.
[0170] An embodiment of the present application also provides a computer program product, which includes computer instructions, which are stored in a computer-readable storage medium and are suitable for being read and executed by a processor, so that a computer device having the processor executes the above-mentioned method for implementing the structure diagram restoration method.
[0171] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the system or device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0172] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0173] It should also be noted that, in this article, relational terms such as first and second, etc. 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 presence of other identical elements in the process, method, article or device including the elements.
[0174] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0175] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. 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 application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for restoring a structure graph, characterized in that: The method comprises: Acquire a first structure diagram file, where the file format of the first structure diagram file is a first format, and the first format does not support editing; Identify the first structure diagram file, obtain a node set and a guide line set, the node set includes nodes of at least one structure tree in the first structure diagram file, and the guide line set includes guide lines of at least one structure tree in the first structure diagram file; Determining the root node of the at least one structure tree comprises: receiving a node specified by a user, and determining the node as the root node of a first structure tree; determining a node in a first subset of the node set that is closest to the root node of the first structure tree as the root node of a second structure tree, wherein the first subset is nodes in the node set other than the nodes of the first structure tree; Taking the root node of the at least one structure tree as a starting point, searching the node set in combination with the guide line set, and obtaining the at least one structure tree; A second structure diagram file is obtained according to the at least one structure tree, wherein the file format of the second structure diagram file is a second format, and the second format supports editing.
2. The method according to claim 1, characterized in that The receiving a node specified by a user and determining the node as a root node of the first structure tree includes: Presenting a selection control to the user; Determine the node selected by the user through the selection control as the root node of the first structure tree; or, Receive the attributes of the root node configured by the user; The root node of the first structure tree is determined from the node set according to the attribute of the root node.
3. The method according to claim 1, characterized in that: The step of taking the root node of the at least one structure tree as a starting point, searching the node set in combination with the guide line set, and obtaining the at least one structure tree comprises: Taking the root node of the first structure tree as a starting point, searching the node set in combination with the guide line set, and obtaining the first structure tree; The root node of the second structure tree is combined with the guide line set to search for a first subset of the node set to obtain the second structure tree.
4. The method according to any one of claims 1 to 2, characterized in that: The step of searching the node set to obtain the at least one structure tree comprises: Search the node set to obtain a third structure tree and a fourth structure tree; The step of obtaining a second structure diagram file according to the at least one structure tree comprises: In response to a splicing operation triggered by a user, splicing the third structure tree and the fourth structure tree to obtain a fifth structure tree; According to the fifth structure tree, a second structure diagram file is obtained.
5. A structure diagram restoration device, characterized in that: The device comprises: An acquisition module, used for acquiring a first structure diagram file, wherein the file format of the first structure diagram file is a first format, and the first format does not support editing; an identification module, used for identifying the first structure diagram file, obtaining a node set and a guide line set, wherein the node set includes nodes of at least one structure tree in the first structure diagram file, and the guide line set includes guide lines of at least one structure tree in the first structure diagram file; A root node determination module, used to determine the root node of the at least one structure tree, comprising: receiving a node specified by a user, and determining the node as the root node of a first structure tree; determining a node in a first subset of the node set that is closest to the root node of the first structure tree as the root node of a second structure tree, wherein the first subset is nodes in the node set other than the nodes of the first structure tree; A search module is used to take the root node of the at least one structure tree as a starting point, search the node set in combination with the guide line set, and obtain the at least one structure tree; The restoration module is used to obtain a second structure diagram file according to the at least one structure tree, wherein the file format of the second structure diagram file is a second format, and the second format supports editing.
6. The device according to claim 5, characterized in that The root node determination module is specifically used for: Presenting a selection control to the user; Determine the node selected by the user through the selection control as the root node of the first structure tree; or, Receive the attributes of the root node configured by the user; The root node of the first structure tree is determined from the node set according to the attribute of the root node.
7. The device according to claim 5, characterized in that The search module is specifically used for: Taking the root node of the first structure tree as a starting point, searching the node set in combination with the guide line set, and obtaining the first structure tree; The root node of the second structure tree is combined with the guide line set to search for a first subset of the node set to obtain the second structure tree.
8. The device according to any one of claims 5 to 6, characterized in that The search module is specifically used to search the node set to obtain the third structure tree and the fourth structure tree; The restoration module is used to respond to a splicing operation triggered by a user, splice the third structure tree and the fourth structure tree to obtain a fifth structure tree; and obtain a second structure diagram file according to the fifth structure tree.
9. An electronic device, characterized in that: including memory and processor; The memory is used to store programs; The processor is configured to execute the program in the memory so as to enable the electronic device to perform the method according to any one of claims 1 to 4.
10. A computer-readable medium, characterized in that Instructions are stored thereon, which, when executed by one or more processors, cause the apparatus to perform the method as claimed in any one of claims 1 to 4.
11. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium and are suitable for being read and executed by a processor, so that a computer device having the processor executes the method according to any one of claims 1 to 4.
