A method and system for generating and executing control commands for smart terminals based on LLM.

By constructing an intelligent terminal control system based on a large language model of LLM, the problems of insufficient scene adaptability, response speed and control accuracy of industrial terminal control systems are solved. High-precision instruction generation and adaptive closed-loop optimization are achieved, thereby improving the control capability of industrial production environment.

CN123069112APending Publication Date: 2026-11-10HUANENG COAL TECH RES CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611242710.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-17
Publication Date
2026-11-10

AI Technical Summary

Technical Problem

Existing industrial terminal control systems are inadequate in terms of scenario adaptability, response speed, and control accuracy. They lack effective end-to-end monitoring and closed-loop optimization mechanisms, making it difficult to meet the needs of complex and ever-changing industrial production environments.

Method used

A large language model based on LLM is used to build an intelligent terminal control system. Through a complete technical chain of data acquisition, instruction generation, execution monitoring and feedback optimization, including data interpolation completion, Kalman filtering denoising, principal component analysis dimensionality reduction, and an integrated mapping model of long short-term memory network and multi-label recurrent neural network, reinforcement learning is combined to generate and optimize instructions.

Benefits of technology

It achieves high-precision feature extraction and instruction generation, improves the accuracy of control command generation and execution timeliness, has adaptive closed-loop optimization capability, and enhances the intelligence and automation level of industrial terminal control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123069112A_ABST
    Figure CN123069112A_ABST
Patent Text Reader

Abstract

This invention relates to a method and system for generating and executing control commands for intelligent terminals based on LLM (Limited Language Modeling), belonging to the field of intelligent terminal control technology. The method includes the following steps: acquiring raw multidimensional time-series data and performing interpolation to obtain a complete multidimensional time-series dataset; inputting the data into a Kalman filter algorithm and updating it through state recursion to obtain denoised feature data; using principal component analysis to reduce dimensionality and output a compact feature set that meets the cumulative variance contribution rate threshold; mapping the compact feature set to a label probability distribution and ensemble prediction results using an ensemble mapping model, obtaining control labels through maximum value decoding, and constructing a structured prompt word text sequence; inputting this sequence into a large language model to generate a candidate instruction set, obtaining semantic feature vectors and constructing a similarity matrix; using the maximum margin criterion optimization operator based on the similarity matrix to select the optimal instruction and send it to the terminal device for execution.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method and system for generating and executing control commands for smart terminals based on LLM, belonging to the field of smart terminal control technology. Background Technology

[0002] In recent years, deep learning technology and large-scale corpus datasets have jointly driven breakthroughs in the field of natural language processing. Among them, large language models, with their approach of large-scale pre-training combined with fine-tuning for downstream tasks, have demonstrated powerful capabilities in multiple areas such as text generation, language understanding, and task planning, becoming a core research direction in natural language processing. The technical advantages of large language models stem from their massive model scale, powerful contextual understanding capabilities, and broad scene adaptability. They not only perform excellently in general text tasks but also have potential for expansion in areas such as cross-language understanding, multimodal learning, and knowledge fusion, providing new pathways for technological upgrades in fields such as intelligent systems and industrial control.

[0003] In the field of industrial terminal control, traditional control modes mostly rely on manual operation or preset rule engines, which have inherent defects such as poor scenario adaptability, slow response, and low optimization iteration efficiency, making it difficult to cope with complex and ever-changing industrial production environments. Existing natural language-based control solutions generally suffer from insufficient command generation accuracy, weak industrial adaptability, and a lack of end-to-end monitoring and closed-loop optimization mechanisms, failing to meet the stringent requirements of industrial scenarios for control precision, response speed, and operational stability. Therefore, this invention proposes an LLM-based intelligent system terminal control command generation and execution monitoring method, constructing a complete technical chain from data acquisition, command generation, execution monitoring to feedback optimization, achieving intelligent, automated, and continuously closed-loop optimization of industrial terminal control.

[0004] Therefore, there is an urgent need for an intelligent terminal control command generation and execution method and system that can sequentially perform data acquisition and quality verification, data preprocessing and feature extraction, working condition label mapping and prompt text generation, large language model instruction generation, candidate instruction screening and optimization, terminal execution and real-time monitoring, and feedback data fusion and model optimization. Summary of the Invention

[0005] To address the problems existing in the prior art, this invention proposes a method and system for generating and executing control commands for smart terminals based on LLM.

[0006] The technical solution of the present invention is as follows: On the one hand, this invention proposes a method for generating and executing control commands for smart terminals based on LLM, comprising the following steps: Collect raw multidimensional time-series data from intelligent mining equipment terminals and perform interpolation to complete the data, resulting in a complete multidimensional time-series dataset; Temporal denoising processing is performed on the complete multidimensional time-series dataset to obtain denoised feature data; Principal component analysis is used to reduce the dimensionality of the denoised feature data, and a compact feature set that meets the preset cumulative variance contribution rate threshold is output. The compact feature set is input into a pre-trained multi-label working condition mapping model, which outputs the probability distribution of each preset control label. The control label corresponding to the current working condition is obtained through probability decoding. Combining equipment attributes and control constraints, a structured prompt word text sequence is generated based on the control label. The prompt word text sequence is input into a large language model to generate a candidate control instruction set. Semantic features are extracted from the candidate control instruction set to obtain the semantic feature vector of each instruction. Based on each semantic feature vector, the semantic similarity between instructions is calculated and an instruction similarity matrix is ​​constructed. Combining the historical execution effectiveness weights of each candidate instruction, an edge optimization screening strategy is adopted based on the similarity matrix to select the optimal control instruction and send it to the terminal device for execution.

[0007] Preferably, the temporal denoising process employs the Kalman filter algorithm, and the denoised state estimate is obtained through state recursion update calculation. Specific steps include: With a discrete processing step size, the values ​​of data of the determined category in the complete multidimensional time series dataset at the corresponding time are directly mapped and assigned to the actual observation input of the Kalman filter algorithm; The state is recursively updated using the preset state transition matrix, observation matrix, and Kalman gain matrix. The state update estimate under the current discrete processing step size is calculated and output as the denoised state estimate.

[0008] Preferably, the method includes the following steps for dimensionality reduction of the denoised feature data through principal component analysis: The denoised multi-dimensional time series dataset is zero-mean processed, and the data covariance matrix is ​​calculated by unbiased estimation of sample covariance. The eigenvalues ​​of the data covariance matrix are sorted in descending order, and the selection optimization operator is used to select the minimum number of principal components to retain that ensures the cumulative variance contribution rate of all eigenvalues ​​is not less than a preset threshold. Dimensionality reduction feature extraction is performed on the denoised feature data based on the minimum number of principal components retained, resulting in a compact feature set.

[0009] Preferably, the pre-trained multi-label working condition mapping model is composed of a long short-term memory network and a multi-label recurrent neural network, and the probabilistic decoding is maximum value decoding; the specific steps for controlling label acquisition and structured prompt word construction include: The output state vector of the hidden layer of the Long Short-Term Memory network is mapped to the label probability distribution by using the output layer activation function; The original prediction outputs of each subnetwork computation link in the multi-label recurrent neural network are weighted and summed with the corresponding residual terms to obtain the integrated prediction result; The tag probability distribution output by the integrated mapping is decoded by the maximum value to output the control tag corresponding to the current working condition.

[0010] Preferably, the method includes the following steps: extracting semantic features from the candidate control instruction set and constructing an instruction similarity matrix: The preset text representation model is invoked to transform each candidate instruction in plain text form output by the large language model into a high-dimensional semantic feature vector; The semantic feature vectors are reduced to a two-dimensional space using the t-SNE algorithm; In a two-dimensional space, a similarity matrix between candidate instructions is constructed by calculating the cosine similarity of the features after dimensionality reduction of any two candidate instructions.

[0011] Preferably, the edge optimization screening strategy is implemented using the maximum edge criterion optimization operator, and the specific steps for screening the optimal control command include: Extract the semantic similarity between each pair of candidate instructions from the similarity matrix; Obtain the historical validity weight corresponding to each candidate instruction; The maximum margin criterion is used to optimize the operator, calculate the product of each semantic similarity and the corresponding historical validity weight, and filter and output the optimal terminal control command from the candidate command set by maximizing the product.

[0012] Preferably, the method further includes a model feedback optimization step: The system collects the actual operating parameters executed by the terminal device in real time and calculates the real-time instruction execution error and the comprehensive execution status score. The real-time instruction execution error, the comprehensive execution status score, and the preset user satisfaction score are input into the reinforcement learning reward function to calculate and output the reinforcement learning reward value. Based on reinforcement learning reward values, the gradient ascent method is used to dynamically update and iterate the model parameters of long short-term memory networks and multi-label recurrent neural networks.

[0013] On the other hand, this invention proposes an LLM-based intelligent terminal control command generation and execution system, comprising the following modules: The data acquisition and completion module is used to acquire the original multi-dimensional time series data from the intelligent mining equipment terminal and perform interpolation to complete the data, thereby obtaining a complete multi-dimensional time series dataset. The temporal denoising module is used to perform temporal denoising processing on the complete multidimensional time-series dataset to obtain denoised feature data. The principal component dimensionality reduction module is used to perform dimensionality reduction processing on the denoised feature data through principal component analysis, and output a compact feature set that meets the preset cumulative variance contribution rate threshold. The working condition mapping and prompt word construction module is used to input a compact feature set into a pre-trained multi-label working condition mapping model, output the probability distribution of each preset control label, and obtain the control label corresponding to the current working condition through probability decoding; combined with equipment attributes and control constraints, a structured prompt word text sequence is generated based on the control label. The large-scale model instruction generation and execution module is used to input the prompt word text sequence into the large language model to generate a candidate control instruction set, extract semantic features from the candidate control instruction set to obtain the semantic feature vector of each instruction, calculate the semantic similarity between instructions based on each semantic feature vector and construct an instruction similarity matrix, combine the historical execution effectiveness weights of each candidate instruction, and use an edge optimization screening strategy based on the similarity matrix to select the optimal control instruction and send it to the terminal device for execution.

[0014] In another aspect, the present invention also proposes an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method as described in any embodiment of the present invention.

[0015] In another aspect, the present invention also proposes a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any embodiment of the present invention.

[0016] The present invention has the following beneficial effects: 1. This invention proposes a method and system for generating and executing control commands for intelligent terminals based on LLM. By performing packet loss quality control and interpolation completion on the original multidimensional time-series data, and calling the Kalman filter algorithm for state recursive update and noise reduction in the preprocessing process, combined with the principal component analysis algorithm to extract a compact feature set that meets the cumulative variance contribution rate threshold according to the eigenvalue arrangement, the random noise caused by sensor physical characteristics and external environmental interference is effectively eliminated. While completely preserving the core working condition information of the original acquired data, the compact dimensionality reduction of data features is achieved, providing high-precision feature input for subsequent steps.

[0017] 2. This invention proposes a method and system for generating and executing control commands for intelligent terminals based on LLM. By constructing an integrated mapping model composed of a long short-term memory network and a multi-label recurrent neural network, the hidden layer of the long short-term memory network is used to extract long-term temporal dependency features and perform probability distribution mapping. At the same time, the original prediction outputs and corresponding residual terms of the computation links of each independent sub-network in the multi-label recurrent neural network are weighted and summed. Through dual-network fusion mapping and maximum value decoding, the control labels corresponding to the current working condition can be accurately extracted. Then, the preset industrial control instruction template is seamlessly combined to automatically convert it into a structured prompt word text sequence, which significantly improves the accuracy of industrial semantic expression and working condition adaptability of the large language model input pre-text construction.

[0018] 3. This invention proposes a method and system for generating and executing control commands for intelligent terminals based on LLM. It generates candidate control commands based on structured prompt word text sequences using a large language model, extracts semantic feature vectors using a preset text representation model, and establishes a similarity matrix using dimensionality reduction calculation. The maximum margin criterion is used to optimize the product of semantic similarity and historical validity weights for maximization screening, outputting the optimal control command for terminal execution. Furthermore, it employs real-time parameter-driven reinforcement learning reward function calculation and gradient ascent method for online dynamic model parameter updates. This achieves full-link terminal control covering data acquisition, intelligent generation, scientific screening, and adaptive closed-loop self-healing correction, significantly improving the accuracy of control command generation, execution timeliness, and the system's continuous dynamic evolution capability in complex scenarios. Attached Figure Description

