Method for automatically extracting and constructing Petri net model from RFC text

Through deep neural network model and semantic role labeling technology, the Petri network model is automatically extracted from RFC text, solving the problem of inability to guarantee modeling efficiency and quality in the existing technology, and achieving efficient and accurate network protocol modeling and automatic analysis.

CN119692333APending Publication Date: 2025-03-25SHANDONG UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411737692.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

The prior art is difficult to automatically extract and construct Petri net models from RFC text, resulting in the inability to guarantee modeling efficiency and quality.

Method used

The deep neural network model is adopted, specifically the Bert-DGCNN-BiLSTM-CRF model, combining semantic role annotation and intermediate representation of XML language, and extracting and transforming the network protocol state transition relationship to generate the Petri network model.

Benefits of technology

In-depth semantic analysis of RFC text is realized, the modeling efficiency and quality of the network protocol Petri network model is improved, and it can provide reference for expert modeling, and supports automatic RFC text analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119692333A_ABST
    Figure CN119692333A_ABST
Patent Text Reader

Abstract

The invention discloses a method for automatically extracting and constructing a Petri net model from an RFC text, and belongs to the technical field of natural language processing, and the method comprises the following steps: obtaining RFC text data, and preprocessing the RFC text data; the method comprises the following steps: constructing and training a Bert-DGCNN-BiLSTM-CRF model, and extracting protocol process information; converting the extracted protocol process information into network protocol intermediate representation; a network protocol state transition relation is extracted, and noise filtering and relation correction are carried out at the same time; the extracted state transition relation is converted into an incidence matrix, a jxl library is used for analyzing the incidence matrix, and visualization of a network protocol Petri network model is achieved through a PNML file and a PIPE visualization tool. According to the method, deep semantic analysis and mining of the RFC text are realized, and the extracted network protocol Petri network model not only can provide reference for expert modeling, but also can provide support for automatic analysis of the RFC text.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of natural language processing, and in particular relates to a method for automatically extracting and constructing a Petri net model from RFC text. Background Art

[0002] In today's information age, Internet technology is changing with each passing day, and network communications are constantly being updated and improved. As data transmission rules, network protocols control the data exchange and transmission of the Internet, and are used throughout all network applications. They are an important support for ensuring the efficient and stable operation of the network. Network protocol specifications and standards are mainly recorded in the Request for Comments (RFC) text of the network protocol, which is written, published and maintained by the Internet Engineering Task Force (IETF). It is an authoritative and rigorous technical document in the field of network engineering. The RFC text uses natural language to describe the functions, properties and application scenarios of the protocol, providing Internet standard reference materials for developers and network administrators. However, due to the inherent ambiguity of natural language, RFC texts often make it difficult for readers to understand the specific implementation process of the protocol, and the unstructured natural language form is not conducive to automatic analysis of network protocols.

[0003] Researchers describe the behavior of network protocols in a formal way and manually construct a network protocol Petri net formal model (Petri net model for short). This method is more convenient for analyzing and verifying the functions of the protocol. Petri net model is a method of using a formal language with rigorous mathematical definitions to explain and examine the behavior of the system. This method can understand and analyze the system in a more abstract and precise way, thereby improving the efficiency and accuracy of the analysis. However, manually constructing a network protocol Petri net formal model is not only time-consuming and labor-intensive, but also the modeling efficiency and quality cannot be guaranteed. Therefore, it is necessary to use information extraction methods to automatically extract and construct a formal model from the RFC text to improve the modeling efficiency and quality.

[0004] The existing network protocol modeling technology methods all manually construct Petri net models for a single network protocol. This method has high requirements for modelers, requiring not only a wealth of network protocol domain knowledge, but also the need to master complex modeling techniques, which is a time-consuming and laborious task. At the same time, due to differences in understanding and ability among modelers, the quality and modeling efficiency of manually constructed models cannot be guaranteed. The researchers used text mining technology to automatically analyze RFC texts, aiming to extract protocol entities and relationships from unstructured protocol texts and mine complex interactive behaviors between entities. This is a shallow semantic analysis, which is not conducive to further analysis of network protocol behaviors to verify their correctness and security. Summary of the invention

[0005] In order to solve the above problems, the present invention proposes a method for automatically extracting and constructing a Petri net model from RFC text, thereby realizing deep semantic analysis and mining of RFC text. The extracted network protocol Petri net model can not only provide a reference for expert modeling, but also provide support for automatic analysis of RFC text.

[0006] The technical solution of the present invention is as follows:

[0007] A method for automatically extracting and constructing a Petri net model from RFC text includes the following steps:

[0008] Step 1: Obtain RFC text data, preprocess it, and label the data according to the extraction target;

[0009] Step 2: Build and train the Bert-DGCNN-BiLSTM-CRF model to extract protocol process information and realize shallow semantic recognition and analysis of RFC text;

[0010] Step 3: Combine the semantic role labeling results to convert the extracted protocol process information into a network protocol intermediate representation;

[0011] Step 4: Extract the network protocol state transition relationship based on the relationship feature words and location information, and express it in the form of triples, while performing noise filtering and relationship correction;

[0012] Step 5: Convert the extracted state transition relationship into an association matrix, use the jxl library to parse the association matrix, and visualize the network protocol Petri net model through the PNML file and the PIPE visualization tool.

[0013] Furthermore, the specific process of step 1 is as follows:

[0014] Step 1.1, use web crawler technology to obtain RFC texts from the RFC-editor website and construct the original data set, which includes six network protocol specifications and standards: TCP, DCCP, BGPv4, LTP, PPTP and SCTP;

[0015] Step 1.2: Clean up text that is not related to the protocol process; specifically: the header, footer, and footer in the RFC text are information that is not related to the protocol process. The header, footer, and footer in the RFC text are matched by regular expressions and deleted;

[0016] Step 1.3: The sentences in the RFC text are separated by periods, commas, semicolons and line breaks. The cleaned RFC text is divided into chunk sequences according to the separators and conjunctions; the conjunctions include if, then, when and while.

[0017] Step 1.4: Label the data according to the pre-designed labeling rules. The elements to be extracted that are related to the process description are divided into three categories: transfer, action, and trigger. The specific labeling rules are: label the transfer as "Transition", the action as "Action", and the trigger as "Trigger". In addition, elements that are not related to the process description are labeled "O".

[0018] Furthermore, in step 2, DGCNN is introduced into the Bi-LSTM-CRF network, and Bert is simultaneously selected as the embedding layer to construct a Bert-DGCNN-BiLSTM-CRF model; the Bert-DGCNN-BiLSTM-CRF model includes five parts: an input layer, a Bert encoding layer, a feature extraction layer, a CRF layer, and an output layer;

[0019] The input of the input layer is a block sequence, which consists of n blocks;

[0020] The Bert encoding layer sets n Bert branches. The input of each Bert branch is the word embedding, sentence embedding and position embedding contained in each block. The i-th block is denoted as BI i =(inp, tok, att), where inp is word embedding; tok is sentence embedding; att is position embedding; the pooled output representing the semantic information of the entire sequence is selected as a chunk vector, that is, the chunk vector corresponding to the i-th chunk is denoted as BO i ; Set a set of corresponding feature vectors for each block, extract keywords, stems, mathematical expressions and part-of-speech features from the block through regular expressions and vectorize the features, that is, the feature vector corresponding to the i-th block is recorded as f i ; f i The eigenvector f corresponding to the first previous block i-1 The eigenvector f corresponding to the second block above i-2 Concatenate as the complete feature vector F of the current block i , F i with BO i The encoding result FEI of the i-th block is obtained by splicing i , the encoding results of all blocks are used as the output of the Bert encoding layer and the input of the feature extraction layer;

[0021] The feature extraction layer consists of four DGCNN convolutional blocks and several Bi-LSTMs. The number of Bi-LSTMs is set according to the length of the block. The encoding results of all blocks are input into four DGCNN convolutional blocks with the same structure. Each DGCNN convolutional block includes three convolutional layers with expansion rates of 1, 2, and 2, respectively, which are used to extract multi-scale features of the sequence. The DGCNN convolutional block controls the transmission of information through the gating unit. The formula of the gating unit is as follows:

[0022]

[0023] Among them, Y is the gated unit output of each DGCNN convolution block; X is the input of each DGCNN convolution block; Conv1 and Conv2 are dilated convolutions with the same structure; + is a vector addition operation; is the Hardamard product operation of the vector; σ is the Sigmoid function;

[0024] The vector output by DGCNN is put into the Bi-LSTM network; the Bi-LSTM network connects the hidden layer information obtained from forward learning and the hidden layer information obtained from backward learning, and the forward hidden layer information of the i-th block is and backward hidden layer information The concatenated result is used as the extracted feature FEO of the i-th block i ; After the feature extraction layer, the extracted features of all blocks are obtained;

[0025] The extracted features of each block are input into the CRF layer as emission scores; all emission scores constitute the emission matrix; the transfer matrix is ​​composed of all transfer scores; the label score of each block is obtained by adding the transfer matrix to the emission matrix, and the formula is as follows:

[0026]

[0027] Among them, f(y i ,y i-1 ,x i ) is the label score of the i-th block; y i ,y i-1 are the labels of the i-th block and the i-1-th block respectively; x i is the i-th block; is the transfer score of the i-th block;

[0028] Calculate the conditional probability for each label as follows:

[0029]

[0030] Where p(x,y) is the probability that label y and chunk x appear at the same time; I is the total number of chunks; exp(·) is an exponential function with base e; y′ is another label different from y, p(x,y′) is the probability that label y′ and chunk x appear at the same time; p(y|x) is the conditional probability of y under input x;

[0031] Maximize the conditional probability p(y|x), that is, minimize the negative log-likelihood function -lnp(y|x); use the Viterbi algorithm to convert the label prediction problem into the optimal path problem with the maximum non-normalized probability, so as to obtain the label sequence with the highest probability as the output of the CRF layer; during the training process, the difference between the actual label of the labeled sequence and the label predicted by the model is used to define the loss function, and the model parameters are updated through the back-propagation algorithm;

[0032] The largest label sequence is the label sequence output by the output layer.

[0033] Furthermore, in step 3, the network protocol intermediate representation is performed based on the XML language; the network protocol intermediate representation consists of six parts: a definition tag, a reference tag, a trigger tag, a behavior tag, a transfer tag, and a logic tag;

[0034] Definition tag: used to define the status and events related to the current protocol in the RFC text. The status and event are recorded as<def_state> and<def_event> ; Set an identifier id inside the tag, incrementing in the order of first appearance;

[0035] Reference tag: When a defined state or event appears in the RFC text, it is marked with a reference tag, and the identifier of the referenced state or event is added internally;

[0036] Trigger mark: used to indicate the trigger conditions before executing certain operations, recorded as <trigger>and< / trigger> ;

[0037] Behavior tag: used to indicate the operation of data packets and the calculation of variables, recorded as <action> and< / action> , including three types: receive, send and issue, which are represented by receive, send and issue respectively; when the RFC text contains an operation data packet or data frame, a behavior tag needs to be added <arg>Parameter markers;

[0038] Transition marker: used to indicate the transition of state, recorded as <transition> and< / transition> ; If one state enters another state, you need to add parameter markers on both sides of the state<arg_source> ,<arg_intermediate> and<arg_target> to indicate the source state, intermediate state, and target state; if no parameter marker is used, the state defaults to the target state;

[0039] Logical markers: used to represent conditional logic and flow control, denoted by <control> and< / control> .

[0040] Furthermore, in step 3, for the extracted protocol process information, the network protocol intermediate representation is generated according to the semantic role labeling result, and the verbs are divided into three types: action verbs are verbs that represent event operations in the group block; transfer verbs are verbs that represent state transfer in the group block; and typeless verbs are verbs that do not have the above types in the group block;

[0041] If the current block's tag is "Trigger" and there is no verb inside or the verb has no type, use <trigger> and< / trigger> Tag; if the current block's tag is "Action", use <action> and< / action> Tag; if the block contains action verbs, you need to further add the corresponding operation type; if the current block label is "Transition" and contains transition verbs, use <transition> and< / transition> Mark; if there is a direction-related preposition "ArgM-DIR" in the transfer sequence, a direction parameter marker needs to be added to the transfer marker; when generating the network protocol intermediate representation, the position of the marker is controlled according to the indentation in the original RFC text.

[0042] Furthermore, in step 4, the network protocol state transition relationship is represented as a triple STT consisting of a source state, a target state and a state transition.<SourceState,Transition,TargetState> , where SourceState represents the source state; TargetState represents the target state; Transition represents the state transfer, which is composed of events and event types; the algorithm is designed based on the relationship feature words and position information to extract the transition list, source state and target state list in turn.

[0043] Furthermore, the specific process of step 4 is as follows:

[0044] Step 4.1, generate a state transition list; the specific process is: input a logical tag set Control containing directed arc tags, record the child tag of the logical tag as childTag, if childTag is a trigger tag and the tag text childText contains the characteristic words "else" and "otherwise", and the transition list is not empty, then use all the event lists of the current protocol to subtract the current transition list to get the completed event; if the tag is not a behavior tag and there is an event tag inside, then find the corresponding event according to the number of the event tag, determine the event type according to the parameter type, and combine the event and the event type to form a complete transition and store it in the state transition list Transitions; if the tag is a behavior tag and there is a parameter tag inside, then determine the corresponding event according to the event number surrounded by the parameter tag, and combine the event with the type of the behavior tag to form a complete transition and store it in the state transition list Transitions;

[0045] Step 4.2, generate source state and target state for each logical tag. The specific process is as follows: traverse all logical tags in the logical tag set Control. If the subtag of the logical tag is a state tag and the text contains "from", the state is the source state; if the text contains "for" and "to", the state is the target state; if the subtag is a state tag, write all states into the state states; when the source state Sources or the target state Targets is empty, supplement it with the state states; finally, all source states form the source state set SourceStates, and all target states form the target state set TargetStates;

[0046] Step 4.3: Noise filtering and relationship correction; The specific process is: first, delete the relationship in the relationship set whose source and target states are the same and whose transition is ε; second, if there is<S1,x?y!,S2> ,<S1,x?,S2> ,<S1,y!,S2> When , the last two relations need to be discarded because they are the noise generated when the first relation is formed; finally, if there are<SourcePlace,δ,TargetPlace> and<SourcePlace,ε,TargetPlace> , δ represents the set of transitions that are not ε, and the following relations need to be deleted; where SourcePlace is the source state position, TargetPlace is the target position; S1 is an example of the source state, and S2 is an example of the target state.

[0047] Furthermore, the specific process of step 5 is as follows:

[0048] The extracted state transition relationship is converted into an association matrix. The rows and columns of the association matrix correspond to states and transitions respectively. The value of each cell indicates whether there is a relationship between the two. Two all-0 matrices with n rows and m columns are established. The first matrix row is the source state, and the columns are different transitions. If a source state has a relationship with a transition, the corresponding value is set to "-1". The second matrix row is the target state, and the columns are different transitions. If a target state has a relationship with a transition, the corresponding value is set to "+1". Finally, the two matrices are merged to form a complete association matrix. However, if the source state and the target state are the same in the relationship set, the corresponding value needs to be set to "+11" in the second matrix. Replace the value of the position with the value "0" in the cell after merging the matrix with "+10".

[0049] Use the jxl library to parse the association matrix, the source state corresponds to the source place, the target state corresponds to the target place, and the transfer corresponds to the transition. Generate a PNML file through the dom4j library; store the data in the association matrix into the list G[i][j], take out the place and transition nodes in the list and store them in the lists P and T; generate the icons and name attributes of the place and transition nodes by traversing the lists P and T, and the directed arcs are used to connect the places and transitions. The source and target attributes represent the starting and ending positions of the arcs, and the values ​​are the unique identifiers of the places and transitions; traverse the list G[i][j], if G[i][j] = -1 or +10, it means that the current arc is a directed arc from the place to the transition, and if G[i][j] = +1 or +10, it means that it is a directed arc from the transition to the place; write the XML file according to the PNML specification, and use the Petri net visualization tool PIPE to open the file to obtain the generated Petri net.

[0050] Beneficial technical effects brought by the present invention:

[0051] 1. Traditional Bi-LSTM-CRF uses the bidirectional contextual information of the text to better understand the semantic and temporal relationships, but it is difficult to model longer dependencies due to the fixed time step. DGCNN adjusts the expansion rate to expand the receptive field of the convolution kernel, thereby better processing long sequence data. Introducing DGCNN into the Bi-LSTM-CRF network can capture a wider range of contextual information. Selecting Bert as the embedding layer allows the network model to have rich semantic information and context understanding capabilities from the beginning of training. The Bert-DGCNN-BiLSTM-CRF model is trained to extract information related to the protocol process, extract information related to the protocol process from the unstructured network protocol text, and realize shallow semantic recognition and analysis of the RFC network protocol text, which not only improves the model training efficiency, but also further improves the ability to recognize and extract network protocol process information through a complex convolutional structure.

[0052] 2. Since the description of state transition in RFC text spans multiple interrelated sentences, it is difficult to achieve direct conversion from unstructured text to formal complex models. In order to solve the nesting problem between protocol elements, a universal intermediate representation based on XML language is given, which mainly consists of six parts: definition tag, reference tag, trigger tag, behavior tag, transfer tag and logic tag. Verbs are divided into three types: action verbs, transfer verbs and untyped verbs. For the extracted process information, the network protocol intermediate representation is generated based on the semantic role labeling results and the three types of verbs as a bridge between the process information and the network protocol Petri net formal model.

[0053] 3. Since the transfer tags in the generated intermediate representation of the network protocol are incomplete, the complete state transfer relationship is further extracted. The state transfer relationship is represented as a triple consisting of the source state, the target state and the transfer. According to the relationship feature words and label types, the algorithm is designed to extract the transfer list, the source state and the target state list in turn. Due to the inherent ambiguity of natural language, the generated triple relationship contains errors and redundancy, and the design rules are used to filter the noise and correct the relationship. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 This is the overall framework diagram of the method for automatically extracting and constructing a Petri net model from RFC text in the present invention.

[0055] Figure 2 It is a structural diagram of the Bert-DGCNN-BiLSTM-CRF network model of the present invention.

[0056] Figure 3 This is an example diagram of the XML tree of the network protocol intermediate representation of the present invention.

[0057] Figure 4 This is an example diagram of the Action block annotation of the present invention.

[0058] Figure 5 This is a partial text example diagram of the TCP protocol of the present invention; wherein, (1) OPEN CALL, (2) CLOSE CALL, and (3) SYN-RECEIVED STATE respectively describe the OPEN call, CLOSE call, and arrival of some segments in the user call.

[0059] Figure 6 For the present invention Figure 5 The corresponding TCP protocol intermediate representation generation result example diagram.

[0060] Figure 7 This is a Petri net model fragment diagram extracted from the TCP protocol text by the present invention. DETAILED DESCRIPTION

[0061] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments:

[0062] The present invention starts from unstructured RFC text data, uses deep neural network and text mining technology, automatically extracts and constructs a formal model of network protocol Petri net, and provides technical support for formal modeling of network protocol and automatic analysis of protocol text. First, DGCNN is introduced into Bi-LSTM-CRF network, Bert is selected as embedding layer synchronously, Bert-DGCNN-BiLSTM-CRF model is constructed and trained, and information related to protocol process is extracted from unstructured network protocol text to realize shallow semantic recognition and analysis of RFC text. Secondly, for the extracted process information, the intermediate representation of network protocol is generated according to the semantic role labeling results and three types of verbs. Then, the state transition relationship is represented as a triple consisting of source state, target state and transfer, the state transition relationship is extracted according to the relationship feature words, and rules are designed for noise filtering and relationship correction. Finally, the extracted state transition relationship is converted into an association matrix, the association matrix is ​​parsed using jxl library, and the Petri net model is visualized through PNML file and PIPE tool. The method proposed in the present invention leverages the powerful advantages of deep neural networks to improve extraction efficiency. The extracted network protocol Petri net model can not only provide a reference for expert modeling, but also provide support for automatic analysis of RFC network protocol texts.

