CN109976807B - Key package identification method based on software operation network - Google Patents

Key package identification method based on software operation network Download PDF

Info

Publication number
CN109976807B
CN109976807B CN201910033604.9A CN201910033604A CN109976807B CN 109976807 B CN109976807 B CN 109976807B CN 201910033604 A CN201910033604 A CN 201910033604A CN 109976807 B CN109976807 B CN 109976807B
Authority
CN
China
Prior art keywords
packet
software
classes
pdn
cdn
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910033604.9A
Other languages
Chinese (zh)
Other versions
CN109976807A (en
Inventor
潘伟丰
蒋海波
王家乐
柴春来
姜波
朱云芳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Youxi Technology Co ltd
Original Assignee
Shenzhen Youxi Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Youxi Technology Co ltd filed Critical Shenzhen Youxi Technology Co ltd
Priority to CN201910033604.9A priority Critical patent/CN109976807B/en
Publication of CN109976807A publication Critical patent/CN109976807A/en
Application granted granted Critical
Publication of CN109976807B publication Critical patent/CN109976807B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/75Structural analysis for program understanding

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a key package identification method based on a software operation network, which comprises the following steps: abstracting a method calling process of software written by Java language during operation into a method calling network; constructing a class dependency network based on the method call network; constructing a packet dependent network based on the class dependent network; calculating the g core number of the packet node based on the packet dependent network, and taking the g core number of the packet node as a measurement index of the importance of the packet node; and performing descending order according to the g cores of the packet nodes to obtain the key packet. In the prior art, a model for describing packages and relationships among the packages is not accurate enough mainly based on static analysis of software source codes. At the same time, the metric used did not accurately characterize the importance of the package. The invention makes up the defects of the prior art, uses a dynamic analysis method based on software operation, and uses the g-core number to measure the importance of the package, thereby identifying the key package. The method has important significance for improving software understanding efficiency, code maintenance efficiency and the like.

Description

Key package identification method based on software operation network
Technical Field
The invention relates to a software key package identification method, in particular to a key package identification method based on a software running network.
Background
Computer software plays an increasingly important role in our lives, so that people have increasingly high requirements on software quality. However, the development of software is a very complicated mental activity, and particularly, as the complexity of the software increases, errors are inevitably introduced in the software development process. Meanwhile, the requirement of the software has uncertainty, and new requirements always emerge continuously in the life cycle of the software. In order for software to remain viable, software must continually evolve to accommodate new needs. The evolution of software also introduces new errors. Therefore, in order to reduce the probability of error introduction during software maintenance, the maintained software must be well understood. However, understanding software is not an easy task, particularly when the software becomes exceptionally complex. Therefore, an effective technology is provided to assist maintenance personnel in understanding the software, so that the maintenance work of the software is simplified, the probability of software introduced errors is reduced, and the improvement of the quality of the software has important significance for daily software maintenance work.
So complex the software, from where we should start understanding the software? Research has shown that it is a feasible method to understand software from its key elements (packages, classes, methods, attributes, etc.), i.e. to understand the key elements first, then to understand the elements related to the key elements along the dependencies between the elements, and so on, thereby understanding the whole software step by step. To identify key software elements, a metric must first be constructed to measure the importance of the software elements. Much work has been done on key element identification: zaidman et al constructs a static class dependency graph and measures the importance of classes using the HITS algorithm. Zhouying et al abstracts the software system of class granularity with class dependency graphs and measures the importance of classes using the PageRank algorithm, HITS, betweenness centrality, and the like. The ginger shujuan and the like construct a state transition model of software, and further measure the importance of classes by calculating the complexity of nodes of the state transition tree. The Panviet al constructs a software structure chart of class granularity and package granularity, and further measures the importance of classes and packages by using a PageRank algorithm, an index and the like. Although there is currently some work on the identification of key elements in software, the following disadvantages remain:
(1) The existing work in the aspect of software key element identification is mainly based on static analysis of software source codes, and dynamic analysis of software in actual operation is lacked. Static analysis does not need to run software, only depends on software source codes, and the relationship among the extracted elements is actually a relationship under the worst condition and may contain redundant relationships; the dynamic analysis needs to run software, collect elements and relationships among the elements in the software running process, and represent the real interaction among the elements. Dynamic analysis is more accurate than static analysis.
(2) The existing work on the identification of key elements of software mainly focuses on measuring the importance of classes, and the work on the importance measurement of methods and packet granularity is very little. Meanwhile, when measuring the importance of the classes, an index is often constructed based on the interaction relationship between the classes and the strength thereof, the influence of the class degree (the number of other interactive classes) on the class importance is ignored, and the importance of the classes cannot be accurately described.
Packages, classes, methods are different levels of software understanding. The cladding level has the largest granularity, the method level has the finest granularity, and the class granularity is intermediate. For some large software, choosing to understand the software starting from packet granularity is one possible way. The key package identification method based on the software operation network can make up the defects of the existing work, so that more accurate model expression packages and inter-package dependence are constructed, more accurate measurement index measurement packages are provided, and technical support is provided for software understanding and software maintenance work.
Disclosure of Invention
The invention aims to provide a key packet identification method based on a software running network aiming at the defects of the prior art.
The technical problem of the invention is mainly solved by the following technical scheme: a key package identification method based on a software operation network comprises the following steps:
(1) Software written in the Java language is abstracted to a method call net FCN = (N, D) at method granularity. Wherein N is a set of method nodes in software; d = { (f) i ,f j )}(f i ∈N,f j e.N) is a set of undirected edges and represents the calling relationship among the methods; each edge will be assigned a non-negative integer as the strength value of the method call relationship. The calling relation between the methods is obtained according to the actual running process of the Java software on the Java virtual machine. The intensity value on the edge refers to the number of calls between methods, and is also obtained in the actual running process of the Java virtual machine according to the Java software.
(2) Constructing a CDN (content delivery network) = (N) based on the FCN completed in the step (1) c ,D c ). Wherein N is c The method is a set of class nodes where methods in the FCN are located; d c ={(c i ,c j )}(c i ∈N c ,c j ∈N c ) Is a set of undirected edges, representing dependencies between classes; each edge in the CDN will be assigned a non-negative integer as the strength value of the dependency between classes. Classes in the CDN are obtained according to the method in the FCN. The class in the FCN where the method is defined becomes a class in the CDN. Meanwhile, the classes in the CDN are a collective name of classes, internal classes, abstract classes, and interfaces in Java. The dependency relationship between the classes is obtained according to the call relationship between the methods in the FCN, that is, if the call relationship exists between the methods included in the classes, the dependency relationship exists between the corresponding classes. The strength value of the dependency relationship between the classes is obtained according to the strength value of the call relationship between the methods in the FCN, that is, the sum of the strength values between the methods included in the classes is the strength value of the dependency relationship between the corresponding classes.
(3) Packet dependent network PDN = (N) constructed based on CDN completed in step (2) p ,D p ). Wherein N is p A set of packet nodes where classes in the CDN are located; d p ={(p i ,p j )}(p i ∈N p ,p j ∈N p ) Is a set of undirected edges, representing the dependency between packages; each edge in the PDN will be assigned a non-negative integer as the strength value of the dependency between the packets. Packets in the PDN are obtained from classes in the CDN. The class-defined packets in the CDN become packets in the PDN. The dependency relationship between the packages is obtained according to the dependency relationship between the classes contained in the packages, that is, the classes contained in the packages have the dependency relationship therebetween, and then the dependency relationship also exists between the corresponding packages. The strength value of the dependency relationship between the packages is obtained according to the strength value of the dependency relationship between the classes in the CDN, that is, the sum of the strength values between the classes included in a package is the strength value of the dependency relationship between the corresponding packages. The packets in the PDN, the dependency relationship among the packets and the strength value of the dependency relationship are obtained in the actual running process of the Java software on a Java virtual machine, and are dynamic analysis instead of static analysis based on source codes.
(4) And (4) calculating the g core number g (i) of the packet node i based on the PDN finished in the step (3) as the importance value of the corresponding packet of the node.
(5) And (5) performing descending order on the packet nodes based on the g-core number of the packet nodes obtained in the step (4), and taking the packet with the top rank as the identified key packet.
Further, the CDN construction in the step (2) specifically includes the following sub-steps:
(2.1) extracting all classes where the methods in the FCN are located, and constructing a CDN (content delivery network) with nodes and no edges, namely CDN = (N) c ,D c = Φ). Φ represents the edge set as null.
(2.2) taking one side (f) in the step (1) D i ,f j ) E.g. D, according to f i And f j The naming rule of (2) determines the class it defines, let f i Is defined in class k, f j Defined in class p. If k ≠ p, and (k, p) is not at D c If internal, (k, p) is added to D c While the intensity value of the side (k, p) is the side (f) i ,f j ) An intensity value of; if k ≠ p, and (k, p) has been at D c If so, update D c Intensity value on inner (k, p) edge, so that its new intensity value is equal to the original value plus the upper edge (f) i ,f j ) The intensity value of (c). If k is equal to p, no processing is done.
(2.3) repeating step (2.2) until all edges in the FCN have been traversed.
Further, the construction of the PDN in step (3) specifically includes the following sub-steps:
(3.1) extracting all packets where the class is located in the CDN, and constructing a PDN with only nodes and no edges, namely PDN = (N) p ,D p = Φ). Φ represents the edge set as null.
(3.2) taking the step (2) D c One side (c) of i ,c j )∈D c According to c i And c j The naming convention of (c) determines the package it defines, let c i Defined in package k, c j Defined in package p. If k ≠ p, and (k, p) is not at D p If internal, (k, p) is added to D p While the intensity value of the edge (k, p) is the edge (c) i ,c j ) An intensity value of; if k ≠ p, and (k, p) is already at D p If so, update D p Intensity value on inner (k, p) edge, so that its new intensity value is equal to original value plus upper edge (c) i ,c j ) The intensity value of (c). If k is equal to p, no processing is done.
And (3.3) repeating the step (3.2) until all edges in the CDN are traversed.
Further, the calculating of the g-core number g (i) of the packet node i in the step (4) specifically includes the following substeps:
and (4.1) solving the weighting degrees of all packet nodes in the PDN obtained in the step (3). Weighting degree w of packet node j j Defined as the sum of the strength values of all edges in the PDN connected to the packet node, i.e.:
Figure BDA0001945106230000031
wherein v is j Is a neighbor packet node set of packet node j; w (j, m) is the intensity value on the edge (j, m).
And (4.2) solving the degrees of all packet nodes in the PDN obtained in the step (3). Degree k of packet node j j Defined as the number of edges in the CDN connected to the packet node.
And (4.3) solving the geometric mean degree of all the nodes in the PDN obtained in the step (3). Geometric mean s of packet node j j Is numerically equal to the nearest w j And k j Integer of the arithmetic square root of the product. s j The calculation formula is as follows:
Figure BDA0001945106230000032
where round (n) returns the integer closest to the value n.
(4.4) finding g nucleus (g =1,2,3, \ 8230;) of the PDN obtained in step (3): and repeatedly removing packet nodes with the geometric mean degree smaller than g and connecting edges thereof in the PDN to obtain a subgraph, namely the g core of the PDN.
(4.5) solving the g core number of all packet nodes in the PDN obtained in the step (3): comparing the g core with the (g + 1) core, if the packet node exists in the g core, but is deleted in the (g + 1) core, the g core number of the packet node is g.
Compared with the prior art, the invention has the following advantages and positive effects:
(1) The construction of the FCN, the CDN and the PDN is constructed based on dynamic analysis of Java software in operation, represents the methods and real interactive relations among the methods, classes and classes, and packages in the software, is more accurate than a static analysis method based on software source codes, and solves the problem of inaccuracy of an element importance measurement method model based on static analysis to a certain extent.
(2) The invention pays attention to the work in the aspect of key package identification, and makes up the problem of insufficient work to a certain extent.
(3) The invention provides a method for measuring the importance of the packet by taking the number of g cores as a measurement index of the importance of the packet, comprehensively considering the problem of influence of the degree (number of other interactive packets) of the level connection strength value of the packet on the importance of the packet, and providing technical support for software understanding, code maintenance and other works.
Drawings
FIG. 1 source code written in the Java language of the present invention;
FIG. 2 is a FCN constructed by an embodiment of the present invention;
FIG. 3 is a CDN constructed with only nodes and no edges constructed by embodiments of the present invention;
FIG. 4 is a CDN constructed by an embodiment of the present invention to include an edge;
FIG. 5 is a final CDN constructed by an embodiment of the present invention;
FIG. 6 is a PDN constructed by an embodiment of the present invention with only nodes and no edges;
FIG. 7 is a PDN constructed by an embodiment of the present invention that includes one edge;
figure 8 final PDN constructed by an embodiment of the present invention;
FIG. 9 g-kernel solution process of an embodiment of the present invention.
Detailed Description
The technical scheme of the invention is further explained by the embodiment and the accompanying drawings:
the invention provides a key packet identification method based on a software operation network, which comprises the following specific steps:
(1) Software written in Java language is abstracted to a method call network FCN = (N, D) at the method granularity. Fig. 1 shows a Java source code. According to the Java source code given in fig. 1, when it runs on the JVM, it first runs cn.edu.calculating.calculating.main (String [ ] args) method, then calls cn.edu.add.add.add (int augend) method 9 times by cn.edu.calculating.calculating.calculating.main (String [ ] args) method, calls cn.edu.Sub1.Sub1.sub1 (int augend ) method 1 times by cn.edu.calculating.calculating.calculating.main (String [ ] args) method; cn.edge.sub 1.Sub1 (int augnd) calls cn.edge.sub 2.Sub2 (int augnd, int addnd) and cn.edge.add.add (int augnd, int addnd) 1 times each at the time of operation. The above methods are named according to the form of 'package name, class name, method name, parameter list', and are complete names of the methods. According to the operating condition of the Java source code shown in fig. 1, the FCN shown in fig. 2 can be obtained, and the text of the node edge is the name of the corresponding method of the node. Wherein, N = { main, sub1, sub2, add } is a set of method nodes (for simplicity, the entry of the package where each method is located, the class name of the class where each method is located, and the parameter list of each method are ignored); d = { (main, sub 1), (main, add), (sub 1, sub 2), (sub 1, add) } is a set of undirected edges, and represents a calling relationship between methods; the numbers on the edges represent the frequency of calling the relationship.
(2) Constructing a CDN (content delivery network) = (N) based on the FCN completed in the step (1) c ,D c ). The construction of the CDN specifically includes the following sub-steps:
(2.1) extracting all classes of the method in the FCN, and constructing a CDN (content delivery network) with only nodes and no edge, namely CDN = (N) c ,D c = Φ). Φ represents the edge set as null. According to the Java source code fragment given in fig. 1, a corresponding CDN = (N) may be constructed c ,D c = Φ) (as shown in fig. 3), where N c And the = { call, ADD, SUB1, SUB2} is a set of class nodes in the source code, and the characters of the node edges are names of corresponding classes of the nodes.
(2.2) taking one side (f) in the step (1) D i ,f j ) E.g. D, according to f i And f j Is specified in the naming ruleDefine its defined class, assume f i Defined in class k, f j Defined in class p. If k ≠ p, and (k, p) is not at D c If not, (k, p) is added to D c While the intensity value of the edge (k, p) is edge (f) i ,f j ) An intensity value of; if k ≠ p, and (k, p) has been at D c If so, update D c Intensity value on inner (k, p) edge, so that its new intensity value is equal to original value plus upper edge (f) i ,f j ) An intensity value of. If k is equal to p, no processing is done. As shown in FIG. 2, if an edge (main, ADD) is taken, since main is defined in the class Calculator and ADD is defined in the class ADD, and Calculator and ADD are not in the same class, ADD (Calculator, ADD) to D c . Meanwhile, the intensity value of the edge (ADD) is 9, and the CDN shown in fig. 4 can be obtained.
(2.3) repeating the step (2.2) until all edges in the FCN are traversed, so as to obtain the final CDN shown in FIG. 5.
(3) Packet dependent network PDN = (N) constructed based on CDN completed in step (2) p ,D p ). The construction of the PDN specifically comprises the following sub-steps:
(3.1) extracting all packets where the class is located in the CDN, and constructing a PDN with only nodes and no edges, namely PDN = (N) p ,D p = Φ). Φ represents the edge set as null. According to the Java source code segment given in fig. 1 and the CDN constructed in fig. 5, the corresponding PDN = (N) can be constructed p ,D p = Φ) (as shown in fig. 6), where N p = cn.edu.call, cn.edu.add, cn.edu.sub1.sub1, cn.edu.sub2.sub2 in the source code, and the characters of the node edges are names of packets corresponding to the node.
(3.2) taking the step (2) D c One side (c) of i ,c j )∈D c According to c i And c j The naming convention of (c) determines the package it defines, let c i Defined in package k, c j Defined in package p. If k ≠ p, and (k, p) is not at D p If not, (k, p) is added to D p While the intensity value of the edge (k, p) is the edge (c) i ,c j ) An intensity value of; if k ≠ p, and (k, p) has been at D p If so, update D p Strong on the inner (k, p) sideValue, so that its new intensity value is equal to the original value plus the upper value (c) i ,c j ) The intensity value of (c). If k is equal to p, no processing is done. As shown in fig. 7, if an edge (cn.ed. Calculator. Calculator, cn.ed.add.add) is taken, (cn.ed.calculator, cn.ed.add) is added to D since Calculator is defined in the cn.ed.calculator packet, ADD is defined in the cn.ed.add packet, and Calculator and ADD are not the same packet p . Meanwhile, the strength value of the edge (cn.edu.calculated, cn.edu.add) is 9, and the CDN shown in fig. 7 can be obtained.
(3.3) repeating the step (3.2) until all edges in the CDN are traversed, so as to obtain the final PDN shown in fig. 8.
(4) And (4) calculating the g core number g (i) of the packet node i based on the PDN finished in the step (3) as the importance value of the corresponding packet of the node. The calculation of the g-core number g (i) of the packet node i specifically comprises the following substeps:
and (4.1) solving the weighting degrees of all packet nodes in the PDN obtained in the step (3). Weighting degree w of packet node j j Defined as the sum of the strength values of all edges in the PDN connected to the packet node, i.e.:
Figure BDA0001945106230000051
wherein v is j Is a neighbor packet node set of packet node j; w (j, m) is the intensity value on the edge (j, m). Thus, the weighting degree w of packet node cn cn.edu.calculator Weighting degree of =9+1=10,cn cn.edu.sub1 Weighting degree w of 1+1=3, cn cn.edu.sub2 The weighting degree of =1,cn cn.edu.add =9+1=10。
And (4.2) solving the degrees of all packet nodes in the PDN obtained in the step (3). Degree k of packet node j j Defined as the number of edges in the PDN connected to the packet node. Thus, the degree k of packet node cn cn.edu.calculator Degree of k is 1+1=2,sub1 cn.edu.sub1 Degree k of 1+1=3,sub2 cn.edu.sub2 Degree of =1,add is k \cn.edu.add =1+1=2。
(4.3)And (4) solving the geometric mean degree of all the nodes in the PDN obtained in the step (3). Geometric mean s of packet node j j Is numerically equal to the nearest w j And k j Integer of the arithmetic square root of the product. s j The calculation formula is as follows:
Figure BDA0001945106230000061
where round (n) returns the integer closest to the value n. Thus, the geometric mean of the method node cn
Figure BDA0001945106230000062
Figure BDA0001945106230000063
(4.4) finding g nucleus (g =1,2,3, \ 8230;) of the PDN obtained in step (3): and repeatedly removing packet nodes with the geometric mean degree smaller than g and connecting edges thereof in the PDN to obtain a subgraph, namely the g core of the PDN. The g-kernel solution process of fig. 8 is shown in fig. 9 (the prefixes cn. Edu. Of each packet are omitted for clarity of illustration).
Calculate 1 kernel (g = 1). Based on the step (4.3), it is possible to obtain
Figure BDA0001945106230000064
Figure BDA0001945106230000065
The resulting 1-core diagram is shown in fig. 9 (left two).
Calculate 2 kernels (g = 2). Based on 1 nucleus, simultaneously because
Figure BDA0001945106230000066
Figure BDA0001945106230000067
Therefore, in the 2-core, the node cn.ed.sub 2 and the edge connected to it in the original 1-core are removed, and the resulting 2-core graph is shown in the (left three) subgraph of fig. 9.
Calculate 3 kernels (g = 3). Based on 2 cores, simultaneously recalculating eachGeometric mean of the nodes, as shown in the (left three) subgraph of FIG. 9, because
Figure BDA0001945106230000068
=4>3, so in the 3-core, node cn. Edu. Sub1 and the edges connected to it in the original 2-core will be removed, and the resulting 3-core graph is shown in the (left four) subgraph of fig. 9.
4 kernels were calculated (g = 4). Based on 3 kernels, the geometric mean of each node is recalculated simultaneously, as shown in the (left-four) subgraph of FIG. 9, because
Figure BDA0001945106230000069
Thus, in the 4 cores, the nodes cn.
(4.5) solving the g-core number of all packet nodes in the PDN obtained in the step (3) as the importance value of the corresponding packet of the node: comparing the g core with the (g + 1) core, if the packet node exists in the g core but is deleted in the (g + 1) core, the g core number of the packet node is g. As in fig. 9, since the node cn. Similarly, the g-core number of the node cn.
(5) And (4) based on the g core number of the packet nodes obtained in the step (4), performing descending order arrangement on the packet nodes by using a sorting algorithm, and taking the packet with the top rank as the identified key packet. Based on the result of step (4.5), the resulting ranking result was (cn.edu.calculator = cn.edu.add: 3) > (cn.edu.sub 1: 2) > (cn.edu.sub 2: 1). Therefore, the key packages of the top 2 are cn.edu.calculator and cn.edu.add, the key packages of the top 3 are cn.edu.calculator, cn.edu.add and cn.edu.sub1, and the key packages of the top 4 are cn.edu.calculator, cn.edu.add, cn.edu.sub1 and cn.edu.sub2.
The specific embodiments described herein are merely illustrative of the spirit of the invention, and the values of cn. Various modifications or additions may be made to the described embodiments or alternatives may be employed by those skilled in the art without departing from the spirit or ambit of the invention as defined in the appended claims.

