CN109117129B - Implicit programming rule filtering method and device - Google Patents

Implicit programming rule filtering method and device Download PDF

Info

Publication number
CN109117129B
CN109117129B CN201810953480.1A CN201810953480A CN109117129B CN 109117129 B CN109117129 B CN 109117129B CN 201810953480 A CN201810953480 A CN 201810953480A CN 109117129 B CN109117129 B CN 109117129B
Authority
CN
China
Prior art keywords
rule
elements
filtering
implicit programming
vector
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
CN201810953480.1A
Other languages
Chinese (zh)
Other versions
CN109117129A (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.)
Beijing Information Science and Technology University
Original Assignee
Beijing Information Science and Technology University
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 Beijing Information Science and Technology University filed Critical Beijing Information Science and Technology University
Priority to CN201810953480.1A priority Critical patent/CN109117129B/en
Publication of CN109117129A publication Critical patent/CN109117129A/en
Application granted granted Critical
Publication of CN109117129B publication Critical patent/CN109117129B/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/30Creation or generation of source code
    • G06F8/33Intelligent editors

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Machine Translation (AREA)

Abstract

According to the implicit programming rule filtering method and device provided by the embodiment of the invention, the target implicit programming rule is obtained, the rule information is obtained by extracting the target implicit programming rule, the vectorization rule information is obtained according to the rule information, the filtering judgment is carried out according to the vectorization rule information, the filtering result is obtained, the program code information is not needed, the candidate implicit programming rule can be automatically filtered, the false alarm and the real implicit programming rule are confirmed, the expense for manually confirming the candidate implicit programming rule is reduced, and therefore the practicability of the existing implicit programming rule mining method is effectively improved.

Description

Implicit programming rule filtering method and device
Technical Field
The invention relates to the technical field of information processing, in particular to a method and a device for filtering implicit programming rules.
Background
There are typically a number of programming rules implied in a program that lack the specification document description, such as: the close file method fclose () should be called after the open file method fopen (), before the string copy method strcpy () is called, whether there is a risk of buffer overflow, etc. Such rules are numerous and limited by development time and schedule, and are rarely described by software engineers using well-defined documents. In addition, the partial programming rules are hidden deeply, and defects of violating the rules are difficult to find by adopting a traditional code review method and the like. Software bugs may arise if a programmer neglects or violates such rules during programming.
The implicit programming rule can be used for defect detection, method/parameter recommendation, automatic document generation and the like, and has high application value. The existing implicit programming rule generation technology mainly adopts a data mining method to analyze a method execution sequence, a source code, a data stream and the like, and candidate implicit programming rules are mined from the data mining method, wherein the candidate implicit programming rules can be in the forms of association rules, pre/post condition conventions, behavior model calling conventions and the like. Candidate implicit programming rules mined by various methods all require manual validation before use, which is a process that is costly and prone to error introduction. For example: the PR-Miner excavates 32283 implicit programming rules from Linux, if the implicit programming rules are not screened and are directly used for defect detection, 1447 suspected defects are still reported even if the suspected defects are checked and reduced by using an inter-process analysis technology, and manual confirmation is difficult to complete; 683 false alarms in 758 implicit programming rules reported by WN Miner are confirmed to be false alarms, with a false alarm rate as high as 90%. Therefore, it is particularly desirable to automatically identify and filter candidate implicit programming rules reported by the implicit programming rule mining tool.
Disclosure of Invention
The invention provides a method and a device for filtering an implicit programming rule, which are used for solving the problems of low efficiency and high false alarm rate in the prior art for filtering the implicit programming rule.
In a first aspect, an embodiment of the present invention provides an implicit programming rule filtering method, including:
acquiring a target implicit programming rule, and extracting the target implicit programming rule to acquire rule information;
obtaining vectorization rule information according to the rule information;
and carrying out filtering judgment according to the vectorization rule information to obtain a filtering result.
Optionally, the extracting the target implicit programming rule to obtain rule information includes:
extracting the target implicit programming rule to obtain rule elements, wherein the rule elements comprise a method name and a variable name;
segmenting each element in the rule elements to obtain a corresponding word set;
the rule information is obtained from a set of words for each element.
Optionally, the obtaining vectorization rule information according to the rule information includes:
vectorizing the words in the word set corresponding to each element to obtain corresponding word vectors;
obtaining an element vector corresponding to each element by adopting a first calculation formula according to all word vectors in the word set corresponding to each element;
and obtaining the vectorization rule information according to all the element vectors.
Optionally, performing filtering judgment according to the vectorization rule information to obtain a filtering result, including:
obtaining Euclidean distances among the elements according to the element vectors and a preset second calculation formula;
taking each element as a node, and obtaining the shortest Hamiltonian loop distance in each element according to the Euclidean distance between the elements;
obtaining the average distance between elements in the target implicit programming rule according to the shortest Hamiltonian loop distance and a preset third calculation formula;
and carrying out filtering judgment according to the average distance and a preset threshold value to obtain a filtering result.
Optionally, the performing filtering judgment according to the average distance and a preset threshold to obtain a filtering result includes:
when the average distance is larger than a preset threshold value, filtering the target implicit programming rule; and when the average distance is smaller than or equal to a preset threshold value, reserving the target implicit programming rule.
In a second aspect, an embodiment of the present invention provides an implicit programming rule filtering apparatus, including:
the extraction module is used for acquiring a target implicit programming rule and extracting the target implicit programming rule to acquire rule information;
the conversion module is used for obtaining vectorization rule information according to the rule information;
and the filtering module is used for carrying out filtering judgment according to the vectorization rule information to obtain a filtering result.
Optionally, the extracting module is specifically configured to:
extracting the target implicit programming rule to obtain rule elements, wherein the rule elements comprise a method name and a variable name;
segmenting each element in the rule elements to obtain a corresponding word set;
the rule information is obtained from a set of words for each element.
Optionally, the conversion module is specifically configured to:
vectorizing the words in the word set corresponding to each element to obtain corresponding word vectors;
obtaining an element vector corresponding to each element by adopting a first calculation formula according to all word vectors in the word set corresponding to each element;
and obtaining the vectorization rule information according to all the element vectors.
Optionally, the filter module is specifically configured to:
obtaining Euclidean distances among the elements according to the element vectors and a preset second calculation formula;
taking each element as a node, and obtaining the shortest Hamiltonian loop distance in each element according to the Euclidean distance between the elements;
obtaining the average distance between elements in the target implicit programming rule according to the shortest Hamiltonian loop distance and a preset third calculation formula;
and carrying out filtering judgment according to the average distance and a preset threshold value to obtain a filtering result.
Optionally, the filter module is specifically configured to:
when the average distance is larger than a preset threshold value, filtering the target implicit programming rule; and when the average distance is smaller than or equal to a preset threshold value, reserving the target implicit programming rule.
According to the technical scheme, the implicit programming rule filtering method and the implicit programming rule filtering device provided by the embodiment of the invention have the advantages that the target implicit programming rule is obtained, the target implicit programming rule is extracted to obtain the rule information, the vectorization rule information is obtained according to the rule information, the filtering judgment is carried out according to the vectorization rule information to obtain the filtering result, the program code information is not needed, the candidate implicit programming rules can be automatically filtered, the false alarm and the real implicit programming rule are confirmed, the expense for manually confirming the candidate implicit programming rules is reduced, and therefore the practicability of the existing implicit programming rule mining method is effectively improved.
Drawings
FIG. 1 is a flowchart illustrating a implicit programming rule filtering method according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of extracting rule information according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating rule vectorization according to an embodiment of the present invention;
FIG. 4 is a schematic flow chart illustrating rule filtering determination according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an implicit programming rule filtering apparatus according to an embodiment of the present invention.
Detailed Description
The following detailed description of embodiments of the present invention is provided in connection with the accompanying drawings and examples. The following examples are intended to illustrate the invention but are not intended to limit the scope of the invention.
Fig. 1 shows that an embodiment of the present invention provides an implicit programming rule filtering method, including:
s11, acquiring a target implicit programming rule, and extracting the target implicit programming rule to acquire rule information.
For step S11, it should be noted that, in the embodiment of the present invention, the target implicit programming rule is obtained, and the extracting is performed on the target implicit programming rule to obtain the rule information, where the obtaining specifically may be:
s111, extracting the target implicit programming rule to obtain rule elements, wherein the rule elements comprise a method name and a variable name;
s112, segmenting each element in the rule elements to obtain a corresponding word set;
s113, obtaining the rule information according to the word set of each element.
With respect to step S111 to step S113, it should be noted that, in the embodiment of the present invention, the implicit programming rule may be an API call sequence, and a definition-use that a certain class of variables should satisfyRelationships, exception handling rules, etc., which are typically composed of method calls, variable usage, variable definitions. The invention refers to the method function and variable composing the rule as rule elements. An implicit programming rule r, if one consists of s elements, can be expressed as r ═ { E ═ E1,E2,…,EsIn which EjE r may be a method call, variable usage, or variable definition.
For each element that makes up a rule, there is a unique name, where the name of the method call is the name of the method and the name of the variable usage or variable definition is the name of the variable. Analysis of the method name and variable name in the program can find that the method name and variable name are usually composed of a group of words. The naming of the method name and the variable name usually needs to follow certain specifications, and the common naming modes mainly comprise a hump method, an underlining method and the like. Among them, the hump method distinguishes the boundary between words by upper case of first letter and lower case of other letters, and the underlining method distinguishes the boundary between words using underlining. In addition, some simplifications may be used in the method and variable names, such as: "file" is reduced to "f", "to" is reduced to "2", etc. The analysis is performed in such a way that it needs to be converted into complete words. To improve the accuracy of the analysis, a stop word list is also provided, including words such as "to", "for", etc., which frequently appear and do not have much practical meaning. Such words adversely affect the accuracy of the relevance analysis and should be removed. After the removal, the word set of each element is formed again by taking the element as an individual set, which is used as the rule information in this embodiment.
It should be noted that the description of the method described in this embodiment is based on a process of processing one of the implicit programming rules, because the same processing procedure is performed for each implicit programming rule. For this, in the following specific process of acquiring rule information, a plurality of implicit programming rules are taken as an example, as shown in fig. 2, specifically, the implicit programming rules are as follows:
step 1-1: initial state, implicit programming rule set of input candidates R ═ { R1,r2,…,rk};
Step 1-2: obtainOne of the rules r is takeniAnalyzing to extract the method name and variable name components therein so that ri={E1,E2,…,Es};
Step 1-3: obtaining one element EjAnalyzing, and segmenting into t words set according to hump method or underline method to obtain E wordsj={w1,w2,…,wt};
Step 1-4: to composition EjThe t words are processed by first converting the shorthand words into complete words, then looking up the stop word list and removing EjThe stop word in (1);
step 1-5: repeating the steps 1-3 until the analysis is finishediAll the constituent elements of (a);
step 1-6: repeating the steps 1-2 until all the rules in the R are analyzed;
step 1-7: outputting the processed implicit programming rule set R.
And S12, acquiring vectorization rule information according to the rule information.
For step S12, it should be noted that, in the embodiment of the present invention, obtaining the vectorization rule information according to the rule information specifically includes:
s121, performing vectorization processing on words in the word set corresponding to each element to obtain corresponding word vectors;
s122, obtaining an element vector corresponding to each element by adopting a first calculation formula according to all the word vectors in the word set corresponding to each element;
and S123, acquiring the vectorization rule information according to all the element vectors.
With respect to steps S121 to S123, it should be noted that, in the embodiment of the present invention, the element E is formed for the implicit rulej={w1,w2,…,wtEvery word w ineRespectively calculate corresponding n-dimensional vectors we={xe,1,xe,2,…,xe,n}. Word vectors for words may be calculated using Word2vec, GloVe, etc. Word vector analysis tools. In calculatingAfter the word vectors of all words, n-dimensional vector representation of the rule constituent elements can be obtained, and the first calculation formula is as follows:
Figure GDA0003176916470000071
wherein, can pass through alphaeDifferent weights may be set for different words, e.g., words of other parts of speech may be set with lower weights as analyzed to find that nouns contribute more to relevance.
As shown in fig. 3, the steps of obtaining the vectorization rule information are as follows:
step 2-1: the initial state, the implicit programming rule set R processed in the previous step is input;
step 2-2: obtaining one of the rules ri={E1,E2,…,Es};
Step 2-3: obtaining one element Ej={w1,w2,…,wt-computing a vector for each of the constituent words using a word vector tool;
step 2-4: computing a vectorized representation of the element according to a first computational formula
Figure GDA0003176916470000072
Step 2-5: repeatedly executing 2-3 until the analysis is finishediObtaining a set of regular element vectors
Figure GDA0003176916470000073
Will r isi'adding vectorization implicit programming rule set R';
step 2-6: repeating the step 2-2 until all the rules in the R are analyzed;
step 2-7: the vectorized implicit programming rule set R' is output.
And S13, performing filtering judgment according to the vectorization rule information to obtain a filtering result.
For step S12, it should be noted that, in the embodiment of the present invention, performing filtering judgment according to the vectorization rule information to obtain a filtering result specifically includes:
s131, acquiring Euclidean distances among the elements according to the element vectors and a preset second calculation formula;
s132, taking each element as a node, and obtaining the shortest Hamiltonian loop distance in each element according to the Euclidean distance between each element;
s133, obtaining an average distance between elements in a target implicit programming rule according to the shortest Hamiltonian loop distance and a preset third calculation formula;
and S134, performing filtering judgment according to the average distance and a preset threshold value to obtain a filtering result.
With respect to step S131 to step S134, it should be noted that, in the embodiment of the present invention, after completing the implicit programming rule vectorization, the rule ri' any two elements of
Figure GDA0003176916470000081
Figure GDA0003176916470000082
The euclidean distance therebetween can be calculated by the following second formula.
Figure GDA0003176916470000083
The euclidean distance between any two elements in the rule is calculated according to equation (2) and recorded using the adjacency matrix M. Taking elements in the implicit programming rule as nodes, and calculating the inclusion rule r by using algorithms such as backtracking method or branch limit methodiThe shortest Hamiltonian loop, denoted micC, including all elements ini
Calculating the average distance between elements in the implicit programming rule, and the third calculation formula is as follows:
Figure GDA0003176916470000084
wherein h is the rule ri' number of elements in.
Setting a threshold value delta, when the average distance of elements in the implicit programming rule is larger than delta, the fact that the association between the elements is low and the possibility of being the true implicit programming rule is low is indicated, and when the average distance is smaller than or equal to delta, the fact that the association between the elements is high and the possibility of being the true implicit programming rule is also high is indicated. Namely: when the average distance is larger than a preset threshold value, filtering the target implicit programming rule; and when the average distance is smaller than or equal to a preset threshold value, reserving the target implicit programming rule.
Through multiple experiments, a proper delta value is found out, an implicit programming rule that the average distance between elements is larger than delta is filtered out, and the implicit programming rule is not used for subsequent defect detection, method/parameter recommendation, automatic document generation and the like.
As shown in fig. 3, the step of filtering and judging the rule is as follows:
step 3-1: a starting state, inputting a vectorized implicit programming rule set R';
step 3-2: obtaining one vectorized implicit programming rule
Figure GDA0003176916470000091
Step 3-3: r is calculated using equation (2)i' any two elements of
Figure GDA0003176916470000092
Has a Euclidean distance d betweenu,vUsing an n × n dimensional adjacency matrix M [ n ]][n]Storing Euclidean distances between elements, making M [ v ]][u]=M[u][v]=du,v
Step 3-4: using an algorithm such as backtracking or branch-bound method, calculating a value comprising ri' the shortest Hamiltonian loop, denoted minC, including all elements ini
Step 3-5: r is calculated using equation (3)i' average distance between elements
Figure GDA0003176916470000093
Step 3-6: if it is
Figure GDA0003176916470000094
Then r isi' Add false positive implicit Programming rule set RerrorOtherwise, r isi' Add confirmation implicit Programming rule set Rconfirm
Step 3-7: repeating the step 3-2 until all implicit programming rules in the R' are traversed;
step 3-8: output false alarm implicit programming rule set RerrorValidating implicit programming rule set Rconfirm
According to the implicit programming rule filtering method provided by the embodiment of the invention, the target implicit programming rule is extracted to obtain the rule information by obtaining the target implicit programming rule, the vectorization rule information is obtained according to the rule information, the filtering judgment is carried out according to the vectorization rule information to obtain the filtering result, the program code information is not needed, the candidate implicit programming rule can be automatically filtered, the false report and the real implicit programming rule are confirmed, the expense for manually confirming the candidate implicit programming rule is reduced, and therefore the practicability of the existing implicit programming rule mining method is effectively improved.
Fig. 5 shows an implicit programming rule filtering apparatus provided in an embodiment of the present invention, which includes an extracting module 51, a transforming module 52, and a filtering module 53, where:
the extracting module 51 is configured to obtain a target implicit programming rule, and extract the target implicit programming rule to obtain rule information;
a conversion module 52, configured to obtain vectorization rule information according to the rule information;
and the filtering module 53 is configured to perform filtering judgment according to the vectorization rule information to obtain a filtering result.
Since the principle of the apparatus according to the embodiment of the present invention is the same as that of the method according to the above embodiment, further details are not described herein for further explanation.
It should be noted that, in the embodiment of the present invention, the relevant functional module may be implemented by a hardware processor (hardware processor).
According to the implicit programming rule filtering device provided by the embodiment of the invention, the target implicit programming rule is extracted to obtain the rule information by obtaining the target implicit programming rule, the vectorization rule information is obtained according to the rule information, the filtering judgment is carried out according to the vectorization rule information to obtain the filtering result, the program code information is not needed, the candidate implicit programming rule can be automatically filtered, the false alarm and the real implicit programming rule are confirmed, the expense for manually confirming the candidate implicit programming rule is reduced, and therefore the practicability of the existing implicit programming rule mining method is effectively improved.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
Those of ordinary skill in the art will understand that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; such modifications and substitutions do not depart from the spirit of the corresponding technical solutions and scope of the present invention as defined in the appended claims.

Claims (8)

1. An implicit programming rule filtering method, comprising:
acquiring a target implicit programming rule, and extracting the target implicit programming rule to acquire rule information;
obtaining vectorization rule information according to the rule information;
filtering and judging according to the vectorization rule information to obtain a filtering result;
wherein, filter and judge according to vectorization rule information, obtain the filtering result, include:
acquiring Euclidean distances among the elements according to the element vectors and a preset second calculation formula;
taking each element as a node, and obtaining the shortest Hamiltonian loop distance in each element according to the Euclidean distance between the elements;
obtaining the average distance between elements in the target implicit programming rule according to the shortest Hamiltonian loop distance and a preset third calculation formula;
performing filtering judgment according to the average distance and a preset threshold value to obtain a filtering result;
wherein the second calculation formula includes:
Figure FDA0003280643230000011
wherein d isu,vIs the u element vector and the v element vectorThe euclidean distance between them,
Figure FDA0003280643230000012
is the u-th element vector and,
Figure FDA0003280643230000013
is the v-th element vector; x is the number ofu,kFor the kth value, x, in the n-dimensional vector of the u-th elementv,kA k-th value in an n-dimensional vector for the v-th element;
the third calculation formula includes:
Figure FDA0003280643230000014
wherein the content of the first and second substances,
Figure FDA0003280643230000015
is a rule ri' average distance between elements, minCiIs a rule ri' shortest Hamiltonian loop including all elements in, h is the rule ri' number of elements in.
2. The method of claim 1, wherein the extracting the target implicit programming rule to obtain rule information comprises:
extracting the target implicit programming rule to obtain rule elements, wherein the rule elements comprise a method name and a variable name;
segmenting each element in the rule elements to obtain a corresponding word set;
the rule information is obtained from a set of words for each element.
3. The method of claim 2, wherein obtaining vectorized rule information according to the rule information comprises:
vectorizing the words in the word set corresponding to each element to obtain corresponding word vectors;
obtaining an element vector corresponding to each element by adopting a first calculation formula according to all word vectors in the word set corresponding to each element;
obtaining the vectorization rule information according to all element vectors;
wherein the first calculation formula is:
Figure FDA0003280643230000021
wherein the content of the first and second substances,
Figure FDA0003280643230000022
is the element vector corresponding to the jth element,
Figure FDA0003280643230000023
is an element EjWord vector, alpha, of the e-th word selected from 1 to t wordseIs the weight, x, of the e-th word vectorj,nIs the nth value in the n-dimensional vector of the jth element.
4. The method according to claim 3, wherein the performing the filtering judgment according to the average distance and a preset threshold to obtain a filtering result comprises:
when the average distance is larger than a preset threshold value, filtering the target implicit programming rule; and when the average distance is smaller than or equal to a preset threshold value, reserving the target implicit programming rule.
5. An implicit programming rule filtering apparatus, comprising:
the extraction module is used for acquiring a target implicit programming rule and extracting the target implicit programming rule to acquire rule information;
the conversion module is used for obtaining vectorization rule information according to the rule information;
the filtering module is used for carrying out filtering judgment according to the vectorization rule information to obtain a filtering result;
wherein, the filtration module is specifically configured to:
acquiring Euclidean distances among the elements according to the element vectors and a preset second calculation formula;
taking each element as a node, and obtaining the shortest Hamiltonian loop distance in each element according to the Euclidean distance between the elements;
obtaining the average distance between elements in the target implicit programming rule according to the shortest Hamiltonian loop distance and a preset third calculation formula;
performing filtering judgment according to the average distance and a preset threshold value to obtain a filtering result;
wherein the second calculation formula includes:
Figure FDA0003280643230000031
wherein d isu,vIs the euclidean distance between the u-th element vector and the v-th element vector,
Figure FDA0003280643230000032
is the u-th element vector and,
Figure FDA0003280643230000033
is the v-th element vector; x is the number ofu,kFor the kth value, x, in the n-dimensional vector of the u-th elementv,kA k-th value in an n-dimensional vector for the v-th element;
the third calculation formula includes:
Figure FDA0003280643230000034
wherein the content of the first and second substances,
Figure FDA0003280643230000035
is a rule ri' average distance between elements, minCiIs a rule ri' shortest Hamiltonian loop including all elements in, h is the rule ri' number of elements in.
6. The apparatus of claim 5, wherein the extraction module is specifically configured to:
extracting the target implicit programming rule to obtain rule elements, wherein the rule elements comprise a method name and a variable name;
segmenting each element in the rule elements to obtain a corresponding word set;
the rule information is obtained from a set of words for each element.
7. The apparatus of claim 6, wherein the conversion module is specifically configured to:
vectorizing the words in the word set corresponding to each element to obtain corresponding word vectors;
obtaining an element vector corresponding to each element by adopting a first calculation formula according to all word vectors in the word set corresponding to each element;
obtaining the vectorization rule information according to all element vectors;
wherein the first calculation formula is:
Figure FDA0003280643230000041
wherein the content of the first and second substances,
Figure FDA0003280643230000042
is the element vector corresponding to the jth element,
Figure FDA0003280643230000043
is an element EjWord vector, alpha, of the e-th word selected from 1 to t wordseIs the weight, x, of the e-th word vectorj,nIs the nth value in the n-dimensional vector of the jth element.
8. The apparatus of claim 7, wherein the filtration module is specifically configured to:
when the average distance is larger than a preset threshold value, filtering the target implicit programming rule; and when the average distance is smaller than or equal to a preset threshold value, reserving the target implicit programming rule.
CN201810953480.1A 2018-08-21 2018-08-21 Implicit programming rule filtering method and device Active CN109117129B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810953480.1A CN109117129B (en) 2018-08-21 2018-08-21 Implicit programming rule filtering method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810953480.1A CN109117129B (en) 2018-08-21 2018-08-21 Implicit programming rule filtering method and device

Publications (2)

Publication Number Publication Date
CN109117129A CN109117129A (en) 2019-01-01
CN109117129B true CN109117129B (en) 2021-11-19

Family

ID=64853396

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810953480.1A Active CN109117129B (en) 2018-08-21 2018-08-21 Implicit programming rule filtering method and device

Country Status (1)

Country Link
CN (1) CN109117129B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107391575A (en) * 2017-06-20 2017-11-24 浙江理工大学 A kind of implicit features recognition methods of word-based vector model

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107391575A (en) * 2017-06-20 2017-11-24 浙江理工大学 A kind of implicit features recognition methods of word-based vector model

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
C程序隐式规则自动提取与反例检测;禹振 等;《电子学报》;20130228;第41卷(第2期);第249-254页 *

Also Published As

Publication number Publication date
CN109117129A (en) 2019-01-01

Similar Documents

Publication Publication Date Title
EP2743854B1 (en) Clustering processing method and device for virus files
CN108021806B (en) Malicious installation package identification method and device
CN109815991A (en) Training method, device, electronic equipment and the storage medium of machine learning model
CN103970733B (en) A kind of Chinese new word identification method based on graph structure
CN106485146B (en) A kind of information processing method and server
CN113590764B (en) Training sample construction method and device, electronic equipment and storage medium
CN111338692B (en) Vulnerability classification method and device based on vulnerability codes and electronic equipment
US20080127043A1 (en) Automatic Extraction of Programming Rules
CN112651296A (en) Method and system for automatically detecting data quality problem without prior knowledge
CN115034220B (en) Abnormal log detection method and device, electronic equipment and storage medium
CN111368534A (en) Application log noise reduction method and device
CN105323763B (en) A kind of recognition methods of junk short message and device
CN115953123A (en) Method, device and equipment for generating robot automation flow and storage medium
CN109286622B (en) Network intrusion detection method based on learning rule set
CN110719278A (en) Method, device, equipment and medium for detecting network intrusion data
CN109117129B (en) Implicit programming rule filtering method and device
CN108804308B (en) Defect detection method and device for new version program
CN111813593A (en) Data processing method, equipment, server and storage medium
CN110837494B (en) Method and device for identifying unspecified diagnosis coding errors of medical record home page
CN114743048A (en) Method and device for detecting abnormal straw picture
CN114153721A (en) API misuse detection method based on decision tree algorithm
CN108563950B (en) Android malicious software detection method based on SVM
CN113392016A (en) Protocol generation method, device, equipment and medium for processing program abnormal condition
CN112465149A (en) Same-city part identification method and device, electronic equipment and storage medium
CN110781072A (en) Code auditing method, device and equipment based on machine learning and storage 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
GR01 Patent grant
GR01 Patent grant