Logisim hardware class course experiment circuit diagram similarity degree detection method and system

By decomposing the Logisim circuit diagram into similar components and calculating the weighted Hausdorff distance, the error problem of plagiarism detection of Logisim circuit diagrams in the prior art is solved, and the accurate similarity judgment and plagiarism detection of complex circuit diagrams are achieved.

CN119167109APending Publication Date: 2024-12-20XI'AN PETROLEUM UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411326307.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-23
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

The existing technology is difficult to effectively detect the plagiarism behavior of Logisim circuit diagrams, especially in complex nested hardware experimental projects. The detection method that directly starts from the overall shape and outline of the circuit diagram is prone to errors, and it is impossible to effectively identify 'search and tiger' type plagiarism or dragging. Shape changes caused by some components of the circuit diagram.

Method used

By decomposing the Logisim circuit diagram into several similar components, calculating the weight of each component, and using the total weighted Hausdorff distance and bubble sorting method, the similarity of the circuit diagram is judged, reducing the interference of cheating methods on detection, and improving the effect of plagiarism detection.

Benefits of technology

It effectively reduces the interference of various cheating methods on similarity detection, improves the effect of plagiarism detection, and can accurately detect shape changes caused by the 'photographing cat and tiger' type plagiarism and dragging some components of the circuit diagram.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119167109A_ABST
    Figure CN119167109A_ABST
Patent Text Reader

Abstract

The invention discloses a Logisim hardware class course experimental circuit diagram similarity degree detection method and system, and the method comprises the steps: decomposing a group of Logisim circuit diagrams into a plurality of similar components for comparison, and calculating the overall similarity degree of the Logisim circuit diagrams through combining the weight of each type of components, a Logisim experimental circuit diagram with the highest similarity is found from the Logisim experimental circuit diagram data set by adopting a bubble sorting method; the detection system is used for operating the detection method and comprises a main body part assembly information set data set creating module, a similarity degree calculating module and a Logisim experimental circuit diagram searching module with the highest similarity degree. According to the method, the interference of various cheating means on similarity detection can be effectively reduced, and the plagiarism problem of how to detect the plagiarism in the experiment that the shape and the contour of the circuit diagram are changed due to the fact that a part of components of the circuit diagram are dragged is solved, so that the plagiarism detection effect is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of digital circuits, and in particular relates to a method and system for detecting similarity of experimental circuit diagrams of Logisim hardware courses. Background Art

[0002] Logisim is an experimental teaching tool used to design and simulate experimental circuit diagrams for hardware courses such as digital logic and computer organization principles. Due to its intuitive graphical interface and easy operation and learning characteristics, Logisim is widely used in undergraduate teaching to help people understand and learn the basic knowledge and design methods of digital circuits. However, due to its easy operation, people only need to drag some components in the copied Logisim circuit diagram to make the circuit diagram different, which seriously affects the quality of experimental teaching. Therefore, how to detect and judge whether the Logisim circuit diagram submitted by the personnel is plagiarized is a very critical step in the experimental teaching process.

[0003] There are two main ways to save Logisim circuit diagrams: text files in XML format and image files in PNG format. XML format text files use tags to describe the detailed information of all components and wires in a circuit diagram. Therefore, plagiarism detection in this form is usually achieved by comparing text similarities. The main detection methods are: WCopyfind, Jplag, etc., such as the JPIag comparison algorithm based on "Greedy String Tiling" disclosed in the article "Finding Plagiarisms among a Set of Programs with JPlag"; PNG format image files use pixel positions and color values ​​to describe the detailed information of all components and wires in a circuit diagram. Therefore, plagiarism detection in this form is usually achieved by using computer vision technology to extract features from images and compare them to quantify and evaluate the degree of similarity between images. The main detection methods are: hash algorithm, structural similarity (SSIM) algorithm, etc., such as the image copy detection algorithm based on "Robust Hashing" disclosed in the article "Robust Hashing With Local Tangent Space Alignment for Image Copy Detection". The current detection methods are only applicable to the similarity detection of general images, and cannot achieve good results for the plagiarism detection of Logisim circuit diagrams.

[0004] The human visual system (HSV) mainly considers the following aspects when judging whether two images are similar: shape and outline, texture and details, color distribution, etc. Among them, shape and outline are very important for similarity judgment. Because they directly affect the overall appearance. If the shapes and outlines of two pictures are very similar, people are more likely to think they are similar. When judging the Logisim circuit diagram, if we directly start from the overall shape and outline of the circuit diagram, when people deliberately drag some components of the circuit diagram to cause the shape and outline of the circuit diagram to change, the judgment result will be wrong.

[0005] The patent with application number 202111157834.X discloses a method for checking for duplicate Logisim circuit diagrams, which represents the Logisim circuit diagram as a set of maximum connected subgraphs, and calculates the similarity of the maximum connected subgraphs to calculate the repetition rate of the maximum connected subgraph set; however, this method has the disadvantage that it can only be applied to plagiarism detection of simple circuit diagrams, and is not very effective for Logisim circuit diagrams in more complex nested hardware experiment projects. Summary of the invention