[0019] Figure 1 This is a flowchart of a smart terminal control command generation and execution method based on LLM proposed in this invention. Detailed Implementation

[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0021] It should be understood that the step numbers used in the text are for ease of description only and are not intended to limit the order in which the steps are performed.

[0022] It should be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0023] The terms “comprising” and “including” indicate the presence of the described feature, whole, step, operation, element and / or component, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or collections thereof.

[0024] The term “and / or” refers to any combination of one or more of the associated listed items, as well as all possible combinations, and includes these combinations.

[0025] Example 1: See Figure 1 This embodiment proposes a method for generating and executing control commands for smart terminals based on LLM, including the following steps: S100 collects real-time environmental data from the intelligent mine work site and sensor data from intelligent mining equipment to construct a raw multi-dimensional time-series dataset, expressed by the formula: ; In the formula, Indicates the time index. Represents the original multidimensional time series dataset. express The first type of data at any given time, express The second type of data at time, express The first moment Class data, Indicates the start time of data collection. Indicates the size of the preset time window for data collection; It should be noted that the sampling frequency is set differently depending on the sensor type; the sampling frequency of a high-frequency sensor is [missing information]. The sampling frequency of the low-frequency environmental sensor is .

[0026] While collecting environmental and sensor data in real time, data quality control is performed simultaneously, including: data accuracy control, transmission stability control, and data integrity control, among which: Data accuracy control requirements The measurement error of class data satisfies the following formula: ; In the formula, Represents a multidimensional time-series data type index. Indicates the first Multidimensional time series data Indicates the first Standard deviation of measurement error for multidimensional time series data Indicates the first Full-scale measurement of multidimensional time-series data; Transmission stability control requires a data transmission packet loss rate of no more than 0.1% and a transmission delay of less than 100ms; Data integrity is defined as the ratio of valid data volume to total sampling volume, and the calculated data integrity rate must be no less than 99.9%. For data gaps occurring during acquisition and transmission, linear interpolation is used to fill in the missing data, expressed by the formula: ; ; In the formula, Indicates the time when data is missing. express Imputation values ​​for missing data at any given time. Indicates the interpolation weight coefficients. This represents the valid data value of the time immediately preceding the missing time. This represents the valid data value of the next adjacent time after the missing time. After interpolating and completing the original multidimensional time series dataset, a complete multidimensional time series dataset is obtained.

[0027] S200. In order to eliminate random noise caused by sensor physical characteristics and external environmental interference, the Kalman filter algorithm is called in the preprocessing process to perform denoising state estimation on each type of data in the complete multidimensional time series dataset. In the current number At a discrete processing step size, the first element in the multidimensional time series dataset will be processed... The values ​​of the data at the corresponding time point, which are determined by the class, are directly mapped and assigned to the actual observed input of the Kalman filter algorithm. The denoised state estimate is then calculated through state recursion update, as expressed by the formula: ; In the formula, Indicates the discrete processing step size index. Indicates the first For the first discrete processing step size, the... State update estimate of class data, This represents the preset state transition matrix. Indicates the first For the first discrete processing step size, the... State update estimate of class data, Indicates the first Kalman gain matrix for each discrete processing step size Indicates the first Actual observed input values ​​under a discrete processing step size This represents a pre-defined observation matrix; Furthermore, after the Kalman filter-denoised multi-dimensional time series dataset is zero-mean processed, the data covariance matrix is ​​calculated through unbiased estimation of sample covariance; and the denoised multi-dimensional time series feature data is introduced into the principal component analysis process for dimensionality reduction feature extraction. In the dimensionality reduction feature extraction process, specific selection optimization operators are used to screen target principal components, ensuring that the cumulative variance contribution rate of the retained principal components is not less than [a certain percentage]. This can be expressed as a formula: ; In the formula, This indicates the number of principal components ultimately retained. Indicates the principal component index. This represents the total dimension of the denoised multi-dimensional time-series dataset. This represents taking the minimum value that makes the constraints within the curly braces true. Value operations, This represents the data covariance matrix sorted from largest to smallest. One eigenvalue; After dimensionality reduction, the output feature dimension The feature set is no greater than 12, and the final result is a compact feature set after dimensionality reduction. This feature set fully preserves the core operating condition information of the original collected data and will be used as input for the multi-label mapping process to generate prompt text adapted to the current operating condition.

[0028] S300. The compact feature set output after dimensionality reduction feature extraction is input into the integrated mapping process of Long Short-Term Memory (LSTM) and multi-label recurrent neural network based on feature pruning, for multi-label mapping and structured prompt word construction. Specifically: The probability distribution is mapped using a specific output layer activation function, expressed by the following formula: ; In the formula, express The final output result of the output layer at each time step. This represents the activation function. This represents the output layer weight matrix. express The output state vector of the hidden layer of the Long Short-Term Memory network at any given time. This represents the output layer bias vector; Meanwhile, the multi-label recurrent neural network ensemble mapping process contains a number of Sub-network computing links; in, The local displacement value is set to The fluctuation range, and the weight of each sub-network's calculated links. Furthermore, the sum of the weights of all sub-network computation links is strictly equal to one; To improve the generalization ability of the algorithm, the regularization coefficient of the residual connection is set to 0.0001. The final ensemble mapping output is obtained by weighted summation of the predicted outputs of each sub-network computation link and the corresponding residual terms, expressed by the formula: ; In the formula, This represents the final integrated mapping output. This represents the index of the subnetwork computation link. This represents the total number of computing links in the sub-networks participating in the integration. Indicates the first The fusion weight coefficients corresponding to the links in each sub-network are calculated. Indicates the first The original prediction output results of each sub-network computation link. Indicates the first Each sub-network computes the residual terms corresponding to the links; The label probability distribution output by the integrated mapping is decoded by the maximum value to obtain the control label corresponding to the current working condition. Combined with the preset industrial control instruction template, a structured prompt word text sequence is generated and input into the preset large language model to generate specific terminal control instructions.

[0029] S400. Input the structured prompt word text sequence into the preset large language model to generate multiple candidate control instructions, specifically: In this embodiment, GPT-3.5 Turbo and GPT-4 are selected as the base models, and domain-specific fine-tuning is performed for industrial control scenarios, wherein: Configure the core parameters for the two basic models: GPT-3.5 Turbo has 175 billion parameters, a context window length of 4096 tokens, and a generation inference latency of about 200ms for a single simple instruction, making it suitable for generating conventional single-device control instructions. GPT-4 has 1.8 trillion parameters, a context window length of 8192 tokens, and a generation and inference latency of approximately 500ms for complex multi-device collaborative instructions, making it suitable for complex control scenarios with multiple coupled parameters.

[0030] Construct basic model performance metrics including instruction generation accuracy, model perplexity, and domain fit. Then, perform domain adjustments for industrial control scenarios to ensure the basic model meets the performance metrics requirements. The accuracy of instruction generation is expressed by the formula: ; In the formula, Indicates the accuracy of instruction generation; Model perplexity, expressed by the formula: ; In the formula, Indicates the perplexity of the model. This represents the natural exponential function. This indicates the total number of lexical units contained in the structured cue word text sequence. Indicates the position index of a word in the structured cue word text sequence. This indicates the first structured cue word in the text sequence. The target word element at each position, This indicates the position from the first to the second position in the structured cue text sequence. All the preceding words in each position, The model represents the state before the given conditions. Given the preceding word, predict the output of the first word. The conditional probability of each target word; Domain fit, expressed by the formula: ; In the formula, Indicates domain suitability; It should be noted that this metric is calculated using the cosine similarity of Word2Vec word vectors; domain-specific vocabulary coverage refers to the proportion of professional terms in the industrial control field covered in the generated text; general vocabulary coverage refers to the proportion of general everyday words covered in the generated text.

[0031] After entering structured prompts, by setting them to... A fluctuating temperature coefficient is used to control the diversity of outputs, thus allowing the large language model to output a limited number of words. A fluctuating set of candidate instructions.

[0032] Furthermore, the candidate instruction set is subjected to similarity calculation and sorting to obtain the optimal control instruction suitable for the current working condition: The semantic feature vector of the candidate instruction set is obtained by using a preset text embedding model. In specific implementation, the candidate instructions in plain text form output by the large language model are transformed into high-dimensional semantic feature vectors by using preset text representation models such as Word2Vec or BERT. Subsequently, the semantic feature vectors of each candidate instruction are reduced to a two-dimensional space using the t-SNE algorithm, and a similarity matrix between candidate instructions is constructed in this two-dimensional space by calculating cosine similarity. Based on the similarity matrix, the maximum edge criterion optimization operator is used to filter and output the optimal terminal control command, which is expressed by the following formula: ; In the formula, This represents the optimal terminal control command obtained through the selection process. This represents the row index of the similarity matrix, corresponding to the first row. Candidate control instructions, This represents the column index of the similarity matrix, corresponding to the [number]th column. Candidate control instructions, In the similarity matrix OK The semantic similarity between two candidate instructions corresponding to a column. Indicates the first Historical validity weight of each candidate instruction; It should be noted that both the row index and the column index are numbered sequentially according to the generation order of the candidate instructions, and correspond one-to-one with each instruction in the candidate instruction set.

[0033] The optimal control command obtained after screening will be sent to the terminal device through the industrial communication protocol to drive the terminal device to execute the corresponding control action.

[0034] The S500 terminal device receives control commands and initiates their execution, while simultaneously performing real-time monitoring and comprehensive status evaluation of the entire execution process. The terminal device must meet unified technical parameter requirements. The instruction response time is no more than 500ms, which is the time interval from receiving the instruction to starting the execution action; The condition for achieving the final execution accuracy is expressed by the formula: ; In the formula, This indicates the final execution accuracy of the terminal device. This represents the final measured value of the actual parameters after the instruction has been executed and the system has entered a steady state. This indicates the target parameter value set by the control command; At the communication layer, the MQTT over TLS protocol is used to ensure transmission security and efficiency, with a transmission rate of no less than 1Mbps and a connection stability of no less than 99.9%. In terms of equipment compatibility, it supports the OPC UA standard and can connect to no fewer than 10 types of industrial equipment, covering common industrial terminals such as motors, valves, and various sensors. During instruction execution, the actual operating parameters of the executed object are collected in real time at a frequency of 10Hz, and the real-time instruction execution error is calculated, expressed by the formula: ; In the formula, express Real-time instruction execution error at any given moment. express The actual observed values ​​of the execution parameters of the object at any given time; The system sets two levels of error thresholds for status classification: the normal threshold is 5%, and the execution status is judged to be normal when the real-time error is not greater than the normal threshold; the alarm threshold is 10%, and a level 3 alarm is triggered when the real-time error is greater than the alarm threshold. The system's abnormal response delay is less than 500ms, ensuring that abnormal conditions can be handled in a timely manner.

[0035] Furthermore, based on error monitoring, a comprehensive execution status score is calculated using the fuzzy comprehensive evaluation method, expressed by the formula: ; In the formula, This indicates the overall execution status score. Indicates the index of evaluation indicators. Indicates the first The weighting coefficients of each evaluation indicator, Indicates the first The execution status score of each evaluation indicator; In this embodiment, when hour, The weighting coefficients of the error index. The score represents the execution status of the error metric. Indicates the error alarm threshold; when hour, The weighting coefficients of the stability index are used to quantify the degree of volatility in the execution data based on the 3σ criterion. The weighting coefficients representing timeliness indicators. The score represents the execution status of the timeliness indicator. Indicates the actual execution time of the instruction. This indicates the maximum allowed execution time.

[0036] Furthermore, reinforcement learning algorithms are used to iteratively optimize the instruction generation parameters of the large language model and the weights of the ensemble model. The reward function for the optimization process is expressed by the formula: ; In the formula, This represents the reward value for reinforcement learning. These represent the reward weights for error, execution status, and user satisfaction, respectively. Indicates user satisfaction rating; In this embodiment, the reinforcement learning reward value The range of values ​​is within the interval Internal error reward weight Execution status reward weight User satisfaction reward weight .

[0037] Based on the reinforcement learning reward value, the gradient ascent method is used to dynamically update the model parameters of the Long Short-Term Memory (LSTM) and multi-label recurrent neural network based on feature pruning, as expressed by the formula: ; ; In the formula, Indicates the index of the parameter update iteration count. Indicates the first The network parameter set updated iteratively. Indicates the first The network parameter set updated iteratively. This represents the gradient of the reward function with respect to the model parameters; The updated model parameters will be sent back to the instruction generation stage to replace the original parameters for the next round of instruction generation.

[0038] Example 2: This embodiment proposes an LLM-based intelligent terminal control command generation and execution system, which includes the following modules: The data acquisition and completion module is used to acquire the original multi-dimensional time series data from the intelligent mining equipment terminal and perform interpolation to complete the data, thereby obtaining a complete multi-dimensional time series dataset. The temporal denoising module is used to perform temporal denoising processing on the complete multidimensional time-series dataset to obtain denoised feature data. The principal component dimensionality reduction module is used to perform dimensionality reduction processing on the denoised feature data through principal component analysis, and output a compact feature set that meets the preset cumulative variance contribution rate threshold. The working condition mapping and prompt word construction module is used to input a compact feature set into a pre-trained multi-label working condition mapping model, output the probability distribution of each preset control label, and obtain the control label corresponding to the current working condition through probability decoding; combined with equipment attributes and control constraints, a structured prompt word text sequence is generated based on the control label. The large-scale model instruction generation and execution module is used to input the prompt word text sequence into the large language model to generate a candidate control instruction set, extract semantic features from the candidate control instruction set to obtain the semantic feature vector of each instruction, calculate the semantic similarity between instructions based on each semantic feature vector and construct an instruction similarity matrix, combine the historical execution effectiveness weights of each candidate instruction, and use an edge optimization screening strategy based on the similarity matrix to select the optimal control instruction and send it to the terminal device for execution.

[0039] Example 3: This embodiment proposes an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the method described in any embodiment of the present invention.

[0040] Example 4: This embodiment proposes a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the method described in any embodiment of the present invention.

[0041] In this application embodiment, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent the existence of A alone, A and B simultaneously, or B alone. A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of singular or plural items. For example, at least one of a, b, and c can represent: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, and c can be single or multiple.

[0042] Those skilled in the art will recognize that the units and algorithm steps described in the embodiments disclosed herein can be implemented using electronic hardware, computer software, or a combination of electronic hardware and software. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0043] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0044] In the several embodiments provided in this application, any function, if implemented as a software functional unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0045] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A method for generating and executing control commands for intelligent terminals based on LLM, characterized in that, Includes the following steps: Collect raw multidimensional time-series data from intelligent mining equipment terminals and perform interpolation to complete the data, resulting in a complete multidimensional time-series dataset; Temporal denoising processing is performed on the complete multidimensional time-series dataset to obtain denoised feature data; Principal component analysis is used to reduce the dimensionality of the denoised feature data, and a compact feature set that meets the preset cumulative variance contribution rate threshold is output. The compact feature set is input into the pre-trained multi-label working condition mapping model, and the probability distribution of each preset control label is output. The control label corresponding to the current working condition is obtained by probability decoding. By combining device attributes and control constraints, a structured sequence of prompt text is generated based on control tags; Input the prompt word text sequence into the large language model to generate a candidate control instruction set, and extract the semantic features of each instruction by extracting semantic features from the candidate control instruction set. The semantic similarity between instructions is calculated based on each semantic feature vector, and an instruction similarity matrix is ​​constructed. Combining the historical execution effectiveness weights of each candidate instruction, an edge optimization screening strategy is adopted based on the similarity matrix to find the optimal control instruction and send it to the terminal device for execution.

2. The method for generating and executing control commands for a smart terminal based on LLM according to claim 1, characterized in that, The temporal denoising process employs the Kalman filter algorithm, which calculates the denoised state estimate through state recursion update. Specific steps include: With a discrete processing step size, the values ​​of data of the determined category in the complete multidimensional time series dataset at the corresponding time are directly mapped and assigned to the actual observation input of the Kalman filter algorithm; The state is recursively updated using the preset state transition matrix, observation matrix, and Kalman gain matrix. The state update estimate under the current discrete processing step size is calculated and output as the denoised state estimate.

3. The method for generating and executing control commands for a smart terminal based on LLM according to claim 1, characterized in that, The method for dimensionality reduction of denoised feature data through principal component analysis includes the following steps: The denoised multi-dimensional time series dataset is zero-mean processed, and the data covariance matrix is ​​calculated by unbiased estimation of sample covariance. The eigenvalues ​​of the data covariance matrix are sorted in descending order, and the selection optimization operator is used to select the minimum number of principal components to retain such that the cumulative variance contribution rate of all eigenvalues ​​is not less than a preset threshold. Dimensionality reduction feature extraction is performed on the denoised feature data based on the minimum number of principal components retained, resulting in a compact feature set.

4. The method for generating and executing control commands for a smart terminal based on LLM according to claim 1, characterized in that, The pre-trained multi-label working condition mapping model is composed of a long short-term memory network and a multi-label recurrent neural network, and the probabilistic decoding is maximum value decoding; the specific steps for controlling label acquisition and structured prompt word construction include: The output state vector of the hidden layer of the Long Short-Term Memory network is mapped to the label probability distribution by using the output layer activation function; The original prediction outputs of each subnetwork computation link in the multi-label recurrent neural network are weighted and summed with the corresponding residual terms to obtain the integrated prediction result; The tag probability distribution output by the integrated mapping is decoded by the maximum value to output the control tag corresponding to the current working condition.

5. The method for generating and executing control commands for a smart terminal based on LLM according to claim 1, characterized in that, The method includes the following steps for extracting semantic features from candidate control instruction sets and constructing an instruction similarity matrix: The preset text representation model is invoked to transform each candidate instruction in plain text form output by the large language model into a high-dimensional semantic feature vector; The semantic feature vectors are reduced to a two-dimensional space using the t-SNE algorithm; In a two-dimensional space, a similarity matrix between candidate instructions is constructed by calculating the cosine similarity of the features after dimensionality reduction of any two candidate instructions.

6. The method for generating and executing control commands for a smart terminal based on LLM according to claim 1, characterized in that, The edge optimization screening strategy is implemented using the maximum edge criterion optimization operator. The specific steps for screening the optimal control command include: Extract the semantic similarity between each pair of candidate instructions from the similarity matrix; Obtain the historical validity weight corresponding to each candidate instruction; The maximum margin criterion is used to optimize the operator, calculate the product of each semantic similarity and the corresponding historical validity weight, and filter and output the optimal terminal control command from the candidate command set by maximizing the product.

7. The method for generating and executing control commands for an intelligent terminal based on LLM according to claim 1, characterized in that, The method also includes a model feedback optimization step: The system collects the actual operating parameters executed by the terminal device in real time and calculates the real-time instruction execution error and the comprehensive execution status score. The real-time instruction execution error, the comprehensive execution status score, and the preset user satisfaction score are input into the reinforcement learning reward function to calculate and output the reinforcement learning reward value. Based on reinforcement learning reward values, the gradient ascent method is used to dynamically update and iterate the model parameters of long short-term memory networks and multi-label recurrent neural networks.

8. A smart terminal control command generation and execution system based on LLM, characterized in that, Includes the following modules: The data acquisition and completion module is used to acquire the original multi-dimensional time series data from the intelligent mining equipment terminal and perform interpolation to complete the data, thereby obtaining a complete multi-dimensional time series dataset. The temporal denoising module is used to perform temporal denoising processing on the complete multidimensional time-series dataset to obtain denoised feature data. The principal component dimensionality reduction module is used to perform dimensionality reduction processing on the denoised feature data through principal component analysis, and output a compact feature set that meets the preset cumulative variance contribution rate threshold. The working condition mapping and prompt word construction module is used to input a compact feature set into a pre-trained multi-label working condition mapping model, output the probability distribution of each preset control label, and obtain the control label corresponding to the current working condition through probability decoding. By combining device attributes and control constraints, a structured sequence of prompt text is generated based on control tags; The large model instruction generation and execution module is used to input the prompt word text sequence into the large language model to generate a candidate control instruction set, and to extract the semantic features of each instruction by extracting the semantic features of the candidate control instruction set. The semantic similarity between instructions is calculated based on each semantic feature vector, and an instruction similarity matrix is ​​constructed. Combining the historical execution effectiveness weights of each candidate instruction, an edge optimization screening strategy is adopted based on the similarity matrix to find the optimal control instruction and send it to the terminal device for execution.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1 to 7.