[0063] The overall framework of the present invention is as follows Figure 1 As shown, the purpose is to use a structured extraction method to automatically extract and construct a network protocol Petri net formal model from the RFC text. Based on the deep neural network model, shallow semantic recognition of the RFC text is performed, and the intermediate representation of the network protocol is generated in combination with semantic role annotation, and the state transition relationship is further extracted. The network protocol Petri net model is visualized through the PNML file and the PIPE tool. The extracted network protocol Petri formal model can be used for automatic analysis and verification of the RFC network protocol text. The present invention mainly solves three key technical problems, namely:

[0064] Key technical issue 1: Network protocol process information extraction based on deep learning;

[0065] Use web crawler technology to collect RFC texts, preprocess the RFC texts, and clean up information that is not related to the protocol process. Block, word segmentation, and part-of-speech tagging are performed on the RFC texts, and label annotation data is designed according to the extraction target. DGCNN is introduced into the Bi-LSTM-CRF network, and Bert is simultaneously selected as the embedding layer to build and train the Bert-DGCNN-BiLSTM-CRF model to extract information related to the protocol process and realize shallow semantic recognition and analysis of RFC texts. This not only improves the efficiency of model training, but also further improves the ability to recognize and extract network protocol process information through complex convolutional structures.

[0066] Key technical issue 2: Generation of intermediate representation of network protocols based on semantic role labeling.

[0067] Since it is difficult to achieve direct transformation from unstructured text to formalized complex models, a universal intermediate representation of network protocols is needed as a bridge between process information and the formalized model of network protocol Petri nets. A network protocol intermediate representation based on XML language is given, which mainly consists of six parts: definition tag, reference tag, trigger tag, behavior tag, transfer tag and logic tag. Verbs are divided into three types: action verbs, transfer verbs and untyped verbs. For the extracted process information, the intermediate representation of network protocols is generated based on the semantic role labeling results and the three types of verbs.

[0068] Key technical issue 3: Extraction of network protocol state transition relations based on rule matching.

[0069] Although there are many transition tags in the generated intermediate representation, only a few tags contain complete state transition relations, so it is necessary to further extract the complete state transition relations. The state transition relations are represented as triples consisting of source state, target state and transition. According to the relational feature words and label types, the algorithm is designed to extract the transition list, source state and target state list in turn. Due to the inherent ambiguity of natural language, the generated triple relations contain errors and redundancy, so the design rules are used to filter the noise and correct the relations.

[0070] The specific process of the method of the present invention is as follows:

[0071] Step 1: Get the RFC text data, perform preprocessing such as cleaning, segmentation, word segmentation, and part-of-speech tagging, and design labels to annotate the data based on the extraction target. The specific process is as follows:

[0072] Step 1.1, use web crawler technology to obtain RFC texts from the RFC-editor website and construct the original data set, which includes six network protocol specifications and standards: TCP, DCCP, BGPv4, LTP, PPTP and SCTP;

[0073] Step 1.2: Perform preprocessing to clean up text irrelevant to the protocol process; specifically: use regular expressions to match the header, footer, and footnote information irrelevant to the protocol process in the RFC text and delete them;

[0074] Step 1.3: The sentences in the RFC text are usually separated by periods, commas, semicolons, and line breaks. The cleaned RFC text is divided into chunk sequences based on these separators and conjunctions (if, then, when, while, etc.);

[0075] Step 1.4: Label the data according to the pre-designed labeling rules for subsequent model training; the elements to be extracted related to the process description are transition, action, and trigger. The specific labeling rules are: label the transition as "Transition", the action as "Action", and the trigger as "Trigger". In addition, elements not related to the process description are labeled "O".

[0076] Step 2: Build and train the Bert-DGCNN-BiLSTM-CRF model to extract the protocol process information and realize the shallow semantic recognition and analysis of the RFC text. The process information is described as a continuous sequence of words in the network protocol text, so the process information extraction is regarded as a sequence labeling task.

[0077] DGCNN is introduced into the Bi-LSTM-CRF network, and Bert is selected as the embedding layer to construct the Bert-DGCNN-BiLSTM-CRF model. Figure 2 As shown in the figure, the Bert-DGCNN-BiLSTM-CRF model consists of five parts: input layer, Bert encoding layer, feature extraction layer, CRF layer and output layer. Figure 2 Only some of the processing of the four blocks is shown.

[0078] (1) Input layer: The input of the input layer is a block sequence, consisting of n blocks. Figure 2 In , the input layer inputs a block sequence consisting of four blocks, for example, "If the receiver was in any other states," is a block.

[0079] (2) Bert encoding layer: The Bert encoding layer is set up with n Bert branches. The input of each Bert branch is the word embedding, sentence embedding and position embedding contained in each block. The i-th block is denoted as BI i =(inp, tok, att), where inp is word embedding; tok is sentence embedding; att is position embedding; the pooled output representing the semantic information of the entire sequence is selected as a chunk vector, that is, the chunk vector corresponding to the i-th chunk is denoted as BO i In order to obtain better extraction effect, a set of corresponding feature vectors is set for each block. The features such as keywords, stems, mathematical expressions and parts of speech are extracted from the block through regular expressions and vectorized. That is, the feature vector corresponding to the i-th block is recorded as f i . i The eigenvector f corresponding to the first previous block i-1 The eigenvector f corresponding to the second block above i-2 Concatenate as the complete feature vector F of the current block i , F i with BO i The encoding result FEI of the i-th block is obtained by splicing i , the encoding results of all blocks are used as the output of the Bert encoding layer and the input of the feature extraction layer.

[0080] (3) Feature extraction layer: It consists of four DGCNN (dynamic graph edge convolutional network) convolution blocks and several Bi-LSTM (bidirectional long short-term memory network). The number of Bi-LSTM is set according to the length of the block. In the embodiment of the present invention, the block length of the input layer input is 4, so 4 Bi-LSTMs are set in the feature extraction layer. The encoding results of all blocks are input into four DGCNN convolution blocks with the same structure. Each DGCNN convolution block includes three layers of convolution layers with expansion rates of 1, 2, and 2, respectively, which are used to extract multi-scale features of the sequence. The DGCNN convolution block controls the transmission of information through the gating unit. The formula of the gating unit is as follows:

[0081]

[0082] Among them, Y is the gated unit output of each DGCNN convolution block; X is the input of each DGCNN convolution block; Conv1 and Conv2 are dilated convolutions with the same structure; + is a vector addition operation; is the Hardamard product operation of the vector; σ is the Sigmoid function.

[0083] In order to make better use of context information, the vector output by DGCNN is put into the Bi-LSTM network. The bidirectional long short-term memory network is an extension of LSTM. It consists of two bidirectional LSTM units, which are responsible for processing sequential and reverse information respectively, so that it can obtain context information in a global scope. And the hidden information obtained by backward learning The forward hidden layer information of the i-th block and backward hidden layer information The concatenated result is used as the extracted feature FEO of the i-th block i After the feature extraction layer, the extracted features of all blocks can be obtained.

[0084] (4) CRF layer: The extracted features of each block are input into the CRF layer as emission scores. CRF can consider the global label dependency, resolve ambiguity and errors between labels, and improve the accuracy of extraction. All emission scores constitute the emission matrix, which is actually the score corresponding to each label after the block sequence passes through DGCNN and Bi-LSTM. The transfer matrix is ​​composed of all transfer scores. The label score of each block is obtained by adding the transfer matrix to the emission matrix. The formula is as follows:

[0085]

[0086] Among them, f(y i ,y i-1 ,x i ) is the label score of the i-th block; y i ,y i-1 are the labels of the i-th block and the i-1-th block respectively; x i is the i-th block; is the transfer score of the i-th block;

[0087] Calculate the conditional probability for each label as follows:

[0088]

[0089]

[0090] Where p(x,y) is the probability that label y and chunk x appear at the same time; I is the total number of chunks; exp(·) is an exponential function with base e; y′ is another label different from y, p(x,y′) is the probability that label y′ and chunk x appear at the same time; p(y|x) is the conditional probability of y given the input x.

[0091] Maximize the conditional probability p(y|x), that is, minimize the negative log-likelihood function -lnp(y|x). The Viterbi algorithm is used to transform the label prediction problem into the optimal path problem with the maximum non-normalized probability, so as to obtain the label sequence with the highest probability as the output of the CRF layer. During the training process, the difference between the true label of the labeled sequence and the label predicted by the model is used to define the loss function, and the model parameters are updated through the back-propagation algorithm.

[0092] (5) Output layer: The largest label sequence is the label sequence output by the output layer. Figure 2 In the example, the output layer outputs a label sequence consisting of four blocks. For example, "Trigger" is the label corresponding to the first block.

[0093] Step 3: Combine the semantic role labeling results to convert the extracted protocol process information into a network protocol intermediate representation.

[0094] Since the state transition described in the RFC text spans multiple interrelated sentences, it is difficult to achieve a direct conversion from unstructured text to a formalized complex model. A universal network protocol intermediate representation is needed. For the extracted process information, the network protocol intermediate representation is generated based on the semantic role labeling results and three types of verbs as a bridge between the process information and the network protocol Petri net formal model.

[0095] Step 3.1, network protocol intermediate representation;

[0096] In order to solve the problem of nesting between protocol elements, the present invention provides a network protocol intermediate representation based on XML language, which abstracts the process information identified by the deep neural network into a structured intermediate representation. The network protocol intermediate representation mainly consists of six parts: definition tag, reference tag, trigger tag, behavior tag, transfer tag and logic tag. Verbs are divided into three types: action verbs, transfer verbs and untyped verbs.

[0097] Definition tag: used to define the status and events related to the current protocol in the RFC text. The status and event are recorded as<def_state> and<def_event> . An identifier id is set inside the tag, increasing in order of first appearance, for example<def_state id="1”> LISTEN< / def_state> The defined states and events will be referenced by reference tags in other tags.

[0098] Reference tags: States and events appear frequently in RFC texts, but not all state and event names are standard and complete, and the text may use different tenses of the same word to represent states and events. When a defined state or event appears in the text, it is necessary to use a reference tag to mark it, and add the identifier of the referenced state or event inside, such as in<ref_state id="2”> SYN-SENT< / ref_state> state.

[0099] Trigger mark: used to indicate the trigger conditions before executing certain operations, recorded as <trigger> and< / trigger> For example, the preparations required to send a data packet or the state that a state was in before it was transferred are usually described by keywords such as if and when.

[0100] Behavior tag: used to indicate the operation of data packets and the calculation of variables, recorded as <action> and< / action> , including three types: receive, send and issue, which are represented by receive, send and issue respectively. When the text contains data packets or data frames of the operation, a behavior tag needs to be added <arg>Parameter markers. For example,<action type="send”> send <arg> a FIN segment< / arg> .

[0101] Transition marker: used to indicate the transition of state, recorded as <transition> and< / transition> If one state enters another state, you need to add parameter markers on both sides of the state.<arg_source> ,<arg_intermediate> and<arg_target> to represent the source state, intermediate state, and target state. For example, <transition> the client moves from<arg_source> OPEN< / arg_source> through<arg_intermediate> CLOSING< / arg_intermediate> to<arg_target> TIME-WAIT< / arg_target>< / transition> If no parameter marker is used, the state defaults to the target state.

[0102] Logical markers: used to represent conditional logic and flow control, denoted by <control> and< / control> A logic tag can contain multiple trigger tags, behavior tags, and transfer tags, as well as other logic tags. There is at least one trigger tag in a logic tag, which is used to indicate the trigger condition before executing certain operations in the logic tag.

[0103] Figure 3 This is an example of an intermediate representation XML tree for a network protocol. In the figure, a logical tag contains two sub-logical tags, and each sub-logical tag has a trigger tag. When the defined states and events appear in the text, they need to be referenced through reference tags.

[0104] Step 3.2: Generate network protocol intermediate representation;

[0105] Semantic Role Labeling (SRL) aims to analyze the predicate argument structure of a sentence in order to better understand the semantics of the sentence. SRL believes that the predicate is the core of the entire sentence, and analyzes the relationship between the remaining components of the sentence and the verb around the predicate. The units directly related to the predicate are called core arguments, represented by Arg-N, and those not directly related are called semantic additional words, represented by ArgM-XXX, as shown in Table 1:

[0106] Table 1 SRL labels and meanings

[0107]

[0108]

[0109] For the extracted protocol process information, the network protocol intermediate representation is generated according to the semantic role labeling results, and the verbs are divided into three types: if the block contains verbs representing event operations (such as "receive" and "send", etc.), the verb is called an action verb; if the block contains verbs representing state transfer (such as "move" and "return", etc.), the verb is called a transfer verb; if the block does not contain the above types of verbs, the verb is called an untyped verb.

[0110] If the current block's tag is "Trigger" and there is no verb inside or the verb has no type, use <trigger> and< / trigger> If the current block's tag is "Action", use <action> and< / action> If the block contains action verbs, you need to add the corresponding operation type, such as Figure 4 As shown in the figure, "receiving" is recognized as a verb, the type is "receive", and "a dccp-response" is the object unit "Arg1". If the label of the current block is "Transition" and contains a transition verb, use <transition> and< / transition> Mark. If there is a direction-related preposition "ArgM-DIR" (such as "from" and "through") in the transfer sequence, you need to add a direction parameter marker in the transfer marker. When generating the network protocol intermediate representation, according to the position of the indentation control marker in the original RFC text, for example, if a logical marker is included in the previous logical marker, the indentation of this logical marker is more than the indentation of the previous logical marker.

[0111] Step 4: Extract the network protocol state transition relationship based on the relationship feature words and location information, and express it in the form of triples, while performing noise filtering and relationship correction.

[0112] Although there are many transition tags in the generated intermediate representation, only a few tags contain complete state transition relations. Therefore, it is necessary to further extract the complete state transition relations based on text features. The network protocol state transition relation is represented as a triple consisting of source state, target state and state transition STT=<SourceState,Transition,TargetState> , where SourceState represents the source state; TargetState represents the target state; Transition represents the state transition, which is composed of events and event types. Based on the relationship feature words and position information, the algorithm is designed to extract the state transition list, source state set, and target state set in sequence. Due to the inherent ambiguity of natural language, the generated triple relations are wrong and redundant, so the design rules are used to filter the noise and correct the relations.

[0113] The specific process of step 4 is as follows:

[0114] Step 4.1, state transition list generation; The pseudo code of Algorithm 1 corresponding to Table 2 gives the transition list generation process, inputs the logical tag set Control containing directed arc tags, and outputs the state transition list Transition composed of all transitions in the logical tag. The child tag of the logical tag child is recorded as childTag. If childTag is a trigger tag and the tag text childText contains the characteristic words "else" and "otherwise", and the transition list is not empty, then the complete event (Transitions) is obtained by subtracting the current transition list from the current protocol's all event list (AllTransitions) (corresponding to rows 3-7 in the table of Algorithm 1). If the tag is not a behavior tag and there is an event tag inside, find the corresponding event Reason according to the event tag number and write it into Transition.reason, determine the event type Type according to the parameter type and write it into Transition.argument, and the event and type are combined to form a complete transition and stored in Transitions (corresponding to rows 8-11 in the table of Algorithm 1). If the tag is a behavior tag and there is a parameter tag inside, determine the corresponding event and behavior tag type combination according to the event number surrounded by the parameter tag (corresponding to rows 13-19 in the table of Algorithm 1).

[0115] Table 2 Algorithm 1 pseudo code

[0116]

[0117] Step 4.2, source state set and target state set generation: Generate source state and target state for each logical tag. The specific process is shown in the pseudo code of Algorithm 2 corresponding to Table 3. Traverse all logical tags child in the logical tag set Control (corresponding to rows 1 to 3 in Algorithm 2). The child tag of the logical tag child is recorded as childTag. If the child tag childTag is a state tag and the text contains "from", the state is the source state (corresponding to rows 4 to 6 in Algorithm 2). If the text contains "for" and "to", the state is the target state (corresponding to rows 7 to 9 in Algorithm 2). If the child tag is a state tag, write all states to the state states (corresponding to rows 12 to 14 in Algorithm 2). When the source state Sources or the target state Targets is empty, supplement it with the state states (corresponding to rows 15 to 20 in Algorithm 2). Finally, all source states form the source state set SourceStates, and all target states form the target state set TargetStates.

[0118] Table 3 Algorithm 2 pseudo code

[0119]

[0120]

[0121] Step 4.3, noise filtering and relationship correction: Due to the inherent ambiguity of natural language, the generated triple relationships contain errors and redundancies. Rules are designed to filter noise and correct relationships to achieve deep semantic analysis of the network protocol RFC text.

[0122] After the relationship extraction is completed, the relationship recognition results may contain some errors, so they need to be filtered and corrected. First, delete the relationship in the relationship set whose source and target states are the same and whose transition is ε. It means that an operation in which no event occurs in a state still maintains the current state, which has no practical meaning in the Petri net representation and is expressed as<SourcePlace,ε,SourcePlace> . Secondly, if there is<S1,x?y!,S2> ,<S1,x?,S2> ,<S1,y!,S2> The last two relations need to be discarded because they are the noise generated when the first relation is formed. Finally, if there are<SourcePlace,δ,TargetPlace> and<SourcePlace,ε,TargetPlace> , δ represents the set of transitions that are not ε, and the following relations need to be deleted. SourcePlace is the source state position, TargetPlace is the target position; S1 is an example of the source state, and S2 is an example of the target state.

[0123] Step 5: Convert the extracted state transition relationship into an association matrix, use the jxl library to parse the association matrix, and visualize the network protocol Petri net model through the PNML file and the PIPE visualization tool.

[0124] The extracted state transition relationship is converted into an association matrix. The rows and columns of the association matrix correspond to states and transitions respectively, and the value of each cell indicates whether there is a relationship between the two. Two all-0 matrices with n rows and m columns are established. The rows of the first matrix are source states, and the columns are different transitions. If a source state has a relationship with a transition, set the corresponding value to "-1". The rows of the second matrix are target states, and the columns are different transitions. If a target state has a relationship with a transition, set the corresponding value to "+1". Finally, merge the two matrices to form a complete association matrix. However, if the source state and the target state are the same in the relationship set, that is,<sourceState,Transition,SourceState> , the value needs to be set to "+11" in the second matrix. To avoid the value in the cell becoming "0" when merging the matrices, generating an incorrect Petri net, the value in the cell of the association matrix should be "+10" in this case. Table 4 shows the partial association matrix of the TCP protocol:

[0125] Table 4 TCP protocol partial association matrix

[0126]

[0127] Use the jxl library to parse the association matrix. The source state corresponds to the source place, the target state corresponds to the target place, and the transfer corresponds to the transition. Generate a PNML file through the dom4j library. Store the data in the association matrix into the list G[i][j], take out the place and transition nodes in the list and store them in the lists P and T. Generate the icons and name attributes of the place and transition nodes by traversing the lists P and T. Directed arcs are used to connect places and transitions. The source and target attributes represent the starting and ending positions of the arcs, and the values ​​are the unique identifiers of the places and transitions. Traverse the list G[i][j]. If G[i][j] = -1 or +10, it means that the current arc is a directed arc from the place to the transition. If G[i][j] = +1 or +10, it means that it is a directed arc from the transition to the place. Write the XML file according to the PNML specification and use the Petri net visualization tool PIPE to open the file to get the generated Petri net.