[0006] In order to overcome the defects of the above-mentioned prior art, the purpose of the present invention is to provide a method and system for detecting the similarity of circuit diagrams in Logisim hardware course experiments. By decomposing a group of Logisim circuit diagrams into several similar components for comparison, and finally calculating the overall similarity of the Logisim circuit diagrams based on the weights of each type of components, the method can effectively detect "copycat" plagiarism or plagiarism based on the "copycat" type plagiarism by dragging some components of the circuit diagram to change the shape and outline of the circuit diagram.

[0007] In order to achieve the above object, the technical solution of the present invention is:

[0008] A method for detecting the similarity of experimental circuit diagrams in Logisim hardware courses comprises the following steps:

[0009] A1. Obtain a Logisim experimental circuit diagram dataset, convert the Logisim experimental circuit diagram into a collection of all component information of the main part of the circuit diagram, and thus create a component information collection dataset of the main part of the circuit diagram;

[0010] A2. Calculate the total weighted Hausdorff distance between the component information set of the main part of each person's circuit diagram and the component information set of the main part of other persons' circuit diagrams by a pairwise comparison method, and then determine the similarity between the two according to the total weighted Hausdorff distance;

[0011] A3. According to the total weighted Hausdorff distance and similarity calculated in step A2, a bubble sort method is used to find the Logisim experimental circuit diagram with the highest similarity from the Logisim experimental circuit diagram data set.

[0012] The specific process of step A1 is as follows:

[0013] A11. Each Logisim experimental circuit diagram consists of a title part and a main part. The attribute information of all components in the main part of the Logisim experimental circuit diagram is extracted.

[0014] A12. Convert the Logisim experimental circuit diagram into a point set consisting of attribute information of all components of the main part, where the attributes of the points in the point set include component type, component horizontal coordinate, and component vertical coordinate;

[0015] A13. The horizontal and vertical coordinates of all points in the point set are processed to approach zero.

[0016] The specific process of step A11 is as follows:

[0017] A111, read the information of all components in the Logisim experimental circuit diagram and find the vertical coordinate BoundaryLineY of the component containing the boundary between the title part and the main part;

[0018] A112. Traverse the information of all components and remove the components whose vertical coordinates are smaller than BoundaryLineY.

[0019] The specific process of step A12 is as follows:

[0020] A121. Abstract all components of the main part into points in a point set. The attributes of the point set include type attribute and position attribute, which correspond to the type, horizontal coordinate and vertical coordinate of the component.

[0021] A122. Extract the attribute information of all components in the main part of the Logisim experimental circuit diagram and store it in the point set.

[0022] The specific process of step A13 is as follows:

[0023] A131. Traverse all points in the point set and find the minimum horizontal coordinate X_Min and the minimum vertical coordinate Y_Min;

[0024] A132. Subtract X_Min from the horizontal coordinate of each point in the point set, and subtract Y_Min from the vertical coordinate of each point.

[0025] The specific process of step A2 is as follows:

[0026] A21. Calculate the component point set P of the two persons to be testeda , P b The ratio of the total number of each type of components to the total number of components in the two component points;

[0027] A22. Calculate the component point set P of the two persons to be tested a , P b The Hausdorff distance of each type of component in and assign it its weight;

[0028] A23. Calculate the component point set P of the two persons to be tested a , P b The sum of the weighted Hausdorff distances of each type of components in P is obtained a , P b The total weighted Hausdorff distance of the two persons to be tested is calculated, and the component point set P of the two persons to be tested is determined according to the total weighted Hausdorff distance combined with the threshold and the corresponding relationship between the similarity degree. a , P b degree of similarity;

[0029] A24. By using the pairwise comparison method among all the personnel component point sets to be tested, that is, executing steps A21, A22 and A23 for every two personnel component point sets to be tested, the total weighted Hausdorff distance between each personnel component information set and other personnel component information sets is calculated, and the similarity between the two is determined.

[0030] The specific process of step A21 is as follows:

[0031] A211. Obtain the component point set P of the two persons to be tested a , P b The union of all component types in TypeUnion and the total number of components in ComponentSum are initialized to 0 as the ratio of the total number of components of each type in TypeUnion to the total number of components in ComponentSum.

[0032] A212, traverse each component type in TypeUnion, respectively in P a , P b Count the number of components in each category and calculate the total number;

[0033] A213. Calculate the ratio of the total number of components of each type of TypeUnion to the total number of components ComponentSum. The ratio is the concentration of the component points of the two people under test, P a , P b The ratio of the total number of components of each type to the total number of components in the two component points.

[0034] The specific process of step A22 is as follows:

[0035] A221. Initialize the component point set P of the two persons to be tested a , P b The Hausdorff distance of each type of component in is 0;

[0036] A222. Obtain the component point sets P of the two persons to be tested in order a , P b A component type in the TypeUnion of all component types in P a , P b If both exist, jump to step A223, otherwise jump to step A224;

[0037] A223, in P a , P b Find the subpoint set P consisting of all components of this component type as , P bs , according to P as and P bs Calculate P a , P b The Hausdorff distance of the component of this type is calculated, and then jump to step A225;

[0038] A224, since there is only one point set with this type of component, its Hausdorff distance cannot be calculated; combined with the correspondence between the Hausdorff distance threshold and the degree of similarity, it is determined through experimental tests that the Hausdorff distance of this type of situation is 4.0, and then jump to step A225;

[0039] A225. Calculate the product of the Hausdorff distance of the component of this type and the proportion of the component of this type to the total number of components ComponentSum, and use it as the final weighted Hausdorff distance of the component of this type; if there are still unvisited component types in the union TypeUnion, jump to step A222.

[0040] The specific process of step A23 is as follows:

[0041] A231. Calculate the subpoint set P as To the subpoint set P bs The one-way Hausdorff distance h(P as ,P bs ):Traverse the subpoint set P as For all points in , calculate the distance from each point to the sub-point set P bs The Euclidean distances of all points in the set are calculated, and the minimum value of the Euclidean distances corresponding to each point is found. The median of the set consisting of the minimum values ​​of the Euclidean distances corresponding to each point is taken as the sub-point set P. asTo the subpoint set P bs One-way Hausdorff distance; Similarly, we can get the subpoint set P bs To the subpoint set P as The one-way Hausdorff distance h(P bs ,P as ); Finally, the larger value of the two one-way Hausdorff distances is taken as P a , P b The Hausdorff distance of this type of component in P a , P b The total weighted Hausdorff distance;

[0042] A232. If the total weighted Hausdorff distance Distance is within the threshold range of [0,1], then the component point set P of the two persons to be tested a , P b The degree of similarity is highly similar: if Distance is within the threshold range of [0,0.25), then P a , P b The similarity level is 1; if Distance is within the threshold range of (0.25, 0.75), then P a , P b The similarity level is 2; if Distance is within the threshold range of [0.75,1], then P a , P b The similarity level is level 3; if the total weighted Hausdorff distance Distance is within the threshold range of (1,2), then the component point set P of the two persons to be tested a , P b The similarity is moderate: if Distance is within the threshold range of (1,1.25], then P a , P b The similarity level is 1; if Distance is within the threshold range of (1.25, 1.75), then P a , P b The similarity level is 2; if Distance is within the threshold range of [1.75,2), then P a , P b The similarity level is level 3; if the total weighted Hausdorff distance Distance is within the threshold range of [2, +∞), then the component point set P of the two persons to be tested a , P b The degree of similarity is low or no similarity.

[0043] The specific process of step A3 is as follows:

[0044] For each Logisim experimental circuit diagram, according to the total weighted Hausdorff distance and similarity calculated in step A2, the bubble sort method is used to find the minimum value in each group of total weighted Hausdorff distances related to it in the Logisim experimental circuit diagram data set, and the Logisim experimental circuit diagram object corresponding to the minimum value is taken as the Logisim experimental circuit diagram with the highest similarity.

[0045] A similarity detection system for experimental circuit diagrams of Logisim hardware courses, used for running the above detection method, comprises: a main part component information set data set creation module, a similarity calculation module and a Logisim experimental circuit diagram search module with the highest similarity;

[0046] The main part component information set data set creation module is used to obtain the Logisim experimental circuit diagram data set, and create the main part component information set data set by converting the Logisim experimental circuit diagram into a set of all component information of the main part of the circuit diagram;

[0047] The similarity calculation module is used to calculate the total weighted Hausdorff distance between the component information set of the main part of the circuit diagram of each person and the component information set of the main part of the circuit diagram of other persons by a pairwise comparison method, so as to judge the similarity between the two according to the total weighted Hausdorff distance;

[0048] The module for searching for the Logisim experimental circuit diagram with the highest similarity is used to find the Logisim experimental circuit diagram with the highest similarity from the Logisim experimental circuit diagram data set by using a bubble sort method according to the calculated total weighted Hausdorff distance and the similarity.

[0049] Compared with the prior art, the advantages of the present invention are:

[0050] (1) The present invention represents the Logisim experimental circuit diagram as a point set composed of all components of the main part, and compares the similarity of the shapes composed of each type of components according to the component type, thereby obtaining the overall similarity of the Logisim experimental circuit diagram. This method can effectively reduce the interference of various cheating methods on similarity detection, thereby improving the effect of plagiarism detection.

[0051] (2) The present invention performs "zero point processing" on the coordinates of all components in the main part of the Logisim experimental circuit diagram toward the coordinate origin, effectively reducing the interference of changes in component coordinates caused by dragging the entire circuit diagram on similarity detection.

[0052] (3) When calculating the Hausdorff distance of each type of component, the present invention takes the median of the set consisting of the minimum values ​​of the Euclidean distances corresponding to each point as the one-way Hausdorff distance from point set A to point set B, thereby effectively reducing the interference of a large Hausdorff distance on similarity detection caused by intentionally dragging some components to a position far away from the main part of the circuit diagram.

[0053] In summary, the technical solution of the present invention represents the Logisim experimental circuit diagram as a point set composed of all components of the main part. This method can effectively reduce the interference of various cheating methods on similarity detection, and solve the problem of how to detect plagiarism in the experiment such as "copying the cat and the tiger" plagiarism or dragging some components of the circuit diagram to change the shape and outline of the circuit diagram, thereby improving the effect of plagiarism detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 The figure is a flow chart of a method for detecting similarity of experimental circuit diagrams of Logisim hardware courses based on Hausdorff distance according to the first embodiment of the present invention.

