TSN configuration method based on natural language processing technology
Patent Information
- Application Number
- CN202511548605.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-28
- Publication Date
- 2026-01-23
Smart Images

Figure CN121387392A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of natural language processing and network communication technology, and relates to a TSN configuration method based on natural language processing technology. Background Technology
[0002] With the deepening integration of Information Technology (IT) and Operational Technology (OT), traditional industrial networks are experiencing unprecedented challenges and opportunities. The rapid development of emerging technologies such as the Industrial Internet, smart manufacturing, autonomous driving, telemedicine, Augmented Reality (AR), and Virtual Reality (VR) places increasingly stringent demands on the real-time performance, determinism, and high reliability of industrial control systems and automation networks. Against this backdrop, traditional Ethernet, due to its best-effort-based transmission mechanism, struggles to provide predictable quality-of-service (QoS) guarantees for critical business traffic.
[0003] Traditional Ethernet communication protocols have increasingly revealed significant shortcomings when faced with demands for high real-time performance, low latency, and high reliability. This is especially true in scenarios highly sensitive to transmission latency and jitter, such as motion control in industrial automation, multi-sensor data fusion in autonomous driving environments, and real-time distribution of high-definition video and multimedia streams. Traditional Ethernet struggles to guarantee determinism and millisecond- or even microsecond-level jitter control. These applications place stringent demands on the network; any data transmission delay or packet loss can directly lead to system failure or even security risks. Therefore, achieving low-latency, high-reliability, and deterministic communication in complex industrial networks has become a critical and urgent problem to solve.
[0004] At the same time, the limitations of traditional network configuration methods are becoming increasingly apparent. In large-scale industrial IoT environments, network topologies are often extremely complex, with a vast number of switches and controllers. Existing configuration methods typically rely on manual operation, requiring users to configure network device parameters one by one through a command-line interface (CLI) or graphical user interface (GUI). This is not only cumbersome and inefficient, but also highly susceptible to human error. Once a configuration error occurs, it may lead to a decline in the overall network service quality, or even cause production system shutdowns, resulting in significant losses. Therefore, improving the intelligence and automation level of configuration has become an inevitable requirement for realizing the evolution of industrial networks.
[0005] To address these issues, Time-Sensitive Networking (TSN) technology emerged. TSN introduces key mechanisms such as time synchronization, traffic shaping, priority scheduling, and redundant transmission at the Ethernet layer, providing industrial control systems with low latency, high bandwidth utilization, and end-to-end deterministic communication capabilities. In recent years, academia and industry have conducted extensive research on the automatic configuration of TSN, involving system architecture design, core algorithm improvement, protocol optimization, and application-oriented implementation methods. However, most existing methods still require professionals with a high level of network knowledge to operate correctly, making it difficult to meet the intuitive and easy-to-use requirements of non-professional users for network configuration.
[0006] To address these issues, this paper proposes a TSN configuration method based on Natural Language Processing (NLP). This approach, by introducing NLP technology, allows users to input network configuration requirements in simple natural language, which the system then automatically parses and generates executable configuration commands. With this method, users do not need to concern themselves with the specific configuration details of each device; instead, they are driven by intuitive natural language requirements, allowing the system to automatically complete complex configuration tasks. This approach not only significantly reduces the operational difficulty and professional threshold but also effectively reduces the risks associated with human configuration errors. Furthermore, the system can adaptively optimize based on historical configuration data and network operating status, ensuring optimal network performance in dynamic environments. Summary of the Invention
[0007] In view of this, the purpose of the present invention is to provide a TSN configuration method based on natural language processing technology.
[0008] To achieve the above objectives, the present invention provides the following technical solution: A TSN configuration method based on natural language processing technology includes the following steps: S1. The user inputs the Time Sensitive Network (TSN) natural language configuration command through the user plane APP, and the APP forwards the command to the NLP module; The S2 and NLP modules parse instructions, generate structured configuration data, and send it to the centralized user configurator (CUC). S3 and CUC forward configuration information to the centralized network configurator (CNC) or send it directly to the TSN configuration system, depending on the complexity of the configuration information. In step S2, the NLP module performs feature extraction, temporal enhancement, sequence labeling, and generates structured configuration data in JSON format on the natural language configuration command text input by the user-facing APP. Specifically: S21. Use a bidirectional encoder from the converter to represent the BERT module for feature extraction: perform vector embedding and encoding on the configuration text to initially extract configuration information features; S22. Temporal enhancement using a Long Short-Term Memory (LSTM) module: Receive BERT output, capture time series features, enhance the contextual relevance of key parameters, and avoid loss of word order information; S23. Optimize sequence labeling using the Conditional Random Field (CRF) module: Combine BERT+LSTM features to perform sequence labeling on TSN configuration instructions so that the configuration parameters conform to the actual grammar rules, and perform global decoding on the sentence label sequence to generate CRF label sequences; S24. Use the JSON formatting module to generate structured data: parse the CRF tag sequence, extract entities, and generate JSON-formatted structured configuration information; If the configuration information in S3 is used to configure only a single switch, the CUC will forward the configuration information to the CNC, which will then parse the structured configuration information and configure the TSN switch. If the configuration information is used to configure multiple switches in a complex manner, the configuration information will be sent to the TSN configuration system, which will then parse the structured configuration information and configure the TSN switch.
[0009] Furthermore, the BERT module in S21 includes an embedding layer and an encoding layer; The embedding layer consists of word embedding, segment embedding and position embedding, and is used to receive the preprocessed text sequence and map each token in the sequence into an embedding vector containing semantic, segment and position information. The encoding layer consists of multiple stacked Transformer encoders. Each Transformer encoder includes a multi-head self-attention mechanism, a feedforward neural network, residual connections, and layer normalization, which are used for deep feature extraction and semantic modeling of the embedded vectors. Among them, the multi-head self-attention mechanism captures global dependencies through parallel computation in multiple subspaces, the feedforward neural network realizes nonlinear feature mapping, and residual connections and layer normalization are used to stabilize gradient propagation and promote information flow.
[0010] Furthermore, S21 also includes the following steps: The preprocessed text sequence is input into the embedding layer, and an embedding vector matrix is generated by the fusion calculation of word embedding, segment embedding and position embedding. The embedding vector matrix is input into the encoding layer, and after passing through a multi-layer Transformer encoder, it undergoes multi-head self-attention feature interaction, feedforward neural network nonlinear transformation and residual connection and layer normalization processing in sequence, and outputs a text feature vector containing deep semantic information.
[0011] Furthermore, the LSTM module in S22 includes a forget gate, an input gate, an output gate, and a cell state unit; The forget gate is used to selectively filter out useless historical information, the input gate is used to obtain information to be updated and generate candidate vectors, and the output gate is used to control the output of cell state. The cell state unit achieves long-term information storage and updating through the collaborative operation of the forget gate and the input gate. The current hidden state is generated by the dot product calculation of the output gate and the hyperbolic tangent activation function to capture long-distance dependencies in natural language configuration instructions.
[0012] Furthermore, S22 also includes the following steps: Receive the feature matrix output by the BERT encoder. The matrix has the following shape: n is the number of words to be segmented according to the configuration instruction, and is the BERT feature dimension. The filter weights of historical cell states are calculated through a forget gate, and a candidate update vector is generated through an input gate. The current cell state is updated by combining the two. The hidden state is generated by multiplying the output gate with the current cell state, and the forward and backward hidden states are concatenated by a bidirectional LSTM structure to output a feature sequence containing bidirectional temporal dependencies.
[0013] Furthermore, S22 also includes the following steps: The bidirectional LSTM structure includes a forward LSTM and a backward LSTM. The forward LSTM processes backward from the starting word of the configuration instruction to capture the left-side context information, while the backward LSTM processes forward from the ending word of the instruction to capture the right-side context information. The hidden states of both at each word position are concatenated to form an output feature vector with a dimension of 2 (the number of hidden units in the unidirectional LSTM), which is used for the sequence labeling task of the downstream CRF module.
[0014] Furthermore, step S23, which uses a Conditional Random Field (CRF) module to optimize sequence labeling, also includes the following steps: Constructing emission scores: The hidden state vector output by the LSTM module is mapped to the score vector of each word pair for each label through a fully connected layer, which includes a weight matrix and a bias vector; Construct the transition matrix T: Define the transition score between labels. The matrix T is of dimension (k is the number of label categories) and represents the score for transitioning from label i to label j. Minimize the negative log-likelihood loss function: Using the true label sequence as supervision, the model parameters are trained by minimizing the negative log-likelihood of the conditional probability, so that the model maximizes the likelihood of the correct label sequence.
[0015] Furthermore, S3 also includes the following steps: The CUC receives the JSON configuration data output by the NLP module and returns the preliminary configuration processing result to the user plane APP. Specifically, the CUC sends the JSON data to the CNC, which processes it and then transmits it to the TSN configuration system or directly to the TSN switch; or the CUC sends the JSON configuration data directly to the TSN configuration system, which then uniformly schedules and distributes it to the switch. The CNC converts the structured configuration information transmitted by the CUC into specific configuration instructions that can be executed by the TSN switch. The management instruction distribution process is as follows: the CNC converts the JSON configuration data into XML configuration instructions of the NETCONF protocol and sends them directly to the TSN switch through the NETCONF client; or the JSON configuration data is sent to the TSN configuration system, which manages the distribution process in a unified manner.
[0016] Furthermore, S3 also includes the following steps: The TSN configuration system receives the JSON configuration instructions transmitted by the CUC or CNC, converts them into XML configuration instructions in the NETCONF protocol, and then sends them to the TSN switch.
[0017] Furthermore, the user-facing APP includes the following modules: The text input module supports users to input long text commands; The configuration prompt module prompts the user to enter compliant natural language configuration information; The configuration distribution module distributes the natural language configuration information input by the user to the control plane; The configuration feedback module receives the configuration execution status from the TSN switch and provides real-time feedback. The beneficial effects of this invention are: Improving configuration efficiency and reducing human intervention and error rates: Traditional TSN configuration relies on manual operation or static strategies, which is inefficient and prone to errors. This solution uses an NLP module (BERT+LSTM+CRF) to automatically parse natural language commands. Users can directly input natural language configuration requirements, and the system automatically completes feature extraction, temporal enhancement, sequence labeling, and structured data generation, eliminating the need for manual coding or protocol command writing. The NLP module uses BERT to capture contextual semantics, LSTM to enhance temporal dependencies, and CRF to optimize the logical consistency of label sequences, ultimately generating directly executable JSON configuration data. This simplifies the configuration process from "manual coding" to "natural language input - automatic parsing - execution," significantly improving efficiency and reducing the impact of human error.
[0018] Enhancing the accuracy and robustness of configuration instruction parsing: The NLP module employs a three-level processing architecture of "BERT + bidirectional LSTM + CRF" to accurately extract key entities and parameters from configuration instructions. BERT generates context-aware word vectors through a bidirectional Transformer encoder; the bidirectional LSTM captures forward / backward temporal dependencies, outputting high-dimensional feature vectors to enhance long-distance dependency capture capabilities; and CRF reduces independent prediction errors by globally optimizing the label sequence. The synergy of these three components enables the system to accurately identify entities and parameters in complex instructions, ensuring the completeness and logical consistency of configuration parameter extraction, with parsing accuracy significantly superior to single-model approaches.
[0019] Optimizing system architecture flexibility and scalability to adapt to complex network environments: The solution adopts a layered design of user plane, control plane, and data plane. In the control plane, the CUC and CNC support multi-path command transmission: the CUC can directly send JSON data to the TSN configuration system or relay it through the CNC; the CNC can directly generate NETCONF protocol commands to issue to the switch or hand them over to the TSN configuration system for scheduling. The TSN configuration system, as an optional intermediate layer, supports priority scheduling, enhancing resource coordination capabilities in complex networks. This "multi-path optional + intermediate layer scheduling" architecture can meet the direct configuration needs of simple scenarios while adapting to the centralized management of large-scale networks, improving the system's adaptability and scalability in different scenarios.
[0020] To standardize the configuration process and provide real-time feedback, enhancing the user experience: The CNC converts JSON data into XML commands using the NETCONF protocol, ensuring that configuration commands conform to industry standards and are compatible with mainstream TSN devices. The CNC returns processing results (such as command reception status or parameter error messages) to the user-facing app in real time, allowing users to keep track of the configuration status. This combination of standardized protocols and real-time feedback mechanisms reduces cross-device compatibility issues while increasing user control over the configuration process and optimizing the overall user experience.
[0021] In summary, this solution leverages NLP technology to automate configuration, enhances parsing accuracy through multi-model collaboration, and strengthens flexibility through a layered architecture. It effectively addresses the issues of low efficiency, reliance on manual intervention, and poor adaptability in traditional TSN configuration, providing an efficient and intelligent solution for TSN configuration management in dynamic network environments.
[0022] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description
[0023] To make the objectives, technical solutions, and advantages of the present invention clearer, the preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, wherein: Figure 1 This is a diagram of the TSN configuration architecture based on natural language processing technology. Figure 2 Here is a flowchart of the TSN configuration method based on natural language processing technology; Figure 3 This is a structural diagram of a BERT module according to an embodiment of the present invention; Figure 4 This is a BERT embedding layer structure according to an embodiment of the present invention; Figure 5 This is a diagram of an LSTM structure according to an embodiment of the present invention. Detailed Implementation
[0024] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0025] The accompanying drawings are for illustrative purposes only and are schematic diagrams, not actual pictures. They should not be construed as limiting the invention. To better illustrate the embodiments of the invention, some parts in the drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions. It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.
[0026] In the accompanying drawings of the embodiments of the present invention, the same or similar reference numerals correspond to the same or similar components. In the description of the present invention, it should be understood that if terms such as "upper," "lower," "left," "right," "front," and "rear" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, the terms used to describe positional relationships in the drawings are only for illustrative purposes and should not be construed as limiting the present invention. For those skilled in the art, the specific meaning of the above terms can be understood according to the specific circumstances.
[0027] With the widespread application of Time-Sensitive Networking (TSN) technology, the complexity and real-time requirements of its configuration management are increasing. Traditional TSN configuration methods rely on manual operation or static strategies, which are difficult to meet the needs of efficient and accurate configuration in dynamic network environments. To address this issue, this solution proposes a TSN configuration method based on Natural Language Processing (NLP) technology. It combines three models—Bidirectional Encoder Representations from Transformers (BERT), Long Short-Term Memory (LSTM), and Conditional Random Field (CRF)—to achieve intelligent transformation from user natural language input to automatic TSN device configuration. To ensure hierarchical management and efficient execution of the system, this solution designs a complete TSN configuration architecture. This architecture covers key aspects such as user interaction, command parsing, configuration decision-making, and device execution. Through the collaborative work of the User Plane Application (APP), Centralized User Configurator (CUC), Centralized Network Configurator (CNC), TSN Configuration System, and TSN Switch, fully automated and intelligent TSN configuration management is achieved.
[0028] Please see Figure 1 This is a diagram of the TSN configuration architecture based on Natural Language Processing (NLP) technology. The architecture adopts a vertically layered design, comprising three levels: the user plane, the control plane, and the data plane. Centered on the control plane, the configuration architecture can be viewed as running north-south. The control plane interacts with the user plane and the data plane through the NLP module and the TSN configuration system, respectively. The functions of each layer of the TSN configuration architecture are as follows: The user plane includes software-defined networking applications (APPs), which can obtain business configuration requirements and implement corresponding network management functions. The user plane APP can obtain natural language configuration commands input by the user and send the configuration commands to the NLP module.
[0029] The control plane mainly consists of an NLP module, CUC, CNC, and TSN configuration system. The NLP module parses the user-input configuration requirements, extracts the configuration information, and generates a JSON file containing the configuration content. The NLP module sends the generated JSON file to the CUC. The CUC then sends the configuration information to the CNC. The configuration information conversion module integrated into the CNC converts the JSON file into configuration information conforming to the Netconf protocol. The CNC then sends this Netconf-compliant configuration information to the TSN configuration system. The TSN configuration system parses the received Netconf-compliant configuration information and configures the TSN switch according to the configuration information.
[0030] The data plane is the part of the network responsible for forwarding data packets. It is separate from the control plane and only needs to perform matching and actions based on instructions from the control plane. The data plane includes at least one TSN switch, which performs data forwarding based on configuration information issued by the control plane.
[0031] The TSN configuration method proposed in this solution, based on natural language processing technology, allows users to input network configuration requirements in simple natural language. The system can then automatically parse and generate executable configuration commands, thereby improving configuration efficiency and reducing the impact of human error.
[0032] against Figure 1 The TSN configuration architecture is as follows: The user inputs configuration requirements into the user-facing app. The NLP module parses the user's input, extracts the configuration information, and generates a JSON file containing the configuration content. The NLP module sends the generated JSON file to the CUC. The CUC then sends the configuration information to the CNC or directly to the TSN configuration system. The CNC sends the configuration information to the TSN configuration system, or it can directly issue configuration commands to configure the TSN switch. The TSN configuration system parses the received configuration information from the CNC or CUC and configures the TSN switch according to the configuration information.
[0033] Please see Figure 2 This is a flowchart of the TSN configuration method based on natural language processing technology. The TSN configuration method based on natural language processing technology includes the following steps: S1: The user-facing application receives TSN natural language configuration instructions. The user-facing application obtains the TSN natural language configuration instructions input by the user and sends them to the NLP module.
[0034] S2: NLP module parses configuration instructions. The NLP module performs multi-stage processing on the input text, successively completing feature extraction, temporal enhancement, sequence labeling, and structured data generation, ultimately generating structured data in JSON format. The NLP module then sends the configuration content in the generated JSON file format to CUC.
[0035] S3: Configuration Command Issuance and Execution. The CUC then sends the configuration information to the CNC or directly to the TSN configuration system. The CNC sends the configuration information to the TSN configuration system, or the CNC can directly issue configuration commands to configure the TSN switch. The TSN configuration system parses the received configuration information from the CNC or CUC and configures the TSN switch according to the configuration information content.
[0036] S1: User plane APP receives TSN natural language configuration command input. The user-facing app obtains the TSN configuration requirements input by the user and processes them using the following modules: 1. Text input module: Supports users to input long text commands.
[0037] 2. Configuration prompt module: prompts the user to enter compliant natural language configuration information.
[0038] 3. Configuration Distribution Module: Distributes the natural language configuration information input by the user to the control plane.
[0039] 4. Configuration Feedback Module: Used to receive the configuration execution status of the TSN switch and provide real-time feedback.
[0040] S2: NLP module parsing configuration instructions The NLP module performs multi-stage processing on the input text, sequentially completing feature extraction, temporal enhancement, sequence labeling, and generation of structured data in JSON format. The NLP module then sends the configuration content of the generated JSON file to CUC.
[0041] The NLP module consists of four parts: a BERT module, an LSTM module, a CRF module, and a JSON formatting module. The BERT module is a powerful pre-trained model employing a multi-layer Transformer encoder. It learns information from both sides of each word, combining contextual information to model the text and more comprehensively reflect sentence semantics, thus providing deep bidirectional language representation of input configuration information. Downstream of the BERT module is an LSTM module. LSTM is a special type of Recurrent Neural Network (RNN) that excels at handling long text sequences and effectively preserves long-distance dependencies, avoiding the vanishing gradient problem. This approach uses the LSTM module to capture the time-series features of TSN configuration instructions, improving the contextual relevance of key parameters. Downstream of the LSTM module is a CRF module. CRF is a probabilistic graphical model for sequence labeling, ensuring the rationality of the output label sequence through a global optimization mechanism. The CRF module combines the features provided by BERT and LSTM to perform sequence labeling of TSN configuration instructions, ensuring that the identified configuration parameters conform to actual grammatical rules. The JSON formatting module parses the CRF label sequence, extracts entities, and generates structured data in JSON format.
[0042] The steps for feature extraction, temporal enhancement, sequence labeling, and generation of structured data in JSON format for user configuration commands in this solution are as follows: 1. The NLP module uses the BERT module to perform vector embedding and encoding on the processed configuration information text in order to initially extract configuration information features.
[0043] 2. The BERT module inputs the encoded output feature vector into the LSTM module. The LSTM module captures the time-series features of TSN configuration commands, improving the contextual relevance of key parameters. This avoids the word order information that may be lost when using BERT alone, enabling the model to more accurately parse the keywords in TSN configuration commands.
[0044] 3. The CRF module is responsible for optimizing the final label sequence, ensuring that the parsing results of the configuration parameters are more reasonable and accurate. Combining features provided by BERT+LSTM, the CRF module performs sequence labeling on the TSN configuration instructions, ensuring that the identified configuration parameters conform to the actual grammar rules. It also performs global decoding of the entire sentence's label sequence, reducing errors that may occur during independent prediction and improving the extraction accuracy of key TSN configuration items.
[0045] 4. The JSON formatting module parses the CRF tag sequence, extracts entities, and generates structured data in JSON format.
[0046] The specific plans for each of the above steps are as follows: 1. Preliminary Feature Extraction with BERT: Please refer to [link / reference]. Figure 3 This is a structural diagram of a BERT module according to an embodiment of the present invention. This solution uses the BERT module to encode configuration information text.
[0047] The BERT module consists of an embedding layer and an encoding layer. The preprocessed configuration information text first enters the embedding layer to generate the corresponding embedding vector. Subsequently, the encoding layer of the BERT module uses multiple Transformer encoders to perform parallel computation, extracting the feature information of the embedding vector, and finally obtaining the output feature vector.
[0048] (1) Embedding layer Please see Figure 4 This is an embodiment of the BERT embedding layer structure of the present invention. The embedding layer of the BERT module, as a core component of the NLP module, is used to transform user-input natural language configuration instructions into vector representations suitable for subsequent processing. The embedding layer receives the text sequence preprocessed by the user-facing app, and captures the semantic, syntactic, and contextual information in the instructions by mapping each token (word or sub-word) to a high-dimensional vector, providing rich input features for subsequent feature extraction, temporal enhancement, and BIO sequence annotation.
[0049] BERT's embedding layer consists of three core parts: word embedding, segment embedding, and positional embedding. Word embedding maps each word in the input text to a fixed-dimensional vector representing its semantic information. Segment embedding distinguishes different sentences or paragraphs in the input sequence, suitable for handling multi-sentence input tasks. Positional embedding provides each word with its position within the sequence, addressing the Transformer's lack of sequence order awareness.
[0050] Input configuration information text into the BERT module The calculation formula is as follows: (1) (2) (3) (4) (5) (6) in, This indicates the composition of the configuration information text. A word or character. This indicates that a row vector is converted into a column vector. This indicates embedding a single word from the input sequence. This indicates embedding of the segment to which the word belongs. This indicates that the position of the word is embedded. Represents word embedding vectors, Represents a segmented embedding vector. Represents the position embedding vector. It is the first in the input sequence The final embedding vector of each word, The output of the embedding layer is a shape of The matrix has different embedding vector dimensions for different BERT modules, and is present in the BERT base. It has 768 dimensions.
[0051] (2) Coding layer The configuration information text is processed by the BERT embedding layer to obtain the embedding layer output, which is then input into the encoding layer for preliminary text feature extraction. The encoding layer of the BERT model is responsible for deep feature extraction and semantic modeling of the input embedding vector. This layer consists of multiple stacked Transformer encoders, each of which includes a multi-head self-attention mechanism, a feedforward neural network, residual connections, and layer normalization, working together to achieve contextual understanding and deep representation learning of the input text.
[0052] Among them, the multi-head self-attention mechanism calculates the correlation between words in the input sequence in different semantic spaces through different attention heads to capture global dependencies and improve information interaction capabilities. The feedforward neural network is responsible for performing non-linear mapping on the features calculated by attention to enhance the model's expressive power. Layer normalization is used to stabilize gradient propagation, improve training convergence speed, and, combined with residual connections, alleviate the gradient vanishing problem and promote information flow in deep networks.
[0053] Through layer-by-layer computation using multi-layer Transformer encoders, the BERT model can fully utilize contextual information to learn high-dimensional semantic representations, providing high-quality text feature vectors for downstream tasks.
[0054] 1) Multi-head self-attention mechanism Self-attention mechanisms allow the model to focus on other word vectors in the input sequence while processing each word vector, thereby capturing global contextual relationships. The multi-head design enables the model to learn multiple semantic features in different representation subspaces.
[0055] For the embedded layer output vector sequence The process generates a Q matrix (query matrix), a K matrix (key matrix), and a V matrix (value matrix) through three different linear transformations. The Q matrix represents the "query" request of the current element for other elements, the K matrix contains the "key" feature information of each element, and the V matrix carries the actual "value" information to be transmitted. The specific formulas are as follows: (7) (8) (9) in , , These are weight matrices; all three weight matrices have a dimension of 1. , Where h is the number of attention heads. Using the obtained Q, K, and V matrices, we can calculate the output of the self-attention mechanism as follows: (10) in It is an activation function that maps any real vector to a probability distribution. This is used to convert the similarity scores obtained from the dot product into normalized attention weights. These weights represent the relative importance of each element in the input sequence to the current query, ensuring that their weighted sum is 1. This facilitates subsequent weighted summation of the V matrix to form an output representation that incorporates global information. This represents the dot product of the Q matrix and the K matrix, which generates a score matrix. As a scaling factor, the dot product result is divided by [the scaling factor]. This is to mitigate the possibility that the product value may be too large when the dimension is high, leading to... This addresses the issue of overly steep gradients, thereby maintaining gradient stability and avoiding numerical instability.
[0056] Multi-head attention mechanisms parallelize the self-attention process into multiple subspaces, each of which computes the attention representation of one "head". Let the first... The output of the head is: (11) After concatenating the outputs of each head, a linear transformation is performed to obtain the final output: (12) in The projection matrix has the following shape: This multi-head mechanism enables the model to focus on different parts of the input simultaneously, capturing multi-faceted semantic information.
[0057] 2) Feedforward Neural Network Feedforward neural networks (FNNs) are an important component of the encoder and decoder layers in the Transformer model. They are responsible for performing nonlinear transformations on the input features, enhancing the model's expressive power. A feedforward neural network typically consists of two fully connected layers connected by a nonlinear activation function. The FNN calculation formula is as follows: (13) in , where is the weight matrix of the first fully connected layer. , is the bias vector of the first fully connected layer. , is the weight matrix of the second fully connected layer. , is the bias vector of the second fully connected layer. This refers to the dimensions of the intermediate layer. Typically... . The activation function introduces a nonlinear transformation into the model, enabling it to learn complex feature maps.
[0058] 3) Residual connectivity and layer normalization Residual connections aim to address the vanishing and exploding gradient problems in deep neural networks. The core idea is to add "skip connections" between network layers, directly passing input information to the output, allowing the network to learn the difference between the input and output. Layer normalization is a normalization technique used to mitigate internal covariate bias in deep neural networks. It normalizes the feature vector of each sample, making its mean 0 and variance 1. The specific calculation formula is as follows: (14) in This represents the result of the embedded layer output vector E being processed by a multi-head attention mechanism and a feedforward neural network. This represents the result of calculating the embedded layer output vector E after residual connection and layer normalization.
[0059] 2. LSTM for handling time-series dependencies The LSTM (Long Short-Term Memory) module is a key component in natural language processing systems. It receives the output of the BERT encoder, extracts temporal features from configuration instructions, and provides high-quality feature representations for the downstream CRF (Conditional Random Field) module. Through its unique gating mechanism, LSTM effectively captures long-range dependencies in natural language configuration instructions. For example, in the instruction "Configure gating lists for GigabitEthernet 1 / 3 interfaces, queues 2 and 5, time interval 20000 microseconds", LSTM can identify the associations between "GigabitEthernet 1 / 3" and "interface", and between "queues 2 and 5" and "gating lists".
[0060] The core architecture of LSTM is highly similar to that of recurrent neural networks (RNNs), aiming to solve the gradient vanishing and gradient exploding problems during long sequence training. LSTM introduces excellent logic units and gating units. This includes cell states as memory units and three gating units—input gate, forget gate, and output gate—to operate the input and output of the RNN. Cell states are responsible for storing and transmitting long-term information, and their updates are performed through the input and forget gates. The cell states in the LSTM network are crucial for information flow; they permeate the entire network, interacting with historical and input information at each node through lightweight linear operations, ensuring the transmission and capture of critical memory information within the network.
[0061] Each gated unit typically consists of a sigmoid activation function and an element-wise multiplication operation. Each gate has a sigmoid activation function to generate a value between 0 and 1 to control the flow of information, and a tanh activation function to generate possible update values. These gates control and adjust the information flow of the cell state through the sigmoid function and element-wise multiplication. Its most basic logical unit structure consists of three gated units: the input gate receives the output of the previous unit, allowing the network to selectively update the cell state; the output gate controls the information flow from the cell state to the hidden state, allowing the most recently captured information to enter the hidden layer and controlling its influence through weights to update the network state; and the forget gate selectively forgets historical information irrelevant to the current task at an appropriate update frequency. This mechanism enables LSTM networks to process long sequences of data more effectively and achieve significant performance improvements in tasks such as next position prediction.
[0062] Please see Figure 5 This is a diagram of an LSTM structure according to an embodiment of the present invention. Assuming t is the current time point of the sequence, each... , , These represent the forget gate, input gate, and output gate of the current node, respectively. Represents the time series of external inputs. The output representing the previous node or history is called the hidden state. This represents the Sigmoid activation function. , , These represent the weight matrices of the gated structure. , , Let represent the linear bias matrices of the gated structure. The relevant calculation formulas are as follows.
[0063] (15) (16) (17) The current node obtains the information to be updated through the input gate and creates a candidate vector. Then, based on the historical cell state and forget gate information, the node selectively discards useless information and updates the current cell state.
[0064] (18) (19) Finally, output gate Compared with the current state Dot product determines the output value : (20) (twenty one) (twenty two) and These are the hyperbolic tangent activation function and the sigmoid activation function, respectively. in It's a forgetting gate, which selectively filters out information that's useless during learning based on the previous output. It and... The input gate is configured to select which information to add to the cell. Used to update the state of cells. and These form the output gate, which determines the output information. This represents the Sigmoid activation function. , , and It is the weight of each door. , , and These are the biases. The input sequence obtained in the previous stage is passed to the LSTM network to predict the future positions of the nodes. LSTM alleviates the gradient problem, enabling the model to capture movement features in long and sparse spatiotemporal trajectories.
[0065] In this design, the input to the LSTM comes from the output of the BERT encoder. Specifically, the input to the LSTM is a feature matrix with the shape... Where n is the number of words or sub-words in the configuration instruction. For example, the instruction "Configure a gating list for the GigabitEthernet 1 / 3 interface" could be segmented into "for", "GigabitEthernet", "1 / 3", "interface", "configure", and "gating list", so n=6. This is the feature dimension output by BERT, typically 768 dimensions. The feature vector of each word incorporates its contextual semantics within the instruction. For example, the vector for "GigabitEthernet" not only reflects its own meaning but is also influenced by words like "for" and "1 / 3," reflecting its role as an interface name.
[0066] The output of the LSTM module is a sequence of hidden states with the shape of .in This refers to the number of hidden units in the LSTM, typically 256. Because a bidirectional LSTM is used, the output is formed by concatenating the forward and backward hidden states. For example, Then the output dimension for each word is 512. This design allows the model to capture the context information of each word simultaneously, improving the understanding of complex instruction relationships.
[0067] To fully capture the context dependencies in configuration instructions, the LSTM module adopts a bidirectional structure, including both forward and backward directions.
[0068] The forward LSTM starts with the first word of the instruction and processes each word backward, generating a forward hidden state. The forward LSTM captures the "past" information of each word. For example, in the instruction "Configure gating list for GigabitEthernet 1 / 3 interface", when processing "GigabitEthernet", the context of "for" is incorporated. When processing "1 / 3", the information from "for" and "GigabitEthernet" is further combined.
[0069] The backward LSTM starts from the last word of the instruction and processes each word backward, generating backward hidden states. The backward LSTM captures "future" information for each word. For example, when processing "gated list," it relies solely on its own information. When processing "configuration," it incorporates the context of the "gated list."
[0070] The forward and backward hidden states are concatenated at the position of each word to form the complete output. This bidirectional design enables the model to understand bidirectional dependencies in instructions; for example, "GigabitEthernet 1 / 3" is guided by both "for" and "interface".
[0071] 3. CRF sequence labeling The CRF (Continuous Randomization Rendering) module handles sequence labeling tasks. It receives the output from the LSTM (Laser Substrate Module) and generates a structured, globally optimal tag sequence, ensuring accurate parsing of configuration instructions, such as recognizing "GigabitEthernet 1 / 3" as the interface name or "queue 2 and 5" as queue parameters. The input to the CRF module is the output of the LSTM module, denoted as... The output of the CRF module is a sequence of tags. ,in It is the label corresponding to the word element i, such as ("ifaceName", "queueList", "timeInterval").
[0072] CRF modeling conditional probability ,in The probability is defined as follows: (twenty three) in This is a normalization factor to ensure that the sum of probabilities is 1. To score the launch, the label will be... The score assigned to the word t. For the transfer score, it means from the label Transferred to The score. CRF is trained by maximizing the likelihood of the correct label sequence, learning parameters. and The detailed design steps for a CRF are as follows: (1) Launch score Emission score measures the LSTM features of each word. With potential labels The degree of matching. We use a fully connected layer to... Mapped to the tag space. The calculation formula is as follows: (twenty four) in Let k be the weight matrix, and k be the number of label categories. This is the bias vector. Let t be the score vector for all possible labels of word t.
[0073] (2) Transfer score Transition scores capture the dependencies between consecutive labels, ensuring logical consistency in the label sequence. For example, "ifaceName" is followed by "operation," not another "ifaceName." The transition matrix T is a... The matrix, where Indicates from the label Move to label The score.
[0074] (3) Loss function CRF is trained by minimizing the negative log-likelihood: (25) in These are the true labeled sequences. This encourages the model to assign the highest probability to the correct sequences.
[0075] The word-level representation provided by LSTM has temporal and context-aware capabilities, enabling CRF to be labeled based on rich feature information while taking into account the dependencies between labels.
[0076] 4. JSON formatting module The JSON formatting module parses the tag sequence of the CRF, extracts key entities, and generates JSON data that conforms to the target format according to predefined mapping rules.
[0077] S3: Configuration command issuance and execution The CUC sends the configuration information to the CNC or directly to the TSN configuration system. The CNC sends the configuration information to the TSN configuration system, or the CNC can directly issue configuration commands to configure the TSN switch. The TSN configuration system parses the received configuration information from the CNC or CUC and configures the TSN switch according to the configuration information.
[0078] In this solution, the CUC acts as a bridge between the user and the TSN configuration system, responsible for receiving JSON configuration data output from the NLP module. The CUC supports two command transmission paths: First, the CUC sends the JSON data to the CNC, which further processes it before transmitting it to the TSN configuration system or directly to the switch. Second, the CUC sends the JSON configuration data directly to the TSN configuration system, which then centrally schedules and distributes it to the switch. The CUC can also return preliminary configuration processing results to the user-plane APP, such as confirming command reception or indicating input errors.
[0079] The CNC is responsible for converting the structured configuration information transmitted by the CUC into specific configuration commands that the TSN switch can execute, and managing the command delivery process. In this solution, the CNC supports two command delivery paths. First, the CNC converts the JSON configuration data into XML configuration commands using the NETCONF protocol and sends the XML commands directly to the TSN switch via a NETCONF client. Second, the CNC sends the JSON configuration data to the TSN configuration system, which then manages the delivery process.
[0080] The TSN configuration system is a collaborative platform between the CUC and CNC, responsible for managing and coordinating the transmission and execution of configuration commands. As an optional middleware layer, it enhances the system's scheduling capabilities and scalability in complex network environments. The TSN configuration system receives JSON configuration commands from the CUC or CNC, converts them into NETCONF protocol XML configuration commands, and then distributes them to the TSN switch. The TSN configuration system can also select the configuration order based on scheduling commands, for example, prioritizing high-priority configuration tasks.
[0081] Example Analysis The configuration command entered by the user in the user-facing APP is: "Configure a gating list for port 3 of the switch with IP address 192.168.0.8, queues 1 and 3, with a time interval of 15000 microseconds for queue 1 and a time interval of 25000 microseconds for queue 3." 2. The user-facing app sends user configuration commands to the NLP module. This solution's NLP module includes three main models: BERT, LSTM, and CRF. Combined with a JSON formatting module, it can convert user-input natural language configuration information into JSON configuration information conforming to a specified format. The specific steps of the NLP module parsing user-input natural language configuration commands are as follows: (1) BERT module processing The BERT module receives natural language configuration instructions from the user and performs word segmentation, generating context-aware feature vectors for each word. BERT uses a pre-trained Transformer encoder and a bidirectional attention mechanism to capture semantic relationships between words in the instructions, such as the association between "IP address" and "192.168.0.8", or the correspondence between "queue 1" and "time interval 15000 microseconds". The word segmentation result from the BERT module is: ["for", "ip", "address", "for", "192.168.0.8", "of", "switch", "port", "3", "configuration", "gated list", ",", "queue", "1", "and", "3", ",", "queue", "1", "time interval", "15000", "microseconds", ",", "queue", "3", "time interval", "25000", "microseconds"]. The final output of the BERT module is a feature matrix of shape (28, 768), where each of the 28 tokens corresponds to a 768-dimensional context feature vector. For example, the vector for "192.168.0.8" incorporates its semantic information as a device IP address, and the correlation between "Queue 1" and subsequent time parameters is enhanced.
[0082] (2) LSTM module processing The bidirectional LSTM module receives the feature matrix generated by BERT and captures the forward and backward temporal dependencies in the sequence, further enhancing the feature representation. The bidirectional LSTM processes the sequence through forward and backward LSTM units (256 hidden units in each direction) to generate a 512-dimensional feature vector, which is particularly suitable for capturing long-distance dependencies in TSN configuration instructions, such as the association between "queue 1" and "time interval 15000 microseconds".
[0083] (3) CRF module processing The CRF module receives the hidden state of the bidirectional LSTM, predicts the globally optimal label sequence, and ensures logical consistency between labels. The label sequence output by the CRF module is ["O", "O", "O", "O", "B-device_ip", "O", "O","B-ifaceName", "I-ifaceName", "O", "O", "O", "B-queueList", "I-queueList", "O", "I-queueList", "O", "B-queueList", "I-queueList", "B-timeInterval", "I-timeInterval", "I-timeInterval", "O", "B-queueList", "I-queueList", "B-timeInterval", "I-timeInterval", "I-timeInterval"].
[0084] (4) JSON formatting The JSON formatting module receives the tag sequence output by the CRF and identifies consecutive entities by traversing the tag sequence, for example, "B-ifaceName I-ifaceName" corresponds to "GigabitEthernet 1 / 3". Then, the JSON formatting module maps the extracted entities to JSON fields, for example, "GigabitEthernet 1 / 3" → "tsnGclLength.ifaceName". It converts text-based parameters (such as "1 and 3") into the required JSON format (such as "queueList: [1, 3]"). The final parsed JSON data is shown in Table 1. Table 1 Configuration Requirements File Contents
[0085] The NLP module sends the generated JSON-formatted configuration content to the CUC, which then forwards the configuration information to the CNC or directly to the TSN configuration system. The CNC can send the configuration information to the TSN configuration system, or it can directly issue configuration commands based on the generated XML-formatted Netconf configuration information to configure the TSN switch. The generated configuration information is shown in Table 2.
[0086] Table 2 Generating Configuration Information
[0087] The TSN configuration system sends the generated XML-formatted Netconf configuration information to the TSN switch via the Netconf client. The Netconf server deployed on the TSN switch can verify and parse the configuration information and configure functions based on the parsed configuration results.
[0088] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A TSN configuration method based on natural language processing technology, characterized in that, Includes the following steps: S1. The user inputs the Time Sensitive Network (TSN) natural language configuration command through the user plane APP, and the APP forwards the command to the NLP module; The S2 and NLP modules parse instructions, generate structured configuration data, and send it to the centralized user configurator (CUC). S3 and CUC forward configuration information to the centralized network configurator (CNC) or send it directly to the TSN configuration system, depending on the complexity of the configuration information. In step S2, the NLP module performs feature extraction, temporal enhancement, sequence labeling, and generates structured configuration data in JSON format on the natural language configuration command text input by the user-facing APP. Specifically: S21. Use a bidirectional encoder from the converter to represent the BERT module for feature extraction: perform vector embedding and encoding on the configuration text to initially extract configuration information features; S22. Temporal enhancement using a Long Short-Term Memory (LSTM) module: Receive BERT output, capture time series features, enhance the contextual relevance of key parameters, and avoid loss of word order information; S23. Optimize sequence labeling using the Conditional Random Field (CRF) module: Combine BERT+LSTM features to perform sequence labeling on TSN configuration instructions so that the configuration parameters conform to the actual grammar rules, and perform global decoding on the sentence label sequence to generate CRF label sequences; S24. Use the JSON formatting module to generate structured data: parse the CRF tag sequence, extract entities, and generate JSON-formatted structured configuration information; If the configuration information in S3 is used to configure only a single switch, the CUC will forward the configuration information to the CNC, which will then parse the structured configuration information and configure the TSN switch. If the configuration information is used to configure multiple switches in a complex manner, the configuration information will be sent to the TSN configuration system, which will then parse the structured configuration information and configure the TSN switch.
2. The TSN configuration method based on natural language processing technology according to claim 1, characterized in that: The BERT module in S21 includes an embedding layer and a coding layer; The embedding layer consists of word embedding, segment embedding and position embedding, and is used to receive the preprocessed text sequence and map each token in the sequence into an embedding vector containing semantic, segment and position information. The encoding layer consists of multiple stacked Transformer encoders. Each Transformer encoder includes a multi-head self-attention mechanism, a feedforward neural network, residual connections, and layer normalization, which are used for deep feature extraction and semantic modeling of the embedded vectors. Among them, the multi-head self-attention mechanism captures global dependencies through parallel computation in multiple subspaces, the feedforward neural network realizes nonlinear feature mapping, and residual connections and layer normalization are used to stabilize gradient propagation and promote information flow.
3. The TSN configuration method based on natural language processing technology according to claim 2, characterized in that: S21 further includes the following steps: The preprocessed text sequence is input into the embedding layer, and an embedding vector matrix is generated by the fusion calculation of word embedding, segment embedding and position embedding. The embedding vector matrix is input into the encoding layer, and after passing through a multi-layer Transformer encoder, it undergoes multi-head self-attention feature interaction, feedforward neural network nonlinear transformation and residual connection and layer normalization processing in sequence, and outputs a text feature vector containing deep semantic information.
4. The TSN configuration method based on natural language processing technology according to claim 1, characterized in that: The LSTM module in S22 includes a forget gate, an input gate, an output gate, and a cell state unit; The forget gate is used to selectively filter out useless historical information, the input gate is used to obtain information to be updated and generate candidate vectors, and the output gate is used to control the output of cell state. The cell state unit achieves long-term information storage and updating through the collaborative operation of the forget gate and the input gate. The current hidden state is generated by the dot product calculation of the output gate and the hyperbolic tangent activation function to capture long-distance dependencies in natural language configuration instructions.
5. The TSN configuration method based on natural language processing technology according to claim 4, characterized in that: S22 further includes the following steps: Receive the feature matrix output by the BERT encoder, the shape of which is , n To configure the number of words to be segmented, For BERT feature dimensions; The filter weights of historical cell states are calculated through a forget gate, and a candidate update vector is generated through an input gate. The current cell state is updated by combining the two. The hidden state is generated by multiplying the output gate with the current cell state, and the forward and backward hidden states are concatenated by a bidirectional LSTM structure to output a feature sequence containing bidirectional temporal dependencies.
6. The TSN configuration method based on natural language processing technology according to claim 5, characterized in that: S22 further includes the following steps: The bidirectional LSTM structure includes a forward LSTM and a backward LSTM. The forward LSTM processes the configuration instruction from the starting word backward to capture the left-hand context information, while the backward LSTM processes the instruction from the ending word forward to capture the right-hand context information. The hidden states at each word position are concatenated to form a 2-dimensional structure. , The output feature vector represents the number of hidden units in a unidirectional LSTM, used for sequence labeling tasks in the downstream CRF module.
7. The TSN configuration method based on natural language processing technology according to claim 1, characterized in that: S23, which uses a Conditional Random Field (CRF) module for optimized sequence labeling, also includes the following steps: Constructing the emission score: The hidden state vector output by the LSTM module is mapped to the score vector of each word pair for each label through a fully connected layer. The fully connected layer contains a weight matrix. and bias vector ; Constructing the transition matrix T: Defining the transition scores between labels The matrix T is dimension, k For the number of tag categories, Indicates from the label i Transfer to label j The score; Minimize the negative log-likelihood loss function: Using the true label sequence as supervision, the model parameters are trained by minimizing the negative log-likelihood of the conditional probability, so that the model maximizes the likelihood of the correct label sequence.
8. The TSN configuration method based on natural language processing technology according to claim 1, characterized in that: S3 further includes the following steps: The CUC receives the JSON configuration data output by the NLP module and returns the preliminary configuration processing result to the user plane APP. Specifically, the CUC sends the JSON data to the CNC, which processes it and then transmits it to the TSN configuration system or directly to the TSN switch; or the CUC sends the JSON configuration data directly to the TSN configuration system, which then uniformly schedules and distributes it to the switch. The CNC converts the structured configuration information transmitted by the CUC into specific configuration instructions that can be executed by the TSN switch. The management instruction distribution process is as follows: the CNC converts the JSON configuration data into XML configuration instructions of the NETCONF protocol and sends them directly to the TSN switch through the NETCONF client; or the JSON configuration data is sent to the TSN configuration system, which manages the distribution process in a unified manner.
9. The TSN configuration method based on natural language processing technology according to claim 1, characterized in that: S3 further includes the following steps: The TSN configuration system receives the JSON configuration instructions transmitted by the CUC or CNC, converts them into XML configuration instructions in the NETCONF protocol, and then sends them to the TSN switch.
10. The TSN configuration method based on natural language processing technology according to claim 1, characterized in that: The user-facing APP includes the following modules: The text input module supports users to input long text commands; The configuration prompt module prompts the user to enter compliant natural language configuration information; The configuration distribution module distributes the natural language configuration information input by the user to the control plane; The configuration feedback module receives the configuration execution status of the TSN switch and provides real-time feedback.