A software testing method, device, storage medium and equipment based on graph matching

Through the software testing method based on graph matching, graph data of simulation system and equipment information is constructed, and nodes and benchmark nodes are matched, which solves the problems of high labor costs, low efficiency and insufficient accuracy in traditional testing methods, and realizes the automation of simulation software Test and efficient and accurate test results.

CN118642974BActive Publication Date: 2024-11-22INTELLIGENT IMITATION TECHNOLOGY (ZHEJIANG) CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411130873.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-16
Publication Date
2024-11-22
Estimated Expiration
2044-08-16

AI Technical Summary

Technical Problem

Traditional testing methods have high labor costs, low efficiency and insufficient accuracy in simulation software testing, making it difficult to fully cover complex simulation system diagram files.

Method used

Using a software testing method based on graph matching, we use the graph data of simulation system and equipment information to build graph data, match nodes and benchmark nodes, and realize automated testing and improve testing efficiency and accuracy.

Benefits of technology

It realizes automated testing of simulation software, improves testing efficiency and accuracy, reduces testing costs, and can effectively cover complex simulation system diagram files.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118642974B_ABST
    Figure CN118642974B_ABST
Patent Text Reader

Abstract

This specification discloses a software testing method, device, storage medium and equipment based on graph matching. The method includes: obtaining simulation system information corresponding to the simulation software and equipment information corresponding to the target electrical equipment; constructing target graph data according to the components contained in the simulation system information and the connection relationship between the components, and constructing pattern graph data according to the components contained in the equipment information and the connection relationship between the components; for each reference node, determining each node with the same label as the reference node in each target node as each candidate matching node corresponding to the reference node; matching the target graph data with the pattern graph data according to each candidate matching node corresponding to each reference node, and testing the simulation software according to the matching results. This scheme realizes the automated testing of the simulation software and effectively improves the accuracy of the test results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a software testing method, apparatus, storage medium and device based on graph matching. Background Art

[0002] Electrical simulation software is a computer software specially used for virtual modeling, simulation and analysis of electrical systems. It is based on electrical engineering principles and mathematical models, and helps engineers and researchers to design, optimize and analyze faults by simulating the behavior, performance and operation of electrical systems.

[0003] In order to meet the growing simulation needs, the functions of simulation software will be constantly updated, which may cause some errors when developing new functions, affecting the simulation results. Therefore, the testing of simulation software is an indispensable part of the electrical engineering design process.

[0004] At present, R&D personnel usually use the traditional testing method, that is, to check with the naked eye whether the node attribute information and connection relationship on the simulation system diagram file are consistent with the electrical equipment information provided by the simulation software. Since the simulation system diagram file is relatively complex and the amount of data is quite large, it is difficult to fully cover the actual application scenarios through manual testing in a short period of time. This results in extremely high labor costs for traditional testing methods, low testing efficiency, and accuracy that needs to be improved.

[0005] Therefore, how to improve the testing efficiency and accuracy of simulation software and reduce the testing cost is an urgent problem to be solved. Summary of the invention

[0006] This specification provides a software testing method, apparatus, storage medium and device based on graph matching to partially solve the above-mentioned problems existing in the prior art.

[0007] This manual adopts the following technical solutions:

[0008] This specification provides a software testing method based on graph matching, including:

[0009] receiving a test request for simulation software of a target electrical device;

[0010] According to the test request, obtaining simulation system information corresponding to the simulation software and device information corresponding to the target electrical device;

[0011] According to the components contained in the simulation system information and the connection relationship between the components, graph data is constructed as target graph data, and each node in the target graph data is used as a target node; and, according to the components contained in the device information and the connection relationship between the components, graph data is constructed as pattern graph data, and each node in the pattern graph data is used as a reference node;

[0012] For each reference node, determine in each target node the nodes having the same label as the reference node as candidate matching nodes corresponding to the reference node;

[0013] According to each candidate matching node corresponding to each reference node, the target graph data is matched with the pattern graph data, and the simulation software is tested according to the matching result.

[0014] Optionally, matching the target graph data with the pattern graph data according to each candidate matching node corresponding to each reference node specifically includes:

[0015] Determine whether each reference node matches each corresponding candidate matching node;

[0016] If each reference node in the pattern graph data corresponds to a matching target node in the target graph data, it is determined that the target graph data matches the pattern graph data.