Claims (8)

1. A key packet identification method based on a software operation network is characterized by comprising the following steps:
(1) Abstracting a method calling process of software written by Java language during operation into a method calling net FCN = (N, D); wherein N is a set of method nodes in software; d = { (f) i ,f j )}(f i ∈N,f j e.N) is a set of undirected edges and represents the calling relationship among the methods; each edge is endowed with a non-negative integer as the strength value of the method calling relationship; the strength value on an edge refers to the number of calls between methods; the calling times and the calling relation among the methods are obtained according to the actual running process of the Java software on the Java virtual machine, and are dynamic analysis instead of static analysis based on source codes;
(2) Building a class dependent network CDN (= (N)) based on the FCN completed in the step (1) c ,D c ) (ii) a Wherein, N c The method is a set of class nodes where methods in the FCN are located; d c ={(c i ,c j ) In which c is i ∈N c ,c j ∈N c The method is a set of undirected edges and represents the dependency relationship between classes; each edge in the CDN is endowed with a nonnegative integer as an intensity value of the dependency relationship between the classes;
(3) Building a packet dependent network PDN = (N) based on CDN completed in step (2) p ,D p ) (ii) a Wherein N is p The class is a set of packet nodes in the CDN; d p ={(p i ,p j ) In which p is i ∈N p ,p j ∈N p The set is a set without directed edges and represents the dependency relationship among the packages; each edge in the PDN is endowed with a nonnegative integer as the strength value of the dependency relationship between the packets;
(4) Calculating g core number g (i) of a packet node i based on the PDN completed in the step (3) as an importance value of a corresponding packet of the node;
(5) And (4) performing descending order on the packet nodes based on the g cores of the packet nodes obtained in the step (4), and taking the packet with the top rank as the identified key packet.
2. The method for identifying key packets based on a software-operated network as claimed in claim 1, wherein the class in step (2) is obtained according to the method in the FCN; the class in the FCN where the method is defined becomes the class in the CDN; the class in the CDN is a class used by the Java software in the actual running process of the Java virtual machine, and is a dynamic analysis, rather than a static analysis based on a source code; meanwhile, classes in the CDN are a general term for classes, internal classes, abstract classes, and interfaces in Java.
3. The method according to claim 1, wherein the dependency relationship between the classes in step (2) is obtained according to a call relationship between the methods in the FCN, that is, if a call relationship exists between the methods included in a class, the dependency relationship exists between the corresponding classes; the dependency relationship among the classes in the CDN is the dependency relationship of the Java software in the actual running process of the Java virtual machine, and is a dynamic analysis instead of a static analysis based on a source code; the strength value of the dependency relationship between the classes is obtained according to the strength value of the calling relationship between the methods in the FCN, namely the sum of the strength values between the methods contained in the classes is the strength value of the dependency relationship between the corresponding classes; the strength value of the dependency relationship between the classes in the CDN is the strength value of the dependency relationship that occurs during the actual running of the Java software on the Java virtual machine, and is a dynamic analysis, not a static analysis based on the source code.
4. The method for identifying key packages based on software operating network as claimed in claim 1, wherein the packages in step (3) are obtained according to classes in CDN; the class-defined packets in the CDN become packets in the PDN; the packet in the PDN is a packet used in the actual running process of the Java software on the Java virtual machine, and is a dynamic analysis, not a static analysis based on source code.
5. The method for identifying the key package based on the software operating network according to claim 1, wherein the dependency relationship among the packages in the step (3) is obtained according to the dependency relationship among the classes contained in the package, that is, if the classes contained in the package have a dependency relationship, then the corresponding package also has a dependency relationship; the dependency relationship among the PDN packages is the dependency relationship of the Java software in the actual running process of the Java virtual machine, and is a dynamic analysis, rather than a static analysis based on a source code; the strength value of the dependency relationship between the packages is obtained according to the strength value of the dependency relationship between the classes in the CDN, that is, the sum of the strength values between the classes contained in the packages is the strength value of the dependency relationship between the corresponding packages; the strength value of the dependency relationship among the packets in the PDN is the strength value of the dependency relationship which occurs in the actual running process of the Java software on a Java virtual machine, and is a dynamic analysis instead of a static analysis based on source codes.
6. The method for identifying a critical package based on a software operating network as claimed in claim 1, wherein the construction of the CDN in the step (2) specifically comprises the following sub-steps:
(2.1) extracting all classes where the methods in the FCN are located, and constructing a CDN (content delivery network) with nodes and no edges, namely CDN = (N) c ,D c = Φ); phi represents that the edge set is empty;
(2.2) taking one edge (f) in the step (1) D i ,f j ) E is D, according to f i And f j The naming rule of (2) determines the class it defines, let f i Defined in class k, f j Defined in class p; if k ≠ p, and (k, p) is not at D c If internal, (k, p) is added to D c While the intensity value of the edge (k, p) is edge (f) i ,f j ) An intensity value of; if k ≠ p, and (k, p) is already at D c If it is, then D is updated c Intensity value on inner (k, p) edge, so that its new intensity value is equal to original value plus upper edge (f) i ,f j ) An intensity value of; if k is equal to p, thenNo treatment is carried out;
(2.3) repeating step (2.2) until all edges in the FCN are traversed.
7. The method for identifying the critical packet based on the software operating network according to claim 1, wherein the construction of the PDN in the step (3) specifically comprises the following sub-steps:
(3.1) extracting all packets where the class is located in the CDN, and constructing a PDN with only nodes and no edges, namely PDN = (N) p ,D p = Φ); phi represents that the edge set is null;
(3.2) taking the step (2) D c One side (c) of i ,c j )∈D c According to c i And c j The naming convention of (c) determines the package it defines, let c i Defined in package k, c j Defined in package p; if k ≠ p, and (k, p) is not at D p If not, (k, p) is added to D p While the intensity value of the side (k, p) is the side (c) i ,c j ) An intensity value of; if k ≠ p, and (k, p) has been at D p If so, update D p Intensity value on inner (k, p) edge, so that its new intensity value is equal to original value plus upper edge (c) i ,c j ) An intensity value of; if k is equal to p, no processing is performed;
and (3.3) repeating the step (3.2) until all edges in the CDN are traversed.
8. The method for identifying a critical packet based on a software operating network as claimed in claim 1, wherein the step (4) of calculating the g-core number g (i) of the packet node i specifically comprises the following sub-steps:
(4.1) solving the weighting degrees of all packet nodes in the PDN obtained in the step (3); weighting degree w of packet node j j Defined as the sum of the strength values of all edges in the PDN connected to the packet node, i.e.:
Figure FDA0003642759860000021
wherein v is j Is a packet nodej is a set of neighbor packet nodes; w (j, m) is the intensity value on the edge (j, m);
(4.2) solving the degrees of all packet nodes in the PDN obtained in the step (3); degree k of packet node j j Defining the number of edges connected with the packet node in the CDN;
(4.3) solving the geometric mean degree of all nodes in the PDN obtained in the step (3); geometric mean s of packet node j j Is numerically equal to the nearest w j And k j Integer of the arithmetic square root of the product; s is j The calculation formula is as follows:
Figure FDA0003642759860000031
wherein round (n) returns the integer closest to the value n;
(4.4) obtaining g nucleus of PDN obtained in the step (3), g =1,2,3, \ 8230;: repeatedly removing packet nodes with geometric mean degree smaller than g and connecting edges thereof in the PDN to obtain a subgraph, namely a g core of the PDN;
(4.5) solving the g-core number of all packet nodes in the PDN obtained in the step (3): and comparing the packet nodes in the g core and the g +1 core, and if the packet node exists in the g core but is deleted in the g +1 core, obtaining that the number of the g cores of the packet node is g.
CN201910033604.9A 2019-01-14 2019-01-14 Key package identification method based on software operation network Active CN109976807B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910033604.9A CN109976807B (en) 2019-01-14 2019-01-14 Key package identification method based on software operation network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910033604.9A CN109976807B (en) 2019-01-14 2019-01-14 Key package identification method based on software operation network