[0055] Figure 2 The following is a circuit diagram of a Logisim experiment of a person in the first embodiment of the present invention.

[0056] Figure 3 The Logisim experimental circuit diagram of the first embodiment of the present invention is converted into point set information composed of all components of the main part.

[0057] Figure 4 This is the point set information after the horizontal coordinates and vertical coordinates of all points in the point set are processed toward zero in the first embodiment of the present invention.

[0058] Figure 5 The following is a circuit diagram of a Logisim experiment performed by another person according to the first embodiment of the present invention.

[0059] Figure 6 This is the point set information after being processed to zero corresponding to the Logisim experimental circuit diagram of another person in the first embodiment of the present invention.

[0060] Figure 7 This is a Logisim experiment circuit diagram of the third person in the first embodiment of the present invention. DETAILED DESCRIPTION

[0061] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and specific embodiments.

[0062] like Figure 1As shown, a method for detecting the similarity of experimental circuit diagrams of Logisim hardware courses comprises the following steps:

[0063] A1. Obtain the Logisim experimental circuit diagram dataset and create a dataset of component information of the main part

[0064] In step A1, each Logisim experimental circuit diagram in the Logisim experimental circuit diagram data set is converted into a point set consisting of all components of the main part of the circuit diagram, thereby obtaining a main part component information set data set. The conversion method includes the following steps:

[0065] (1) Extract the attribute information of all components in the main part of the Logisim experimental circuit diagram, and convert the Logisim experimental circuit diagram into a point set consisting of all components in the main part. Figure 2 As shown, a Logisim experimental circuit diagram consists of a header part and a main part. The header part contains a small number of components, which mainly stipulate the input, output, some design requirements and the boundary between the header part and the main part of the experimental circuit diagram; the main part is used for the specific experimental circuit diagram design. Therefore, it is only necessary to extract all the component information of the main part. In this process, it is necessary to determine the main part based on the vertical coordinate of the boundary between the title part and the main part (the boundary line BoundaryLineY in the Logisim experimental circuit diagram is the vertical coordinate 322 of the label component with the content "Note: No input and output port signals can be added"), and remove all components in the circuit diagram whose vertical coordinates are less than BoundaryLineY, so as to obtain the following Figure 3 The point set information P1 shown is composed of all components of the main part of the circuit diagram.

[0066] (2) The horizontal and vertical coordinates of all points in the point set P1 are processed to be close to zero. For example: Figure 2 As shown in the figure, the information of the point set P1 corresponding to the components of the main part of the Logisim experimental circuit diagram is: 22 "Tunnel" type components, 8 "★1-bit full adder" type components, 1 "XOR Gate" type component and 3 "Splitter" type components and the corresponding position information of each component. The smallest horizontal coordinate is 100 and the smallest vertical coordinate is 370. Subtract 100 from the horizontal coordinate of each point in the point set P1 and subtract 370 from the vertical coordinate of each component, so that the relative positions of all points in the point set remain unchanged, and all points are close to zero.

[0067] A2. Calculate the total weighted Hausdorff distance between each personnel component information set and other personnel component information sets by pairwise comparison, and then judge the similarity between the two based on the total weighted Hausdorff distance.

[0068] A21. A method for calculating the ratio of the total number of each type of components in the component point sets P1 and P2 of two persons to be tested to the total number of components in the component point sets of the two persons to be tested comprises the following steps:

[0069] (A211) Obtain the union of all component types TypeUnion and the total number of components ComponentSum in the component point sets P1 and P2 of the two persons to be tested. For example: The information of P1 and P2 is as follows Figure 4 and Figure 6 As shown, the union TypeUnion of all component types in P1 and P2 is {"Tunnel", "★1-bit full adder", "XOR Gate", "Splitter"}; the total number of components ComponentSum is 70.

[0070] (A212) Traverse each component type in TypeUnion, count the number of components of each type in P1 and P2 respectively, and calculate the total number. For example: in P1, there are 22 "Tunnel" type components, 8 "★1-bit full adder" type components, 1 "XOR Gate" type components, and 3 "Splitter" type components; in P2, there are 27 "Tunnel" type components, 8 "★1-bit full adder" type components, and 1 "XOR Gate" type components; in P1 and P2, there are 49 "Tunnel" type components in total, 16 "★1-bit full adder" type components in total, 2 "XOR Gate" type components in total, and 3 "Splitter" type components in total.

[0071] (A213) Calculate the ratio of the total number of components of each type of TypeUnion to the total number of components ComponentSum. For example: the ratio of the "Tunnel" type component to the total number of components ComponentSum in P1 and P2 is 0.7, the ratio of the "★1-bit full adder" type component to the total number of components ComponentSum is about 0.228, the ratio of the "XOR Gate" type component to the total number of components ComponentSum is about 0.028, and the ratio of the "Splitter" type component to the total number of components ComponentSum is about 0.042.

[0072] A22. The method for calculating the Hausdorff distance of each type of component in the component point sets P1 and P2 of two persons to be tested and assigning the weights thereof comprises the following steps:

[0073] (A221) Initialize the Hausdorff distance of each type of component in the component point sets P1 and P2 of the two persons to be tested to 0;

[0074] (A222) sequentially obtain a component type from the union of all component types in the component point sets P1 and P2 of the two persons to be tested, and if the component type exists in both P1 and P2, jump to step (3); otherwise, jump to step (A224);

[0075] (A223) Find the subpoint sets P1S and P2S consisting of all components of this component type in P1 and P2, calculate the Hausdorff distance of this type of components (component types existing in both P1 and P2) in P1 and P2 according to P1S and P2S, and then jump to step (A225);

[0076] (A224) Since only one point set has this type of component, its Hausdorff distance cannot be calculated; combined with the correspondence between the Hausdorff distance threshold and the degree of similarity, the Hausdorff distance of this type of situation needs to be greater than 2. Finally, after experimental testing, it is determined that the Hausdorff distance of this type of component in P1 and P2 (the component type that only exists in P1 and P2) is 4.0, and then jump to step (A225);

[0077] (A225) Calculate the product of the Hausdorff distance of the component of this type and the proportion of the component of this type to the total number of components ComponentSum, and use it as the final weighted Hausdorff distance of the component of this type. If there are still unvisited component types in the union TypeUnion, jump to step (A222).

[0078] For example: Calculate the Hausdorff distance of each type of component in the component point sets P1 and P2 of the two people to be tested and assign them a weight. Take the calculation of the Hausdorff distance of the "★1-bit full adder" type component as an example: Since this type of component exists in both P1 and P2, go to step (3); find the sub-point set P1S composed of "★1-bit full adder" type components in P1 and P2 {(★1-bit full adder, (200, 110)), (★1-bit full adder, (380, 110)), (★1-bit full adder, (660, 110)), (★1-bit full adder, (750, 110)), (★1-bit full adder, (480, 110)), (★1-bit full adder, (280, 110)). 0)), (★1-bit full adder, (860, 110)), (★1-bit full adder, (570, 110))}, P2S{(★1-bit full adder, (750, 160)), (★1-bit full adder, (390, 160)), (★1-bit full adder, (480, 160)), (★1-bit full adder, (570, 160)), (★1-bit full adder, (300, 160)), (★1-bit full adder, (660, 160)), (★1-bit full adder, (210, 160)), (★1-bit full adder, (120, 160))}. The specific process of calculating the Hausdorff distance of the "★1-bit full adder" type component (component type existing in both P1 and P2) in P1 and P2 according to P1S and P2S is as follows: First, calculate the one-way Hausdorff distance h(P1S, P2S) from the sub-point set P1S to the sub-point set P2S. That is, traverse all points in the sub-point set P1S, calculate the Euclidean distance from each point to all points in the sub-point set P2S (if the coordinate values ​​of the points in the sub-point sets P1S and P2S are large, the calculated Euclidean distance can be reduced to the same order of magnitude as the threshold) and find the minimum value of the Euclidean distance corresponding to each point, and take the median of the set consisting of the minimum values ​​of the Euclidean distance corresponding to each point as the one-way Hausdorff distance from the sub-point set P1S to the sub-point set P2S.Taking (★1-bit full adder, (200,110)) as an example, the component obtains the Euclidean distance of all points of P2S (due to the large coordinate value, the calculated Euclidean distance is reduced to the same order of magnitude as the threshold, and the Euclidean distance is reduced by 100 times here) as {5.522680508593631, 1.96468827043885, 2.8442925306655784, 3.733630940518 894, 1.118033988749895, 4.62709412050371, 0.5099019513592785, 0.9433981132056605}, the minimum value is 0.5099019513592785; calculate the Euclidean distances of the other seven points to all the points of P2S in turn and find their minimum value; then in the set {0.5, 0.5, 0. 5, 0.5, 0.5099019513592785, 0.5099019513592785, 0.5385164807134504, 1.2083045973594573}, the median is 0.5049509756796393, and the final one-way Hausdorff distance h(P1S,P2S) from the sub-point set P1S to the sub-point set P2S is 0.504950975679 6393; Similarly, the one-way Hausdorff distance h(P2S,P1S) from the sub-point set P2S to the sub-point set P1S is 0.5049509756796393; Finally, the larger value of h(P1S,P2S) and h(P2S,P1S) is taken as the Hausdorff distance of the "★1-bit full adder" type component (component type existing in both P1 and P2) in P1 and P2, which is 0.5049509756796393. After being assigned a weight of 0.228, the weighted Hausdorff distance of the "★1-bit full adder" type component (component type existing in both P1 and P2) is 0.11541736586963183. Let's take the calculation of the Hausdorff distance of the "Splitter" type component as an example: since this type of component exists in P1 but not in P2, we proceed to step (4); the Hausdorff distance of the "Splitter" type component (a component type that only exists in P1 or P2) in P1 and P2 is 4.0. After the weight of 0.042 is assigned, the weighted Hausdorff distance of the "Splitter" type component (a component type that only exists in P1 or P2) is 0.17142857142857143.The weighted Hausdorff distances of the other two types of components are: the weighted Hausdorff distance of the "Tunnel" type component is 0.6603786792439623; the weighted Hausdorff distance of the XOR Gate is 0.06240094190811873.

[0079] A23, calculating the sum of the weighted Hausdorff distances of each type of component in the component point sets P1 and P2 of the two persons to be tested, thereby obtaining the total weighted Hausdorff distance of the component point sets P1 and P2 of the two persons to be tested, and judging the similarity of the component point sets P1 and P2 of the two persons to be tested according to the total weighted Hausdorff distance combined with the corresponding relationship between the threshold and the similarity degree. The specific process is:

[0080] First, the weighted Hausdorff distance of each type of component in the component point sets P1 and P2 of the two persons to be tested is summed, and the total weighted Hausdorff distance of the component point sets P1 and P2 of the two persons to be tested is obtained as: 1.0096255584502842; then, the similarity of the component point sets P1 and P2 of the two persons to be tested is judged by combining the corresponding relationship between the threshold and the similarity degree: 1.0096255584502842 is within the threshold range of (1,1.25], so it can be concluded that the similarity of the component point sets P1 and P2 of the two persons to be tested is moderately similar, and the similarity level is level 1.

[0081] A24. By using a pairwise comparison method among all the component point sets of the persons to be tested, that is, executing steps A21, A22 and A23 for every two component point sets of the persons to be tested, the total weighted Hausdorff distance between the circuit diagram component information set of each person and the circuit diagram component information sets of other persons is calculated, and the degree of similarity between the two is determined.

[0082] For example: Logisim experimental circuit diagram data set consists of Figure 2 , Figure 5 and Figure 7 The three Logisim experimental circuit diagrams shown are composed of Figure 2 The Logisim experiment circuit diagram shown: Calculation Figure 2 and Figure 5 The total weighted Hausdorff distance of the Logisim experimental circuit diagram shown is 1.0096255584502842, the similarity is moderately similar, and the similarity level is level 1; calculation Figure 2 and Figure 7 The total weighted Hausdorff distance of the Logisim experimental circuit diagram shown is 1.1573370589140468, the similarity is moderately similar, and the similarity level is level 1; Figure 5 The Logisim experimental circuit diagram shown: Figure 5 and Figure 2 The total weighted Hausdorff distance of the Logisim experimental circuit diagram shown is equal to Figure 2 and Figure 5 The total weighted Hausdorff distance of the Logisim experimental circuit diagram shown; Calculate Figure 5 and Figure 7 The total weighted Hausdorff distance of the Logisim experimental circuit diagram shown is 0.6124721211111975, the degree of similarity is highly similar, and the similarity level is 2.

[0083] A3. Based on the total weighted Hausdorff distance and similarity calculated in step A2, find the Logisim experimental circuit diagram with the highest similarity from the Logisim experimental circuit diagram dataset.

[0084] For each Logisim experimental circuit diagram, according to the total weighted Hausdorff distance and similarity calculated in step A2, the bubble sort method is used to find the minimum value in each group of total weighted Hausdorff distances related to it in the Logisim experimental circuit diagram data set, and the Logisim experimental circuit diagram object corresponding to the minimum value is taken as the Logisim experimental circuit diagram with the highest similarity.

[0085] For example: Figure 2 The Logisim experimental circuit diagram shown: According to the total weighted Hausdorff distance and similarity calculated in step A2, the following are related: Figure 2 and Figure 5 The total weighted Hausdorff distance is 1.0096255584502842; Figure 2 and Figure 7 The total weighted Hausdorff distance of is 1.1573370589140468; the minimum value obtained by bubble sorting these two total weighted Hausdorff distances is 1.0096255584502842. Figure 2 The Logisim experimental circuit diagram shown in the figure has the highest similarity with the Logisim experimental circuit diagram in the Logisim experimental circuit diagram dataset: Figure 5 ;for Figure 5 The Logisim experimental circuit diagram shown: According to the total weighted Hausdorff distance and similarity calculated in step A2, the following are related: Figure 5 and Figure 2 The total weighted Hausdorff distance is 1.0096255584502842; Figure 5 and Figure 7 The total weighted Hausdorff distance of the Logisim experimental circuit diagram shown is 0.6124721211111975; the minimum value obtained by bubble sorting these two total weighted Hausdorff distances is 0.612472121111197. Figure 5 The Logisim experimental circuit diagram shown in the figure has the highest similarity with the Logisim experimental circuit diagram in the Logisim experimental circuit diagram dataset: Figure 7 ;for Figure 7 The Logisim experimental circuit diagram shown has the following associated values ​​according to the total weighted Hausdorff distance and similarity calculated in step A2: Figure 7 and Figure 2 The total weighted Hausdorff distance is 1.1573370589140468; Figure 7 and Figure 5 The total weighted Hausdorff distance of is 0.6124721211111975; the minimum value of bubble sorting these two total weighted Hausdorff distances is 0.6124721211111975. Figure 7 The Logisim experimental circuit diagram shown in the figure has the highest similarity with the Logisim experimental circuit diagram in the Logisim experimental circuit diagram dataset: Figure 5 .

[0086] The present invention also includes a Logisim hardware course experimental circuit diagram similarity detection system for running the above detection method, referring to Figure 1 , including: a module for creating a data set of component information of the main body, a module for calculating the similarity degree, and a module for searching the circuit diagram of the Logisim experiment with the highest similarity degree;

[0087] The main part component information set data set creation module is used to obtain the Logisim experimental circuit diagram data set, and create the main part component information set data set by converting the Logisim experimental circuit diagram into a set of all component information of the main part of the circuit diagram;

[0088] The similarity calculation module is used to calculate the total weighted Hausdorff distance between the component information set of the main part of the circuit diagram of each person and the component information set of the main part of the circuit diagram of other persons by a pairwise comparison method, so as to judge the similarity between the two according to the total weighted Hausdorff distance;

[0089] The module for searching for the Logisim experimental circuit diagram with the highest similarity is used to find the Logisim experimental circuit diagram with the highest similarity from the Logisim experimental circuit diagram data set by using a bubble sort method according to the calculated total weighted Hausdorff distance and the similarity.

[0090] In summary, the present invention decomposes the Logisim circuit diagram: the overall structure of the Logisim circuit diagram can be regarded as a shape composed of several similar components. When a group of Logisim circuit diagrams need to be compared, they can be classified and compared according to the component type, and each type of component can be given a certain weight in combination with the number of each type of component, and finally the overall comparison result of the Logisim circuit diagram is obtained. The Hausdorff distance can be well applied to this process. The Hausdorff distance is a metric for measuring the distance between two point sets and is widely used in the fields of image processing, computer vision and shape matching. It is particularly suitable for comparing the similarity of two shapes, even if the size, position or number of points of the two shapes are different. The similarity of each type of component can be obtained by using the Hausdorff distance, and then the similarity of the overall Logisim circuit diagram can be obtained.

[0091] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for detecting the similarity of experimental circuit diagrams in Logisim hardware courses, characterized in that: The following steps are involved: A1. Obtain a Logisim experimental circuit diagram dataset, convert the Logisim experimental circuit diagram into a collection of all component information of the main part of the circuit diagram, and thus create a component information collection dataset of the main part of the circuit diagram; A2. Calculate the total weighted Hausdorff distance between the component information set of the main part of each person's circuit diagram and the component information set of the main part of other persons' circuit diagrams by a pairwise comparison method, and then determine the similarity between the two according to the total weighted Hausdorff distance; A3. According to the total weighted Hausdorff distance and similarity calculated in step A2, a bubble sort method is used to find the Logisim experimental circuit diagram with the highest similarity from the Logisim experimental circuit diagram data set.

2. A method for detecting similarity of experimental circuit diagrams in Logisim hardware courses according to claim 1, characterized in that: The specific process of step A1 is as follows: A11. Each Logisim experimental circuit diagram consists of a title part and a main part. The attribute information of all components in the main part of the Logisim experimental circuit diagram is extracted. A12. Convert the Logisim experimental circuit diagram into a point set consisting of attribute information of all components of the main part, where the attributes of the points in the point set include component type, component horizontal coordinate, and component vertical coordinate; A13. The horizontal and vertical coordinates of all points in the point set are processed to approach zero.

3. A method for detecting similarity of circuit diagrams in Logisim hardware course experiments according to claim 2, characterized in that: The specific process of step A11 is as follows: A111, read the information of all components in the Logisim experimental circuit diagram and find the vertical coordinate BoundaryLineY of the component containing the boundary between the title part and the main part; A112. Traverse the information of all components and remove the components whose vertical coordinates are smaller than BoundaryLineY.

4. A method for detecting similarity of circuit diagrams in Logisim hardware course experiments according to claim 2, characterized in that: The specific process of step A12 is as follows: A121. Abstract all components of the main part into points in a point set. The attributes of the point set include type attribute and position attribute, which correspond to the type, horizontal coordinate and vertical coordinate of the component. A122. Extract the attribute information of all components in the main part of the Logisim experimental circuit diagram and store it in the point set. The specific process of step A13 is as follows: A131. Traverse all points in the point set and find the minimum horizontal coordinate X_Min and the minimum vertical coordinate Y_Min; A132. Subtract X_Min from the horizontal coordinate of each point in the point set, and subtract Y_Min from the vertical coordinate of each point.

5. A method for detecting similarity of experimental circuit diagrams in Logisim hardware courses according to claim 1, characterized in that: The specific process of step A2 is as follows: A21. Calculate the component point set P of the two persons to be tested a , P b The ratio of the total number of each type of components to the total number of components in the two component points; A22. Calculate the component point set P of the two persons to be tested a , P b The Hausdorff distance of each type of component in and assign it its weight; A23. Calculate the component point set P of the two persons to be tested a , P b The sum of the weighted Hausdorff distances of each type of components in P is obtained a , P b The total weighted Hausdorff distance of the two persons to be tested is calculated, and the component point set P of the two persons to be tested is determined according to the total weighted Hausdorff distance combined with the threshold and the corresponding relationship between the similarity degree. a , P b degree of similarity; A24. By using the pairwise comparison method among all the personnel component point sets to be tested, that is, executing steps A21, A22 and A23 for every two personnel component point sets to be tested, the total weighted Hausdorff distance between each personnel component information set and other personnel component information sets is calculated, and the similarity between the two is determined.

6. A method for detecting similarity of experimental circuit diagrams in Logisim hardware courses according to claim 5, characterized in that: The specific process of step A21 is as follows: A211. Obtain the component point set P of the two persons to be tested a , P b The union of all component types in TypeUnion and the total number of components in ComponentSum are initialized to 0 as the ratio of the total number of components of each type in TypeUnion to the total number of components in ComponentSum. A212, traverse each component type in TypeUnion, respectively in P a , P b Count the number of components in each category and calculate the total number; A213. Calculate the ratio of the total number of components of each type of TypeUnion to the total number of components ComponentSum. The ratio is the concentration of the component points of the two people under test, P a , P b The ratio of the total number of components of each type to the total number of components in the two component points.

7. A method for detecting similarity of experimental circuit diagrams in Logisim hardware courses according to claim 5, characterized in that: The specific process of step A22 is as follows: A221. Initialize the component point set P of the two persons to be tested a , P b The Hausdorff distance of each type of component in is 0; A222. Obtain the component point sets P of the two persons to be tested in order a , P b A component type in the TypeUnion of all component types in P a , P b If both exist, jump to step A223, otherwise jump to step A224; A223, in P a , P b Find the subpoint set P consisting of all components of this component type as , P bs , according to P as and P bs Calculate P a , P b The Hausdorff distance of the component of this type is calculated, and then jump to step A225; A224, since there is only one point set with this type of component, its Hausdorff distance cannot be calculated; combined with the correspondence between the Hausdorff distance threshold and the degree of similarity, it is determined through experimental tests that the Hausdorff distance of this type of situation is 4.0, and then jump to step A225; A225. Calculate the product of the Hausdorff distance of the component of this type and the proportion of the component of this type to the total number of components ComponentSum, and use it as the final weighted Hausdorff distance of the component of this type; if there are still unvisited component types in the union TypeUnion, jump to step A222.

8. A method for detecting similarity of experimental circuit diagrams in Logisim hardware courses according to claim 5, characterized in that: The specific process of step A23 is as follows: A231. Calculate the subpoint set P as To the subpoint set P bs The one-way Hausdorff distance h(P as ,P bs ):Traverse the subpoint set P as For all points in , calculate the distance from each point to the sub-point set P bs The Euclidean distances of all points in the set are calculated, and the minimum value of the Euclidean distances corresponding to each point is found. The median of the set consisting of the minimum values ​​of the Euclidean distances corresponding to each point is taken as the sub-point set P. as To the subpoint set P bs One-way Hausdorff distance; Similarly, we can get the subpoint set P bs To the subpoint set P as The one-way Hausdorff distance h(P bs ,P as ); Finally, the larger value of the two one-way Hausdorff distances is taken as P a , P b The Hausdorff distance of this type of component in P a , P b The total weighted Hausdorff distance; A232. If the total weighted Hausdorff distance Distance is within the threshold range of [0,1], then the component point set P of the two persons to be tested a , P b The degree of similarity is highly similar: if Distance is within the threshold range of [0,0.25), then P a , P b The similarity level is 1; if Distance is within the threshold range of (0.25, 0.75), then P a , P b The similarity level is 2; if Distance is within the threshold range of [0.75,1], then P a , P b The similarity level is level 3; if the total weighted Hausdorff distance Distance is within the threshold range of (1,2), then the component point set P of the two persons to be tested a , P b The similarity is moderate: if Distance is within the threshold range of (1,1.25], then P a , P b The similarity level is 1; if Distance is within the threshold range of (1.25, 1.75), then P a , P b The similarity level is 2; if Distance is within the threshold range of [1.75,2), then P a , P b The similarity level is level 3; if the total weighted Hausdorff distance Distance is within the threshold range of [2, +∞), then the component point set P of the two persons to be tested a , P b The degree of similarity is low or no similarity.

9. A method for detecting similarity of experimental circuit diagrams in Logisim hardware courses according to claim 1, characterized in that: The specific process of step A3 is as follows: For each Logisim experimental circuit diagram, according to the total weighted Hausdorff distance and similarity calculated in step A2, the bubble sort method is used to find the minimum value in each group of total weighted Hausdorff distances related to it in the Logisim experimental circuit diagram data set, and the Logisim experimental circuit diagram object corresponding to the minimum value is taken as the Logisim experimental circuit diagram with the highest similarity.

10. A similarity detection system for experimental circuit diagrams in Logisim hardware courses, characterized in that: Used to run the detection method described in claims 1 to 9 above, comprising: a main body component information set data set creation module, a similarity calculation module and a Logisim experimental circuit diagram search module with the highest similarity; The main body component information set data set creation module is used to obtain a Logisim experimental circuit diagram data set, and create a circuit diagram main body component information set data set by converting the Logisim experimental circuit diagram into a set of all component information of the circuit diagram main body; The similarity calculation module is used to calculate the total weighted Hausdorff distance between the component information set of the main part of the circuit diagram of each person and the component information set of the main part of the circuit diagram of other persons by a pairwise comparison method, so as to judge the similarity between the two according to the total weighted Hausdorff distance; The module for searching for the Logisim experimental circuit diagram with the highest similarity is used to find the Logisim experimental circuit diagram with the highest similarity from the Logisim experimental circuit diagram data set by using a bubble sort method according to the calculated total weighted Hausdorff distance and the similarity.