[0017] Optionally, determining whether each reference node matches each corresponding candidate matching node specifically includes:

[0018] For each reference node, determining a connection relationship between the reference node and other reference nodes;

[0019] For each candidate matching node corresponding to the reference node, it is determined whether the candidate matching node and the target node matched with the other reference nodes also have the connection relationship. If so, it is determined that the reference node matches the candidate matching node.

[0020] Optionally, for each candidate matching node corresponding to the reference node, determining whether the candidate matching node also has the connection relationship with the target node matched with the other reference node specifically includes:

[0021] For each reference node, determine a reference node that has a connection relationship with the reference node and has been matched, as an associated node corresponding to the reference node, and determine a target node that matches the associated node;

[0022] For each candidate matching node corresponding to the reference node, determine whether the candidate matching node has the connection relationship with the target node that matches the associated node. If so, mark the candidate matching node as matched to obtain a marked node. Otherwise, determine that the reference node does not match the candidate matching node.

[0023] Optionally, the method further comprises:

[0024] Determine a next target node that has a connection relationship with the marked node, and determine a next reference node that has a connection relationship with the reference node;

[0025] When it is determined that the next target node does not match the next reference node, it is determined that the marked node does not match the reference node, and the marked node is marked as not matching.

[0026] Optionally, for each reference node, before determining whether the reference node matches each candidate matching node corresponding to the reference node, the method further includes:

[0027] For each reference node, determine the matching priority corresponding to the reference node according to the number of candidate matching nodes corresponding to the reference node;

[0028] Determining whether each reference node matches each corresponding candidate matching node includes:

[0029] According to the matching priority, it is determined whether each reference node matches each corresponding candidate matching node.

[0030] Optionally, for each reference node, the fewer the number of candidate matching nodes corresponding to the reference node, the higher the matching priority corresponding to the reference node.

[0031] This specification provides a software testing device based on graph matching, including:

[0032] A receiving module, used for receiving a test request of the simulation software for the target electrical equipment;

[0033] An acquisition module, used for acquiring simulation system information corresponding to the simulation software and device information corresponding to the target electrical device according to the test request;

[0034] A construction module, used to construct graph data as target graph data according to the components and the connection relationship between the components contained in the simulation system information, and use the nodes in the target graph data as target nodes, and to construct graph data as pattern graph data according to the components and the connection relationship between the components contained in the device information, and use the nodes in the pattern graph data as reference nodes;

[0035] A determination module, for determining, for each reference node, nodes in each target node that have the same label as the reference node as candidate matching nodes corresponding to the reference node;

[0036] The matching module is used to match the target graph data with the pattern graph data according to the candidate matching nodes corresponding to each reference node, and to test the simulation software according to the matching results.

[0037] 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 software testing method based on graph matching is implemented.

[0038] 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 software testing method based on graph matching when executing the program.

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

[0040] In the software testing method based on graph matching provided in the present specification, simulation system information corresponding to the simulation software and device information corresponding to the target electrical equipment are obtained; target graph data are constructed based on the components contained in the simulation system information and the connection relationships between the components, and pattern graph data are constructed based on the components contained in the device information and the connection relationships between the components; for each reference node, nodes having the same label as the reference node are determined in each target node as candidate matching nodes corresponding to the reference node; according to the candidate matching nodes corresponding to each reference node, the target graph data and the pattern graph data are matched, and the simulation software is tested based on the matching results.

[0041] It can be seen from the above method that this scheme can convert complex simulation system information into graph data with a simple structure. By matching the reference nodes in the pattern graph data with the target nodes in the target graph data, the automated testing of the simulation software is realized. By determining the candidate matching nodes, the testing efficiency is further improved, the automated testing of the simulation software is realized, the accuracy of the test results is effectively improved, and the testing cost is reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] 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:

[0043] Figure 1 A flowchart of a software testing method based on graph matching provided in this specification;

[0044] Figure 2 A schematic diagram of target graph data provided in this specification;

[0045] Figure 3 A schematic diagram of a mode diagram data provided in this specification;

[0046] Figure 4 A schematic diagram of a matching path search process provided in this specification;

[0047] Figure 5 A schematic diagram of a node matching sequence provided in this specification;

[0048] Figure 6 A schematic diagram of a software testing device based on graph matching provided in this specification;