[0128] In order to demonstrate the feasibility and superiority of the present invention, the following specific examples are given.

[0129] TCP activities are described as responses to events, which are divided into three types: user calls, segment arrivals, and user timeouts. Take the partial text of the TCP protocol as an example, such as Figure 5 As shown, Figure 5 (1) OPEN CALL, (2) CLOSE CALL, and (3) SYN-RECEIVED STATE respectively describe the arrival of the OPEN call, CLOSE call, and some fragments in the user call.

[0130] Figure 6 for Figure 5 The corresponding TCP protocol intermediate representation generation result example diagram contains 4 logical tags and 10 sub-logical tags. The state transition relationship extraction results are shown in Table 5, and a total of 10 groups of relationships are extracted.

[0131] Table 5 TCP protocol intermediate representation generation results

[0132]

[0133]

[0134] The state transition relationship extraction results are converted into an association matrix, and the corresponding PNML file is generated according to the PNML syntax. The final Petri net model is obtained with the help of the PIPE tool, as shown in Figure 7 shown.

[0135] Of course, the above description is not a limitation of the present invention, and the present invention is not limited to the above examples. Changes, modifications, additions or substitutions made by technicians in this technical field within the essential scope of the present invention should also fall within the protection scope of the present invention.< / arg> < / arg>

Claims

1. A method for automatically extracting and constructing a Petri net model from RFC text, characterized in that: The steps include: Step 1: Obtain RFC text data, preprocess it, and label the data according to the extraction target; Step 2: Build and train the Bert-DGCNN-BiLSTM-CRF model to extract protocol process information and realize shallow semantic recognition and analysis of RFC text; Step 3: Combine the semantic role labeling results to convert the extracted protocol process information into a network protocol intermediate representation; Step 4: Extract the network protocol state transition relationship based on the relationship feature words and location information, and express it in the form of triples, while performing noise filtering and relationship correction; Step 5: Convert the extracted state transition relationship into an association matrix, use the jxl library to parse the association matrix, and visualize the network protocol Petri net model through the PNML file and the PIPE visualization tool.

2. The method for automatically extracting and constructing a Petri net model from an RFC text according to claim 1, characterized in that: The specific process of step 1 is as follows: Step 1.1, use web crawler technology to obtain RFC texts from the RFC-editor website and construct the original data set, which includes six network protocol specifications and standards: TCP, DCCP, BGPv4, LTP, PPTP and SCTP; Step 1.2: Clean up text that is not related to the protocol process; specifically: the header, footer, and footer in the RFC text are information that is not related to the protocol process. The header, footer, and footer in the RFC text are matched by regular expressions and deleted; Step 1.3: The sentences in the RFC text are separated by periods, commas, semicolons and line breaks. The cleaned RFC text is divided into chunk sequences according to the separators and conjunctions; the conjunctions include if, then, when and while. Step 1.4, label the data according to the pre-designed labeling rules; the elements to be extracted related to the process description are three types: transfer, action, and trigger. The specific labeling rules are: label the transfer as "Transition", the action as "Action", and the trigger as "Trigger"; in addition, the elements not related to the process description are labeled "O".

3. The method for automatically extracting and constructing a Petri net model from an RFC text according to claim 1, characterized in that: In the step 2, DGCNN is introduced into the Bi-LSTM-CRF network, and Bert is simultaneously selected as the embedding layer to construct a Bert-DGCNN-BiLSTM-CRF model; the Bert-DGCNN-BiLSTM-CRF model includes five parts: an input layer, a Bert encoding layer, a feature extraction layer, a CRF layer, and an output layer; The input of the input layer is a block sequence, which consists of n blocks; The Bert encoding layer sets n Bert branches. The input of each Bert branch is the word embedding, sentence embedding and position embedding contained in each block. The i-th block is denoted as BI i =(inp, tok, att), where inp is word embedding; tok is sentence embedding; att is position embedding; the pooled output representing the semantic information of the entire sequence is selected as a chunk vector, that is, the chunk vector corresponding to the i-th chunk is denoted as BO i ; Set a set of corresponding feature vectors for each block, extract keywords, stems, mathematical expressions and part-of-speech features from the block through regular expressions and vectorize the features, that is, the feature vector corresponding to the i-th block is recorded as f i ; f i The eigenvector f corresponding to the first previous block i-1 The eigenvector f corresponding to the second block above i-2 Concatenate as the complete feature vector F of the current block i , F i with BO i The encoding result FEI of the i-th block is obtained by splicing i , the encoding results of all blocks are used as the output of the Bert encoding layer and the input of the feature extraction layer; The feature extraction layer consists of four DGCNN convolutional blocks and several Bi-LSTMs. The number of Bi-LSTMs is set according to the length of the block. The encoding results of all blocks are input into four DGCNN convolutional blocks with the same structure. Each DGCNN convolutional block includes three convolutional layers with expansion rates of 1, 2, and 2, respectively, which are used to extract multi-scale features of the sequence. The DGCNN convolutional block controls the transmission of information through the gating unit. The formula of the gating unit is as follows: Among them, Y is the gated unit output of each DGCNN convolution block; X is the input of each DGCNN convolution block; Conv1 and Conv2 are dilated convolutions with the same structure; + is a vector addition operation; is the Hardamard product operation of the vector; σ is the Sigmoid function; The vector output by DGCNN is put into the Bi-LSTM network; the Bi-LSTM network connects the hidden layer information obtained from forward learning and the hidden layer information obtained from backward learning, and the forward hidden layer information of the i-th block is and backward hidden layer information The concatenated result is used as the extracted feature FEO of the i-th block i ; After the feature extraction layer, the extracted features of all blocks are obtained; The extracted features of each block are input into the CRF layer as emission scores; all emission scores constitute the emission matrix; the transfer matrix is ​​composed of all transfer scores; the label score of each block is obtained by adding the transfer matrix to the emission matrix, and the formula is as follows: Among them, f(y i ,y i-1 ,x i ) is the label score of the i-th block; y i ,y i-1 are the labels of the i-th block and the i-1-th block respectively; x i is the i-th block; is the transfer score of the i-th block; Calculate the conditional probability for each label as follows: Where p(x,y) is the probability that label y and chunk x appear at the same time; I is the total number of chunks; exp(·) is an exponential function with base e; y′ is another label different from y, p(x,y′) is the probability that label y′ and chunk x appear at the same time; p(y|x) is the conditional probability of y under input x; Maximize the conditional probability p(y|x), that is, minimize the negative log-likelihood function -lnp(y|x); use the Viterbi algorithm to convert the label prediction problem into the optimal path problem with the maximum non-normalized probability, so as to obtain the label sequence with the highest probability as the output of the CRF layer; during the training process, the difference between the actual label of the labeled sequence and the label predicted by the model is used to define the loss function, and the model parameters are updated through the back-propagation algorithm; The largest label sequence is the label sequence output by the output layer.

4. The method for automatically extracting and constructing a Petri net model from an RFC text according to claim 1, characterized in that: In the step 3, the network protocol intermediate representation is performed based on the XML language; the network protocol intermediate representation consists of six parts: definition tag, reference tag, trigger tag, behavior tag, transfer tag and logic tag; Definition tag: used to define the status and events related to the current protocol in the RFC text. The status and event are recorded as<def_state> and<def_event> ; Set an identifier id inside the tag, incrementing in the order of first appearance; Reference tag: When a defined state or event appears in the RFC text, it is marked with a reference tag, and the identifier of the referenced state or event is added internally; Trigger mark: used to indicate the trigger conditions before executing certain operations, recorded as <trigger> and< / trigger> ; Behavior tag: used to indicate the operation of data packets and the calculation of variables, recorded as <action> and< / action> , including three types: receive, send and issue, which are represented by receive, send and issue respectively; when the RFC text contains an operation data packet or data frame, a behavior tag needs to be added <arg> Parameter markers;< / arg> Transition marker: used to indicate the transition of state, recorded as <transition> and< / transition> ; If one state enters another state, you need to add parameter markers on both sides of the state<arg_source> ,<arg_intermediate> and<arg_target> to indicate the source state, intermediate state, and target state; if no parameter marker is used, the state defaults to the target state; Logical markers: used to represent conditional logic and flow control, denoted by <control> and< / control> .

5. The method for automatically extracting and constructing a Petri net model from an RFC text according to claim 4, characterized in that: In the step 3, for the extracted protocol process information, the network protocol intermediate representation is generated according to the semantic role labeling result, and the verbs are divided into three types: action verbs are verbs that represent event operations in the block; transfer verbs are verbs that represent state transfer in the block; and typeless verbs are verbs that do not have the above types in the block; If the current block's tag is "Trigger" and there is no verb inside or the verb has no type, use <trigger> and< / trigger> Tag; if the current block's tag is "Action", use <action> and< / action> Tag; if the block contains action verbs, you need to further add the corresponding operation type; if the current block label is "Transition" and contains transition verbs, use <transition> and< / transition> Mark; if there is a direction-related preposition "ArgM-DIR" in the transfer sequence, a direction parameter marker needs to be added to the transfer marker; when generating the network protocol intermediate representation, the position of the marker is controlled according to the indentation in the original RFC text.

6. The method for automatically extracting and constructing a Petri net model from an RFC text according to claim 5, characterized in that: In step 4, the network protocol state transition relationship is represented as a triple STT consisting of a source state, a target state and a state transition.<SourceState,Transition,TargetState> , where SourceState represents the source state; TargetState represents the target state; Transition represents the state transfer, which is composed of events and event types; the algorithm is designed based on the relationship feature words and position information to extract the transition list, source state and target state list in turn.

7. The method for automatically extracting and constructing a Petri net model from an RFC text according to claim 6, characterized in that: The specific process of step 4 is as follows: Step 4.1, generate a state transition list; the specific process is: input the logic tag set Control containing directed arc tags, record the child tag of the logic tag as childTag, if childTag is a trigger tag and the tag text childText contains the characteristic words "else" and "otherwise", and the transition list is not empty, then use the list of all events of the current protocol to subtract the current transition list to obtain the completion event; If the tag is not a behavior tag and there is an event tag inside, the corresponding event is found according to the number of the event tag, and the event type is determined according to the parameter type. The event and event type are combined to form a complete transition and stored in the state transition list Transitions; If the tag is a behavior tag and there are parameter tags inside, the corresponding event is determined according to the event number surrounded by the parameter tags, and the event is combined with the type of the behavior tag to form a complete transition and stored in the state transition list Transitions; Step 4.2, generate source state and target state for each logical tag. The specific process is as follows: traverse all logical tags in the logical tag set Control. If the subtag of the logical tag is a state tag and the text contains "from", the state is the source state; if the text contains "for" and "to", the state is the target state; if the subtag is a state tag, write all states into the state states; when the source state Sources or the target state Targets is empty, supplement it with the state stated; finally, all source states form the source state set SourceStates, and all target states form the target state set TargetStated; Step 4.3: Noise filtering and relationship correction; The specific process is: first, delete the relationship in the relationship set whose source and target states are the same and whose transition is ε; second, if there is<S1,x?y!,S2> ,<S1,x?,S2> ,<S1,y!,S2> When , the last two relations need to be discarded because they are the noise generated when the first relation is formed; finally, if there are<SourcePlace,γ,TargetPlace> and<SourcePlace,ε,TargetPlace> , δ represents the set of transitions that are not ε, and the following relations need to be deleted; where SourcePlace is the source state position, TargetPlace is the target position; S1 is an example of the source state, and S2 is an example of the target state.

8. The method for automatically extracting and constructing a Petri net model from an RFC text according to claim 7, characterized in that: The specific process of step 5 is as follows: The extracted state transition relationship is converted into an association matrix. The rows and columns of the association matrix correspond to states and transitions respectively, and the value of each cell indicates whether there is a relationship between the two. Create two all-0 matrices with n rows and m columns. The first matrix row is the source state and the column is the different transitions. If a source state has a relationship with a transition, set the corresponding value to "-1"; the second matrix row is the target state, and the column is the different transitions; if a target state has a relationship with a transition, set the corresponding value to "+1"; finally, merge the two matrices to form a complete association matrix; but if the source state and the target state are the same in the relationship set, set the corresponding value in the second matrix to "+11"; replace the value of the position with the value of "0" in the cell after merging the matrix with "+10"; Use jxl library to parse the association matrix, source state corresponds to source location, target state corresponds to target location, transfer corresponds to migration, and generate PNML file through dom4j library; Store the data in the association matrix into the list G[i][j], take out the place and transition nodes in the list and store them in the lists P and T; generate the icons and name attributes of the place and transition nodes by traversing the lists P and T, directed arcs are used to connect places and transitions, the source and target attributes represent the starting and ending positions of the arcs, and the values ​​are the unique identifiers of the places and transitions; traverse the list G[i][j], if G[i][j] = -1 or +10, it means that the current arc is a directed arc from the place to the transition, if G[i][j] = +1 or +10, it means that it is a directed arc from the transition to the place; write the XML file according to the PNML specification, and use the Petri net visualization tool PIPE to open the file to obtain the generated Petri net.