A node traversal method, device, storage medium and electronic device

Through a node traversal method, the circuit simulation path is determined using the filtering conditions in the circuit state path diagram, which solves the problem of low efficiency in determining circuit state switching conditions in the prior art, and realizes more efficient determination of circuit state switching conditions.

CN119578364BActive Publication Date: 2025-04-18INTELLIGENT IMITATION TECHNOLOGY (ZHEJIANG) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510137843.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-07
Publication Date
2025-04-18
Estimated Expiration
2045-02-07

AI Technical Summary

Technical Problem

In the prior art, the efficiency of determining the circuit state switching conditions is low, which is mainly due to the complexity of the path map caused by the number of devices and the connection method in the circuit, resulting in the difficulty of artificially traversing the path map.

Method used

A node traversal method is provided, by obtaining a pre-constructed circuit state path diagram, determining the starting node and the termination node, and determining the intermediate node according to the starting node, filtering the connection node through preset filtering conditions until the intermediate node is a termination node, forming a circuit simulation path, and then verifying whether the circuit to be simulated can realize the preset function.

Benefits of technology

The efficiency of node traversal is improved, the need for artificial traversal path map is reduced, and the efficiency of determining circuit state switching conditions is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119578364B_ABST
    Figure CN119578364B_ABST
Patent Text Reader

Abstract

The present specification discloses a node traversal method, device, storage medium and electronic device. The method screens the connection nodes of the intermediate node by presetting the screening conditions, obtains the next node that meets the requirements, and re-determines the next node as the intermediate node until the intermediate node is the terminal node. The method does not need to manually traverse the path graph, improves the traversal efficiency, and further improves the efficiency of determining the circuit state switching condition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present specification relates to the field of computers, and in particular to a node-wide method, device, storage medium, and electronic device. Background Art

[0002] With the development of computer technology, various conditions and entities required for business can now be abstracted into a path graph consisting of nodes and directed edges, and then the business can be executed according to the path graph. When designing a circuit, the circuit is usually simulated to verify the circuit function and state transition conditions. For example, the circuit can be abstracted into a path graph, and the conditions for circuit state switching can be determined based on the path graph to facilitate subsequent business execution. Among them, the circuit state may switch from a normal working state to a fault state, or from a fault state to a normal working state. In addition, multiple conditions may need to be triggered simultaneously for the state switching to occur, or the state switching may occur when any one condition is triggered.

[0003] However, the number of devices in the circuit and the way they are connected make the abstracted path graph more complex, making it difficult to manually traverse the required path in the path graph, and thus making it less efficient to determine the circuit state switching conditions.

[0004] Based on this, this specification provides a node traversal method. Summary of the invention

[0005] This specification provides a node traversal method, device, storage medium and electronic device to partially solve the above-mentioned problems existing in the prior art.

[0006] This manual adopts the following technical solutions:

[0007] This specification provides a node traversal method, the method comprising:

[0008] Obtain a pre-built circuit state path graph, wherein the nodes in the circuit state path graph include state nodes and condition nodes, wherein the state nodes are used to represent circuit states, the condition nodes are used to represent conditions for circuit state transitions, and the edges represent circuit state transition relationships;

[0009] In the circuit state path diagram, determining a starting node and an ending node;

[0010] According to the starting node, determine the intermediate node and record it;

[0011] Determine a plurality of connection nodes directly connected to the intermediate node, determine and record the next node of the intermediate node among the plurality of connection nodes according to a preset screening condition, and redetermine the next node as the intermediate node until the intermediate node is the terminal node, thereby obtaining a circuit simulation path consisting of the starting node, the plurality of intermediate nodes and the terminal node;

[0012] According to the circuit simulation path, the circuit to be simulated corresponding to the circuit state path diagram is controlled to verify whether the circuit to be simulated can realize a preset function.

[0013] Optionally, the node type of the starting node is a state node;

[0014] Determining an intermediate node according to the starting node specifically includes:

[0015] Determine several nodes directly connected to the starting node as initial connected nodes;

[0016] For each newly connected node, determine whether the newly connected node is recorded;

[0017] If not, it is determined whether to determine the initially connected node as an intermediate node according to the node type of the initially connected node.

[0018] Optionally, judging whether to determine the initially connected node as an intermediate node according to the node type of the initially connected node specifically includes:

[0019] When the node type of the initially connected node is a conditional node, the initially connected node is determined as an intermediate node.

[0020] Optionally, the circuit state path graph further includes connection information, and the connection information is used to record the nodes connected by each edge;

[0021] Determining a number of connection nodes directly connected to the intermediate node, specifically including:

[0022] Determine all edges of the intermediate node;

[0023] According to the connection information and all edges in the circuit state path graph, a number of connection nodes directly connected to the intermediate node are determined.

[0024] Optionally, among several connected nodes, determining the next node of the intermediate node according to a preset screening condition specifically includes:

[0025] For each connection node, determine whether the connection node is recorded;

[0026] If not, it is determined whether to determine the connecting node as the next node of the intermediate node according to the node type of the connecting node.

[0027] Optionally, judging whether to determine the connecting node as the next node of the intermediate node according to the node type of the connecting node specifically includes:

[0028] Determine whether the node type of the connection node is a state node;

[0029] If so, when the connection node is a termination node, the connection node is determined as the next node of the intermediate node.

[0030] Optionally, among several connected nodes, determining the next node of the intermediate node according to a preset screening condition specifically includes:

[0031] For each connection node, determine whether the node type of the connection node is a conditional node;

[0032] If so, when the connecting node is not recorded, the connecting node is determined as the next node of the intermediate node.

[0033] Optionally, according to the circuit simulation path, controlling the circuit to be simulated corresponding to the circuit state path diagram specifically includes:

[0034] When there is more than one circuit simulation path, determining a combination condition according to condition nodes in a plurality of circuit simulation paths;

[0035] According to the combination condition, the circuit to be simulated corresponding to the circuit state path diagram is controlled.

[0036] This specification provides a node traversal device, the device comprising:

[0037] A circuit state path graph acquisition module, used to acquire a pre-built circuit state path graph, wherein the nodes in the circuit state path graph include state nodes and condition nodes, wherein the state nodes are used to represent the circuit state, the condition nodes are used to represent the conditions for the circuit state transition, and the edges represent the circuit state transition relationship;

[0038] A designated node determination module is used to determine a starting node and an ending node in the circuit state path diagram;

[0039] An intermediate node determination module, used to determine and record the intermediate node according to the starting node;

[0040] A circuit simulation path determination module is used to determine a number of connection nodes directly connected to the intermediate node, and among the several connection nodes, determine and record the next node of the intermediate node according to a preset screening condition, and re-determine the next node as the intermediate node until the intermediate node is the terminal node, thereby obtaining a circuit simulation path consisting of the starting node, the several intermediate nodes and the terminal node;

[0041] The simulation module is used to control the circuit to be simulated corresponding to the circuit state path diagram according to the circuit simulation path, and verify whether the circuit to be simulated can realize the preset function.

[0042] Optionally, the node type of the starting node is a state node;

[0043] The intermediate node determination module is specifically used to determine several nodes directly connected to the starting node as initial connection nodes; for each initial connection node, determine whether the initial connection node is recorded; if not, determine whether to determine the initial connection node as an intermediate node based on the node type of the initial connection node.

[0044] Optionally, the intermediate node determination module is specifically configured to, when the node type of the initially connected node is a conditional node, determine the initially connected node as an intermediate node.

[0045] Optionally, the circuit state path graph further includes connection information, and the connection information is used to record the nodes connected by each edge;

[0046] The circuit simulation path determination module is specifically used to determine all edges of the intermediate node; and determine a number of connection nodes directly connected to the intermediate node according to the connection information and all edges in the circuit state path diagram.

[0047] Optionally, the circuit simulation path determination module is specifically used to determine, for each connection node, whether the connection node is recorded; if not, determine whether to determine the connection node as the next node of the intermediate node according to the node type of the connection node.

[0048] Optionally, the circuit simulation path determination module is specifically used to determine whether the node type of the connection node is a state node; if so, when the connection node is a termination node, the connection node is determined as the next node of the intermediate node.

[0049] Optionally, the circuit simulation path determination module is specifically used to determine, for each connection node, whether the node type of the connection node is a conditional node; if so, when the connection node is not recorded, determine the connection node as the next node of the intermediate node.

[0050] Optionally, the simulation module is specifically used to, when there is more than one circuit simulation path, determine a combination condition based on conditional nodes in several circuit simulation paths; and control the circuit to be simulated corresponding to the circuit state path diagram based on the combination condition.

[0051] This specification provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned node traversal method is implemented.

[0052] This specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned node traversal method when executing the program.

[0053] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:

[0054] It can be seen from the node traversal method provided in this specification that a pre-built circuit state path diagram is first obtained. The nodes in the circuit state path diagram include state nodes and conditional nodes. The state node is used to represent the intermediate state of the circuit, and the conditional node is used to represent the condition of the circuit state transition. The edge represents the circuit state transition relationship. In the circuit state path diagram, the starting node and the ending node are determined. Then, based on the starting node, the intermediate node is determined and recorded. Several connection nodes directly connected to the intermediate node are determined. Among the several connection nodes, the next node of the intermediate node is determined and recorded according to the preset screening conditions, and the next node is re-determined as the intermediate node until the intermediate node is the ending node. According to the recording order of the intermediate node and the next node, the circuit simulation path is determined. According to the circuit simulation path, the circuit corresponding to the circuit state path diagram is controlled to verify whether the circuit can realize the preset function.

[0055] The method screens the connection nodes of the intermediate nodes by presetting the screening conditions, obtains the next node that meets the requirements, and re-determines the next node as the intermediate node until the intermediate node is the terminal node. The method does not require manual traversal of the path graph, improves the traversal efficiency, and further improves the efficiency of determining the circuit state switching conditions. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The illustrative embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation on this specification. In the drawings:

[0057] Figure 1 A schematic diagram of a node traversal method provided in this specification;

[0058] Figure 2 A circuit state path diagram provided for this specification;

[0059] Figure 3 A screening schematic diagram provided in this specification;

[0060] Figure 4 A schematic diagram of a node traversal device provided in this specification;

[0061] Figure 5 A method corresponding to the Figure 1 Schematic diagram of the structure of an electronic device. DETAILED DESCRIPTION

[0062] In order to make the purpose, technical solutions and advantages of this specification more clear, the technical solutions of this specification will be clearly and completely described below in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.

[0063] The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.

[0064] When designing a circuit, in order to ensure that the circuit can meet the requirements and realize the required functions, the circuit is generally simulated to determine the conditions for the circuit state transition. Specifically, the circuit can be abstracted into a path graph, and the conditions for the circuit state switching can be determined based on the path graph. However, when the circuit is more complex, the path graph will also be more complex, and it is more difficult to manually determine several required paths in the path graph, and the efficiency of determining the circuit state switching conditions is low. Therefore, this specification provides a node traversal method. The execution subject of this specification can be an electronic device that can execute the solution of this specification, such as a server, a personal computer (PC), a distributed cluster, etc., and can also be other computing devices with computing capabilities. This specification does not limit this. For the sake of convenience, this specification uses the server as the execution subject for description.

[0065] Figure 1 A schematic diagram of a node traversal method provided in this specification includes the following steps:

[0066] S100: Acquire a pre-constructed circuit state path graph, wherein the nodes in the circuit state path graph include state nodes and condition nodes, wherein the state nodes are used to represent circuit states, the condition nodes are used to represent conditions for circuit state transitions, and the edges represent circuit state transition relationships.

[0067] In one or more embodiments of this specification, the server may first obtain a pre-built circuit state path diagram, which is obtained by abstracting the circuit to be simulated, and may be constructed by the user according to the circuit to be simulated, or may be determined by the server according to the technology well known to persons skilled in the art and the circuit to be simulated. For example, using finite state machine technology, etc., this specification does not limit how to determine the circuit state path diagram according to the circuit to be simulated.

[0068] It should be noted that the nodes in the circuit state path diagram include state nodes and condition nodes. The state nodes are used to represent the circuit state, the condition nodes are used to represent the conditions for circuit state transition, and the edges represent circuit state transition relationships.

[0069] Figure 2 A circuit state path diagram provided in this manual, such as Figure 2 shown.

[0070] There are existing status nodes 1~3, condition nodes 1~5, and edges are used to connect each node. Figure 2 There are edges 1 to 9 in the circuit. Assume that the path of state 1-edge 1-condition 1-edge 2-state 2 is used for explanation. State 1 is an open circuit state, and state 2 is a normal working state. The condition that edges 1 and 2 can represent the state transition of the circuit is condition 1. Then, condition 1 may be a disconnected wire. Then, condition 1 can change the circuit to be simulated from an open circuit state to a normal working state. The circuit state may include a normal working state and a fault state. The fault state includes an open circuit fault state, a short circuit fault state, and the like.

[0071] S102: Determine a start node and an end node in the circuit state path diagram.

[0072] Specifically, when constructing a circuit state path diagram, a unique identifier or a character with a distinguishing function may be assigned to each node as node information, such as different nodes having different node names. The starting node and the ending node may be fixed or may be changed as required, and this specification does not limit this. If two of the nodes are designated as the starting node and the ending node, respectively, the node names or identifiers of the designated starting node and the ending node may be recorded when constructing the circuit state path diagram.

[0073] Furthermore, the server may determine the starting node and the ending node according to the recorded node information, and record them.

[0074] It should be noted that the node types of the start node and the end node are state nodes. This is because the circuit state path diagram is mainly used to determine the circuit state transition conditions. Therefore, when traversing, the state node is generally used as the start node, and the other condition nodes are traversed. Finally, the traversal ends with the node whose node type is the state node, and a path of state node-condition node...-state node is obtained. The server can determine the conditions for the circuit to transition from the start state to the end state based on the condition nodes in the path.

[0075] S104: Determine and record intermediate nodes according to the starting node.

[0076] In one or more embodiments of the present specification, the server may first determine a node directly connected to the starting node, and then determine whether the node directly connected to the starting node meets the requirements. If so, the server may determine the node directly connected to the starting node as an intermediate node.

[0077] Specifically, the circuit state path graph also includes connection information, which is used to record the nodes connected by each edge. Then, the server can determine several nodes directly connected to the starting node as the initial connection nodes based on the connection information.

[0078] Continue to use Figure 2 For example, if state 1 is the initial node, it can be determined from the connection information that the edges connected from state 1 include edge 1, edge 3, and edge 6, wherein edge 1 is also connected to condition 1, edge 3 is also connected to condition 2, and edge 6 is also connected to state 3. Therefore, the initial nodes directly connected to the initial node include condition 1, condition 2, and state 3.

[0079] However, not all initially connected nodes obtained may meet the business requirements. Therefore, the server may screen several initially connected nodes according to preset screening conditions to obtain nodes that meet the requirements as intermediate nodes.

[0080] Specifically, for each newly connected node, it is determined whether the newly connected node is recorded. If it is not recorded, it means that the newly connected node may be determined as an intermediate node for the first time. If not, it is determined whether the newly connected node is determined as an intermediate node based on the node type of the newly connected node. Generally speaking, the newly connected node directly connected to the initial node will not be recorded when the intermediate node is determined for the first time, but may be recorded in the second time or more times. For example, there is a circular path between nodes, such as node 1 is connected to node 2 and node 3 respectively, and node 2 is connected to node 3.

[0081] According to the node type of the first connected node, when judging whether to determine the first connected node as an intermediate node, when the node type of the first connected node is a conditional node, the first connected node is determined as an intermediate node. If the node type of the first connected node is a state node, since the first connected node is directly connected to the initial node and both are state nodes. It is understandable that when two state nodes are switching states, a conversion condition is obviously required. Therefore, there is at least one conditional node between the two state nodes, and the two state nodes are directly connected and do not conform to business logic. Therefore, when the node type of the first connected node is a conditional node, the first connected node is determined as an intermediate node. That is, the node is a state node, and the directly connected node is a conditional node, and the node must be a starting node, and the nodes recorded during the search process do not include directly connected nodes, which meets the requirements.

[0082] In addition, even if the intermediate nodes are determined, the first connected nodes must be recorded in order to determine the traversed nodes. Figure 2 In the example, the first connected nodes include condition 1, condition 2 and state 3, and the intermediate nodes finally screened include condition 1 and condition 2.

[0083] S106: Determine a number of connection nodes directly connected to the intermediate node, and among the several connection nodes, determine and record the next node of the intermediate node according to preset screening conditions, and redetermine the next node as the intermediate node until the intermediate node is the terminal node, thereby obtaining a circuit simulation path consisting of the starting node, the several intermediate nodes and the terminal node.

[0084] After the intermediate node is determined, the next node of the intermediate node can be determined, and then the next node of the next node can be determined, until the traversal reaches the end node.

[0085] When determining the next node of the intermediate node, several connection nodes directly connected to the intermediate node may be determined first. Similar to determining the initial connection node, the server may first determine all edges of the intermediate node based on the connection information. Then, based on the connection information and all edges in the circuit state path graph, several connection nodes directly connected to the intermediate node may be determined.

[0086] Afterwards, among several connected nodes, the next node of the intermediate node is determined according to a preset screening condition.

[0087] Specifically, Figure 3 A screening schematic diagram provided in this specification, such as Figure 3 shown.

[0088] The server can first determine whether each connection node is recorded. If not, it means that the connection node cannot be an intermediate node directly connected to the initial node, that is, the point has not been found. Then, the server can determine whether to determine the connection node as the next node of the intermediate node based on the node type of the connection node. That is, determine whether the node type of the connection node is a status node. If so, it is also necessary to determine whether the connection node is a termination node. When the connection node is a termination node, the connection node is determined as the next node of the intermediate node.

[0089] If any one or more of the following conditions are met: the connection node is recorded, the node type is not a status node, and is not a termination node, then the server may only record the connection node.

[0090] Based on the statement of determining the intermediate node in step S104, it can be known that the node type of the intermediate node directly connected to the initial node is a conditional node. Then, the aforementioned screening condition can be that if the node is a conditional node and the next node is also a state node, then the next node must be a termination node, and the nodes recorded during the search process do not include the next node, which meets the requirements.

[0091] Afterwards, the next node is re-determined as an intermediate node until the intermediate node becomes a terminal node, thereby obtaining a circuit simulation path consisting of the starting node, a plurality of intermediate nodes and the terminal node.

[0092] S108: According to the circuit simulation path, the circuit to be simulated corresponding to the circuit state path diagram is controlled to verify whether the circuit to be simulated can realize a preset function.

[0093] Specifically, the server controls the circuit to be simulated corresponding to the circuit state path diagram according to the circuit simulation path, that is, according to the conditions in the circuit simulation path, verifies whether the circuit to be simulated can achieve the preset function. For example, the circuit is in a normal working state, the condition node is that the voltage is greater than 100V, and the circuit is in a short-circuit state. Then, the server simulates the circuit to be simulated according to the conditions to verify whether the circuit is short-circuited when the voltage is greater than 100V.

[0094] The specific functions of the circuit to be simulated can be set as needed, and this manual does not limit this. For example, the circuit to be simulated can be used to implement the path planning of a sweeping robot, the classification path of a logistics sorting system, etc. Then, after simulating the circuit to be simulated according to the conditions, if the simulation is successful, it means that there is no abnormality in the connection of the circuit to be simulated, and the function of the circuit to be simulated can be verified. This manual does not limit how to perform the function verification of the circuit to be simulated.

[0095] It should be noted that edges have directions. For example, the circuit to be simulated switches from a normal state to a fault state only if the temperature is higher than 200 degrees. However, if the temperature is higher than 200 degrees, the circuit will not switch from the fault state to the normal state. Therefore, edges have directions.

[0096] In addition, when there is more than one circuit simulation path, a combination condition is determined according to the condition nodes in the circuit simulation paths, and the circuit to be simulated corresponding to the circuit state path diagram is controlled according to the combination condition. The details will be described later in the specification and will not be repeated here.

[0097] based on Figure 1 The node traversal method shown in the figure, this method screens the connection nodes of the intermediate node by preset screening conditions, obtains the next node that meets the requirements, and re-determines the next node as the intermediate node until the intermediate node is the terminal node. The method does not need to manually traverse the path graph, improves the traversal efficiency, and further improves the efficiency of determining the circuit state switching condition.

[0098] Regarding step S104, it should be noted that, since there may be multiple intermediate nodes directly connected to the starting node, the server only executes step S104 for one intermediate node directly connected to the starting node at a time, or it may execute step S104 for multiple intermediate nodes directly connected to the starting node at the same time, and this specification does not limit this. Among them, the first traversal method can be understood as a depth-first search, and the second traversal method can be understood as a breadth-first search.

[0099] For step S106, among several connection nodes, when determining the next node of the intermediate node according to the preset screening conditions, the server can also determine for each connection node whether the node type of the connection node is a conditional node. If so, when the connection node is not recorded, the connection node is determined as the next node of the intermediate node. That is, if the node is a conditional node and the next node is also a conditional node, and the nodes recorded during the search process do not include the next node, then the requirements are met. Conditional nodes can be connected to conditional nodes, and a path of state-condition-condition-state can be formed, indicating that two conditions are required for circuit state transition. For example, Figure 2 In the example, if the starting node is in state 1, the ending node is in state 2, and the intermediate nodes include condition 2 and condition 3, then the path state 1-condition 2-condition 3-state 2 is formed. This means that the circuit needs to go through condition 2 and condition 3 to convert from state 1 to state 2. The specific conditions are not limited in this specification and can be determined according to specific circuit design requirements.

[0100] Continue to use Figure 2 For example, state 1 finds directly connected initial nodes including condition 1, condition 2 and state 3 through connection information, edge 1, edge 3 and edge 6, determines two intermediate nodes condition 1 and condition 2 through preset screening conditions, and records the passed nodes condition 1, condition 2 and state 3. There are currently two circuit simulation paths, namely {state 1, condition 1} and {state 1, condition 2}.

[0101] After that, condition 1 searches for the next node through connection information and edge 2, and finds state 1 and state 2. Since state 1 is the node passed during the search, state 1 is excluded. At the same time, state 2 is the termination node, so the search stops. Currently, there is a circuit simulation path of {state 1, condition 1, state 2}.

[0102] Condition 2 searches for the next node through connection information and edge 3, and finds condition 3 and state 1. Because state 1 records the nodes passed during the search process, state 1 is excluded. At the same time, condition 3 is a node that meets the preset screening conditions, and the node is recorded, so the circuit simulation path is updated to {state 1, condition 2, condition 3}.

[0103] Condition 3 searches for the next node through connection information and edge 4, and finds condition 2 and state 2. Because condition 2 is the node passed during the search, condition 2 is excluded. At the same time, state 2 is a node that meets the preset screening conditions, and state 2 is the end node, so the search stops. There is currently another circuit simulation path, which is {state 1, condition 2, condition 3, state 2}. At the same time, there are currently two circuit simulation paths, namely {state 1, condition 1, state 2} and {state 1, condition 2, condition 3, state 2}.

[0104] Since there is more than one circuit simulation path, the server can determine the combination condition according to the condition nodes in several circuit simulation paths. In the above embodiment, the combination condition is (condition 1.condition || (condition 2.condition && condition 3.condition)).

[0105] Furthermore, the server may control the circuit to be simulated corresponding to the circuit state path diagram according to the combination conditions, that is, simulate the circuit to be simulated according to the combination conditions to verify whether the circuit to be simulated can realize the preset function.

[0106] In addition, through the specific implementation of the preset screening conditions in the specification, it can be explained that the traversal in this specification may not traverse all nodes in the circuit state path diagram, but only search for nodes that meet the requirements. Moreover, in the process of searching, if all the recorded nodes meet the preset screening conditions, but cannot be traversed to the termination node, the circuit simulation path finally obtained does not meet the requirements. For example, if the circuit simulation path is state 1-condition 1-condition 2-condition 3, and there is no termination node, the path will not be retained.

[0107] The node traversal method provided in this specification has many effects. First, the algorithm is flexible and diverse. The appropriate traversal algorithm can be selected according to actual needs to balance the calculation efficiency and path quality. Second, the circuit simulation path generation is accurate and reliable, which can ensure that every node on the required path can be accurately recorded. Third, it has a wide range of applications and can be applied to multiple fields such as traffic navigation, logistics planning, social network analysis, and modeling simulation to provide users with valuable information. Fourth, the traversal efficiency is high, and the traversal speed is much higher than manual traversal.

[0108] The above is one or more implementation methods of this specification, based on Figure 1 The flowchart of the node traversal method shown in FIG. 4 is also provided in this specification. The corresponding node traversal device is also provided in this specification.

[0109] Figure 4 A schematic diagram of a node traversal device provided in this specification includes:

[0110] The circuit state path graph acquisition module 400 is used to acquire a pre-built circuit state path graph, wherein the nodes in the circuit state path graph include state nodes and condition nodes, wherein the state nodes are used to represent the circuit state, the condition nodes are used to represent the conditions for the circuit state transition, and the edges represent the circuit state transition relationship;

[0111] A designated node determination module 402 is used to determine a start node and an end node in the circuit state path diagram;

[0112] An intermediate node determination module 404 is used to determine and record the intermediate node according to the starting node;

[0113] The circuit simulation path determination module 406 is used to determine a number of connection nodes directly connected to the intermediate node, and among the several connection nodes, determine and record the next node of the intermediate node according to a preset screening condition, and re-determine the next node as the intermediate node until the intermediate node is the terminal node, thereby obtaining a circuit simulation path consisting of the starting node, the several intermediate nodes and the terminal node;

[0114] The simulation module 408 is used to control the circuit to be simulated corresponding to the circuit state path diagram according to the circuit simulation path, and verify whether the circuit to be simulated can realize the preset function.

[0115] Optionally, the node type of the starting node is a state node;

[0116] The intermediate node determination module 404 is specifically used to determine several nodes directly connected to the starting node as initial connection nodes; for each initial connection node, determine whether the initial connection node is recorded; if not, determine whether to determine the initial connection node as an intermediate node based on the node type of the initial connection node.

[0117] Optionally, the intermediate node determination module 404 is specifically configured to determine the initially connected node as an intermediate node when the node type of the initially connected node is a conditional node.

[0118] Optionally, the circuit state path graph further includes connection information, and the connection information is used to record the nodes connected by each edge;

[0119] The circuit simulation path determination module 406 is specifically used to determine all edges of the intermediate node; and determine a number of connection nodes directly connected to the intermediate node according to the connection information and all edges in the circuit state path diagram.

[0120] Optionally, the circuit simulation path determination module 406 is specifically used to determine, for each connection node, whether the connection node is recorded; if not, determine whether to determine the connection node as the next node of the intermediate node according to the node type of the connection node.

[0121] Optionally, the circuit simulation path determination module 406 is specifically used to determine whether the node type of the connection node is a state node; if so, when the connection node is a termination node, the connection node is determined as the next node of the intermediate node.

[0122] Optionally, the circuit simulation path determination module 406 is specifically used to determine, for each connection node, whether the node type of the connection node is a conditional node; if so, when the connection node is not recorded, determine the connection node as the next node of the intermediate node.

[0123] Optionally, the simulation module 408 is specifically used to, when there is more than one circuit simulation path, determine a combination condition according to conditional nodes in several circuit simulation paths; and control the circuit to be simulated corresponding to the circuit state path diagram according to the combination condition.

[0124] This specification also provides a computer-readable storage medium, which stores a computer program, which can be used to execute the above Figure 1 A node traversal method provided.

[0125] This manual also provides Figure 5 The one shown corresponds to Figure 1 Schematic diagram of the structure of an electronic device. Figure 5 As shown, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 5 The node traversal method described.

[0126] Of course, in addition to software implementation, this specification does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the executor of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0127] In the 1990s, it was very clear whether the improvement of a technology was hardware improvement (for example, improvement of the circuit structure of diodes, transistors, switches, etc.) or software improvement (improvement of the method flow). However, with the development of technology, many improvements of the method flow today can be regarded as direct improvements of the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be implemented with hardware entity modules. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask chip manufacturers to design and make dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one kind of HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages ​​and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.

[0128] The controller may be implemented in any suitable manner, for example, the controller may take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (e.g., software or firmware) executable by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, and the memory controller may also be implemented as part of the control logic of the memory. It is also known to those skilled in the art that, in addition to implementing the controller in a purely computer-readable program code manner, the controller may be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, such a controller may be considered as a hardware component, and the devices for implementing various functions included therein may also be considered as structures within the hardware component. Or even, the devices for implementing various functions may be considered as both software modules for implementing the method and structures within the hardware component.

[0129] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0130] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0131] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0132] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0133] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0134] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0135] In a typical configuration, a computing device includes one or more processors (first chips), input / output interfaces, network interfaces, and memory.

[0136] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0137] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0138] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0139] It should be understood by those skilled in the art that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0140] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, controls, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0141] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0142] The above description is only an embodiment of the present specification and is not intended to limit the present specification. For those skilled in the art, the present specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification shall be included in the scope of the claims of the present specification.

Claims

1. A node traversal method, characterized in that: The method comprises: Obtain a pre-built circuit state path graph, wherein the nodes in the circuit state path graph include state nodes and condition nodes, wherein the state nodes are used to represent circuit states, the condition nodes are used to represent conditions for circuit state transitions, and the edges represent circuit state transition relationships; In the circuit state path diagram, determining a starting node and an ending node; According to the starting node, determine the intermediate node and record it; Determine a number of connection nodes directly connected to the intermediate node, determine and record the next node of the intermediate node among the several connection nodes according to a preset screening condition, and re-determine the next node as an intermediate node until the intermediate node is a terminal node, thereby obtaining a circuit simulation path consisting of the starting node, the several intermediate nodes and the terminal node; the preset screening condition includes: whether the node type of the connection node is a conditional node, whether the connection node is recorded, and whether the connection node is a terminal node; According to the circuit simulation path, the circuit to be simulated corresponding to the circuit state path diagram is controlled to verify whether the circuit to be simulated can realize a preset function.

2. The method according to claim 1, characterized in that The node type of the starting node is a state node; Determining an intermediate node according to the starting node specifically includes: Determine several nodes directly connected to the starting node as initial connected nodes; For each newly connected node, determine whether the newly connected node is recorded; If not, it is determined whether to determine the initially connected node as an intermediate node according to the node type of the initially connected node.

3. The method according to claim 2, characterized in that According to the node type of the initially connected node, determining whether to determine the initially connected node as an intermediate node specifically includes: When the node type of the initially connected node is a conditional node, the initially connected node is determined as an intermediate node.

4. The method according to claim 1, characterized in that The circuit state path graph also includes connection information, and the connection information is used to record the nodes connected by each edge; Determining a number of connection nodes directly connected to the intermediate node, specifically including: Determine all edges of the intermediate node; According to the connection information and all edges in the circuit state path graph, a number of connection nodes directly connected to the intermediate node are determined.

5. The method according to claim 1, characterized in that Among several connected nodes, determining the next node of the intermediate node according to a preset screening condition specifically includes: For each connection node, determine whether the connection node is recorded; If not, it is determined whether to determine the connecting node as the next node of the intermediate node according to the node type of the connecting node.

6. The method according to claim 5, characterized in that According to the node type of the connection node, determining whether to determine the connection node as the next node of the intermediate node specifically includes: Determine whether the node type of the connection node is a state node; If so, when the connection node is a termination node, the connection node is determined as the next node of the intermediate node.

7. The method according to claim 1, characterized in that Among several connected nodes, determining the next node of the intermediate node according to a preset screening condition specifically includes: For each connection node, determine whether the node type of the connection node is a conditional node; If so, when the connecting node is not recorded, the connecting node is determined as the next node of the intermediate node.

8. The method according to claim 1, characterized in that According to the circuit simulation path, controlling the circuit to be simulated corresponding to the circuit state path diagram specifically includes: When there is more than one circuit simulation path, determining a combination condition according to condition nodes in a plurality of circuit simulation paths; According to the combination condition, the circuit to be simulated corresponding to the circuit state path diagram is controlled.

9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of claims 1 to 8 is implemented.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method described in any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Traversal path generation method and apparatus, server and storage medium

    CN107943685A

  • Task robot testing method and device, electronic equipment and storage medium

    CN114880241A