[0049] Figure 7 A method corresponding to the Figure 1 Schematic diagram of electronic equipment. DETAILED DESCRIPTION

[0050] 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.

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

[0052] Figure 1 A flowchart of a software testing method based on graph matching provided in this specification includes the following steps:

[0053] S101: receiving a test request for simulation software of a target electrical device;

[0054] S102: According to the test request, obtain simulation system information corresponding to the simulation software and device information corresponding to the target electrical device.

[0055] With the continuous advancement of power systems, industrial automation, intelligent control and new energy technologies, traditional electrical design, testing and verification methods face many challenges, such as high equipment costs, long experimental cycles, and high safety risks. In order to overcome these challenges, electrical simulation software came into being and gradually became an indispensable tool in the field of electrical engineering.

[0056] In order to ensure the reliability and accuracy of the simulation software, this manual provides a software testing method based on graph matching, which improves the accuracy of the test results and the test efficiency by converting the electrical system diagram and the electrical equipment information into graph data and matching them.

[0057] In this specification, the execution entity used to implement a software testing method based on graph matching can be a terminal device such as a laptop computer, a desktop computer, or, of course, a server. For the sake of ease of description, the following will only take the terminal device as an example of the execution entity to illustrate a software testing method based on graph matching provided in this specification.

[0058] Before testing the simulation software, the terminal device may receive a test request for the simulation software of the target electrical device.

[0059] In this specification, the target electrical equipment may include various types of equipment used for electric energy conversion, transmission, distribution, use and control, including but not limited to power generation equipment (such as generators), substation equipment (such as transformers, disconnectors, combination electrical appliances, etc.), transmission equipment (such as transmission lines, cables), distribution equipment (such as high-voltage switchgear, low-voltage distribution cabinets, etc.), control equipment (such as programmable logic controllers, relays, circuit breakers, etc.), power electronic equipment (such as rectifiers, inverters, frequency converters, etc.) and other electrical equipment such as battery packs, inverters, motors, lightning arresters, etc., and this specification does not make specific restrictions on this.

[0060] The components of electrical equipment may include contactors, relays, mutual inductors, circuit breakers, fuses, resistors, power supplies, switches, buttons, indicator lights, etc. The component composition corresponding to different electrical equipment is also different, and this manual does not make specific restrictions on this.

[0061] After receiving the test request, the terminal device can start the test program and perform integrity verification on the configuration file of the simulation software to be tested after reading the configuration file. The configuration information in the configuration file may include: database IP address (host), port (port), database name (db), user name (username) and password (password), etc. If the above key information is missing, an exception will be directly thrown in the verification link and the testing of the simulation software will be stopped.

[0062] If the configuration file passes the integrity check, the terminal device can further obtain the simulation system information corresponding to the simulation software and the actual device information corresponding to the target electrical device according to the test request.

[0063] The simulation system information may be a drawing file of the simulation system. Since the simulation software is simulation software for the target electrical equipment, the simulation system information includes the components of the target electrical equipment and the connection relationship between the components expected by the software developer.

[0064] Compared with the simulation system information, the device information corresponding to the target electrical device includes the actual body component composition of the target electrical device and the actual connection relationship between the components.

[0065] It should be noted that the simulation system information can be read from the simulation software itself, and the device information corresponding to the target electrical device can be provided by the user.

[0066] S103: Based on the components contained in the simulation system information and the connection relationships between the components, graph data is constructed as target graph data, and each node in the target graph data is used as a target node. Also, based on the components contained in the device information and the connection relationships between the components, graph data is constructed as pattern graph data, and each node in the pattern graph data is used as a reference node.

[0067] The terminal device may construct graph data as target graph data (Target Graph, TG) according to the components and the connection relationship between the components included in the simulation system information, and use each node in the target graph data as a target node.

[0068] Specifically, the terminal device can construct a triple of graph data by taking each component included in the simulation system information as the target node, the connection relationship between the nodes as the edge, and the name and attribute corresponding to each component as the label of the node corresponding to each component: , where V represents a node set, E represents an edge set, and L represents a node label. For ease of understanding, this specification provides a target graph data schematic diagram, such as Figure 2 shown.

[0069] Figure 2 A schematic diagram of target graph data provided in this specification.

[0070] in, ~ for Figure 2 The target nodes contained in the target graph data shown are connected by edges to the target nodes corresponding to the components having a connection relationship.

[0071] Similarly, the terminal device can construct graph data as pattern graph data (Patter Graph, PG) according to the components contained in the device information and the connection relationship between the components, and use each node in the pattern graph data as a reference node.

[0072] Specifically, the terminal device can construct a triple of graph data by taking each component contained in the device information as a reference node, the connection relationship between the nodes as an edge, and the name and attribute corresponding to each component as a label of the node corresponding to each component: For ease of understanding, this specification provides a schematic diagram of a mode diagram data, such as Figure 3 shown.

[0073] Figure 3 This is a schematic diagram of a mode diagram data provided in this specification.

[0074] in, ~ for Figure 3 The reference nodes included in the pattern graph data shown are connected by edges to the reference nodes corresponding to the elements having a connection relationship.

[0075] S104: For each reference node, determine in each target node nodes the nodes having the same label as the reference node as candidate matching nodes corresponding to the reference node.

[0076] For each reference node in the pattern graph data PG , the terminal device can compare the target graph data TG with the reference node The target node v with the same label is taken as its corresponding candidate matching node, denoted as .

[0077] by Figure 2 and Figure 3 For example, Figure 3 In and Figure 2 In The corresponding labels are the same (both are A), so ,express The candidate matching nodes are .

[0078] For another example, Figure 3 In and Figure 2 In The corresponding labels are the same (both are C), so ,express The candidate matching nodes are .

[0079] S105: Match the target graph data with the pattern graph data according to each candidate matching node corresponding to each reference node, and test the simulation software according to the matching result.

[0080] The terminal device can match the target graph data with the pattern graph data according to each candidate matching node corresponding to each reference node, wherein the terminal device can determine whether each reference node matches each corresponding candidate matching node, and if each reference node in the pattern graph data corresponds to a matching target node in the target graph data, then it is determined that the target graph data matches the pattern graph data. At this point, the simulation software can be considered to have passed the test.

[0081] In this specification, since the label of the candidate matching node is the same as the label corresponding to the corresponding reference node, that is to say, for each reference node, the attributes, name and other information of the reference node and its corresponding matching nodes are the same, it is possible to further determine whether there is a consistent connection relationship between the reference node and the matching node, thereby judging whether the two match.

[0082] Among them, for each reference node, the terminal device can determine the connection relationship between the reference node and other reference nodes. For each candidate matching node corresponding to the reference node, the terminal device can determine whether the candidate matching node and the target node matching the other reference nodes also have the said connection relationship. If so, it is determined that the reference node matches the candidate matching node, otherwise the two do not match.

[0083] For each reference node, the terminal device may determine a reference node that has a connection relationship with the reference node and has been matched as an associated node corresponding to the reference node, and determine a target node that matches the associated node.

[0084] For each candidate matching node corresponding to the reference node, determine whether the candidate matching node and the target node matched by its associated node have the connection relationship. If so, mark the candidate matching node as matched to obtain a marked node. Otherwise, determine that the reference node does not match the candidate matching node.

[0085] Specifically, for If we consider Matched nodes connectivity and dynamically update the candidate matching set , many invalid matches can be avoided. In this specification, this process can be implemented by the following algorithm:

[0086] Matchable ( )

[0087] 1for and do

[0088] 2 if then

[0089] 3 return false;

[0090] 4 end

[0091] 5end

[0092] 6return true;

[0093] The terminal device can determine the target node by whether the target graph data and the matched nodes in the pattern graph data have the same connection relationship. Is it a base node? For example, suppose a matched edge in the pattern graph data (line 1 of the algorithm), is a matched node, then in the target graph node and There must also be an edge between and Only then can it be matched, otherwise it can be concluded and It is definitely not a legal match (lines 2-3 of the algorithm).

[0094] It can be seen that matching connectivity pruning conditions is very important because it can reduce the candidate matching set of the current branch from the full target graph to the neighbors of the matched subgraph.

[0095] by Figure 2 and Figure 3 For example, assuming that the current algorithm has completed The matching nodes are Then judge Is it is a legal match, since and There is a connection between and If there is no connection between them, terminate this matching branch directly.

[0096] And for and ,because and There is a connection between and There is also a connection between Temporarily marked as matched.

[0097] Furthermore, for each marked node, the terminal device can determine the next target node that has a connection relationship with the marked node, and determine the next reference node that has a connection relationship with the reference node. When it is determined that the next target node does not match the next reference node, it is determined that the marked node does not match the reference node, and the marked node is marked as mismatched.

[0098] Specifically, based on the candidate matching set, the terminal device can use a backtracking algorithm to match the pattern graph node with the target graph node. The algorithm is as follows:

[0099] Recursive Matching )

[0100] 1for and v is unmatcheddo

[0101] 2 if not Matchable then

[0102] 3 continue;

[0103] 4 end

[0104] 5 ;

[0105] 6 if then

[0106] 7 Recursive Matching );

[0107] 8 else

[0108] 9 Output a matching result ;

[0109] 10 end

[0110] 11

[0111] 12end

[0112] Among them, the terminal device can match each reference node in the pattern graph data in turn, and before matching the next reference node (line 7 of the algorithm), mark the corresponding matching node in the current target graph as matched (line 5 of the algorithm), so as to avoid multiple nodes in the pattern graph matching the same target node. When the algorithm backtracks to the current node (that is, based on the next node, it is determined that the reference node and its corresponding candidate node do not match), the target node must be marked as unmatched (line 11 of the algorithm). It is not difficult to see that the entire recursive matching process forms a highly For ease of understanding, this specification provides a schematic diagram of the search process for a matching path, such as Figure 4 shown.

[0113] Figure 4 A schematic diagram of a matching path search process provided in this specification.

[0114] The entire matching process is a deep search process. The length of each line from the root node to the leaf node in the search tree is The path corresponds to a legal match, such as the path is a matching subgraph. Obviously, the length of the whole tree is The maximum number of paths is , which also happens to be the algorithmic complexity.

[0115] Here still Figure 2 and Figure 3 For example, for and ,because and There is a connection between and There is also a connection between Temporarily marked as matched, but due to and There is no subsequent node connected to it, so it can be judged that and Match.

[0116] Assume and The matching has been completed, then for For example, For its corresponding associated node, Candidate matching nodes ,because and Directly also exists with and The same connection relationship between them, so we can Mark as matched, when The next benchmark node , and There is a connection between and Matching target nodes There is no connection between them, so Re-label as mismatched, i.e., benchmark node With the target node No match.

[0117] It should be noted that for the root node in the pattern graph data (such as Figure 2 In ), since there is no previous reference node, the root node can be directly matched with its corresponding candidate matching node in the target graph data (such as Figure 1 In ) as matched.

[0118] Furthermore, for each reference node, if the matching order is also included without breaking the matching connectivity, many false matches can be reduced, that is, a search branch can be terminated as soon as possible. Therefore, before matching the reference node, the terminal device can determine the matching order for matching each reference node.

[0119] Specifically, for each reference node, the terminal device determines the matching priority corresponding to the reference node according to the number of candidate matching nodes corresponding to the reference node, and then determines whether each reference node matches each corresponding candidate matching node according to the matching priority corresponding to each reference node. Among them, for each reference node, the fewer the number of candidate matching nodes corresponding to the reference node, the higher the matching priority corresponding to the reference node, and the more the number of candidate matching nodes corresponding to the reference node, the lower the matching priority corresponding to the reference node. For ease of understanding, this specification provides a schematic diagram of determining the node matching order, such as Figure 5 shown.

[0120] Figure 5 A schematic diagram of a node matching sequence provided in this specification.

[0121] Among them, if the candidate matching nodes are arranged from few to many (i.e. ) order, only three node verifications are required, namely ; but if according to If the order of matching is carried out, 3+50*49=2453 node verifications are required. It can be seen that node matching based on priority division can effectively improve the efficiency of matching each benchmark node with its corresponding candidate matching node, and further improve the overall efficiency of testing the simulation software.

[0122] Based on the above method, if each reference node in the pattern graph data corresponds to a matching target node in the target graph data, it is determined that the target graph data matches the pattern graph data, and at this time, it can be determined that the simulation software has passed the test. If there are some reference nodes that do not have matching target nodes in the target graph data, it is determined that the target graph data does not match the pattern graph data, and at this time, it can be determined that the simulation software has not passed the test.

[0123] by Figure 2 and Figure 3 For example, Figure 3 Each benchmark node in Figure 2 There is a matching target node in each of them, so it can be considered Figure 2 The corresponding target graph data and Figure 3 The corresponding pattern map data is matched.

[0124] It can be seen from the above method that this solution has a comprehensive data verification process, which can intelligently extract and automatically compare the full amount of data according to the actual usage scenario, greatly improving the test efficiency and ensuring the correctness of the data; the verification problem of the simulation system diagram file (target diagram TG) and the power equipment information file (mode diagram PG) is converted into a sub-graph matching problem. This method can be reused for batch verification of other simulation system information and has good practicality and generalization.

[0125] The above is one or more implementations of the software testing method based on graph matching in this specification. Based on the same idea, this specification also provides a corresponding software testing device based on graph matching, such as Figure 6 shown.

[0126] Figure 6 A schematic diagram of a software testing device based on graph matching provided in this specification includes:

[0127] The receiving module 601 is used to receive a test request for the simulation software of the target electrical device;

[0128] An acquisition module 602 is used to acquire simulation system information corresponding to the simulation software and device information corresponding to the target electrical device according to the test request;

[0129] A construction module 603 is used to construct graph data as target graph data according to the components and the connection relationship between the components contained in the simulation system information, and use the nodes in the target graph data as target nodes, and to construct graph data as pattern graph data according to the components and the connection relationship between the components contained in the device information, and use the nodes in the pattern graph data as reference nodes;

[0130] A determination module 604 is used to determine, for each reference node, nodes in each target node that have the same label as the reference node as candidate matching nodes corresponding to the reference node;

[0131] The matching module 605 is used to match the target graph data with the pattern graph data according to the candidate matching nodes corresponding to each reference node, and test the simulation software according to the matching results.

[0132] Optionally, the matching module 605 is specifically used to determine whether each reference node matches each corresponding candidate matching node; if each reference node in the pattern graph data corresponds to a matching target node in the target graph data, it is determined that the target graph data matches the pattern graph data.

[0133] Optionally, the matching module 605 is specifically used to determine, for each reference node, the connection relationship between the reference node and other reference nodes; for each candidate matching node corresponding to the reference node, determine whether the candidate matching node and the target node matched with the other reference nodes also have the connection relationship; if so, determine that the reference node matches the candidate matching node.

[0134] Optionally, the matching module 605 is specifically used to, for each reference node, determine a reference node that has been matched and has a connection relationship with the reference node as an associated node corresponding to the reference node, and determine a target node that matches the associated node; for each candidate matching node corresponding to the reference node, determine whether the candidate matching node and the target node that matches the associated node have the connection relationship, and if so, mark the candidate matching node as matched to obtain a marked node, otherwise determine that the reference node does not match the candidate matching node;

[0135] Optionally, the matching module 605 is also used to determine the next target node that has a connection relationship with the marked node, and to determine the next reference node that has a connection relationship with the reference node; when it is determined that the next target node does not match the next reference node, it is determined that the marked node does not match the reference node, and the marked node is marked as unmatched.

[0136] Optionally, for each reference node, before determining whether the reference node and each candidate matching node corresponding to the reference node match, the matching module 605 is further used to determine, for each reference node, a matching priority corresponding to the reference node according to the number of candidate matching nodes corresponding to the reference node;

[0137] The matching module 605 is specifically used to determine whether each reference node matches each corresponding candidate matching node according to the matching priority.

[0138] Optionally, for each reference node, the fewer the number of candidate matching nodes corresponding to the reference node, the higher the matching priority corresponding to the reference node.

[0139] 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 software testing method based on graph matching is provided.

[0140] This manual also provides Figure 7 The one shown corresponds to Figure 1 A schematic diagram of the electronic device. Figure 7 As mentioned above, 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 1 The software testing method based on graph matching. Of course, in addition to the software implementation, this specification does not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0141] For the improvement of a technology, it can be clearly distinguished whether it is a hardware improvement (for example, improvement of the circuit structure of diodes, transistors, switches, etc.) or a 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 a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming 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.

[0142] 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.

[0143] 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.

[0144] 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.

[0145] 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.

[0146] 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.

[0147] 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.

[0148] 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.

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

[0150] 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.

[0151] 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 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.

[0152] 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.

[0153] 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.

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

[0155] 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.

[0156] 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 software testing method based on graph matching, characterized in that: include: receiving a test request for simulation software of a target electrical device; According to the test request, obtaining simulation system information corresponding to the simulation software and device information corresponding to the target electrical device; According to the components contained in the simulation system information and the connection relationship between the components, graph data is constructed as target graph data, and each node in the target graph data is used as a target node; and, according to the components contained in the device information and the connection relationship between the components, graph data is constructed as pattern graph data, and each node in the pattern graph data is used as a reference node; For each reference node, determine in each target node the nodes having the same label as the reference node as candidate matching nodes corresponding to the reference node; According to each candidate matching node corresponding to each benchmark node, the target graph data is matched with the pattern graph data, and the simulation software is tested according to the matching result, wherein it is determined whether the connection relationship between each benchmark node is the same as the connection relationship between the candidate matching nodes corresponding to each benchmark node, so as to match the target graph data with the pattern graph data.

2. The method according to claim 1, characterized in that According to each candidate matching node corresponding to each reference node, matching the target graph data with the pattern graph data specifically includes: Determine whether each reference node matches each corresponding candidate matching node; If each reference node in the pattern graph data corresponds to a matching target node in the target graph data, it is determined that the target graph data matches the pattern graph data.

3. The method according to claim 2, characterized in that Determining whether each reference node matches each corresponding candidate matching node includes: For each reference node, determining a connection relationship between the reference node and other reference nodes; For each candidate matching node corresponding to the reference node, it is determined whether the candidate matching node and the target node matched with the other reference nodes also have the connection relationship. If so, it is determined that the reference node matches the candidate matching node.

4. The method according to claim 3, characterized in that For each candidate matching node corresponding to the reference node, determining whether the candidate matching node and the target node matched with the other reference nodes also have the connection relationship includes: For each reference node, determine a reference node that has a connection relationship with the reference node and has been matched, as an associated node corresponding to the reference node, and determine a target node that matches the associated node; For each candidate matching node corresponding to the reference node, determine whether the candidate matching node has the connection relationship with the target node that matches the associated node. If so, mark the candidate matching node as matched to obtain a marked node. Otherwise, determine that the reference node does not match the candidate matching node.

5. The method according to claim 4, characterized in that The method further comprises: Determine a next target node that has a connection relationship with the marked node, and determine a next reference node that has a connection relationship with the reference node; When it is determined that the next target node does not match the next reference node, it is determined that the marked node does not match the reference node, and the marked node is marked as not matching.

6. The method according to claim 2, characterized in that For each reference node, before determining whether the reference node matches each candidate matching node corresponding to the reference node, the method further includes: For each reference node, determine the matching priority corresponding to the reference node according to the number of candidate matching nodes corresponding to the reference node; Determining whether each reference node matches each corresponding candidate matching node includes: According to the matching priority, it is determined whether each reference node matches each corresponding candidate matching node.

7. The method according to claim 6, characterized in that For each reference node, the fewer the number of candidate matching nodes corresponding to the reference node, the higher the matching priority corresponding to the reference node.

8. A software testing device based on graph matching, characterized in that: include: A receiving module, used for receiving a test request of the simulation software for the target electrical equipment; An acquisition module, used for acquiring simulation system information corresponding to the simulation software and device information corresponding to the target electrical device according to the test request; A construction module, used to construct graph data as target graph data according to the components and the connection relationship between the components contained in the simulation system information, and use the nodes in the target graph data as target nodes, and to construct graph data as pattern graph data according to the components and the connection relationship between the components contained in the device information, and use the nodes in the pattern graph data as reference nodes; A determination module, for determining, for each reference node, nodes in each target node that have the same label as the reference node as candidate matching nodes corresponding to the reference node; A matching module is used to match the target graph data with the pattern graph data according to the candidate matching nodes corresponding to each reference node, and to test the simulation software according to the matching results, wherein it is determined whether the connection relationship between the reference nodes is the same as the connection relationship between the candidate matching nodes corresponding to each reference node, so as to match the target graph data with the pattern graph data.

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

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

Citation Information

Patent Citations

  • Analog integrated circuit-oriented sub-circuit matching method

    CN113987979A

  • Intelligent substation simulation test method, device and equipment and storage medium

    CN114239291A

  • Simulation test method and device for component

    CN116136952A

  • Graph data processing system, method and equipment and storage medium

    CN116501927A

  • Electrical node aggregation method and device based on graph theory

    CN117290744A