Publications (2)

Publication Number Publication Date
CN109976807A CN109976807A (en) 2019-07-05
CN109976807B true CN109976807B (en) 2022-11-25

Family

ID=67076579

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910033604.9A Active CN109976807B (en) 2019-01-14 2019-01-14 Key package identification method based on software operation network

Country Status (1)

Country Link
CN (1) CN109976807B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105389192A (en) * 2015-12-18 2016-03-09 浙江工商大学 Method for measuring importance of software class based on weighted q2 index
CN106547737A (en) * 2016-10-25 2017-03-29 复旦大学 Based on the sequence labelling method in the natural language processing of deep learning

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017134665A1 (en) * 2016-02-03 2017-08-10 Cocycles System for organizing, functionality indexing and constructing of a source code search engine and method thereof

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105389192A (en) * 2015-12-18 2016-03-09 浙江工商大学 Method for measuring importance of software class based on weighted q2 index
CN106547737A (en) * 2016-10-25 2017-03-29 复旦大学 Based on the sequence labelling method in the natural language processing of deep learning

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"基于软件网络加权k-核分析的关键类识别方法";潘伟丰等;《电子学报》;20180830;第46卷(第5期);第1071-1077页,图1-2 *

Also Published As

Publication number Publication date
CN109976807A (en) 2019-07-05

Similar Documents

Publication Publication Date Title
CN107665228B (en) Associated information query method, terminal and equipment
US9864672B2 (en) Module specific tracing in a shared module environment
CN111722839B (en) Code generation method and device, electronic equipment and storage medium
CN110795455A (en) Dependency relationship analysis method, electronic device, computer device and readable storage medium
JP2010522397A (en) Using collaboration development information in a team environment
US20070204216A1 (en) System and method for creating layouts using a layout editor
CN112800095A (en) Data processing method, device, equipment and storage medium
CN109376153B (en) System and method for writing data into graph database based on NiFi
CN113672628A (en) Data blood margin analysis method, terminal device and medium
CN114461644A (en) Data acquisition method and device, electronic equipment and storage medium
CN108415998B (en) Application dependency relationship updating method, terminal, device and storage medium
CN115203435A (en) Entity relation generation method and data query method based on knowledge graph
US10360208B2 (en) Method and system of process reconstruction
CN114064925A (en) Knowledge graph construction method, data query method, device, equipment and medium
CN117055851A (en) Software architecture recovery method and device, electronic equipment and storage medium
CN112579604A (en) Test system number making method, device, equipment and storage medium
CN109976807B (en) Key package identification method based on software operation network
CN112559525A (en) Data checking system, method, device and server
CN107273293B (en) Big data system performance test method and device and electronic equipment
CN109871318B (en) Key class identification method based on software operation network
JP5121891B2 (en) Rule inspection device, rule inspection method and rule inspection program
CN114385155A (en) vue project visualization tool generation method, device, equipment and storage medium
CN111159203B (en) Data association analysis method, platform, electronic equipment and storage medium
CN109947428B (en) High-quality software recommendation method based on software stability measurement
CN113722141A (en) Method and device for determining delay reason of data task, electronic equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20220926

Address after: No. n817, 3rd floor, xingguangyingjing, No. 117, Shuiyin Road, Yuexiu District, Guangzhou, Guangdong 510000

Applicant after: Zhiyueyun (Guangzhou) Digital Information Technology Co.,Ltd.

Address before: 310018, No. 18 Jiao Tong Street, Xiasha Higher Education Park, Hangzhou, Zhejiang

Applicant before: ZHEJIANG GONGSHANG University

TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20221109

Address after: 518000 605-56, Building 1, Meinian International Plaza, Xinggong Road, Taohuayuan Community, Merchants Street, Nanshan District, Shenzhen, Guangdong

Applicant after: Shenzhen Youxi Technology Co.,Ltd.

Address before: No. n817, 3rd floor, xingguangyingjing, No. 117, Shuiyin Road, Yuexiu District, Guangzhou, Guangdong 510000

Applicant before: Zhiyueyun (Guangzhou) Digital Information Technology Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant