CN114943197B - Simulation method and device of circuit control logic and electronic equipment - Google Patents

Simulation method and device of circuit control logic and electronic equipment Download PDF

Info

Publication number
CN114943197B
CN114943197B CN202210874061.5A CN202210874061A CN114943197B CN 114943197 B CN114943197 B CN 114943197B CN 202210874061 A CN202210874061 A CN 202210874061A CN 114943197 B CN114943197 B CN 114943197B
Authority
CN
China
Prior art keywords
potential
pin
potential object
circuit diagram
simulation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210874061.5A
Other languages
Chinese (zh)
Other versions
CN114943197A (en
Inventor
不公告发明人
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qingdao Zhongke Fangde Software Co ltd
Original Assignee
Qingdao Zhongke Fangde Software Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Qingdao Zhongke Fangde Software Co ltd filed Critical Qingdao Zhongke Fangde Software Co ltd
Priority to CN202210874061.5A priority Critical patent/CN114943197B/en
Publication of CN114943197A publication Critical patent/CN114943197A/en
Application granted granted Critical
Publication of CN114943197B publication Critical patent/CN114943197B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/30Circuit design
    • G06F30/32Circuit design at the digital level
    • G06F30/327Logic synthesis; Behaviour synthesis, e.g. mapping logic, HDL to netlist, high-level language to RTL or netlist
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/30Circuit design
    • G06F30/32Circuit design at the digital level
    • G06F30/33Design verification, e.g. functional simulation or model checking
    • G06F30/3308Design verification, e.g. functional simulation or model checking using simulation

Abstract

The application discloses a simulation method, a simulation device and an electronic device of circuit control logic, which respond to the received simulation starting operation aiming at a circuit diagram, by creating a potential object containing a wire connection pin for each wire in the circuit diagram, and holding in the potential object a pin having the same potential as it and the pin being connected to the same circuit element, whereby the association between the wires is established in the circuit diagram by the potential objects created for each wire, further, after the control operation is performed on the switching element according to the simulation control rule, the potential object to which the pin of the switching element on which the control operation is performed belongs and the associated potential object can be obtained and the voltage setting is performed on the pin of the potential object, therefore, the simulation content corresponding to the switch element is obtained, and the simulation content corresponding to the switch element is output on the circuit diagram.

Description

Simulation method and device of circuit control logic and electronic equipment
Technical Field
The present disclosure relates to the field of electrical simulation technologies, and in particular, to a method and an apparatus for simulating circuit control logic, and an electronic device.
Background
With the rapid development of current electronic technology, the electrical design of large-scale equipment in various industries is more complicated. Current circuit simulation schemes typically simulate from the standpoint of electrical characteristics. For example, electrical parameters are obtained by building a three-dimensional model, and so on.
Therefore, a technical solution capable of simulating the circuit control logic is needed.
Disclosure of Invention
In view of this, the present application provides a method and an apparatus for simulating a circuit control logic, and an electronic device, so as to solve the technical problem that the prior art cannot simulate the circuit control logic. The following were used:
the application provides a simulation method of circuit control logic, which is characterized in that the simulation method is suitable for a circuit diagram of a circuit to be simulated, the circuit diagram comprises a plurality of circuit elements, the circuit elements are connected through wires, and the wires are connected with the circuit elements through pins; the method comprises the following steps:
receiving a simulated launch operation for the circuit diagram;
in response to the simulation starting operation, creating a corresponding potential object set of the circuit diagram in an initial state; the potential object set comprises a plurality of potential objects, each potential object corresponds to one wire in the circuit diagram, the potential objects comprise pins connected with the corresponding wires and an associated object list, the associated object list is used for storing potential objects having an association relationship with the potential object to which the potential objects belong, and the association relationship is as follows: the two potential objects comprise pins connected to the same circuit element, and the potentials of the pins are the same; the initial state is as follows: the switch elements in the circuit diagram are all in a closed state;
according to a preset simulation control rule, executing control operation on a switch element in the circuit diagram; the control operation is for closing the switching element or opening the switching element;
obtaining a first potential object to which a pin of the switching element on which a control operation is performed belongs and a second potential object in an associated object list of the first potential object;
voltage setting is carried out on a pin belonging to the first potential object and a pin belonging to the second potential object, so that simulation contents corresponding to the switching elements which are respectively subjected to control operation are obtained;
and outputting the simulation content on the circuit diagram, wherein the simulation content at least comprises the voltage of a pin contained in the circuit diagram after the control operation of the switching element is executed.
The above method, preferably, the circuit diagram corresponds to a potential object list for holding potential objects to which pins of the switching elements on which the control operation is performed belong and potential objects in an associated object list of the potential objects;
wherein after performing a control operation on a switching element in the circuit diagram according to a preset simulation control rule, the method further comprises:
adding a first potential object to which a pin of the switching element to which a control operation is performed belongs and a second potential object in an associated object list of the first potential object to the potential object list;
wherein the obtaining of the first potential object to which the pin of the switching element on which the control operation is performed belongs and the second potential object in the associated object list of the first potential object includes:
extracting, in the potential object list, a first potential object to which a pin of the switching element to which a control operation is performed belongs and a second potential object in an associated object list of the first potential object;
wherein after the voltage setting of the pin belonging to the first potential object and the pin belonging to the second potential object, the method further comprises:
deleting the first potential object and the second potential object in the potential object list.
The above method, preferably, the voltage setting of the pin belonging to the first electric potential object and the pin belonging to the second electric potential object includes:
respectively taking each first potential object as a target potential object, and executing the following process:
obtaining a power pin list of the target potential object, wherein the power pin list is used for storing pins connected to a power supply in the target potential object;
judging whether a power supply pin list of the target potential object is empty or not;
if the power pin list of the target potential object is not empty, obtaining the voltage of the power pin in the power pin list of the target potential object, obtaining the associated potential object in the associated object list of the target potential object, respectively taking each associated potential object as the target potential object, and returning to execute the steps of: obtaining a power supply pin list of the target potential object until the voltages of the power supply pins in the power supply pin list of the associated potential object in the associated object list of the target potential object are all obtained;
if the power pin list of the target potential object is empty, obtaining the associated potential objects in the associated object list of the target potential object, respectively taking each associated potential object as the target potential object, and returning to execute the following steps: obtaining a power supply pin list of the target potential object until the voltage of the power supply pin in the power supply pin list of each associated potential object in the associated object list of the target potential object is obtained;
setting pin voltages of respective pins of the target potential object according to the obtained voltage of the power supply pin;
obtaining the associated potential objects in the associated object list of the target potential objects, respectively taking each associated potential object list as the target potential object, and returning to execute the following steps: and according to the obtained voltage of the power supply pin, setting the pin voltage of each pin of the target potential object until the pin voltage of each pin of the associated potential object in the associated object list of the target potential object is set.
The method, preferably, if the power supply pin voltage is not obtained, further comprises:
setting pin voltage of each pin of the target potential object to be a first set value;
obtaining the associated potential objects in the associated object list of the target potential objects, respectively taking each associated potential object as a target potential object, and returning to execute the following steps: setting the pin voltage of the target potential object to be a first set value until the pin voltage of each pin of each associated potential object in the associated object list of the target potential object is set to be completed.
The above method, preferably, further comprises:
if a plurality of voltage values exist in the obtained voltage of the power pin, ending the current simulation process and outputting prompt information, wherein the prompt information is at least used for prompting that the circuit diagram is abnormal and prompting the position information of the power pin.
In the above method, preferably, before the voltage setting is performed on the pin of the first potential object and the pin of the second potential object, the method further includes:
updating the associated object list of the first potential object and the associated object list of the second potential object.
The above method, preferably, the creating of the corresponding set of potential objects of the circuit diagram in the initial state includes:
creating a memory database, wherein element information of circuit elements in the circuit diagram is stored in the memory database;
obtaining wire information of wires contained in the circuit diagram according to the element information, wherein the wire information contains pin information at the tail end of the wire;
traversing all wires contained in the circuit diagram and pins connected with the wires;
respectively creating a corresponding potential object for each wire when the circuit in the circuit diagram is in an initial state, wherein the potential object corresponding to the wire comprises a pin connected with the wire;
adding an associated object list for each potential object according to the pin potential contained by each potential object, wherein the pins of the potential objects contained in the associated object list and the pins of the potential objects belonging to the associated object list are connected to the same circuit element and have the same potential; the potential objects corresponding to all the wires form a potential object set corresponding to the circuit diagram;
and saving the potential object set to the memory database.
The above method, preferably, further comprises:
monitoring whether a simulation end operation for the circuit diagram is received;
if the simulation ending operation aiming at the circuit diagram is received, saving the simulation content corresponding to the switch element which is executed with the control operation and ending the current simulation flow.
The application also provides a simulation device of the circuit control logic, which is suitable for a circuit diagram of a circuit to be simulated, wherein the circuit diagram comprises a plurality of circuit elements, the circuit elements are connected through wires, and the wires are connected with the circuit elements through pins; the device comprises:
an operation receiving unit for receiving a simulation start operation for the circuit diagram;
a set creating unit for creating a set of potential objects corresponding to the circuit diagram in an initial state in response to the simulation starting operation; the potential object set comprises a plurality of potential objects, each potential object corresponds to one wire in the circuit diagram, the potential objects comprise pins connected with the corresponding wires and an associated object list, the associated object list is used for storing potential objects having an association relationship with the potential object to which the potential objects belong, and the association relationship is as follows: the two potential objects comprise pins connected to the same circuit element, and the potentials of the pins are the same; the initial state is as follows: the switch elements in the circuit diagram are all in a closed state;
the switch control unit is used for executing control operation on the switch elements in the circuit diagram according to a preset simulation control rule; the control operation is for closing the switching element or opening the switching element;
an object obtaining unit configured to obtain a first potential object to which a pin of the switching element on which a control operation is performed belongs and a second potential object in an associated object list of the first potential object;
a voltage setting unit for performing voltage setting on a pin belonging to the first potential object and a pin belonging to the second potential object to obtain simulation contents corresponding to the switching elements on which control operations are respectively performed;
and the simulation output unit is used for outputting the simulation content on the circuit diagram, and the simulation content at least comprises the voltage of a pin contained in the circuit diagram after the switching element is controlled to operate.
The present application further provides an electronic device, including:
a display for outputting the circuit diagram; the circuit diagram comprises a plurality of circuit elements, the circuit elements are connected through wires, and the wires are connected with the circuit elements through pins;
a processor to: receiving a simulation start operation for the circuit diagram; in response to the simulation starting operation, creating a corresponding potential object set of the circuit diagram in an initial state; the potential object set comprises a plurality of potential objects, each potential object corresponds to one wire in the circuit diagram, the potential objects comprise pins connected with the corresponding wires and an associated object list, the associated object list is used for storing potential objects having an association relationship with the potential objects to which the potential objects belong, and the association relationship is as follows: the two potential objects comprise pins connected to the same circuit element, and the potentials of the pins are the same; the initial state is as follows: the switch elements in the circuit diagram are all in a closed state; according to a preset simulation control rule, executing control operation on a switch element in the circuit diagram; the control operation is for closing the switching element or opening the switching element; obtaining a first potential object to which a pin of the switching element on which a control operation is performed belongs and a second potential object in an associated object list of the first potential object; voltage setting is carried out on pins belonging to the first potential object and pins belonging to the second potential object so as to obtain simulation contents corresponding to the switching elements which are respectively subjected to control operation; and outputting the simulation content on the circuit diagram, wherein the simulation content at least comprises the voltage of a pin contained in the circuit diagram after the control operation of the switching element is executed.
As can be seen from the above technical solutions, in the simulation method, apparatus and electronic device for circuit control logic disclosed in the present application, in response to a received simulation start operation for a circuit diagram, by creating a potential object including a wire connection pin for each wire in the circuit diagram, and storing a potential object having the same potential as the wire connection pin in the potential object, and connecting the pin to the same circuit element, thereby establishing an association relationship between the wires by the potential object created for each wire in the circuit diagram, and after performing a control operation on a switch element according to a simulation control rule, in the present application, a potential object to which the pin of the switch element on which the control operation is performed belongs and the associated potential object can be obtained and voltage setting is performed on the pin of the potential object, thereby obtaining a simulation content corresponding to the switch element, and then the simulation content corresponding to the switch element is output on the circuit diagram. It can be seen that, in the present application, corresponding simulation content can be obtained in the process of performing control operation on the switching elements in the circuit diagram according to the simulation control rule, thereby realizing simulation of the control logic of the circuit.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a flowchart of a simulation method of a circuit control logic according to an embodiment of the present disclosure;
FIG. 2 is a circuit diagram of a circuit to be simulated in the embodiment of the present application;
FIGS. 3-6 are diagrams illustrating simulation of circuit control logic according to embodiments of the present application;
fig. 7-9 are partial flow charts of a simulation method of circuit control logic according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of an emulation apparatus of a circuit control logic according to a second embodiment of the present application;
fig. 11 is a schematic structural diagram of an electronic device according to a third embodiment of the present application;
fig. 12-17 are diagrams illustrating circuit diagram simulations applicable to large devices according to the present application.
Among them, in fig. 3 to 6, 16 and 17:
the circuit breaker 1, the circuit breaker 2, the circuit breaker 3, the 110V power supply 4, the ground power supply 5, the relay 6, the relay 7, the wire 8, the 110V power supply pin 9, the pin 10, the wire 11, the pin 12, the pin 13, the pin 14, the wire 15, the pin 16, the pin 17, the wire 18, the pin 19, the pin 20, the wire 21, the pin 22, the pin 23, the ground power supply pin 24, the potential object a, the potential object b, the potential object c, the potential object d, and the potential object e.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, a flowchart of an implementation of a simulation method for circuit control logic according to an embodiment of the present application is provided, where the method may be applied to an electronic device, such as a computer or a server, capable of performing simulation control on a circuit diagram. The circuit diagram of the circuit to be simulated comprises a plurality of circuit elements, the circuit elements are connected through wires, and the wires are connected with the corresponding circuit elements through pins. The technical scheme in the embodiment is used for realizing simulation processing of the control logic of the circuit.
Specifically, the method in this embodiment may include the following steps:
step 101: a simulation boot operation for a circuit diagram of a circuit to be simulated is received.
In this embodiment, a simulation interface may be output for a user on the electronic device, an operation control for the circuit diagram is set in the simulation interface, and the user may operate the operation control, so that a simulation operation for the circuit diagram, such as a simulation start operation and a simulation end operation, is received on the electronic device. For example, as shown in fig. 2, a simulation interface is output on a display screen of the electronic device, a circuit diagram of a circuit to be simulated and contents such as a simulation start control, a simulation pause control, a simulation end control, and the like are displayed on the interface, and a user may perform a trigger operation on the simulation start control to instruct to start simulating the circuit diagram, so that a simulation start operation for the circuit diagram can be received on the electronic device.
Step 102: in response to a simulation initiation operation, a corresponding set of potential objects of the circuit diagram in an initial state is created.
Wherein, the initial state can be: all the switching elements in the circuit diagram are in a closed state. The circuit diagram includes a plurality of potential objects in a corresponding potential object set in an initial state. Each potential object corresponds to a respective one of the conductors in the circuit diagram. The potential objects comprise pins connected with corresponding wires and an associated object list, and the associated object list is used for storing the potential objects which have associated relations with the potential objects. The relationship here is: the two potential objects comprise pins connected to the same circuit element and the potentials of the pins are the same.
For example, as shown in fig. 3, a circuit diagram of a circuit to be simulated is shown, in which three switching elements, a circuit breaker 1, a circuit breaker 2, and a circuit breaker 3 are included; the device also comprises a 110V power supply 4, a grounding power supply 5, a relay 6 and a relay 7; the lead 8 is provided with a 110V power pin 9 and a pin 10, and the lead 8 is respectively connected with a 110V power supply 4 and the circuit breaker 1; the wire 11 is provided with a pin 12, a pin 13 and a pin 14, and the wire 11 is respectively connected with the circuit breaker 1, the circuit breaker 2 and the circuit breaker 3; the wire 15 is provided with a pin 16 and a pin 17, and the wire 15 is respectively connected with the circuit breaker 2 and the relay 6; the lead 18 is provided with a pin 19 and a pin 20, and the lead 18 is respectively connected with the circuit breaker 3 and the relay 7; the wire 21 has a pin 22, a pin 23 and a ground power pin 24, and the wire 21 is connected to the relay 6, the relay 7 and the ground power supply 5, respectively. In the initial state, all the switch elements in the circuit diagram are in the closed state, the potentials of the 110V power pin 9, pin 10, pin 12, pin 13, pin 14, pin 16, pin 19, pin 17, pin 20 are the same, and the potentials of the pin 22 and pin 23 and the ground power pin 24 are the same.
Based on this, the circuit diagram created in the present embodiment contains potential objects as shown in table 1 in the corresponding potential object set in the initial state:
TABLE 1 set of potential objects in the initial state
Conducting wire Electric potential object Associated object list
Conducting wire
8 Potential object a Potential object b
Wire
11 Potential object b Potential objects a, c, d
Conducting wire
15 Potential object c Potential object b
Conductor
18 Potential object d Potential object b
Wire 21 Potential object e Is free of
As shown in fig. 4, the potential object a and the potential object b respectively include a pin 10 and a pin 12 connected to the circuit breaker 1, and the pin 10 and the pin 12 have the same potential in the initial state, so the potential object a and the potential object b have an association relationship; the potential object b and the potential object c respectively comprise a pin 13 and a pin 16 which are connected to the circuit breaker 2, and the pin 13 and the pin 16 have the same potential in the initial state, so the potential object b and the potential object c have an associated relationship; the potential object b and the potential object d respectively include a pin 14 and a pin 19 connected to the circuit breaker 3, and the pin 14 and the pin 19 are the same in potential in the initial state, so the potential object b and the potential object d have an associated relationship. The potential object e comprises a pin 22, a pin 23 and a grounding power pin 24, taking the pin 22 as an example for explanation, although the potential object e and the potential object c respectively comprise a pin 17 and a pin 22 connected with the relay 6, the potentials of the pin 17 and the pin 22 are different in the initial state, so that the potential object e and the potential object c have no association relationship; similarly, it can be determined that the potential object e has no association with any other potential object.
For example, as shown in fig. 5, the potential object a, the potential object b, the potential object c, and the potential object d are potential objects with associated pins, and the potential object e is a potential object with an independent pin. Based on this, the 110V power supply pin 9, the pin 17, and the pin 20 may be understood as an external pin (out pin) corresponding to the potential object a, the potential object b, the potential object c, and the potential object d, the pin 10, the pin 12, the pin 13, the pin 14, the pin 16, and the pin 19 are all internal pins corresponding to the potential object a, the potential object b, the potential object c, and the potential object d, and the pin 22, the pin 23, and the ground power supply pin 24 may be understood as an external pin corresponding to the potential object e.
It should be noted that, in the initial state, in the simulation interface output on the display screen of the electronic device, each switch element in the circuit diagram is in a closed state by default, and at this time, all the wires are electrified and can be marked as green, so as to achieve the purpose of prompting the user.
Step 103: and according to a preset simulation control rule, performing control operation on the switching elements in the circuit diagram.
Wherein the control operation is for closing the switching element or for opening the switching element. The simulation control rule comprises: and (3) respectively carrying out closing or opening operation rules on each switching element in the circuit diagram. Specifically, the simulation control rule may include at least one operation rule, each operation rule corresponds to one switching element, and each control rule is used to indicate an operation of closing or opening the corresponding switching element. In addition, a sequence may be set between each control rule, for example, an opening operation of the circuit breaker 2 is performed first, then a closing operation of the circuit breaker 2 is performed, then an opening operation of the circuit breaker 3 is performed, and the like.
Therefore, in the embodiment, according to the simulation control rule, each switching element in the circuit diagram is sequentially turned on or turned off so as to simulate the turning on or turning off of the switching element in the actual operation process of the circuit.
Specifically, in the present embodiment, the operation of closing or opening the switching element may be implemented by configuring a computer program. Alternatively, in this embodiment, the user may manually turn on or off the switching elements in sequence according to the simulation control rule.
Step 104: a first potential object to which a pin of a switching element to which a control operation is performed belongs and a second potential object in an associated object list of the first potential object are obtained.
In this embodiment, the switching element on which the control operation is performed may be determined first, and then the pin of the switching element may be determined. The switching element usually connects at least two pins, whereby the first potential object to which these pins belong is at least two. Based on this, after at least two first potential objects to which the switching element pins belong are determined, the potential objects in the association object list of the first potential objects are determined as second potential objects, thereby obtaining at least two first potential objects and a second potential object having an association relation with each first potential object.
For example, in fig. 3, in an initial state, the circuit breaker 2 is opened, and the circuit breaker 2 has a pin 13 and a pin 16. As shown in fig. 6, the determination of the first potential object to which the pin of the circuit breaker 2 belongs may include: potential object b and potential object c. Further, according to the set of potential objects in table 1, the second potential object in the associated object list of the first potential object includes: potential object a, potential object c, and potential object d.
Step 105: and performing voltage setting on the pin belonging to the first potential object and the pin belonging to the second potential object to obtain simulation content corresponding to the switching element on which the control operation is performed.
The simulation content at least comprises the voltage of a pin contained in a circuit diagram after each switch element is respectively executed with control operation.
Specifically, in this embodiment, the voltages of the pins in the circuit diagram may be sequentially set based on the voltage of the power pin in the circuit diagram, so as to obtain the voltage value of each pin in the circuit diagram, which may have a potential change after the control operation is performed on the switching element, that is, the simulation content corresponding to the switching element on which the control operation is performed.
For example, taking fig. 6 as an example, the voltages of the potential object b, the potential object a, the potential object c and the potential object d are set in the present embodiment, so as to obtain the simulation content containing the pin voltage values, and the simulation content corresponds to the broken circuit breaker 2.
It should be noted that, after the switching elements are controlled, the associated object list of each potential object in the potential object set of the circuit diagram may be changed. And when the voltage setting is performed on the pins of the first potential object and the pins of the second potential object, the voltage setting is performed according to a new associated object list of each potential object.
Step 106: and outputting simulation contents corresponding to the switching elements on which the control operations are performed on the circuit diagram.
Specifically, in this embodiment, the voltage of the corresponding pin in the simulation content may be output at a position corresponding to each pin on the circuit diagram, so that a user can view the voltage state of each pin in the circuit diagram when the switching element is controlled.
It should be noted that, each time the switching element is controlled, steps 104 to 106 are executed until the simulation is finished.
As can be seen from the foregoing technical solutions, in a simulation method for circuit control logic provided in an embodiment of the present application, in response to a received simulation start operation for a circuit diagram, by creating a potential object containing a wire connection pin for each wire in the circuit diagram, and keeping a pin having the same potential as the potential object and a potential object of which the pin is connected to the same circuit element in the potential object, whereby the association between the wires is established in the circuit diagram by the potential objects created for each wire, further, after the control operation is performed on the switching element according to the simulation control rule, in the present embodiment, the potential object to which the pin of the switching element on which the control operation is performed belongs and the associated potential object can be obtained and the voltage setting can be performed on the pin of the potential object, therefore, the simulation content corresponding to the switch element is obtained, and the simulation content corresponding to the switch element is further output on the circuit diagram. It can be seen that, in the present application, corresponding simulation content can be obtained in the process of performing control operation on the switching elements in the circuit diagram according to the simulation control rule, thereby realizing simulation of the control logic of the circuit.
In one implementation, before step 105, in the present embodiment, the associated object list of the first potential object and the associated object list of the second potential object are first updated according to the connection state of each circuit element in the circuit diagram to obtain a new set of potential objects.
For example, taking fig. 6 as an example, after the pin voltages of the potential object b, the potential object c, the potential object a, and the potential object d are set in the present embodiment, the associated object list of each potential object in the circuit diagram is updated according to the set pin voltages, as shown in table 2 below.
Table 2 set of potential objects after the circuit breaker 2 is opened
Conducting wire Electric potential object Associated object list
Conducting wire
8 Potential object a Potential object b
Wire
11 Potential object b Potential objects a, d
Conductor
15 Potential object c Is free of
Conductor 18 Potential object d Potential object b
Wire 21 Potential object e Is free of
In one implementation, the circuit diagram corresponds to a potential object list for holding potential objects to which pins of the switching elements on which the control operation is performed belong and potential objects in an associated object list of the potential objects.
That is, every time the switching element is subjected to the control operation, i.e., after step 103, the second potential object in the list of the first potential object and the associated object of the first potential object to which the pin of the switching element subjected to the control operation belongs is added to the list of the potential objects in the present embodiment.
For example, taking fig. 6 as an example, after the circuit breaker 2 is opened, the potential object b, the potential object c, the potential object a, and the potential object d are added to the potential object list in the present embodiment, as shown in table 3 below:
table 3 list of potential objects
Switching element List of potential objects
Circuit breaker
2 Potential objects a, b, c and d
Based on this, at the time of acquiring the first potential object and the second potential object in step 104, the first potential object to which the pin of the switching element on which the control operation is performed belongs and the second potential object in the associated object list of the first potential object may be extracted in the potential object list.
For example, taking fig. 6 as an example, after the circuit breaker 2 is opened, the potential objects which may have potential changes and need to be subjected to potential updating are stored in the potential object list, and at this time, the potential objects a-d, that is, the first potential object and the corresponding second potential object corresponding to the circuit breaker 2 on which the opening operation is performed, are extracted from the potential object list in this embodiment.
Further, after step 105, that is, after voltage setting is performed on the pin belonging to the first potential object and the pin belonging to the second potential object, the first potential object and the second potential object are deleted in the potential object list in the present embodiment, that is, the potential object to which the pin subjected to overvoltage setting belongs is deleted to indicate that potential updating is completed.
In one implementation, when performing voltage setting on the pin belonging to the first potential object and the pin belonging to the second potential object in step 105, a power supply pin may be obtained for the potential object by traversing the associated pin, and then voltage setting may be performed on each pin by traversing the associated pin according to the pin voltage of the power supply pin. Specifically, the following process is executed with each first potential object as a target potential object, as shown in fig. 7:
step 701: a list of power pins of the target potential object is obtained.
Wherein the power pin list is used to hold pins connected to the power source in the target potential object. For example, taking fig. 6 as an example, after the circuit breaker 2 is opened, the pin voltages of the potential object a, the potential object b, the potential object c, and the potential object d need to be updated. At this time, the potential object b and the potential object c may be first taken as target potential objects, and all the power supply pin lists of the target potential objects may be started to be traversed. Taking the potential object b as a target potential object as an example, a power pin list of the potential object b is obtained, where the potential object b includes a pin 12, a pin 13, and a pin 14, but the power pin list is empty. Taking the potential object c as a target potential object as an example, pins of the potential object c are obtained, including the pin 16 and the pin 17, but the power pin list is empty.
Step 702: it is determined whether the power pin list of the target potential object is empty, i.e., whether the target potential object has a pin connected to the power supply, if so, step 703-step 704 are performed, and if not, step 704 is performed.
For example, taking fig. 6 as an example, the power pin list of the potential object b is empty, and the power pin list of the potential object c is empty.
The power source here includes a positive power source and a ground power source. Thus, the power pin may be a pin of a power supply having a voltage output greater than 0, or the power pin may be a pin of a ground power supply, such as the 110V power pin 9 or the ground power pin 24 shown in fig. 6.
Step 703: the voltage of the power supply pin in the power supply pin list of the target potential object is obtained.
Specifically, the voltage of the power pin in the power pin list is the voltage of the power pin connected to the target potential object. In this embodiment, the voltage of each power pin in the power pin list of the target potential object may be obtained through traversal.
Step 704: obtaining the associated potential objects in the associated object list of the target potential object, respectively taking each associated potential object as the target potential object, and returning to execute the step 701 until the voltage of the power supply pin in the power supply pin list of each associated potential object in the associated object list of the target potential object is obtained.
For example, taking fig. 6 as an example, the power pin list of the potential object b is empty, at this time, the potential objects in the associated object list of the potential object b, that is, the potential object a and the potential object d, are respectively target potential objects, the power pin list of the potential object a and the power pin list of the potential object d are obtained, and only there is a power pin in the power pin list of the potential object a, at this time, it may be determined that the potential object b corresponds to one power pin, and the pin voltage of the power pin is 110V.
As another example, taking fig. 6 as an example, the power pin list of the potential object c is empty, and the associated object list of the potential object c is already empty, and there is no associated potential object, that is, the power object c does not correspond to any power pin.
Step 705: it is determined whether the power pin voltage is obtained, and if the power pin voltage is obtained and the obtained power pin voltage has only one value, steps 706-707 are performed, and if the power pin voltage is not obtained, steps 708-709 are performed.
It should be noted that the voltage obtained in step 705 includes: the voltage of the power supply pin in the power supply pin list of the target potential object, and the voltage of the power supply pin in the power supply pin category of the associated potential object in the associated object list of the target potential object. Based on this, the voltage may not be obtained in step 705, that is, the respective power pin lists of the target potential object and the corresponding associated potential object are all empty; alternatively, step 705 may obtain a voltage, that is, only one power pin in the respective power pin lists of the target potential object and the corresponding associated potential object; alternatively, in step 705, a plurality of voltages may be obtained and only one value of these voltages is obtained, that is, a plurality of power pins are shared in the respective power pin lists of the target potential object and its corresponding associated potential object, and the voltages of these power pins are all consistent; alternatively, in step 705, a plurality of voltages may be obtained and may have a plurality of values, that is, a plurality of power pins are shared in the respective power pin lists of the target potential object and the associated potential object corresponding to the target potential object, and the voltages of the power pins are not consistent, which indicates that there is an abnormality in the circuit diagram, such as a short circuit in the circuit diagram.
If the power supply pin voltage is not obtained, the target potential object and the potential object with the correlation are represented to be in an open circuit state. If the obtained power supply pin voltage has only one value or the obtained power supply pin voltages have a plurality of values and all the voltages are consistent, it indicates that the target potential object and the potential object having the association relationship are in a normal circuit conducting state.
Step 706: according to the obtained power supply pin voltage, the pin voltage of each pin of the target potential object is set.
For example, taking fig. 6 as an example, after the voltage 110V to the power pin is obtained by taking the potential object b as a target potential object, the pin voltages of the pins of the potential object b, such as the internal pin and the external pin, are both set to be 110V.
Step 707: and obtaining the associated potential objects in the associated object list of the target potential objects, respectively taking each associated potential object as the target potential object, and returning to execute the step 706 until the pin voltage of each pin of each associated potential object in the associated object list of the target potential objects is completely set.
For example, taking fig. 6 as an example, after the pin voltages of the pin 12, the pin 13 and the pin 14 of the potential object b are set to 110V, the associated potential object of the potential object b has the potential object a, the pin voltages of the 110V power supply pin 9 and the pin 10 of the potential object a are both 110V, the associated potential object of the potential object b also has the potential object d, and based on this, the pin voltages of the pin 19 and the pin 20 of the reset potential object d are both 110V.
Step 708: the pin voltage of each pin of the target potential object is set to a first set value.
Specifically, in this embodiment, the first setting value may be a value different from the power pin voltage and the ground pin voltage. For example, the first set value may be set to-3, so that both the internal pin and the external pin of the target potential object are set to-3 to distinguish the voltage of the ground pin as 0.
For example, taking fig. 6 as an example, with the potential object c as a target potential object, the power supply pin voltage is not obtained, and the pin voltages of the pin 16 and the pin 17 of the potential object c are both-3 at this time.
Step 709: obtaining the associated potential objects in the associated object list of the target potential object, respectively taking each associated potential object as the target potential object, and returning to execute the step 708 until the pin voltage of each pin of each associated potential object in the associated object list of the target potential object is completely set.
For example, taking fig. 6 as an example, taking the potential object c as a target potential object, after the pin voltages of the pin 16 and the pin 17 of the potential object c are both-3, the associated object list of the potential object c is empty, that is, there is no associated potential object, and the setting is completed at this time.
In addition, based on the above implementation, in the process of traversing the power pins in the circuit diagram, if the obtained voltage for the target potential object has a plurality of voltage values, it indicates that there is a case where two power supplies with different voltages are directly connected through a wire in the circuit diagram, that is, there is a short circuit in the circuit diagram, at this time, the current simulation process may be ended, and prompt information is output, where the prompt information is at least used to prompt that the circuit diagram has an abnormality and to prompt position information of the power pins. For example, power pins respectively corresponding to a plurality of voltage values are highlighted on the circuit diagram to prompt the user.
In addition, in the process of traversing the pins in the circuit diagram, whether the short circuit exists in the circuit diagram is also detected, if the short circuit exists in the circuit diagram, the current simulation process can be ended, and second prompt information is output, wherein the second prompt information is at least used for prompting the position information of the loop where the short circuit exists. For example, the wires contained in the short circuit are highlighted on the circuit diagram to prompt the user.
In one implementation, when creating the corresponding set of potential objects of the circuit diagram in the initial state in step 102, this can be specifically implemented as follows, as shown in fig. 8:
step 801: and creating an in-memory database.
Wherein, the memory database stores the element information of the circuit elements in the circuit diagram. For example, the component information may include a component unique identification, a component name, device-related pin information, and the like. Specifically, the device may include basic information of the device, such as name, type, ID, etc., and may further include a default state of the device, a current state of the device, pin information, pin voltage, etc.
Step 802: wire information of wires included in the circuit diagram is obtained based on the element information.
The wire information comprises pin information at the tail end of the wire. Taking the circuit diagram shown in fig. 3 as an example, the wire information includes pin information of respective ends of a wire 8, a wire 11, a wire 15, a wire 18, and a wire 21, for example, a 110V power pin 9 and a pin 10 are respectively provided at the end of the wire 8, a pin 12, a pin 13, and a pin 14 are respectively provided at the end of the wire 11, a pin 16 and a pin 17 are respectively provided at the end of the wire 15, a pin 19 and a pin 20 are respectively provided at the end of the wire 18, and a pin 22, a pin 23, and a ground power pin 24 are respectively provided at the end of the wire 21.
Step 803: in the initial state of the circuit in the circuit diagram, a corresponding potential object is created for each wire individually.
Wherein, the potential object corresponding to the wire comprises a pin connected with the wire. Taking the circuit diagram shown in fig. 3 as an example, the potential object a corresponding to the wire 8 includes a 110V power pin 9 and a pin 10, the potential object b corresponding to the wire 11 includes a pin 12, a pin 13 and a pin 14, the potential object c corresponding to the wire 15 includes a pin 16 and a pin 17, the potential object d corresponding to the wire 18 includes a pin 19 and a pin 20, and the potential object e corresponding to the wire 21 includes a pin 22, a pin 23 and a ground power pin 24, as shown in fig. 4.
Step 804: and adding an associated object list for each potential object according to pin potential contained in each potential object.
Pins of the potential objects contained in the associated object list and pins of the potential objects belonging to the associated object list are connected to the same circuit element and have the same potential; and the potential objects corresponding to all the wires form a potential object set corresponding to the circuit diagram. Taking the circuit diagram shown in fig. 3 as an example, in the present embodiment, association object lists are added for the potential objects a to e, respectively, according to the association relationship between the potential objects, so as to obtain the potential object sets shown in table 1.
Step 805: and saving the potential object set to an in-memory database.
In one implementation, the method in this embodiment may further include the following steps, as shown in fig. 9:
step 107: it is monitored whether an end of simulation operation for the circuit diagram is received and if an end of simulation operation is received, step 108 is performed.
Taking fig. 2 as an example, the user may click on the simulation ending control to instruct ending of the simulation of the circuit diagram, so that the simulation ending operation for the circuit diagram can be received on the computer. In addition, the user can click the simulation pause control to indicate that the simulation of the circuit diagram is paused until the circuit diagram is continuously simulated after the click operation of the simulation resume control is received.
Step 108: and saving the simulation content corresponding to the switch element which is executed with the control operation and ending the current simulation flow.
There may be one or more switching elements on which the control operation is performed, and there may be one or more pieces of the saved simulation content.
It should be noted that, in this embodiment, step 107 may be executed before or after any step shown in fig. 1, if the simulation end operation is not received, the flow shown in fig. 1 is executed continuously, and if the simulation end operation is received, step 108 is executed to stop the simulation.
Referring to fig. 10, a schematic structural diagram of a simulation apparatus of a circuit control logic according to a second embodiment of the present application is provided, where the apparatus may be configured in an electronic device, such as a computer or a server, capable of performing simulation control on a circuit diagram. The circuit diagram of the circuit to be simulated comprises a plurality of circuit elements, the circuit elements are connected through wires, and the wires are connected with the circuit elements through pins. The technical scheme in the embodiment is used for realizing simulation processing of the control logic of the circuit.
Specifically, the apparatus in this embodiment may include the following units:
an operation receiving unit 1001 for receiving a simulation start operation for the circuit diagram;
a set creating unit 1002, configured to create a corresponding set of potential objects of the circuit diagram in an initial state in response to the simulation starting operation; the potential object set comprises a plurality of potential objects, each potential object corresponds to one wire in the circuit diagram, the potential objects comprise pins connected with the corresponding wires and an associated object list, the associated object list is used for storing potential objects having an association relationship with the potential object to which the potential objects belong, and the association relationship is as follows: the two potential objects comprise pins connected to the same circuit element, and the potentials of the pins are the same; the initial state is as follows: the switch elements in the circuit diagram are all in a closed state;
a switch control unit 1003, configured to perform a control operation on a switch element in the circuit diagram according to a preset simulation control rule; the control operation is for closing the switching element or opening the switching element;
an object obtaining unit 1004 for obtaining a first potential object to which a pin of the switching element on which a control operation is performed belongs and a second potential object in an associated object list of the first potential object;
a voltage setting unit 1005 for performing voltage setting on the pin belonging to the first potential object and the pin belonging to the second potential object to obtain simulation contents corresponding to the switching elements on which the control operation is performed, respectively;
a simulation output unit 1006, configured to output the simulation content on the circuit diagram, where the simulation content at least includes a voltage of a pin included in the circuit diagram after the switching element is controlled.
As can be seen from the above technical solutions, in the simulation apparatus of circuit control logic according to the second embodiment of the present application, in response to a received simulation start operation for a circuit diagram, by creating a potential object containing a wire connection pin for each wire in the circuit diagram, and holding in the potential object a pin having the same potential as it and the pin being connected to the same circuit element, whereby the association between the wires is established in the circuit diagram by the potential objects created for each wire, further, after the control operation is performed on the switching element according to the simulation control rule, in the present embodiment, the potential object to which the pin of the switching element on which the control operation is performed belongs and the associated potential object can be obtained and the voltage setting can be performed on the pin of the potential object, therefore, the simulation content corresponding to the switch element is obtained, and the simulation content corresponding to the switch element is output on the circuit diagram. It can be seen that, in the present application, corresponding simulation content can be obtained in the process of performing control operation on the switching elements in the circuit diagram according to the simulation control rule, thereby realizing simulation of the control logic of the circuit.
It should be noted that, for the specific implementation of each unit in the present embodiment, reference may be made to the corresponding content in the foregoing, and details are not described here.
Referring to fig. 11, a schematic structural diagram of an electronic device provided in the third embodiment of the present application is shown, where the electronic device may be a computer or a server. Specifically, the electronic device in this embodiment may include the following structure:
a display 1101 for outputting a circuit diagram; the circuit diagram comprises a plurality of circuit elements, the circuit elements are connected through wires, and the wires are connected with the circuit elements through pins;
a processor 1102 for: receiving a simulation start operation for the circuit diagram; in response to the simulation starting operation, creating a corresponding potential object set of the circuit diagram in an initial state; the potential object set comprises a plurality of potential objects, each potential object corresponds to one wire in the circuit diagram, the potential objects comprise pins connected with the corresponding wires and an associated object list, the associated object list is used for storing potential objects having an association relationship with the potential object to which the potential objects belong, and the association relationship is as follows: the two potential objects comprise pins connected to the same circuit element, and the potentials of the pins are the same; the initial state is as follows: the switch elements in the circuit diagram are all in a closed state; according to a preset simulation control rule, executing control operation on a switch element in the circuit diagram; the control operation is for closing the switching element or opening the switching element; obtaining a first potential object to which a pin of the switching element on which a control operation is performed belongs and a second potential object in an associated object list of the first potential object; voltage setting is carried out on pins belonging to the first potential object and pins belonging to the second potential object so as to obtain simulation contents corresponding to the switching elements which are respectively subjected to control operation; and outputting the simulation content on the circuit diagram, wherein the simulation content at least comprises the voltage of a pin contained in the circuit diagram after the control operation of the switching element is executed.
As can be seen from the foregoing technical solutions, in an electronic device provided in the third embodiment of the present application, in response to a received simulation start operation for a circuit diagram, by creating a potential object containing a wire connection pin for each wire in the circuit diagram, and holding in the potential object a pin having the same potential as it and the pin being connected to the same circuit element, whereby the association between the wires is established in the circuit diagram by the potential object created for each wire, further, after the control operation is performed on the switching element according to the simulation control rule, in the present embodiment, the potential object to which the pin of the switching element on which the control operation is performed belongs and the associated potential object can be obtained and the voltage setting can be performed on the pin of the potential object, therefore, the simulation content corresponding to the switch element is obtained, and the simulation content corresponding to the switch element is output on the circuit diagram. It can be seen that, in the present application, corresponding simulation content can be obtained in the process of performing control operation on the switching elements in the circuit diagram according to the simulation control rule, thereby realizing simulation of the control logic of the circuit.
It should be noted that, in the present embodiment, reference may be made to the corresponding contents in the foregoing for specific implementation of the processor 1102, and details are not described here.
Taking a circuit of a large-scale device as an example, in order to realize simulation of a control logic of the circuit of the large-scale device, the following simulation control scheme is provided in the application:
as shown in fig. 12, the overall operation process of the simulation in the present application is as follows:
step 1201, click the "start" button, namely the simulation start control in the foregoing, to start the simulation.
Step 1202, initializing simulation information, wherein a specific process of initialization is as shown in fig. 13.
Step 1203, checking whether the simulation is finished, namely whether the simulation finishing operation is received in the foregoing text, and if the simulation is not finished, executing step 1204; if the simulation is finished, go to step 1208.
Step 1204, acquiring a list of potential objects which need to be updated currently; when a software user manually operates the circuit diagram or operates the circuit diagram through an automatic control program, for example, a switch closing operation and a switch opening operation are performed, and the operated switch element is changed in corresponding potential, the changed potential is added to the potential object list to be updated.
Step 1205, check if the potential object list is empty. If not, i.e., size of list! =0, go to step 1206; if the current thread is empty, the current thread is blocked, and if the potential object list is updated, the current thread is returned to the step 1203 (i.e. the current thread is awakened).
Step 1206, removing a potential object from the potential object list and obtaining the removed potential object P, and updating the simulation information of the potential object P, such as setting the pin voltage of the potential object P; the size of the potential object list is reduced by 1.
Step 1207, again checks whether the simulation has ended. If the simulation is not finished, executing the step 1205 again, and continuing to process the potential object list; if the simulation is finished, go to step 1208.
Step 1208, stop the simulation. When the "stop" or "end" simulation button is clicked, that is, when the simulation end control in the foregoing is clicked, the simulation needs to be ended, but is not executed immediately, and the logic that loops to the next step 1203 and step 1207 judges that the branch of "yes" is executed, that is, the simulation is ended.
As shown in fig. 13, in order to implement the process of initializing the simulation information, the simulation data analysis program in this application implements the processing of initializing the simulation information, and mainly analyzes information for wires and pins, and mainly includes the following contents:
1, creating a memory database, and storing relevant information of equipment and the like in a circuit diagram, wherein the relevant information comprises equipment unique identification, equipment name, equipment relevant pin information and the like.
Analyzing all circuit diagrams, converting element data in all circuit diagrams into equipment data required in simulation, namely element simulation data information, and acquiring wire information of all circuit diagrams; the component simulation data information includes device basic information (device name, type, id (identification)), default state, current state, pin information, pin voltage, and the like; the wire information comprises pin information of the tail ends of the two ends of the wire.
3, traversing the wires, parsing the circuit diagram into different potential objects, and then merging all component pins connected by connecting wires of the same potential into potential objects associated with each other. The method specifically comprises the following steps: obtaining a wire, retrieving a wire set associated with a pin connected with the wire, traversing the associated pins of the two pins connected with the wire and the wire set associated with the pin, continuing to traverse the associated wires and the wires associated with the pins by the wire set, and so on, and performing recursive traversal until all the pins connected with the wires with the same potential are classified as potential objects associated with each other, so as to reduce the circuit complexity in simulation analysis.
And 4, all the leads are traversed, and the circuit analysis is completed. The circuit analysis results, i.e., the set of potential objects, are stored in an in-memory database.
As shown in fig. 14, is an implementation flow of updating the potential object of step 6 in fig. 12:
first, when the potential object is updated, the potential voltage value is obtained by the potential of the power supply pin by traversing the power supply pin. If the circuit is short-circuited or the voltage values are inconsistent in the process of acquiring the voltage, the circuit reports errors, a prompt is given on a software output field window, the specific position of an error-reporting pin is prompted, the simulation process is terminated, and the simulation state is kept.
Then, after the current potential object voltage is obtained, the related pins are traversed for updating and the related potential objects are traversed for updating, namely: the pins and associated potential objects under the potential object need to be voltage set, recursively in turn, until all potential object processing is complete.
It should be noted that, after the simulation of the circuit diagram is started, if the simulation content is selected to be recorded in advance, for example, if a button of "start recording" is clicked, the process of simulation recording needs to be entered, and in the process of updating the potential object, when the voltage is updated, the simulation content including the voltage of each pin and the like is recorded in the memory. And after the simulation is finished or a 'stop recording' button is clicked, popping up a prompt box for storing the database file, and storing all contents recorded in the simulation process into one database file. Through the simulation recording tool, simulation content can be displayed.
As shown in fig. 15, the specific analytic process of potential update shown in fig. 14 is implemented by a setelecric function, specifically as follows:
first, a pin voltage of a potential object is acquired.
Second, the power pin class of the potential object is traversed to obtain the maximum voltage therein. The method comprises the following specific steps: and acquiring all power pins, traversing the voltage value of each power pin, taking the maximum value, and if two effective voltages exist simultaneously and the voltages are inconsistent, indicating that the short circuit is in error.
After that, after the power supply voltage is acquired, the voltage of the associated pin and the voltage of the pin of the associated potential object start to be updated. The method comprises the following specific steps: updating pin voltage of the potential object, wherein if the pin is a voltage pin, an error is reported and updating is not carried out, and if the pin is not a power supply pin, the pin voltage is updated and a voltage change signal is output; in addition, the setting of the pin voltage of the associated potential object of the potential object can be realized by specifically continuing to call the setelecric function.
That is, in the present embodiment, the power supply voltage of the potential object is acquired, and then the pin voltage of the associated potential object and the pin voltage of the associated pin are updated in a recursive manner until the recursion is ended.
With reference to the above implementation flows, taking the circuit diagram shown in fig. 2 as an example, the simulation process is illustrated:
1. fig. 2 shows a complete circuit diagram including power supply, conductors, circuit breakers, relays and ground.
2. Upon clicking the "start" simulation button, the circuit simulation begins. At the start of the circuit simulation, the switch defaults to a closed state, as shown in FIG. 3. Wherein the live wire can be marked green to remind the user. After that, the whole circuit diagram is resolved into 5 potential objects, which are potential object a, potential object b, potential object c, potential object d, and potential object e, respectively, as shown in fig. 4.
Based on fig. 4, potentiometric object analysis:
1) the circuit diagram is divided into 5 potential objects according to the connection condition of the wires.
2) The pins of the potential objects a, b, c and d have the same potential, the other pins are internal pins except for the pin 9, the pin 17 and the pin 20, and the four potential objects are associated with each other according to the direct connection condition, as shown in fig. 5.
3) The potential object e is independent and has no other related potential objects;
3. after the simulation is started, the circuit diagram can be operated. By double-striking the circuit breaker 2 in the circuit diagram, the circuit breaker 2 switch is opened, and the circuit diagram is shown in fig. 6:
1) the circuit breaker 2 is in an open state, and the potential object b of the pin 13 and the potential object c of the pin 16 connected with the circuit breaker 2 need to be updated.
2) The potential object c is the same as the potential object e and has no related potential object;
3) only the potential objects a and d are associated with the potential object b; the pin 13 of the circuit breaker 2 changes from the inner pin to the outer pin.
4. Again by double-striking the circuit breaker 2 in the circuit diagram, the circuit breaker 2 switch is closed. The set of potential objects is shown in table 1.
5. By double-striking the circuit breaker 1 in the circuit diagram, the circuit breaker 1 switch is opened. The circuit diagram is shown in fig. 16:
1) when the circuit breaker 1 is in an open state, the potential object a where the pin 10 connected with the circuit breaker 1 is located and the potential object b where the pin 12 is located need to be updated.
2) Potential object a is not associated with a potential object;
3) the associated objects of the potential object b are changed from a, c, d to c, d as shown in table 4 below.
Table 4 set of potential objects after the circuit breaker 1 is opened
Conducting wire Electric potential object Associated object list
Conducting wire
8 Potential object a Is free of
Wire 11 Potential object b Potential objects c, d
Conductor
15 Potential object c Potential object b
Conductor
18 Potential object d Potential object b
Wire 21 Potential object e Is free of
6. Again by means of the circuit breaker 1 in the double-click circuit diagram, the circuit breaker 1 switch is closed. The set of potential objects is shown in table 1.
7. Again by double-striking the circuit breaker 2 in the circuit diagram, the circuit breaker 2 switch is opened. The set of potential objects is shown in table 2.
8. Then, through the circuit breaker 1 in the double-click circuit diagram, the circuit breaker 1 and the circuit breaker 2 are both in a switch off state. The circuit diagram is shown in fig. 17:
1) the circuit breaker 1 is in an open state, and a potential object a where a pin 10 and a potential object b where a pin 12 connected with the circuit breaker 1 are located need to be updated.
2) Potential objects a are unrelated potential objects;
3) the related object of the potential object b is changed from a and d to d;
4) the other potential objects varied accordingly as shown in table 5 below.
Table 5 set of potential objects after circuit breaker 1 and circuit breaker 2 are opened
Conducting wire Electric potential object Associated object list
Conducting wire
8 Potential object a Is composed of
Wire 11 Potential object b Potential object d
Conductor
15 Potential object c Is free of
Conductor 18 Electric potential pairElephant d Potential object b
Wire 21 Potential object e Is free of
4. And (5) ending the simulation: the simulation process can be finished by clicking the stop simulation button, and the circuit diagram is displayed as before the simulation.
The following whole vehicle circuit diagram of simulation scale is taken as an example, and the simulation performance test results are shown in table 6.
Number of circuit diagrams of the whole vehicle: 4829 number of components: 35765, stitch number: 116224, number of leads: 47124, number of potentials: 18358, simulation time: in milliseconds. As shown in Table 6, each row of results contains the simulation start time and the simulation duration of the simulated circuit diagram:
TABLE 6 simulation Performance test results
Simulation start time Simulation duration ms
2022-6-17 15:50:25.324 2.807000
2022-6-17 15:50:32.399 0.310000
2022-6-17 15:50:39.143 0.473000
2022-6-17 15:50:48.387 5.569000
2022-6-17 15:50:59.419 2.113000
2022-6-17 15:51:08.276 1.330000
2022-6-17 15:51:17.691 2.368000
2022-6-17 15:51:22.702 0.430000
2022-6-17 15:51:37.239 1.344000
2022-6-17 15:51:47.878 0.363000
2022-6-17 15:52:01.595 1.939000
2022-6-17 15:52:15.766 1.922000
2022-6-17 15:52:22.329 6.986000
2022-6-17 15:52:31.715 2.100000
2022-6-17 15:52:39.987 1.337000
2022-6-17 15:52:49.755 1.425000
2022-6-17 15:53:00.009 2.308000
2022-6-17 15:53:05.896 1.807000
2022-6-17 15:53:19.244 1.392000
2022-6-17 15:53:30.163 1.391000
In summary, the electrical characteristics of the components other than the control logic are omitted in the present application. By neglecting the unconscious electrical characteristics, the control logic calculation method is optimized, so that the efficiency of large-scale circuit simulation of the whole vehicle is improved, and the simulation real-time performance is guaranteed.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative components and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the components and steps of the various examples have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A simulation method of circuit control logic is characterized in that the simulation method is suitable for a circuit diagram of a circuit to be simulated, the circuit diagram comprises a plurality of circuit elements, the circuit elements are connected through wires, and the wires are connected with the circuit elements through pins; the method comprises the following steps:
receiving a simulated launch operation for the circuit diagram;
in response to the simulation starting operation, creating a corresponding potential object set of the circuit diagram in an initial state; the potential object set comprises a plurality of potential objects, each potential object corresponds to one wire in the circuit diagram, the potential objects comprise pins connected with the corresponding wires and an associated object list, the associated object list is used for storing potential objects having an association relationship with the potential object to which the potential objects belong, and the association relationship is as follows: the two potential objects comprise pins connected to the same circuit element, and the potentials of the pins are the same; the initial state is as follows: the switch elements in the circuit diagram are all in a closed state;
according to a preset simulation control rule, executing control operation on a switch element in the circuit diagram; the control operation is for closing the switching element or opening the switching element;
obtaining a first potential object to which a pin of the switching element on which a control operation is performed belongs and a second potential object in an associated object list of the first potential object;
voltage setting is carried out on pins belonging to the first potential object and pins belonging to the second potential object so as to obtain simulation contents corresponding to the switching elements which are respectively subjected to control operation;
and outputting the simulation content on the circuit diagram, wherein the simulation content at least comprises the voltage of a pin contained in the circuit diagram after the control operation of the switching element is executed.
2. The method according to claim 1, wherein the circuit diagram corresponds to a potential object list for holding potential objects to which pins of switching elements on which the control operation is performed belong and potential objects in an associated object list of the potential objects;
wherein after performing a control operation on the switching elements in the circuit diagram according to a preset simulation control rule, the method further comprises:
adding a first potential object to which a pin of the switching element to which a control operation is performed belongs and a second potential object in an associated object list of the first potential object to the potential object list;
wherein the obtaining of the first potential object to which the pin of the switching element on which the control operation is performed belongs and the second potential object in the associated object list of the first potential object includes:
extracting, in the potential object list, a first potential object to which a pin of the switching element to which a control operation is performed belongs and a second potential object in an associated object list of the first potential object;
wherein after the voltage setting of the pin belonging to the first potential object and the pin belonging to the second potential object, the method further comprises:
deleting the first potential object and the second potential object in the potential object list.
3. The method according to claim 1 or 2, wherein the voltage setting of the pin belonging to the first electric potential object and the pin belonging to the second electric potential object comprises:
respectively taking each first electric potential object as a target electric potential object, and executing the following process:
obtaining a power pin list of the target potential object, wherein the power pin list is used for storing pins connected to a power supply in the target potential object;
judging whether a power supply pin list of the target potential object is empty or not;
if the power pin list of the target potential object is not empty, obtaining the voltage of the power pin in the power pin list of the target potential object, obtaining the associated potential object in the associated object list of the target potential object, respectively taking each associated potential object as the target potential object, and returning to execute the steps of: obtaining a power supply pin list of the target potential object until the voltages of the power supply pins in the power supply pin list of the associated potential object in the associated object list of the target potential object are all obtained;
if the power pin list of the target potential object is empty, obtaining the associated potential objects in the associated object list of the target potential object, respectively taking each associated potential object as the target potential object, and returning to execute the following steps: obtaining a power supply pin list of the target potential object until the voltage of the power supply pin in the power supply pin list of each associated potential object in the associated object list of the target potential object is obtained;
setting pin voltages of the pins of the target potential object according to the obtained voltage of the power supply pin;
obtaining the associated potential objects in the associated object list of the target potential objects, respectively taking each associated potential object list as the target potential object, and returning to execute the following steps: and according to the obtained voltage of the power supply pin, setting the pin voltage of each pin of the target potential object until the pin voltage of each pin of the associated potential object in the associated object list of the target potential object is set.
4. The method of claim 3, wherein if the power supply pin voltage is not obtained, the method further comprises:
setting pin voltage of each pin of the target potential object to be a first set value;
obtaining the associated potential objects in the associated object list of the target potential objects, respectively taking each associated potential object as a target potential object, and returning to execute the steps of: setting the pin voltage of the target potential object to be a first set value until the pin voltage of each pin of each associated potential object in the associated object list of the target potential object is set to be completed.
5. The method of claim 3, further comprising:
if a plurality of voltage values exist in the obtained voltage of the power supply pin, ending the current simulation process and outputting prompt information, wherein the prompt information is at least used for prompting that the circuit diagram is abnormal and prompting the position information of the power supply pin.
6. The method according to claim 1 or 2, characterized in that before the voltage setting of the pin belonging to the first potential object and the pin belonging to the second potential object, the method further comprises:
updating the associated object list of the first potential object and the associated object list of the second potential object.
7. The method of claim 1 or 2, wherein the creating of the corresponding set of potential objects of the circuit diagram in the initial state comprises:
creating a memory database, wherein element information of circuit elements in the circuit diagram is stored in the memory database;
obtaining wire information of wires contained in the circuit diagram according to the element information, wherein the wire information contains pin information at the tail end of the wire;
traversing all wires contained in the circuit diagram and pins connected with the wires;
respectively creating a corresponding potential object for each wire when the circuit in the circuit diagram is in an initial state, wherein the potential object corresponding to the wire comprises a pin connected with the wire;
adding a related object list for each potential object according to the potential of a pin contained in each potential object, wherein the pin in the potential object contained in the related object list and the pin of the potential object belonging to the pin are connected to the same circuit element and have the same potential; the potential objects corresponding to all the wires form a potential object set corresponding to the circuit diagram;
and saving the potential object set to the memory database.
8. The method according to claim 1 or 2, characterized in that the method further comprises:
monitoring whether a simulation end operation for the circuit diagram is received;
if the simulation ending operation aiming at the circuit diagram is received, saving the simulation content corresponding to the switch element which is executed with the control operation and ending the current simulation flow.
9. The simulation device of the circuit control logic is characterized by being suitable for a circuit diagram of a circuit to be simulated, wherein the circuit diagram comprises a plurality of circuit elements, the circuit elements are connected through wires, and the wires are connected with the circuit elements through pins; the device comprises:
an operation receiving unit for receiving a simulation start operation for the circuit diagram;
a set creating unit for creating a set of potential objects corresponding to the circuit diagram in an initial state in response to the simulation start operation; the potential object set comprises a plurality of potential objects, each potential object corresponds to one wire in the circuit diagram, the potential objects comprise pins connected with the corresponding wires and an associated object list, the associated object list is used for storing potential objects having an association relationship with the potential object to which the potential objects belong, and the association relationship is as follows: the two potential objects comprise pins connected to the same circuit element, and the potentials of the pins are the same; the initial state is as follows: the switch elements in the circuit diagram are all in a closed state;
the switch control unit is used for executing control operation on the switch elements in the circuit diagram according to a preset simulation control rule; the control operation is for closing the switching element or opening the switching element;
an object obtaining unit configured to obtain a first potential object to which a pin of the switching element on which a control operation is performed belongs and a second potential object in an associated object list of the first potential object;
a voltage setting unit for performing voltage setting on a pin belonging to the first potential object and a pin belonging to the second potential object to obtain simulation contents corresponding to the switching elements on which control operations are respectively performed;
and the simulation output unit is used for outputting the simulation content on the circuit diagram, and the simulation content at least comprises the voltage of a pin contained in the circuit diagram after the switching element is controlled to operate.
10. An electronic device, comprising:
a display for outputting the circuit diagram; the circuit diagram comprises a plurality of circuit elements, the circuit elements are connected through wires, and the wires are connected with the circuit elements through pins;
a processor to: receiving a simulated launch operation for the circuit diagram; in response to the simulation starting operation, creating a corresponding potential object set of the circuit diagram in an initial state; the potential object set comprises a plurality of potential objects, each potential object corresponds to one wire in the circuit diagram, the potential objects comprise pins connected with the corresponding wires and an associated object list, the associated object list is used for storing potential objects having an association relationship with the potential object to which the potential objects belong, and the association relationship is as follows: the two potential objects comprise pins connected to the same circuit element, and the potentials of the pins are the same; the initial state is as follows: the switch elements in the circuit diagram are all in a closed state; according to a preset simulation control rule, executing control operation on a switch element in the circuit diagram; the control operation is to close the switching element or to open the switching element; obtaining a first potential object to which a pin of the switching element on which a control operation is performed belongs and a second potential object in an associated object list of the first potential object; voltage setting is carried out on pins belonging to the first potential object and pins belonging to the second potential object so as to obtain simulation contents corresponding to the switching elements which are respectively subjected to control operation; and outputting the simulation content on the circuit diagram, wherein the simulation content at least comprises the voltage of a pin contained in the circuit diagram after the control operation of the switching element is executed.
CN202210874061.5A 2022-07-25 2022-07-25 Simulation method and device of circuit control logic and electronic equipment Active CN114943197B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210874061.5A CN114943197B (en) 2022-07-25 2022-07-25 Simulation method and device of circuit control logic and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210874061.5A CN114943197B (en) 2022-07-25 2022-07-25 Simulation method and device of circuit control logic and electronic equipment

Publications (2)

Publication Number Publication Date
CN114943197A CN114943197A (en) 2022-08-26
CN114943197B true CN114943197B (en) 2022-09-23

Family

ID=82911085

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210874061.5A Active CN114943197B (en) 2022-07-25 2022-07-25 Simulation method and device of circuit control logic and electronic equipment

Country Status (1)

Country Link
CN (1) CN114943197B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013075909A1 (en) * 2011-11-25 2013-05-30 Siemens Aktiengesellschaft Method for the automatic generation of simulation models using circuit diagrams
CN103907360A (en) * 2011-09-01 2014-07-02 美商楼氏电子有限公司 System and a method for streaming pdm data from or to at least one audio component
CN112099379A (en) * 2020-09-28 2020-12-18 山东工业职业学院 Electrical control circuit simulation system
CN114116437A (en) * 2020-08-28 2022-03-01 中车唐山机车车辆有限公司 Method and platform for converting circuit control file into electrical simulation model
CN114239443A (en) * 2021-12-14 2022-03-25 武汉风河信息科技有限公司 Electrical simulation and electrical fault diagnosis method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6448812B1 (en) * 1998-06-11 2002-09-10 Infineon Technologies North America Corp. Pull up/pull down logic for holding a defined value during power down mode
JP2003006041A (en) * 2001-06-20 2003-01-10 Hitachi Ltd Semiconductor device
CZ303954B6 (en) * 2012-04-17 2013-07-10 CESNET, zájmové sdruzení právnických osob Circuit arrangement for quick analysis of packet headers transmitted on a data bus

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103907360A (en) * 2011-09-01 2014-07-02 美商楼氏电子有限公司 System and a method for streaming pdm data from or to at least one audio component
WO2013075909A1 (en) * 2011-11-25 2013-05-30 Siemens Aktiengesellschaft Method for the automatic generation of simulation models using circuit diagrams
CN114116437A (en) * 2020-08-28 2022-03-01 中车唐山机车车辆有限公司 Method and platform for converting circuit control file into electrical simulation model
CN112099379A (en) * 2020-09-28 2020-12-18 山东工业职业学院 Electrical control circuit simulation system
CN114239443A (en) * 2021-12-14 2022-03-25 武汉风河信息科技有限公司 Electrical simulation and electrical fault diagnosis method

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
Subthreshold Source-Coupled Logic Circuits for Ultra-Low-Power Applications;Armin Tajalli 等;《IEEE Journal of Solid-State Circuits》;20080731;第43卷(第7期);第1699-1710页 *
一种无位置传感器无刷直流电机驱动电路;范承志 等;《微电机(伺服技术)》;20010331(第03期);第19-20、24页 *
基于仿真的电气专业化协同设计工具的开发及应用;姚海兰等;《中国新技术新产品》;20170630(第11期);第37-41页 *
空气制动系统供风单元计时控制问题分析及改进;詹诚 等;《铁道技术监督》;20201231;第48卷(第12期);第37-41页 *
集成模拟乘法器在通信中应用的仿真研究;宫芳 等;《信息技术》;20030630(第06期);第41-42页 *

Also Published As

Publication number Publication date
CN114943197A (en) 2022-08-26

Similar Documents

Publication Publication Date Title
US7200543B2 (en) Method for fault analysis using simulation
US6489971B1 (en) Graphical programming environment for deterministic finite state automata
CN107080945B (en) Method and device for testing artificial intelligence behaviors in game and electronic equipment
CN108304326B (en) Automatic testing system and method for android intelligent terminal
CN104794049A (en) Application program test method and device
CN111352826A (en) Automatic generation method and tool for interface test case
CN111259212B (en) Telemetering data interpretation method, device, equipment and storage medium
JPH06507991A (en) Formation of knowledge base and its simulation
CN112231228A (en) Firmware upgrade test method, device, platform, equipment and storage medium
CN112882930A (en) Automatic testing method and device, storage medium and electronic equipment
CN114943197B (en) Simulation method and device of circuit control logic and electronic equipment
CN112596651B (en) Acceptance method, device, equipment and storage medium for power distribution terminal debugging
CN112416706A (en) Power consumption testing method, device and system, storage medium and electronic device
CN111897283A (en) Programmable logic controller software element monitoring method, system and storage medium
US11902105B2 (en) Interactive graphical user interface for visualizing flow data in a programmable network switch
CN113254332A (en) Multi-scenario testing method, system, terminal and storage medium for storage system
CN114239443A (en) Electrical simulation and electrical fault diagnosis method
CN108762138B (en) Method and system for automatically generating anti-error logic of electrical equipment based on equipment number
CN112015648A (en) Test method, device, computer equipment and medium based on automation script
CN109741805A (en) PDF reports method and device, storage medium and the electronic device automatically generated
CN113159729B (en) Point table checking system and method for shortening point table checking time
CN112463473B (en) Method, system, terminal and storage medium for testing storage data stream unit
CN110083358B (en) Tool for modifying switch number of traction automatic switching device based on scripting language
CN114154442A (en) Simulation method, system, equipment and storage medium of vehicle control logic
US20240037016A1 (en) Computer readable storage medium, debugging support device, debugging support method, and machine learning device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant