A method, device, storage medium and equipment for modeling, simulating and analyzing a circuit diagram
By using a graphical interface to display the model library and construct the target circuit diagram in circuit simulation analysis, the problem of circuit design data migration and integration in the prior art is solved, and the cost of flexible data exchange and simulation analysis of circuit diagrams is reduced.
Patent Information
- Application Number
- CN202510296468.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-13
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2045-03-13
AI Technical Summary
In the prior art, when circuit design data is migrated to a new simulation environment or integrated with other software, it is difficult to directly expand or adapt, resulting in users needing to remodel, increasing the cost of simulation analysis.
The model library is displayed through a preset graphical interface, and the user's layout operation instructions are obtained, the target circuit diagram is built and the basic data of the diagram is obtained. According to the basic data and port number representation of the graph, the data is converted into netlist data that interacts with the simulation analysis program to support the data exchange of different simulation analysis software.
It realizes the intermediate representation of circuit diagrams without relying on specific simulation analysis programs, thereby flexibly exchanging data in different simulation analysis software, reducing the cost of simulation analysis.
Smart Images

Figure CN119783624B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of circuit simulation technology, and particularly to a method, apparatus, storage medium, and device for modeling, simulating, and analyzing circuit diagrams. Background Art
[0002] Modeling and simulation software is a tool for simulating and analyzing system performance. Through modeling and simulation software, testing and evaluating designs can be carried out without actually building or manufacturing physical prototypes, so as to reduce expensive physical tests and unnecessary iterations, thereby effectively improving the verification efficiency while reducing the verification cost and risk, and thus making the modeling and simulation software an irreplaceable engineering simulation software and teaching software. In the actual use process, users can, through the rich electronic components provided by the modeling and simulation software, such as power supplies, resistors, inductors, pulleys, etc., and after simply setting component parameters and simulation time, etc., observe the circuit state at any time. Among them, relatively well-known modeling and simulation software includes Modelica, matlab, Simulink, etc.
[0003] However, since different modeling and simulation software usually adopts its own unique data format to represent circuit diagram data. These data formats are often tailored for specific software or simulation environments, focusing on meeting the internal needs of the software and optimizing performance. Although this proprietary data format design improves the software operation efficiency to a certain extent, it also brings obvious limitations. When users need to migrate circuit design data to a new simulation environment or integrate with other software, the existing data formats are often difficult to directly expand or adapt, resulting in users needing to re-model, thus greatly increasing the cost of simulation analysis.
[0004] Therefore, how to reduce the cost of simulation analysis is an urgent problem to be solved. Summary of the Invention
[0005] This specification provides a method, apparatus, storage medium, and device for modeling, simulating, and analyzing circuit diagrams to partially solve the above problems existing in the prior art.
[0006] This specification adopts the following technical solutions:
[0007] This specification provides a method for modeling, simulating, and analyzing circuit diagrams, the method comprising:
[0008] displaying a preset model library in a preset graphical interface, and obtaining layout operation instructions executed by a user for different models included in the model library, where the models are used to represent electronic components required for constructing a circuit diagram and connection tools for connecting the electronic components;
[0009] Construct a target circuit diagram according to the layout operation instruction, and parse the target circuit diagram to obtain the graph basic data corresponding to the target circuit diagram; each node in the graph basic data is used to represent each graph element included in the target circuit diagram, and the graph elements include: electronic components and the connections between electronic components; each edge in the graph data is used to represent the connection relationship between two graph elements;
[0010] When receiving a simulation analysis instruction for the target circuit diagram, determine the port number representations corresponding to the respective electronic components included in the graph basic data according to the edges included in the graph basic data, and the port number representations are used to represent the connection relationship between electronic components;
[0011] According to the graph basic data and the port number representations, convert the graph basic data into netlist data required for interacting with a simulation analysis program, so that the simulation analysis software performs a simulation analysis on the target circuit diagram based on the netlist data.
[0012] Optionally, constructing a target circuit diagram according to the layout operation instruction specifically includes:
[0013] According to the layout operation instruction, determine at least one model selected by the user, and determine the definition data of the model, where the definition data is used to represent the basic attribute data of the model and the connection method of the model;
[0014] Construct a target circuit diagram in a preset circuit diagram drawing canvas according to the definition data of the model.
[0015] Optionally, parsing the target circuit diagram to obtain the graph basic data corresponding to the target circuit diagram specifically includes:
[0016] Parse the target circuit diagram to obtain circuit structure data for representing the target circuit diagram, where the circuit structure data includes: component entity representation data, line representation data, and connection point representation data;
[0017] According to the circuit structure data, convert to obtain each node included in the target circuit diagram and the node features of each node, so as to obtain the graph basic data corresponding to the target circuit diagram.
[0018] Optionally, when receiving a simulation analysis instruction for the target circuit diagram, determining the port number representations corresponding to the respective electronic components included in the graph basic data according to the edges included in the graph basic data specifically includes:
[0019] When receiving a simulation analysis instruction for the target circuit diagram, generate a task request;
[0020] Send the task request to each processor in sequence according to the order among the processors included in the preset processing flow chain until the task request is sent to the target processor that matches the task request, so that the target processor determines the port number representations corresponding to the various electronic components included in the graph basic data according to the edges included in the graph basic data; wherein, different processors in the processing flow chain are used to execute different simulation analysis tasks in response to different task requests.
[0021] Optionally, determining the port number representations corresponding to the various electronic components included in the graph basic data according to the edges included in the graph basic data specifically includes:
[0022] Select a first target node from each node of the graph basic data, and the first target node is used to represent an electronic component.
[0023] Construct an instance object according to the node characteristics of the first target node, and determine the connection points included in the instance object.
[0024] Allocate port numbers to each connection point according to the order among the connection points.
[0025] Determine the port number representations corresponding to the various electronic components included in the graph basic data according to the port numbers of each connection point.
[0026] Optionally, determining the port number representations corresponding to the various electronic components included in the graph basic data according to the port numbers of the connection points included in each instance object specifically includes:
[0027] Linearly and recursively traverse each second target node in the graph basic data to determine, for each instance object, other instance objects connected to the instance object through the connection represented by the second target node, and determine the connection points used when connecting to the other instance objects from the connection points of the instance object.
[0028] Reset the port numbers of the connection points of the instance object and the port numbers of the connection points of the other instance object to the same port number; wherein, the reset port number is used to represent that the instance object and the other instance object are connected to each other through the connection point corresponding to the reset port number.
[0029] Determine the port number representations corresponding to the various electronic components included in the graph basic data according to the reset port number.
[0030] Optionally, determining the port number representations corresponding to the various electronic components included in the graph basic data according to the reset port number specifically includes:
[0031] In the case of determining that there is an instance object of a specified type among the instance objects, adjust the port number of the instance object of the specified type to a specified value;
[0032] According to the adjusted port number, determine the port number representations corresponding to the respective electronic components included in the graph basic data.
[0033] This specification provides a circuit diagram modeling and simulation analysis device, including:
[0034] An acquisition module, configured to display a preset model library through a preset graphical interface, and acquire layout operation instructions executed by a user for different models included in the model library, where the models are used to represent electronic components required for constructing a circuit diagram and connection tools for connecting the electronic components;
[0035] A conversion module, configured to construct a target circuit diagram according to the layout operation instructions, and parse the target circuit diagram to obtain graph basic data corresponding to the target circuit diagram; each node in the graph basic data is used to represent each graph element included in the target circuit diagram, and the graph elements include: electronic components and connections between the electronic components; each edge in the graph data is used to represent a connection relationship between two graph elements;
[0036] A determination module, configured to, in the case of receiving a simulation analysis instruction for the target circuit diagram, determine the port number representations corresponding to the respective electronic components included in the graph basic data according to the edges included in the graph basic data, where the port number representations are used to represent the connection relationship between the electronic components;
[0037] A simulation analysis module, configured to convert the graph basic data into netlist data required for interacting with a simulation analysis program according to the graph basic data and the port number representations, so that the simulation analysis software performs simulation analysis on the target circuit diagram based on the netlist data.
[0038] This specification provides a computer-readable storage medium, where the storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned circuit diagram modeling and simulation analysis method is implemented.
[0039] This specification provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the program, the above-mentioned circuit diagram modeling and simulation analysis method is implemented.
[0040] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:
[0041] In the method for modeling and simulating analysis of the circuit diagram provided in this specification, first, a preset model library is displayed in a preset graphical interface, and layout operation instructions executed by the user for different models included in the model library are obtained. Here, the models are used to represent the electronic components required to construct the circuit diagram and the connection tools for connecting the electronic components. Then, according to the layout operation instructions, a target circuit diagram is constructed, and the target circuit diagram is parsed to obtain the graph basic data corresponding to the target circuit diagram. Each node in the graph basic data is used to represent each graph element included in the target circuit diagram, and the graph elements include: electronic components and the connections between the electronic components. Each edge in the graph data is used to represent the connection relationship between two graph elements. When a simulation analysis instruction for the target circuit diagram is received, according to the edges included in the graph basic data, the port number representations corresponding to the respective electronic components included in the graph basic data are determined. The port number representations are used to represent the connection relationship between the electronic components. According to the graph basic data and the port number representations, the graph basic data is converted into netlist data required for interaction with the simulation analysis program, so that the simulation analysis software can perform simulation analysis on the target circuit diagram based on the netlist data.
[0042] As can be seen from the above method, the server can convert the target circuit diagram drawn by the user in the graphical interface into a form of graph data that is independent of a specific simulation analysis program and store it as an intermediate representation form. Thus, while being able to support the user's editing operations in the graphical interface and intuitively represent the topological structure between the electronic components and the basic attributes of the electronic components in the target circuit diagram, it can also be converted into netlist data in different formats supported by different simulation analysis software when simulation analysis is required, facilitating flexible data exchange in different simulation analysis software and different functional modules, and thus effectively reducing the cost of simulation analysis. Brief Description of the Drawings
[0043] The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The schematic embodiments of this specification and their descriptions are used to explain this specification and do not constitute an improper limitation to this specification. In the drawings:
[0044] Figure 1 It is a schematic flow chart of a method for modeling and simulating analysis of a circuit diagram provided in this specification;
[0045] Figure 2 It is a schematic diagram of the circuit structure data provided in this specification;
[0046] Figure 3A It is a schematic diagram of the port numbers of the connection points provided in this specification;
[0047] Figure 3BSchematic diagram of the port number of a connection point after reset provided in this specification;
[0048] Figure 4 Schematic diagram of the process of circuit diagram simulation analysis provided in this specification;
[0049] Figure 5 Schematic diagram of a circuit diagram modeling and simulation analysis device provided in this specification;
[0050] Figure 6 Corresponding to Figure 1 Schematic diagram of an electronic device. Specific implementation manners
[0051] To make the objectives, technical solutions and advantages of this specification clearer, the technical solutions of this specification will be clearly and completely described below in conjunction with specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, rather than all the embodiments. Based on the embodiments in this specification, all other embodiments obtained by those of ordinary skill in the art without making creative efforts shall fall within the scope of protection of this specification.
[0052] The following will detail the technical solutions provided in each embodiment of this specification in conjunction with the drawings.
[0053] Figure 1 Schematic diagram of the flow of a circuit diagram modeling and simulation analysis method provided in this specification, including the following steps:
[0054] S101: Display a preset model library through a preset graphical interface, and obtain the layout operation instructions executed by the user for different models included in the model library, where the models are used to represent the electronic components required for constructing a circuit diagram.
[0055] In this specification, the service platform can provide a preset model library to the user through a preset graphical interface, so that the user can execute layout operation instructions for different models included in the model library in the graphical interface, such as dragging, text editing, clicking, etc. Then, according to the layout operation instructions sent by the user, the models selected by the user can be determined, and the definition data configured by the user for the selected models can be determined. Furthermore, according to the models selected by the user and the definition data of the models, a target circuit diagram can be constructed in the circuit diagram drawing canvas, and simulation analysis can be performed based on the constructed target circuit diagram.
[0056] Among them, the above models may refer to the symbols of electronic components required for constructing a circuit diagram and the connection line tools for connecting these electronic components provided by the service platform to the user in advance. Here, the electronic components may be, for example: power supplies, resistors, capacitors, transistors, etc.
[0057] The defined data of the above model may refer to the data used to describe the basic attributes of the electronic components corresponding to the model in circuit design and simulation, as well as the necessary information such as the connection method of the model. Such as: component name, manufacturer name, model number, electrical characteristic parameters (such as: resistance value, rated power, capacitance value, withstand voltage value, etc.), size, pin layout (the model can have multiple pins for connecting with other models, and the pins here can refer to the metal joint points on the model), connection method, etc.
[0058] It should be noted that among the models included in the model library, the defined data of some models may be fixed. Of course, the defined data of some models may also be user-defined. At this time, the business platform can set basic defined data for each model in the model library, so that when the user needs to customize the defined data of at least some of the selected models, the user can, based on the basic defined data of the model for which the defined data needs to be customized, execute the layout operation instruction for the model for which the defined data needs to be customized in the graphical interface to obtain the modified defined data of the model for which the defined data needs to be customized, so that the business platform can construct the target circuit diagram according to the modified defined data of the model.
[0059] In this specification, the execution entity for implementing the circuit diagram modeling and simulation analysis method may refer to a specified device such as a server set in the business platform, or may refer to terminal devices such as desktop computers and laptop computers. For the convenience of description, hereinafter, only the case where the server is the execution entity will be used as an example to describe the circuit diagram modeling and simulation analysis method provided in this specification.
[0060] S102: According to the layout operation instruction, construct a target circuit diagram, and parse the target circuit diagram to obtain the graph basic data corresponding to the target circuit diagram; each node in the graph basic data is used to represent each graph element included in the target circuit diagram, and the graph elements include: electronic components and the connections between electronic components; each edge in the graph data is used to represent the connection relationship between two graph elements.
[0061] It should be noted that in this specification, component entity representation data, line representation data, and connection point representation data can be used to represent the component entities, lines, and connection points included in different circuit diagrams.
[0062] Among them, the component entity may refer to an electronic component extended from the model for actual circuit diagram drawing. There are multiple pins on the component entity for connecting between component entities. The pins here can be the metal joint points on the entity for connecting different component entities.
[0063] In the above content, the lines can refer to the connections between various electronic components in a circuit diagram. These lines can be straight lines, curves, broken lines, or other forms, and their function in the circuit diagram is to show the flow direction and connection relationship of current, signals, or power supplies.
[0064] In the above content, the joint point Joint can refer to the connection point of two or more lines or conductors in a circuit. The joint point can be a physical connection between different parts or components in the circuit, which allows current or signals to be transmitted from one part to another.
[0065] It can be seen from the above content that through the above circuit structure data, a data representation of a complex circuit diagram can be completely defined. For the convenience of understanding, the following combines Figure 2 to elaborate on the above circuit structure data in detail.
[0066] Figure 2 is a schematic diagram of the circuit structure data provided in this specification.
[0067] Combined with Figure 2 it can be seen that for each component entity data Entity, it can include definition data Model of the model and attributes such as pins Pins. For each line representation data Edge, it can include attributes such as start joint Start Joint and end joint End Joint.
[0068] It can be seen from the above content that the server can represent the target circuit diagram through component entity representation data Entity, line representation data Edge, and connection point representation data Joints.
[0069] Based on this, the server can construct the target circuit diagram according to the layout operation instructions executed by the user in the graphical interface, and then can parse the target circuit diagram to obtain the circuit structure data used to characterize the target circuit diagram.
[0070] Furthermore, after the server obtains the circuit structure data used to characterize the target circuit diagram, it can convert according to the circuit structure data to obtain each node included in the target circuit diagram and the node features of each node, so as to obtain the graph basic data corresponding to the target circuit diagram, and then can store the graph structure of the target circuit diagram through the graph data.
[0071] Specifically, the server can create a node corresponding to each graph element included in the target circuit diagram according to the component entity representation data or line representation data of the graph element, and then can determine the node features of the node corresponding to the graph element according to the attributes of the component entity representation data or line representation data of the graph element, and the connection point representation data included in the graph element.
[0072] Among them, for each graphic element corresponding to an electronic component included in the target circuit diagram, if the connection points included in the graphic element indicate that the connection points included in the graphic element corresponding to the connection line between the data and the electronic component represent the same data, it can be considered that the graphic element is connected to the graphic element corresponding to the connection line between the above-mentioned electronic components through the connection points represented by the data included in the graphic element. At this time, it can be determined that the node used to represent the graphic element in the above-mentioned graphic basic data and the node used to represent the graphic element corresponding to the connection line between the above-mentioned electronic components are connected by an edge. And so on, the server can convert and obtain the graphic basic data corresponding to the target circuit diagram according to the circuit structure data and store it.
[0073] In actual application scenarios, the formats of the netlist data used by different simulation analysis programs are often different. For example: SPICE netlist, Verilog netlist, EDIF netlist, etc. At this time, for each format of netlist data, a conversion program for converting the graphic basic data into the netlist data of this format can also be preset in the server. In the case of receiving a simulation analysis instruction for the target circuit diagram, the format of the netlist data that needs to be converted can be determined according to the simulation analysis instruction as the target format. Furthermore, the conversion program that matches the target format can be determined from the preset conversion programs, and the graphic basic data can be converted into the netlist data required for interacting with the simulation analysis program through the conversion program that matches the target format.
[0074] It should be noted that since the simulation analysis tasks performed by users when performing simulation analysis on different circuit diagrams may be different (for example: in the circuit performance simulation analysis task, basic parameters such as the voltage, current, and power of the circuit need to be simulated and analyzed. In the signal integrity simulation analysis task, the transmission quality of signals in the circuit needs to be analyzed, including: reflection, crosstalk, attenuation, etc.), and the execution logics of different simulation analysis tasks are often different, so code programs for executing different task logics often need to be deployed in the server, which makes it often difficult to manage and maintain these code programs.
[0075] Therefore, in this specification, the code programs of the above different task logics and the conversion programs in the above content can be deployed in different processors, and these processors can be stored in a chained structure. As a result, when the server receives a simulation analysis instruction for a target circuit diagram, it can generate a task request according to the received simulation analysis instruction for the target circuit diagram, and send the task request to each processor in sequence according to the order among the processors included in the preset processing flow chain until the task request is sent to the target processor that matches the task request, so that the target processor can determine the port number representations corresponding to the various electronic components included in the graph basic data according to the edges included in the graph basic data.
[0076] S103: When receiving a simulation analysis instruction for the target circuit diagram, determine the port number representations corresponding to the various electronic components included in the graph basic data according to the edges included in the graph basic data, where the port number representations are used to characterize the connection relationships between electronic components.
[0077] S104: According to the graph basic data and the port number representations, convert the graph basic data into netlist data required for interaction with the simulation analysis program, so that the simulation analysis software can perform simulation analysis on the target circuit diagram based on the netlist data.
[0078] In this specification, when the server determines that it is necessary to perform simulation analysis on a target circuit diagram, it can obtain the graph basic data corresponding to the target circuit diagram, and then can determine the port number representations corresponding to the various electronic components included in the target circuit diagram according to the edges included in the graph basic data. Furthermore, according to the graph basic data and the port number representations corresponding to the various electronic components included in the target circuit diagram, the graph basic data can be converted into netlist data required for interaction with the simulation analysis program, so as to perform simulation analysis on the target circuit diagram based on the netlist data.
[0079] Among them, there can be various conditions for the server to determine that it is necessary to perform simulation analysis on a target circuit diagram. For example, when receiving a simulation analysis instruction for the target circuit diagram, a task request can be generated according to the simulation configuration parameters set by the user (such as simulation time, simulation step size, analysis type, etc.), and then it can be determined that it is necessary to perform simulation analysis on the target circuit diagram according to the task request.
[0080] For another example: when the user inputs or adjusts the simulation configuration parameters in the graphical interface, the server can automatically determine that it is necessary to perform simulation analysis on the target circuit diagram when monitoring the changes in these parameters.
[0081] In the above content, the method for determining the port number representation corresponding to each electronic component included in the target circuit diagram based on the edges included in the graph basic data can be that the server selects a first target node (i.e., the node used to represent the electronic component) from each node of the graph basic data, and then can construct instance objects (each instance object is used to represent each electronic component in the target circuit) according to the node characteristics of the first target node, and determine the connection points included in the instance object. Then, according to the order of the connection points included in each instance object, port numbers can be assigned to the connection points included in each instance object.
[0082] Furthermore, the server can determine the port number representation corresponding to each electronic component included in the graph basic data according to the port numbers of the connection points included in each instance object, specifically as Figure 3A shown.
[0083] Figure 3A This is a schematic diagram of the port numbers of the connection points provided in this specification.
[0084] In Figure 3A the shown target circuit diagram, there are 4 electronic components, namely a single-phase sinusoidal AC voltage source, a resistor, an ammeter, a voltage probe, and a special component ground. Among them, the single-phase sinusoidal AC voltage source has 2 connection points, the voltage probe has 1 connection point, the resistor has 2 connection points, the ammeter has 2 connection points, and the ground has 1 connection point.
[0085] At this time, the server can select the first target nodes corresponding to the single-phase sinusoidal AC voltage source, resistor, ammeter, and voltage probe from each node of the graph basic data, and construct instance objects of the single-phase sinusoidal AC voltage source, resistor, ammeter, and voltage probe according to the node characteristics of the first target node, and determine the connection points included in each instance object. Then, according to the order of the connection points, port numbers can be assigned to the connection points included in each instance object. As Figure 3A shown, the connection point with port number 1 and the connection point with port number 2 included in the single-phase sinusoidal AC voltage source, the connection point with port number 3 included in the voltage probe, the connection point with port number 4 and the connection point with port number 5 included in the resistor, and the connection point with port number 6 and the connection point with port number 7 included in the ammeter.
[0086] Among them, the order of the connection points can refer to the order of traversing each connection point of different instance objects.
[0087] In the above content, according to the sequence of the connection points, the method of allocating port numbers to the connection points included in each instance object can be to allocate port numbers to the connection points included in each instance object in ascending order according to the sequence of the connection points.
[0088] Further, after the server sequentially allocates port numbers to the connection points included in each instance object, it is also necessary to linearly and recursively traverse each second target node in the graph basic data to determine, for each instance object, other instance objects connected to this instance object through the connection lines represented by the second target node, and determine the connection points used when connecting to other instance objects from the connection points of this instance object, and reset the port numbers of the connection points of this instance object and the port numbers of the connection points of other instance objects to the same port number.
[0089] Among them, the reset port number is used to represent that this instance object is connected to other instance objects through the connection points corresponding to the reset port number.
[0090] Further, the server can determine the port number representations corresponding to the respective electronic components included in the graph basic data according to the port numbers of the connection points included in each instance object after reset. Specifically, as Figure 3B shown.
[0091] Figure 3B This is a schematic diagram of the port numbers of the connection points after reset provided in this specification.
[0092] Combined with Figure 3B it can be seen that for the instance object corresponding to the single-phase sinusoidal AC voltage source, the connection point with a port number of 1 of this instance object is connected through a connection line to the connection point with a port number of 3 of the instance object corresponding to the voltage probe and the connection point with a port number of 4 of the instance object corresponding to the resistor. At this time, the connection points with a port number of 1, a port number of 3, and a port number of 4 can be used as connection points. Furthermore, by resetting the port numbers corresponding to the above three connection points to the same port number, it is used to represent that the instance object corresponding to the single-phase sinusoidal AC voltage source, the instance object corresponding to the voltage probe, and the instance object corresponding to the resistor are connected through the connection line and the connection points corresponding to the reset port number.
[0093] Specifically, the server can determine, according to the sequence of each instance object, to use the port number of the connection point of the instance object corresponding to the single-phase sinusoidal AC voltage source as the reset port number of the above three connection points, that is, set the port numbers of the connection points with a port number of 3 and a port number of 4 to 1.
[0094] It should be noted that for each electronic component, when a certain connection point in the electronic component is connected to the connection points of other electronic components through a wire, the connection point used to connect to the wire is the connection point.
[0095] In addition, in actual application scenarios, the circuit diagrams drawn by users often also include special components, such as: ground, input / output ports, etc.
[0096] At this time, when the server determines that there is an instance object of the specified type among the instance objects, the server can also reset the port number of the instance object of the specified type to a specified value (the above-mentioned specified value can be set according to actual needs, for example: 0). Furthermore, based on the reset port number, the server can determine the port number representation of the electronic component corresponding to the instance object of the specified type included in the graph basic data, and based on the port numbers of the connection points included in each instance object determined again, determine the port number representation of each electronic component included in the graph basic data.
[0097] It is worth noting that for each electronic component, the port number representation of the electronic component is used to characterize the connection relationship between the electronic component and other electronic components.
[0098] For example: in Figure 3B , in the single-phase sinusoidal AC voltage source, the connection point with port number 1 and the connection point with port number 2 are connected to other electronic components. At this time, the port number representation of the single-phase sinusoidal AC voltage source is (1, 2). By analogy, it can be known that the port number representation of the resistor is (1, 5). Furthermore, based on the port number representation of the single-phase sinusoidal AC voltage source and the port number representation of the resistor, it can be known that the single-phase sinusoidal AC voltage source is connected to the connection point with port number 1 in the resistor through the connection point with port number 1 and a wire.
[0099] Furthermore, the server can convert the graph basic data into netlist data required for interacting with the simulation analysis program according to the graph basic data and the port number representation.
[0100] For example: The partial netlist data used to characterize the above-mentioned single-phase sinusoidal AC voltage source can be {"label": "AC", "name": "AC1", "index": 1, "type": "ELECTRIC", "ports": [1, 2]}. By analogy, the netlist data used to characterize the target circuit diagram can be obtained.
[0101] It should be noted that the above-mentioned netlist data can include features such as nodes (Elements), ports (Ports), attributes (Attributes), etc.
[0102] Among them, nodes are used to represent various logic gates, devices, input / output ports, etc. in a circuit. Each node has a unique identifier and name, which are used to correspond to the basic components in the target circuit diagram.
[0103] Ports are used to represent the connections between various nodes in a circuit. The number of ports represents the number of connection points. When the port numbers are the same, it means they are connected in the circuit.
[0104] In addition, the attributes of each node or wire in the netlist data are used to describe additional information such as the characteristics, functions, and physical locations of the node or wire.
[0105] For example, a node can have different logic functions (such as AND, OR, NOT, etc.), or can have different basic attributes (switch closed state, resistance, capacitance, etc.).
[0106] For the sake of easy understanding, the following details the call relationships during the simulation analysis process of the circuit diagram modeling and simulation analysis method described above, specifically as Figure 4 shown.
[0107] Figure 4 This is a schematic diagram of the process of circuit diagram simulation analysis provided in this specification.
[0108] Combined with Figure 4 It can be seen that the user can construct the target circuit diagram on the circuit diagram drawing canvas provided in the graphical interface by executing layout operation instructions for different models included in the model library in the graphical interface, selecting different electronic components, and connecting the electronic components after configuring the definition data of each electronic component.
[0109] The server can parse the target circuit diagram drawn by the user by calling the server-side process, obtain the graph basic data corresponding to the target circuit diagram, and store it.
[0110] Furthermore, when the server determines that simulation analysis needs to be performed on the target circuit diagram, it can call the server-side process to convert the graph basic data corresponding to the target circuit diagram into the netlist data required for interaction with the simulation analysis program. Furthermore, it can call the computing-side process to perform simulation analysis based on the netlist data corresponding to the target circuit diagram and obtain the simulation analysis result.
[0111] It should be noted that the above simulation analysis result can be timing representation data, that is, the calculation result used to represent the change of target parameters (such as current, voltage) over time within a specified time period.
[0112] As can be seen from the above method, the server can convert the target circuit diagram drawn by the user in the graphical interface into the form of graph data that does not depend on a specific simulation analysis program, and store it as an intermediate representation form. Thus, while being able to support the editing operations of the user in the graphical interface and visually represent the topological structure between the electronic components and the basic attributes of the electronic components in the target circuit diagram, it can also be converted into netlist data in different formats supported by different simulation analysis software when simulation analysis is required, so as to facilitate flexible data exchange in different simulation analysis software and different functional modules, and further effectively reduce the cost of simulation analysis.
[0113] The above is a method for modeling and simulating analysis of one or more implementation circuit diagrams in this specification. Based on the same idea, this specification also provides a corresponding device for modeling and simulating analysis of circuit diagrams, as Figure 5 shown.
[0114] Figure 5 is a schematic diagram of a device for modeling and simulating analysis of a circuit diagram provided in this specification, including:
[0115] An acquisition module 501, configured to display a preset model library in a preset graphical interface, and acquire layout operation instructions executed by the user for different models included in the model library, where the models are used to represent electronic components required for constructing a circuit diagram and connection tools for connecting the electronic components;
[0116] A conversion module 502, configured to construct a target circuit diagram according to the layout operation instructions, and parse the target circuit diagram to obtain graph basic data corresponding to the target circuit diagram; each node in the graph basic data is used to represent each graph element included in the target circuit diagram, and the graph elements include: electronic components and connections between electronic components; each edge in the graph data is used to represent the connection relationship between two graph elements;
[0117] A determination module 503, configured to, when receiving a simulation analysis instruction for the target circuit diagram, determine port number representations corresponding to the respective electronic components included in the graph basic data according to the edges included in the graph basic data, where the port number representations are used to represent the connection relationship between the electronic components;
[0118] A simulation analysis module 504, configured to convert the graph basic data into netlist data required for interacting with a simulation analysis program according to the graph basic data and the port number representations, so that the simulation analysis software performs simulation analysis on the target circuit diagram based on the netlist data.
[0119] Optionally, the conversion module 502 is specifically configured to determine at least one selected model according to the layout operation instruction, and determine the definition data of the model, where the definition data is used to characterize the basic attribute data of the model and the connection mode of the model; and construct a target circuit diagram in a preset circuit diagram drawing canvas according to the definition data of the model.
[0120] Optionally, the conversion module 502 is specifically configured to parse the target circuit diagram to obtain circuit structure data for characterizing the target circuit diagram, where the circuit structure data includes: component entity representation data, line representation data, and connection point representation data; and convert according to the circuit structure data to obtain each node included in the target circuit diagram and the node features of each node, so as to obtain the graph basic data corresponding to the target circuit diagram.
[0121] Optionally, the determination module 503 is specifically configured to generate a task request when receiving a simulation analysis instruction for the target circuit diagram; when it is determined according to the task request that a simulation analysis needs to be performed on the target circuit diagram, send the task request to each processor in sequence according to the order among the processors included in a preset processing flow chain until the task request is sent to a target processor that matches the task request, so that the target processor determines the port number representation corresponding to each electronic component included in the graph basic data according to the edges included in the graph basic data; where different processors in the processing flow chain are used to execute different simulation analysis tasks in response to different task requests.
[0122] Optionally, the determination module 503 is specifically configured to select a first target node from each node of the graph basic data, where the first target node is used to characterize an electronic component; construct an instance object according to the node features of the first target node, and determine the connection points included in the instance object; assign port numbers to each connection point according to the order among the connection points; and determine the port number representation corresponding to each electronic component included in the graph basic data according to the port number of each connection point.
[0123] Optionally, the determining module 503 is specifically configured to linearly and recursively traverse each second target node in the graph basic data, and for each instance object, determine other instance objects connected to the instance object through the connection line represented by the second target node, and determine a connection point used when connecting to the other instance objects from each connection point of the instance object; reset the port number of the connection point of the instance object and the port number of the connection point of the other instance object to the same port number; wherein, the reset port number is used to represent that the instance object and the other instance object are connected to each other through the connection point corresponding to the reset port number; and determine the port number representation corresponding to each electronic component included in the graph basic data according to the reset port number.
[0124] Optionally, the determining module 503 is specifically configured to, when it is determined that there is an instance object of a specified type among the instance objects, adjust the port number of the instance object of the specified type to a specified value; and determine the port number representation corresponding to each electronic component included in the graph basic data according to the adjusted port number.
[0125] This specification also provides a computer-readable storage medium, which stores a computer program, and the computer program can be used to execute the above Figure 1 provided method for modeling and simulating analysis of a circuit diagram.
[0126] This specification also provides Figure 6 a schematic structural diagram of an electronic device corresponding to Figure 1 . As Figure 6 described above, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory. Of course, it may also include other hardware required for other services. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to implement the above Figure 1 described method for modeling and simulating analysis of a circuit diagram. Of course, in addition to the software implementation manner, this specification does not exclude other implementation manners, such as a logic device or a combination of software and hardware, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or a logic device.
[0127] For an improvement in a technology, it can be clearly distinguished whether it is a hardware improvement (e.g., improvement in circuit structures such as diodes, transistors, switches, etc.) or a software improvement (improvement in method processes). However, with the development of technology, many improvements in method processes today can be regarded as direct improvements in hardware circuit structures. Almost all designers obtain the corresponding hardware circuit structure by programming the improved method process into the hardware circuit. Therefore, it cannot be said that an improvement in a method process cannot be implemented with a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. The designer can program by himself to "integrate" a digital system on a piece of PLD, without having to ask a chip manufacturer to design and fabricate a dedicated integrated circuit chip. Moreover, nowadays, instead of manually fabricating integrated circuit chips, this programming is mostly implemented using "logic compiler" software, which is similar to the software compiler used in program development and writing. The original code before compilation also has to be written in a specific programming language, which is called a hardware description language (HDL), and there is not only one kind of HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. Currently, the most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also be aware that by simply performing a little logical programming on the method process with the above-mentioned several hardware description languages and programming it into the integrated circuit, it is easy to obtain the hardware circuit that implements the logical method process.
[0128] The controller can be implemented in any suitable manner. For example, the controller can take the form of, for example, a microprocessor or a processor and a computer-readable medium storing computer-readable program code (such as software or firmware) executable by the (micro)processor, logic gates, switches, an application specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of the controller include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in the form of pure computer-readable program code, it is entirely possible to logically program the method steps to enable the controller to implement the same functions in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as either software modules for implementing the method or structures within the hardware component.
[0129] The systems, devices, modules, or units illustrated in the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or any combination of these devices.
[0130] For the convenience of description, when describing the above devices, they are described separately as various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0131] Those skilled in the art should understand that the embodiments of this specification can be provided as a method, a system, or a computer program product. Therefore, this specification can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, this specification can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) containing computer-usable program code.
[0132] This specification is described with reference to the flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the specification. It should be understood that each flow and / or block in the flowchart and / or block diagram, and combinations of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that the instructions executed by the processor of the computer or other programmable data processing device generate means for implementing the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0133] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufacture including instruction means that implement the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0134] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0135] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory.
[0136] The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM), and / or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). The memory is an example of computer-readable media.
[0137] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0138] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity 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, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0139] It should be understood by those skilled in the art that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0140] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0141] The various embodiments in this specification are described in a progressive manner. For the parts that are the same or similar among the various embodiments, reference can be made to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and for the relevant parts, reference can be made to the partial description of the method embodiments.
[0142] The above is only the embodiments of this specification and is not intended to limit this specification. For those skilled in the art, various changes and modifications can be made to this specification. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of this specification shall be included within the scope of the claims of this specification.
Claims
1. A modeling and simulation analysis method for a circuit diagram, characterized in that: The method comprises: Displaying a preset model library in a preset graphical interface, and obtaining layout operation instructions executed by a user for different models contained in the model library, the models being used to represent electronic components required to construct a circuit diagram, and wiring tools for connecting the electronic components; According to the layout operation instruction, a target circuit diagram is constructed, and the target circuit diagram is parsed to obtain graph basic data corresponding to the target circuit diagram; each node in the graph basic data is used to represent each graph element included in the target circuit diagram, and the graph elements include: electronic components and connections between electronic components; each edge in the graph data is used to represent a connection relationship between two graph elements; Upon receiving a simulation analysis instruction for the target circuit diagram, determining, according to the edges contained in the basic graph data, port number representations corresponding to the electronic components contained in the basic graph data, wherein the port number representations are used to characterize connection relationships between the electronic components; According to the diagram basic data and the port number representation, the diagram basic data is converted into the netlist data required for interacting with the simulation analysis program, so that the simulation analysis software performs simulation analysis on the target circuit diagram based on the netlist data.
2. The method according to claim 1, characterized in that According to the layout operation instruction, constructing a target circuit diagram specifically includes: According to the layout operation instruction, at least one model selected by the user is determined, and definition data of the model is determined, where the definition data is used to characterize basic attribute data of the model and a connection mode of the model; According to the definition data of the model, a target circuit diagram is constructed in a preset circuit diagram drawing canvas.
3. The method according to claim 1, characterized in that The target circuit diagram is parsed to obtain basic diagram data corresponding to the target circuit diagram, specifically including: Parsing the target circuit diagram to obtain circuit structure data for characterizing the target circuit diagram, wherein the circuit structure data includes: component entity representation data, line representation data, and connection point representation data; According to the circuit structure data, each node contained in the target circuit diagram and the node characteristics of each node are converted to obtain the graph basic data corresponding to the target circuit diagram.
4. The method according to claim 1, characterized in that In the case of receiving a simulation analysis instruction for the target circuit diagram, determining, according to the edges contained in the basic data of the diagram, the port number representation corresponding to each electronic component contained in the basic data of the diagram, specifically includes: In case of receiving a simulation analysis instruction for the target circuit diagram, generating a task request; The task request is sent to each processor in sequence along the sequence of processors included in a preset processing flow chain until the task request is sent to a target processor that matches the task request, so that the target processor determines the port number representation corresponding to each electronic component included in the graph basic data according to the edges included in the graph basic data; wherein different processors in the processing flow chain are used to respond to different task requests and perform different simulation analysis tasks.
5. The method according to claim 1, characterized in that Determining, according to the edges included in the graph basic data, the port number representation corresponding to each electronic component included in the graph basic data, specifically includes: Selecting a first target node from each node of the graph basic data, wherein the first target node is used to represent an electronic component; According to the node characteristics of the first target node, an instance object is constructed, and the connection points included in the instance object are determined; According to the sequence between the connection points, a port number is assigned to each connection point; According to the port number of each joint point, the port number representation corresponding to each electronic component contained in the basic data of the graph is determined.
6. The method according to claim 5, characterized in that According to the port number of the joint point contained in each instance object, the port number representation corresponding to each electronic component contained in the graph basic data is determined, specifically including: Linearly recursively traverse each second target node in the graph basic data to determine, for each instance object, other instance objects connected to the instance object through the line represented by the second target node, and determine, from each connection point of the instance object, a connection point used when connecting with the other instance objects; Reset the port number of the connection point of the instance object and the port number of the connection point of the other instance object to the same port number; wherein the reset port number is used to indicate that the instance object and the other instance object are connected to each other through the connection point corresponding to the reset port number; According to the reset port number, the port number representation corresponding to each electronic component included in the graph basic data is determined.
7. The method according to claim 6, characterized in that Determining the port number representation corresponding to each electronic component included in the graph basic data according to the reset port number specifically includes: When it is determined that there is an instance object of a specified type among the instance objects, adjusting the port number of the instance object of the specified type to a specified value; According to the adjusted port number, the port number representation corresponding to each electronic component included in the graph basic data is determined.
8. A circuit diagram modeling simulation analysis device, characterized in that: include: An acquisition module, used to display a preset model library in a preset graphical interface, and to acquire layout operation instructions executed by a user for different models contained in the model library, the models being used to represent electronic components required for constructing a circuit diagram, and wiring tools for connecting the electronic components; A conversion module, used to construct a target circuit diagram according to the layout operation instruction, and parse the target circuit diagram to obtain basic diagram data corresponding to the target circuit diagram; Each node in the graph basic data is used to represent each graph element included in the target circuit diagram, and the graph elements include: electronic components and connections between electronic components; each edge in the graph data is used to represent a connection relationship between two graph elements; A determination module, configured to determine, upon receiving a simulation analysis instruction for the target circuit diagram, a port number representation corresponding to each electronic component contained in the graph basic data according to the edges contained in the graph basic data, wherein the port number representation is used to characterize a connection relationship between the electronic components; The simulation analysis module is used to convert the basic diagram data into the netlist data required for interacting with the simulation analysis program according to the basic diagram data and the port number representation, so that the simulation analysis software can perform simulation analysis on the target circuit diagram based on the netlist data.
9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of claims 1 to 7 is implemented.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Information pushing method and device, storage medium and electronic equipment
CN118365177A
Method for intelligently identifying power failure range of distribution network maintenance single line diagram based on OCS system
CN119360084A