A schematic diagram generation method, device, electronic device and storage medium
By classifying and processing the target data in the schematic file and determining the position direction, schematic diagrams are generated, and the problem of schematic viewing in the existing technology requires expensive licenses, and intelligent schematic viewing with rich functions and low cost is achieved.
Patent Information
- Application Number
- CN202011025762.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-25
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2040-09-25
AI Technical Summary
The prior art requires expensive software licenses during the generation and viewing of schematic diagrams, and lacks network/device list and reverse check functions when viewing schematic diagrams through PDF, and has a single function.
By obtaining the target data in the schematic file, classifying the target data list to generate a target data list, determining the position and direction of the data in the schematic canvas, generating corresponding schematic diagrams, and realizing intelligent viewing without permission.
It realizes schematic viewing without occupancy of software licenses, reduces costs, and provides network/device list and reverse check functions, enhancing the functionality and efficiency of viewing.
Smart Images

Figure CN114253601B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the technical field of software development, and in particular, to a schematic diagram generation method, apparatus, electronic device, and storage medium. Background Art
[0002] There are many design software for schematic diagrams. To solve the interoperability between different schematic diagram platforms, there are some schematic diagram files in common formats, such as Electronic Design Interchange Format (EDIF), etc. Through the import and export of these files, interoperability between different platforms can be achieved.
[0003] The design and inspection of schematic diagrams are two different requirements. Usually, after the schematic diagram is generated, when it is necessary to view the schematic diagram, the schematic diagram file can be imported into the design software for viewing, or the schematic diagram can be saved in PDF format and viewed using PDF tools. However, when viewing the schematic diagram through the design software, it is necessary to occupy more licenses, resulting in waste of resources and high costs; when viewing the schematic diagram through PDF, there are no functions such as network / device list and reverse lookup, and the functions are very single. Summary of the Invention
[0004] The present invention provides a schematic diagram generation method, apparatus, electronic device, and storage medium to realize intelligent viewing of schematic diagrams without occupying the license of software.
[0005] In a first aspect, an embodiment of the present invention provides a schematic diagram generation method, including:
[0006] Obtaining target data in a schematic diagram file;
[0007] Performing classification processing on the target data to generate a target data list;
[0008] Determining the position and direction of the data in the target data list on a schematic diagram canvas, and generating a schematic diagram corresponding to the schematic diagram file according to the position and direction.
[0009] In a second aspect, an embodiment of the present invention further provides a schematic diagram generation apparatus, where the apparatus includes:
[0010] A data acquisition module, configured to acquire target data in a schematic diagram file;
[0011] A classification processing module, configured to perform classification processing on the target data to generate a target data list;
[0012] A schematic diagram generation module, configured to determine the positions and directions of the data in the target data list on the schematic diagram canvas, and generate schematic diagram graphics corresponding to the schematic diagram file according to the positions and directions.
[0013] In a third aspect, an embodiment of the present invention further provides an electronic device, which includes:
[0014] One or more processors;
[0015] A storage device for storing one or more programs,
[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement a schematic diagram generation method as described in any one of the embodiments of the present invention.
[0017] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements a schematic diagram generation method as described in any one of the embodiments of the present invention.
[0018] The present invention obtains target data in a schematic diagram file, classifies and processes the target data to generate a target data list, then determines the positions and directions of the data in the target data list on the schematic diagram canvas, and generates schematic diagram graphics corresponding to the schematic diagram file according to the positions and directions. The present invention provides an implementation manner for generating schematic diagram graphics. Based on the above implementation manner, only by inputting the schematic diagram file into the corresponding viewing software can the entire schematic diagram be viewed, without occupying the license of the software, reducing the cost of viewing the schematic diagram. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 It is a flowchart of a schematic diagram generation method provided by an embodiment of the present invention;
[0020] Figure 2 It is a classification diagram of a target data provided by an embodiment of the present invention;
[0021] Figure 3 It is a flowchart of a method for traversing and extracting target data provided by an embodiment of the present invention;
[0022] Figure 4 It is a flowchart of a schematic diagram generation method provided by an embodiment of the present invention;
[0023] Figure 5 It is a flowchart of a method for interactively viewing a target data list through a schematic diagram provided by an embodiment of the present invention;
[0024] Figure 6A flowchart for interactively viewing a schematic diagram through a target data list provided by an embodiment of the present invention;
[0025] Figure 7 A structural schematic diagram of a schematic diagram generation device provided by an embodiment of the present invention;
[0026] Figure 8 A structural schematic diagram of an electronic device provided by an embodiment of the present invention. Detailed implementation manners
[0027] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present invention, rather than limiting the present invention. In addition, it should be noted that, for the sake of convenience of description, only parts related to the present invention rather than all structures are shown in the drawings.
[0028] Figure 1 A flowchart of a schematic diagram generation method provided by Embodiment 1 of the present invention. This embodiment is applicable to the situation of generating a schematic diagram according to a schematic diagram file. This method can be executed by a schematic diagram file generation device, and the device can be implemented in a software and / or hardware manner. Refer to Figure 1 and the method specifically includes the following steps:
[0029] S110. Obtain target data in the schematic diagram file.
[0030] Exemplarily, the schematic diagram file in the embodiment of the present invention can be an EDIF schematic diagram file. The target data is the valid data in the schematic diagram file, such as data information related to the schematic diagram, such as devices, connection relationships between devices, pages corresponding to the schematic diagram, and text identification information.
[0031] Since the amount of data in the EDIF schematic diagram file is very large, generally there are hundreds of thousands to millions of lines, but the valid data is not much and is relatively scattered. Therefore, it is necessary to first extract the valid target data in the schematic diagram file.
[0032] S120. Classify the target data to generate a target data list.
[0033] In this embodiment, after obtaining the target data of the schematic diagram file, it is necessary to classify the obtained target data according to certain classification rules, and then generate a target data list according to the classification result. Optionally, the target data can be classified according to the classification methods of devices, device connection relationships, schematic diagram pages, and other data.
[0034] Specifically, continuing with the schematic file being an EDIF file as an example, according to the characteristics of the EDIF valid data, the target data is classified to generate a target data list, including: classifying the target data into three categories: symbol, page, and view attribute; traversing and extracting the classified target data according to a preset rule to generate the target data list corresponding to the target data. In this embodiment, after classifying the target data, it is necessary to further traverse and extract the classified data according to a certain rule to generate a target data list.
[0035] See further Figure 2 , Figure 2 which is a classification diagram of a kind of target data provided by an embodiment of the present invention. The target data can be divided into three major categories: symbol, page, and viewmap. Each major category corresponds to the classification data included below. After classifying the target data, the target data is traversed and extracted according to a certain rule. In this embodiment, the classified target data needs to be traversed twice. The specific traversing and extracting process can be seen in Figure 3 :
[0036] The first step: When traversing for the first time, first traverse the viewmap. The viewmap data is at the bottom, but needs to be extracted first. The data included in the viewmap is the instance attribute of the device. The two-dimensional array A of the data traversed and extracted, where the first dimension stores the device label, and the second dimension stores the instance attribute and value; among them, the device label is the unique identifier of the device in the schematic diagram. The second dimension of the array A can include all the attribute information corresponding to the device label, such as device code, manufacturer, and package name, etc. In addition, the device number corresponding to the schematic diagram is stored in the array A. This part of the attribute value is missing in the symbol and can form a complement with the data in the symbol.
[0037] The second step: Conduct the second traversal to extract the data included in the symbol: device model, device bounding box, line composed of devices, text included in the device, and connect_pin. All of the above data includes the data name and coordinates. The data traversed and extracted is put into the two-dimensional array B. The first dimension is the device, and the second dimension includes other information related to the device such as the device model and the line composed of the device, so as to obtain the two-dimensional data related to the device.
[0038] Step 3: Extract the data contained under the page, including instances, nets, and others, such as marked text and line segments. Each page corresponds to the above information. Among them, the net represents the connection relationship information of the devices.
[0039] Step 4: An instance is the device attribute under the page, which is complementary to the data in the symbol. If a device has an instance attribute, the value of value in the data is "?". For example, if the instance attribute of the device obtained at this time is R?, the value of the corresponding attribute of the corresponding device in the viewmap needs to be captured and replaced. Exemplarily, if the instance attribute of the corresponding device is R1 at this time, the value "1" corresponding to this instance attribute is captured and replaced with the above value "?". Additionally, transform represents the zero coordinate, indicating the position of the device in the schematic drawing page. All the data traversed and extracted from the page is placed in a two-dimensional array C, where the first dimension is the page, and the second dimension is other information related to the page.
[0040] Step 5: The net data includes net labels and net segments. Traverse and extract them respectively, and store the traversed and extracted data into two-dimensional arrays D and E respectively. The first dimension of both is the page. The second dimension of data D is the net label, and the second dimension of array E is the net segment. Among them, the net label is the connection method of the device. For example, the net label can be GND, VCC, etc.; the net segment is used to uniquely identify the net label.
[0041] Step 6: Other represents the text and line segments marked on the web page. Similar to Step 4, it is stored in array C.
[0042] After the above data traversal process, multiple two-dimensional arrays corresponding to the target data can be obtained. The target data list is formed by the above multiple two-dimensional arrays. Therefore, the above target data list includes two-dimensional data related to the device, two-dimensional data with the same device connection relationship, and other two-dimensional data information, etc.
[0043] S130. Determine the position and orientation of the data in the target data list on the schematic drawing canvas, and generate the schematic diagram corresponding to the schematic file according to the position and orientation.
[0044] In this embodiment, after classifying and extracting the target data, it is necessary to present the extracted data on the canvas.
[0045] Specifically, the data in the target data list all have corresponding coordinate information. First, it is necessary to convert the coordinates of the data in the target data list into canvas coordinates according to the coordinate conversion relationship between the coordinates in the schematic diagram file and the canvas coordinates, so as to determine the position information of the data in the target data list on the schematic diagram canvas.
[0046] Further, after the position information is determined, it is also necessary to further determine the direction information corresponding to the above data to generate the schematic diagram graphics corresponding to the schematic diagram file. Exemplarily, the EDIF schematic diagram data determines the direction of the schematic diagram through the rotation angle and the starting point. After obtaining the rotation angle and the starting point corresponding to the data, rotate the starting point according to the rotation angle to determine the position of each starting point after rotation on the canvas, and finally generate the schematic diagram graphics corresponding to the schematic diagram file for the user to view.
[0047] The technical solution provided by the embodiment of the present invention obtains the target data in the schematic diagram file, classifies and processes the target data to generate a target data list, then determines the position and direction of the data in the target data list on the schematic diagram canvas, and generates the schematic diagram graphics corresponding to the schematic diagram file according to the position and direction. The present invention provides an implementation method for generating schematic diagram graphics. Based on the above implementation method, only by inputting the schematic diagram file into the corresponding viewing software can the entire schematic diagram be viewed, without occupying the license of the software, reducing the cost of viewing the schematic diagram.
[0048] Figure 4 It is a flowchart of a schematic diagram generation method provided by an embodiment of the present invention. The embodiment of the present invention further refines S130 on the basis of the above embodiment. See Figure 4 This method includes:
[0049] S410. Obtain the target data in the schematic diagram file.
[0050] S420. Classify and process the target data to generate a target data list.
[0051] S430. Determine the conversion relationship between the coordinates of the data in the target data list and the schematic diagram canvas coordinates according to the attribute information of the schematic diagram canvas.
[0052] In this embodiment, the canvas attributes of the schematic diagram may include the setting method of coordinates, the setting method of canvas grid points, etc. Different canvas attributes correspond to different coordinate conversion relationships.
[0053] S440. Determine the coordinate position of the data in the target data list on the schematic diagram canvas according to the conversion relationship.
[0054] In this embodiment, after the coordinate conversion relationship between the data in the target data list and the schematic drawing canvas is determined, the data in the target data list is subjected to coordinate conversion to obtain the positions of the data in the target data list on the schematic drawing canvas.
[0055] Exemplarily, if the coordinate origin of the schematic drawing canvas in this embodiment is set in the upper left corner, the canvas grid point size is 254000, the coordinates corresponding to a data pt in the target data list are x1 = 254000 and y1 = 127000, and the canvas size of the schematic diagram is x0 * y0, the coordinates corresponding to the data pt on the schematic drawing canvas can be obtained as: x = x1 / 254000, y = y0 - y1 / 254000.
[0056] Furthermore, the coordinate representation methods for different types of data are different. For example, the coordinates of the data in a symbol and the coordinates of the data in a page are different. The coordinates of the data in a page are absolute coordinates, but the coordinates of the data in a symbol do not consider the origin and are only relative coordinates. The zero point is the transform attribute extracted from the page. For example, the coordinates of a certain data in a symbol are: x1 = 254000, y1 = 127000, the transform corresponding to the symbol in the corresponding page is x2 = 35814000, y2 = 9906000, and the canvas size is x0 * y0. The coordinates corresponding to this data on the schematic drawing canvas can be obtained as:
[0057] x = (x1 + x2) / 254000, y = y0 - (y1 + y2) / 254000.
[0058] S450. According to the coordinate position, as well as the starting point and the preset rotation angle corresponding to the data in the target data list, determine the direction of the data in the target data list on the schematic drawing canvas, and generate the schematic diagram graphics corresponding to the schematic diagram file.
[0059] In this embodiment, after determining the coordinates corresponding to each data in the target data list through the above coordinate conversion, it is also necessary to determine the direction information corresponding to each data in the target data list, and then finally determine the graphics corresponding to each data in the target data through the coordinates and the direction, so as to generate the schematic diagram graphics corresponding to the schematic diagram file.
[0060] Exemplarily, there are two definitions of direction for EDIF schematic diagram data, one is rotation and the other is the starting point. Both parts of data are included in the target data list corresponding to the EDIF schematic diagram file and can be directly obtained from the above target data list.
[0061] Specifically, the preset rotation angles can be: 0°, 90°, 180°, and 270°, which can be represented as R0, R90, R180, R270. Among them, R0 and R180 are in the left-to-right direction, and R90 and R270 are in the bottom-to-top direction; the starting points can be: upper left, middle left, lower left, upper center, middle center, lower center, upper right, middle right, lower right.
[0062] Taking a certain text as an example, assuming the coordinates are (x0, y0), the text length is textlength, and the text height is textHeight.
[0063] When the preset rotation direction is R0, the corresponding coordinates after rotation for each starting point are respectively:
[0064] R0 / upper left: x = x0, y = y0 - textHeight;
[0065] R0 / middle left: x = x0, y = y0 - textHeight / 2;
[0066] R0 / lower left: x = x0, y = y0;
[0067] R0 / upper center: x = x0 - textlength / 2, y = y0 - textHeight;
[0068] R0 / middle center: x = x0 - textlength / 2, y = y0 - textHeight / 2;
[0069] R0 / lower center: x = x0 - textlength / 2, y = y0;
[0070] R0 / upper right: x = x0 - textlength, y = y0 - textHeight;
[0071] R0 / middle right: x = x0 - textlength, y = y0 - textHeight / 2;
[0072] R0 / lower right: x = x0 - textlength, y = y0;
[0073] When the preset rotation direction is R90, the coordinates corresponding to each starting point after rotation are as follows:
[0074] R90 / upper left: x = x0 + textHeight, y = y0;
[0075] R90 / middle left: x = x0 + textHeight / 2, y = y0;
[0076] R90 / lower left: x = x0, y = y0;
[0077] R90 / upper center: x = x0 + textHeight, y = y0 - textlength / 2;
[0078] R90 / middle center: x = x0 + textHeight / 2, y = y0 - textlength / 2;
[0079] R90 / lower center: x = x0, y = y0 - textlength / 2;
[0080] R90 / upper right: x = x0 + textHeight, y = y0 - textlength;
[0081] R90 / middle right: x = x0 + textHeight / 2, y = y0 - textlength;
[0082] R90 / lower right: x = x0, y = y0 - textlength;
[0083] When the preset rotation direction is R180, the coordinates corresponding to each starting point after rotation are as follows:
[0084] R180 / upper left: x = x0 - textlength, y = y0;
[0085] R180 / middle left: x = x0 - textlength, y = y0 - textHeight / 2;
[0086] R180 / lower left: x = x0 - textlength, y = y0 - textHeight;
[0087] R180 / upper center: x = x0 - textlength / 2, y = y0;
[0088] R180 / middle center: x = x0 - textlength / 2, y = y0 - textHeight / 2;
[0089] R180 / lower center: x = x0 - textlength / 2, y = y0 - textHeight;
[0090] R180 / upper right: x = x0, y = y0;
[0091] R180 / middle right: x = x0, y = y0 - textHeight / 2;
[0092] R180 / lower right: x = x0, y = y0 - textHeight;
[0093] When the preset rotation direction is R270, the coordinates corresponding to each starting point after rotation are:
[0094] R270 / upper left: x = x0 - textHeight, y = y0 - textlength;
[0095] R270 / middle left: x = x0 - textHeight / 2, y = y0 - textlength;
[0096] R270 / lower left: x = x0, y = y0 - textlength;
[0097] R270 / upper center: x = x0 - textHeight, y = y0 - textlength / 2;
[0098] R270 / middle center: x = x0 - textHeight / 2, y = y0 - textlength / 2;
[0099] R270 / lower center: x = x0, y = y0 - textlength / 2;
[0100] R270 / upper right: x = x0 - textHeight, y = y0;
[0101] R270 / middle right: x = x0 - textHeight / 2, y = y0;
[0102] R270 / lower right: x = x0, y = y0.
[0103] A technical solution provided by an embodiment of the present invention provides a specific implementation manner for converting data in a target data list into a schematic diagram graphic. By determining the position and direction of the data in the target data list, a schematic diagram graphic can be generated correspondingly for the user to view.
[0104] Further, on the basis of the above embodiment, after determining the position and direction of the data in the target data list in the schematic diagram canvas and generating the schematic diagram graphic corresponding to the schematic diagram file according to the position and direction, it further includes:
[0105] Establish an association relationship between the target data list and the schematic diagram graphic to interactively view the target data list and the schematic diagram graphic.
[0106] In this embodiment, after the schematic diagram graphic is generated, in order to realize the mutual inspection between the schematic diagram and the target data list, it is necessary to establish an association relationship between the schematic diagram and the target data list according to the object name, so as to realize the intelligent jump during the viewing between the schematic diagram and the target data list. Among them, the object includes the device or the connection relationship of the device. Specifically, establishing the association relationship between the target data list and the schematic diagram graphic to interactively view the target data list and the schematic diagram graphic includes:
[0107] Based on the automatic sorting method and the same item merging method, sort and merge the corresponding data information in the target data list to obtain the sorted and merged target data list;
[0108] Establish an association relationship between the data with the same name in the sorted and merged target data list and the schematic diagram graphic to interactively view the sorted and merged target data list and the schematic diagram graphic.
[0109] In this embodiment, the networks in the target data list include two types: with labels and without labels. Any network has a software-defined number. For networks with the same label, this number is the distinguishing mark. Therefore, it is necessary to arrange these associated networks in the target data list. For example, when there are multiple networks with the network label GND in the target data list, each GND is uniquely identified by a number. In this embodiment, the automatic sorting method and the same item merging method are used to arrange the networks in the target data list according to the connection relationship. Among them, the above network represents the connection relationship of the device.
[0110] Exemplarily, the network formats in the array obtained by classifying and extracting the array in the above embodiments are as follows. For example: D(0) = AAA, D(1) = $1N111, D(2) = BBB, D(3) = $1N222, D(4) = AAA, D(5) = $2N333.
[0111] First, sort the array D by the automatic sorting method, which can be specifically implemented by the statement D.sort(); then, merge the same items in the sorted array by the same-item merging method. The specific implementation statement is as follows:
[0112] Same-item merging method:
[0113]
[0114] In this embodiment, it is possible to sort the networks in the target data list according to the connection relationship, which is a function not available in the prior art for viewing schematic diagrams through PDF, facilitating users to view schematic diagrams.
[0115] Furthermore, after sorting and merging the connection relationships of the above devices, establish an association relationship for the data in the sorted and merged target data list that has the same name as the data in the schematic diagram, so as to realize the intelligent interactive viewing between the schematic diagram and the target data list.
[0116] Among them, the interactive viewing of the sorted and merged target data list and the schematic diagram graphics includes:
[0117] If a schematic object selection operation in the schematic diagram graphics is detected, when the schematic object is selected and displayed in the schematic diagram graphics, select the object with the same name as the schematic object in the sorted and merged target data list at the same time; or,
[0118] If a list object selection operation in the sorted and merged target data list is detected, obtain the object view with the same name as the list object from the schematic diagram image according to the list object.
[0119] Among them, the object includes a device or the connection relationship of the device.
[0120] In this embodiment, it is possible to realize the intelligent association from the schematic diagram to the target data list, and also the intelligent association from the target data list to the schematic diagram, so as to realize the two-way mutual inspection between the schematic diagram and the target data list.
[0121] Specifically, refer to Figure 5 , Figure 5A flowchart for interactively viewing a target data list through a schematic diagram provided by an embodiment of the present invention. Optionally, the two-way mutual search in this embodiment can be implemented by detecting a mouse click event. When it is detected that an object is selected on the schematic diagram page, if the object is a network and the network is the connection relationship of devices, according to the tag (label) of the object clicked by the mouse in the schematic diagram canvas, the network is thickened and colored, and the view corresponding to the network is obtained. At the same time, the network array in the target data list is traversed, and according to the association relationship between the schematic diagram and the target data list, the corresponding network in the target data list is selected; when it is detected that an object is selected on the schematic diagram page, if the object is a device, according to the tag (label) of the object clicked by the mouse in the schematic diagram canvas, a frame is added to the device to obtain the view, and at the same time, the device array in the target data list is traversed, and the corresponding device in the target data list is selected.
[0122] Figure 6 A flowchart for interactively viewing a schematic diagram through a target data list provided by an embodiment of the present invention. When it is detected that a network is selected in the target data list, the page is located according to the network array in the target data list, the corresponding page is opened, and all objects are traversed, and object operations are performed according to the tag of the object: thickening, coloring, and obtaining the view; when it is detected that a device is selected in the target data list, the page number is located according to the device array in the target data list, the corresponding canvas page is opened according to the page number in the array, and all objects are traversed, and object operations are performed on the object according to the tag: adding a frame to the device and obtaining the view.
[0123] The embodiment of the present invention realizes the interactive viewing of the schematic diagram and the target data list by intelligently associating the schematic diagram and the target data list.
[0124] Figure 7 A structural schematic diagram of a schematic diagram generation device provided by an embodiment of the present invention. The schematic diagram generation device provided by the embodiment of the present invention can execute a schematic diagram generation method provided by any embodiment of the present invention. See Figure 7 This device includes a data acquisition module 710, a classification processing module 720, and a schematic diagram generation module 730.
[0125] Among them, the data acquisition module 710 is used to acquire target data in the schematic diagram file;
[0126] The classification processing module 720 is used to classify and process the target data to generate a target data list;
[0127] The schematic diagram generation module 730 is used to determine the position and direction of the data in the target data list on the schematic diagram canvas, and generate a schematic diagram corresponding to the schematic diagram file according to the position and direction.
[0128] Further, the classification processing module 720 is specifically configured to: classify the target data into three categories: symbols, pages, and view attributes;
[0129] Traverse and extract the classified target data according to a preset rule to generate a target data list corresponding to the target data.
[0130] Further, the schematic diagram generation module 730 is specifically configured to: determine a conversion relationship between the coordinates of the data in the target data list and the coordinates of the schematic diagram canvas according to the attribute information of the schematic diagram canvas;
[0131] Determine the coordinate positions of the data in the target data list in the schematic diagram canvas according to the conversion relationship;
[0132] Determine the directions of the data in the target data list in the schematic diagram canvas according to the coordinate positions and the starting points and preset rotation angles corresponding to the data in the target data list, and generate a schematic diagram corresponding to the schematic diagram file.
[0133] Further, the device further includes an interactive viewing module, configured to establish an association relationship between the target data list and the schematic diagram, so as to interactively view the target data list and the schematic diagram.
[0134] The above interactive viewing module is specifically configured to: sort and merge the corresponding data information in the target data list based on an automatic sorting method and a same item merging method to obtain a sorted and merged target data list;
[0135] Establish an association relationship between the data with the same name in the sorted and merged target data list and the schematic diagram to interactively view the sorted and merged target data list and the schematic diagram.
[0136] Further, the above interactive viewing module is further specifically configured to: if a schematic diagram object selection operation in the schematic diagram is detected, while selecting and displaying the schematic diagram object in the schematic diagram, select an object with the same name as the schematic diagram object in the sorted and merged target data list; or,
[0137] If a list object selection operation in the sorted and merged target data list is detected, obtain an object view with the same name as the list object from the schematic diagram image according to the list object.
[0138] Wherein, the object includes a device or a connection relationship between devices.
[0139] The schematic diagram generation device provided by the embodiment of the present invention has strong scalability and can develop various new functions according to requirements.
[0140] The schematic diagram generation device provided by an embodiment of the present invention can execute the schematic diagram generation method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the method, which will not be elaborated herein.
[0141] Figure 8 It is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. Figure 8 It shows a block diagram of an exemplary electronic device 12 suitable for implementing the embodiments of the present invention. Figure 8 The shown electronic device 12 is merely an example and should not impose any limitation on the functions and usage scope of the embodiments of the present invention.
[0142] As Figure 8 shown, the electronic device 12 is presented in the form of a general-purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 connecting different system components (including the system memory 28 and the processing unit 16).
[0143] The bus 18 represents one or more of several types of bus structures, including a memory bus or a memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus structures. For example, these architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
[0144] The electronic device 12 typically includes a variety of computer system-readable media. These media can be any available media accessible by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.
[0145] The system memory 28 may include computer system-readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, a storage system 34 can be used for reading and writing non-removable, non-volatile magnetic media ( Figure 8 not shown, commonly referred to as a "hard disk drive"). Although Figure 8not shown, a disk drive for reading and writing to a removable non-volatile disk (such as a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (such as a CD-ROM, DVD-ROM or other optical medium) may be provided. In these cases, each drive may be connected to the bus 18 through one or more data medium interfaces. The memory 28 may include at least one program product having a set (such as at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0146] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include the implementation of a network environment. The program modules 42 generally perform the functions and / or methods in the embodiments described in the present invention.
[0147] The electronic device 12 may also communicate with one or more external devices 14 (such as a keyboard, a pointing device, a display 24, etc.), and may also communicate with one or more devices that enable a user to interact with the electronic device 12, and / or communicate with any device that enables the electronic device 12 to communicate with one or more other computing devices (such as a network card, a modem, etc.). Such communication may be carried out through the input / output (I / O) interface 22. In addition, the electronic device 12 may also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through the network adapter 20. As shown in the figure, the network adapter 20 communicates with other modules of the electronic device 12 through the bus 18. It should be understood that although not shown in the figure, other hardware and / or software modules may be used in combination with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0148] The processing unit 16 executes various functional applications and data processing by running the programs stored in the system memory 28, such as implementing a schematic diagram generation method provided by the embodiments of the present invention.
[0149] The embodiments of the present invention also provide a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, it implements a schematic diagram generation method as described in any one of the embodiments of the present invention. Wherein, the method includes:
[0150] Obtain the target data in the schematic diagram file;
[0151] Classify the target data to generate a target data list;
[0152] Determine the position and orientation of the data in the target data list on the principle drawing canvas, and generate the schematic diagram graphics corresponding to the schematic diagram file according to the position and orientation.
[0153] The computer storage medium of the embodiments of the present invention may adopt any combination of one or more computer-readable media. The computer-readable media may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the computer-readable storage medium include: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0154] The computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries the computer-readable program code. Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0155] The program code contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0156] Computer program code for performing the operations of the present invention may be written in one or more programming languages or combinations thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and also including conventional procedural programming languages such as the "C" language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network including a local area network (LAN) or a wide area network (WAN), or, may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0157] Note that the above is only the preferred embodiment of the present invention and the technical principles applied. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, re-adjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments. Without departing from the concept of the present invention, more other equivalent embodiments may be included, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A schematic diagram generation method, characterized in that, Including: Obtain target data in the schematic diagram file; Classify the target data to generate a target data list; Determine the position and orientation of the data in the target data list on the schematic diagram canvas, and generate a schematic diagram corresponding to the schematic diagram file according to the position and orientation; Among them, the classifying the target data to generate a target data list includes: Classify the target data into three categories: symbols, pages, and view attributes; Traverse and extract the classified target data according to preset rules to generate a target data list corresponding to the target data, including: Traverse the classified target data twice. The first traversal extracts instance attributes from view attributes, and the second traversal extracts data in symbols and data included under pages; among them, data under pages includes: instances, networks, and others; Complement the instance data under the page with the data in the symbol, and traverse and extract the network labels and network segments in the network data respectively; Put the extracted data into corresponding two-dimensional arrays respectively to obtain multiple two-dimensional arrays corresponding to the target data, and construct a hierarchical target data list through the multiple two-dimensional arrays corresponding to the target data.
2. The method according to claim 1, characterized in that, Determine the position and orientation of the data in the target data list on the schematic diagram canvas, and generate a schematic diagram corresponding to the schematic diagram file according to the position and orientation, including: Determine the conversion relationship between the coordinates of the data in the target data list and the coordinates of the schematic diagram canvas according to the attribute information of the schematic diagram canvas; Determine the coordinate position of the data in the target data list on the schematic diagram canvas according to the conversion relationship; Determine the orientation of the data in the target data list on the schematic diagram canvas according to the coordinate position and the starting point and preset rotation angle corresponding to the data in the target data list, and generate a schematic diagram corresponding to the schematic diagram file.
3. According to the method described in claim 1, after determining the position and orientation of the data in the target data list on the schematic diagram canvas and generating a schematic diagram corresponding to the schematic diagram file according to the position and orientation, it further includes: Establish an association relationship between the target data list and the schematic diagram to interactively view the target data list and the schematic diagram.
4. The method according to claim 3, characterized in that, Establishing an association relationship between the target data list and the schematic diagram to interactively view the target data list and the schematic diagram includes: Based on the automatic sorting method and the same item merging method, sort and merge the corresponding data information in the target data list to obtain a sorted and merged target data list; Establish an association relationship between the data with the same name in the sorted and merged target data list and the schematic diagram to interactively view the sorted and merged target data list and the schematic diagram.
5. The method according to claim 4, characterized in that, Interactively viewing the sorted and merged target data list and the schematic diagram includes: If a schematic object selection operation in the schematic diagram is detected, while the schematic object is selected and displayed in the schematic diagram, an object with the same name as the schematic object is selected in the sorted and merged target data list; or, If a list object selection operation in the sorted and merged target data list is detected, an object view with the same name as the list object is obtained from the schematic diagram image according to the list object; wherein, the object includes a device or a connection relationship between devices.
6. A schematic diagram generating device, characterized in that, The device includes: a data acquisition module, configured to acquire target data in a schematic diagram file; a classification processing module, configured to perform classification processing on the target data to generate a target data list; a schematic diagram generation module, configured to determine the position and orientation of the data in the target data list on the schematic diagram canvas, and generate a schematic diagram corresponding to the schematic diagram file according to the position and orientation; wherein, the classification processing module is specifically configured to: classify the target data into three categories: symbols, pages, and view attributes; traverse and extract the classified target data according to a preset rule to generate a target data list corresponding to the target data, including: performing two traversals on the classified target data, extracting instance attributes in the first traversal of view attributes, and extracting data in symbols and data included under pages in the second traversal; wherein, the data under pages includes: instances, networks, and others; complementing the instance data under the page with the data in the symbols, and traversing and extracting network labels and network line segments in the network data respectively; putting the extracted data into corresponding two-dimensional arrays respectively to obtain multiple two-dimensional arrays corresponding to the target data, and constructing a hierarchical target data list through the multiple two-dimensional arrays corresponding to the target data.
7. An electronic device, characterized in that, The electronic device includes: one or more processors; a storage device, configured to store one or more programs, when the one or more programs are executed by the one or more processors, enabling the one or more processors to implement a schematic diagram generation method according to any one of claims 1-5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements a schematic diagram generation method according to any one of claims 1-5.
Citation Information
Patent Citations
Generation method of schematic circuit diagram connecting line
CN103164546A
Method for displaying electronic document and browser plug-in
CN111026860A