Flexible production plan prediction system and method based on knowledge graph and language model
Through a flexible production planning prediction system based on knowledge graph and language model, multimodal data is integrated and system self-update is realized, the problems of data flow breakpoints, insufficient multimodal integration, untimely knowledge iteration and insufficient adaptability of large models in the existing flexible production decision-making system are solved, and efficient and accurate flexible production decisions and production efficiency improvements are achieved.
Patent Information
- Application Number
- CN202411490178.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-10-24
AI Technical Summary
The existing flexible production decision-making system faces problems such as data flow breakpoints, insufficient data multimodal integration, untimely iteration of knowledge, and insufficient adaptability and interpretability of large models in practical applications.
A flexible production planning prediction system based on knowledge graph and language model is adopted, and a flexible production large language model building module is established through feature network graphs, a flexible production planning model building module, a knowledge graph building module and a flexible production planning prediction module are integrated to realize the system's self-updation and decision-making optimization.
It significantly improves the immediacy and accuracy of flexible production decisions, improves production efficiency and cost-effectiveness, and enhances the dynamic adaptability and decision-making transparency of the system.
Smart Images

Figure CN119623911A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of flexible production decision technology, and in particular to a flexible production plan prediction system and method based on knowledge graph and language model. Background Art
[0002] First, as a key technology of intelligent manufacturing, flexible production faces the challenge of data flow breakpoints. At present, the intelligent manufacturing system is slow to respond due to the poor data flow between the external market and internal production, making it difficult to meet customers' immediate needs, and the immediate decision-making ability of flexible production is limited. For example, the Chinese patent application number CN118261741A, the application publication date is May 30, 2024, and the name of the invention is: A flexible production management system and method based on digital twins. The scheme constructs a flexible production management system including a target time period marking module, a processable process line set construction module, a use priority analysis module, a new raw material comparison module, an optimal waiting process line generation module and an AGV equipment operation module, but the invention does not perform flexible production management based on customer needs, resulting in a separation of flexible production decisions from actual needs.
[0003] Secondly, the data basis of existing flexible production decisions is relatively single and lacks multimodal data. Most of them are based on text and numerical data such as orders, production logs and sensor data, but in reality there are more complex influencing factors, such as multimodal data such as customer behavior and production line monitoring. For example, Chinese patent application number CN219861615U, the application publication date is May 24, 2023, and the name of the invention is: A flexible production system for aluminum electrolytic cells. This solution controls flexible production through power, temperature and flow monitoring modules, but the invention only considers sensor data, and the data is similarly single. Therefore, it is necessary to integrate multimodal data such as the Internet of Things, customer feedback and market dynamics, and improve the accuracy of flexible production decisions through richer data while improving production efficiency and reducing costs.
[0004] Thirdly, the iteration of existing flexible production decision-making knowledge lacks real-time updates. At present, the environment faced by flexible production technology has undergone tremendous changes, such as large changes in customer demand and rapid iterations in the product market. However, most of the existing flexible production technologies are based on fixed knowledge, lack iterative updates according to changes in the environment, and lack dynamic adaptability. Faced with a complex and changing market environment, existing flexible production decision-making systems often fail or fail, seriously affecting the decision-making effect. For example, Chinese patent application number CN116993126A, the application publication date is September 14, 2023, and the name of the invention is: A flexible production scheduling method and device based on a hybrid genetic algorithm. This scheme uses a hybrid genetic algorithm to perform flexible production scheduling, but the algorithm itself lacks a self-update mechanism and cannot dynamically adapt to changes in the market environment. Therefore, it is urgent to introduce advanced multimodal large models to enhance data processing performance and decision-making efficiency.
[0005] Finally, although the existing multimodal large models are widely used, there are bottlenecks in adaptability, update mechanism and interpretability in specific intelligent manufacturing scenarios. It is not flexible enough to respond to changes in complex production environments and cannot capture market dynamics in real time; the decision-making process is opaque, and it is difficult to provide decision makers with intuitive and reliable decision-making basis. For example, the Chinese patent application number CN117610896A, the application publication date is January 24, 2024, and the name of the invention is: Intelligent scheduling system based on industrial large models. This solution performs efficient and resource-saving scheduling and control analysis based on industrial large model data to achieve real-time and efficient scheduling and control that meets changes in industrial production needs. However, the large model used in this solution lacks professional domain knowledge, resulting in poor interpretability of the model output. Therefore, it is urgent to introduce advanced large model knowledge enhancement technology to improve professional field adaptability and interpretability. Summary of the invention
[0006] The purpose of the present invention is to address the defects of the prior art and provide a flexible production plan prediction system and method based on knowledge graph and language model.
[0007] The present invention provides a flexible production plan prediction system based on knowledge graph and language model, comprising:
[0008] A feature network diagram building module is used to aggregate the historical production data of the flexible factory to obtain feature network diagram data;
[0009] A flexible production large language model building module is used to train the natural language algorithm using feature network graph data to obtain a flexible production large language model;
[0010] A flexible production planning model building module is used to combine several modern heuristic algorithm layers as stacking modules to form a stacking framework, and train the stacking framework using feature network graph data to obtain a flexible production planning model;
[0011] A knowledge graph establishment module is used to input the image data in the feature network graph data into the flexible production large language model to convert it into text data, then merge the text data obtained by the image data conversion with the text data in the feature network graph data and classify them according to the data meaning to obtain customer demand text data and comprehensive flexible production plan text data, input the feature network graph data into the flexible production large language model to obtain demand-production relationship text data, perform event extraction on the customer demand text data and the comprehensive flexible production plan text data in the historical production data of the flexible factory to obtain customer demand events and comprehensive flexible production plan events, and link the customer demand events and the comprehensive flexible production plan events according to the demand-production relationship text data to obtain a knowledge graph;
[0012] The flexible production plan prediction module is used to input the flexible production large language model, flexible production plan model, knowledge graph and current customer demand into the language model development framework and make predictions based on current customer demand to obtain comprehensive flexible production plan prediction results.
[0013] Furthermore, in the characteristic network diagram establishment module, the specific method of aggregating the flexible factory historical production data to obtain the characteristic network diagram data is as follows:
[0014] Establish the feature matrix E representing historical data i , the formula is as follows:
[0015]
[0016] in, Represent the text data feature vector a, image data feature vector b and code data feature vector c respectively, establish a feature network graph consisting of nodes and edges between nodes, and convert the feature matrix E representing historical data i As the initial representation of each node, the weights between nodes are the edges of the feature network graph, and i represents the sequence number of the historical data and its corresponding node number;
[0017] Use the GCN aggregator to aggregate the information of node i and all its neighbor nodes j and update the representation of the node. The specific steps are: use the weight matrix W l The representations of node i and all its neighboring nodes j are linearly transformed and then normalized. The representations of all neighboring nodes j of node i after normalization are summed. Then, the representation of node i in the next layer in the GCN aggregator is processed by activation function to obtain the node representation of node i after aggregation by the GCN aggregator. The formula is expressed as:
[0018]
[0019] in, represents the representation of node i at the l+1th layer in the GCN aggregator, represents the representation of node i’s neighbor node j in the GCN aggregator at the lth layer, σ represents the activation function, W represents the weight matrix of the lth layer in the GCN aggregator, and N i represents the set of neighbor nodes j of node i, and d(i,j) represents the distance between node i and its neighbor node j;
[0020] The GAT aggregator uses the attention mechanism to aggregate the information of node i and all its neighboring nodes j, and updates the node representation. The specific steps are: use the additive attention mechanism to calculate the attention weight between node i and all its neighboring nodes j and weight the neighboring nodes j of node i, sum the representations of all weighted neighboring nodes j, and obtain the representation of node i in the next layer of the GAT aggregator for activation function processing to obtain the node representation of node i after aggregation by the GAT aggregator. The formula is expressed as:
[0021]
[0022] in, represents the attention weight between node i and its neighbor node j, represents the representation of node i’s neighbor node j at the lth layer in the GAT aggregator, represents the representation of node i at the l+1th layer in the GAT aggregator;
[0023] HAN aggregator and GNN aggregator are used to aggregate according to the homogeneous relationship and heterogeneous relationship between node i and its neighbor node j respectively. The specific steps are: in HAN aggregator, the content attention mechanism is used to calculate the attention weights between homogeneous nodes and aggregate them, and in GNN aggregator, the key-value attention mechanism is used to calculate the attention weights between heterogeneous nodes and aggregate them. The formula is expressed as:
[0024]
[0025] in, They represent the attention scores between node i and its neighbor node j in homogeneous relationship and the attention scores between node i and its neighbor node j in heterogeneous relationship, represents the representation of node i at layer l in the HAN aggregator, represents the representation of node i’s neighbor node j at the lth layer in the HAN aggregator, represents the representation of node i at layer l in the GNN aggregator, represents the representation of node i’s neighbor node j at the lth layer in the GNN aggregator, and They represent the weight matrix that converts the representation of node i into the query vector and the weight matrix that converts the representation of node i’s neighbor node j into the query vector, respectively. represents the weight matrix that converts the representation of node i’s neighbor node j into a key vector, represents the weight matrix that converts the representation of node i into a value vector, softmax represents the softmax function, represents the l+1th layer representation of node i obtained by aggregating homogeneous nodes in the HAN aggregator, represents the l+1th layer representation of node i obtained by aggregating heterogeneous nodes in the GNN aggregator, and T represents transpose;
[0026] Finally, an asynchronous update is performed. The specific steps are: use the update gate selection mechanism to select the best aggregation method according to the representation of node i, and then use the best aggregation method to update the representation of node i. The formula is expressed as:
[0027]
[0028] Among them, β represents the selection mechanism of the update gate, δ is a function parameterized by the multi-layer perceptron, and the function δ is used to select the best node representation as the final node representation among the node representations obtained by the GCN aggregator, GAT aggregator, HAN aggregator and GNN aggregator through the selection mechanism of the update gate. The final representation of node i is Determined by the update gate selection mechanism, Z i The representation function δ represents the selection result of the final representation of node i. The weight in the aggregator corresponding to the final representation of node i is the final representation of the edge. The final representation of node i and the final representation of the edge constitute the feature network graph data. According to the meaning of the final representation of node i, the feature network graph data is divided into customer demand data and comprehensive flexible production plan data.
[0029] Furthermore, in the flexible production large language model establishment module, the specific method of using the feature network graph data to train the natural language algorithm to obtain the flexible production large language model is as follows:
[0030] The flexible production large language model adopts the Transformer algorithm, in which the TTT layer is used to replace the self-attention mechanism in the Transformer algorithm. The TTT layer includes a multi-layer perceptron.
[0031] The forward propagation function of the flexible production large language model is written as follows: First, the input sequence of the current time step is combined with the hidden state of the previous time step by improving the encoder in the Transformer algorithm to obtain the context vector, and the context vector is input into the multi-layer perceptron of the TTT layer. For a multi-layer perceptron with l layers, the output z of the lth layer l and activate output a l It can be expressed as:
[0032]
[0033] a l-1 =φ l (z l )
[0034] in, is the weight matrix of the lth layer in the multilayer perceptron, b l is the bias vector of the lth layer in the multilayer perceptron, and the hidden state includes the weight matrix and the bias vector b l , a l-1 is the activation output of the l-1th layer. When the input layer l=1, a 0 is the activation output of the first layer, φ l is the activation function ReLU of the lth layer;
[0035] Then in the TTT layer, the gradient descent method is used to update the hidden state, which is the weight matrix and the bias vector. The back propagation algorithm is used to calculate the loss function. The gradient of the multilayer perceptron parameters is:
[0036]
[0037] in, To represent the loss function L with respect to the weight matrix W of the lth layer l The gradient of To represent the loss function L with respect to the bias vector b of the lth layer l The gradient of , L is the loss function;
[0038] Then use the gradient descent method to update the weight matrix and bias vector of the multilayer perceptron:
[0039]
[0040] in, Indicates that the weight matrix of the lth layer is updated using the gradient descent method. To indicate the use of gradient descent to update the bias vector of the lth layer, η is the learning rate;
[0041] The context vector output by the encoder and the updated hidden state in the multi-layer perceptron of the TTT layer are input into the softmax function of the decoder in the improved Transformer algorithm. The softmax function obtains the output result of the Transformer algorithm based on the context vector and the updated hidden state.
[0042] The feature network graph data is divided into a training set and a validation set, and the improved Transformer algorithm is trained. During training, the input sequence of the improved Transformer algorithm is the customer demand data in the feature network graph data, and the corresponding output is a comprehensive flexible production plan. During training, the customer demand data in the feature network graph data is converted into the input sequence of the improved Transformer algorithm: the final representations of all nodes are serialized, and node indexes are added to the sequence to identify specific nodes. The weight matrix representing the final representation of the edge is added to the sequence to obtain the input sequence during training. After the improved Transformer algorithm is trained, a flexible production large language model is obtained.
[0043] Furthermore, in the flexible production planning model building module, several modern heuristic algorithm layers are used as stacking modules to form a stacking framework, and the specific method of using the characteristic network graph data to train the stacking framework to obtain the flexible production planning model is as follows:
[0044] Firstly, a stacking framework is selected as the structure of the flexible production planning model, and the genetic algorithm layer, particle swarm optimization layer and simulated annealing layer are used as stacking modules of the stacking framework. Each stacking module adopts a linear stacking method: the output of one stacking module is used as the input of the next stacking module, and the target performance parameters of the flexible production planning model are determined;
[0045] Then, the customer demand data in the feature network graph data is serialized and input into the flexible production large language model for generative language expansion to obtain feature-enhanced customer demand data as the input of the flexible production planning model. The feature-enhanced customer demand data is in text mode. The genetic algorithm layer, the particle swarm optimization layer, and the simulated annealing layer are arranged and combined in sequence, and the stacking frames of different orders of the stacked modules obtained by the arrangement and combination are input with feature-enhanced input sequences for training. Finally, cross-validation is used according to the target performance parameters to evaluate the generalization ability of the model for the target performance, and the stacking frame with the largest generalization ability is selected as the trained flexible production planning model.
[0046] Furthermore, the knowledge graph establishment module inputs the image data in the feature network graph data into the flexible production large language model to convert it into text data, then merges the text data obtained by converting the image data with the text data in the feature network graph data and classifies them according to the meaning of the data to obtain customer demand text data and comprehensive flexible production plan text data, inputs the feature network graph data into the flexible production large language model to obtain demand-production relationship text data, extracts events from the customer demand text data and the comprehensive flexible production plan text data to obtain customer demand events and comprehensive flexible production plan events, and links customer demand events and comprehensive flexible production plan events according to the demand-production relationship text data to obtain the specific method of the knowledge graph as follows:
[0047] Extracting text data of customer demand and comprehensive flexible production plan and image data of customer demand and comprehensive flexible production plan from feature network graph data, inputting the image data of customer demand and comprehensive flexible production plan into flexible production big language model respectively, obtaining customer demand text data converted from image data and comprehensive flexible production plan text data converted from image data respectively, merging customer demand text data obtained from image conversion and customer demand text data extracted from feature network graph data to obtain customer demand text database, merging comprehensive production plan text data obtained from image conversion and comprehensive production plan text data extracted from feature network graph data to obtain comprehensive flexible production plan text database, inputting feature network data set into flexible production big language model to obtain demand-production relationship text data, establishing demand-production relationship text database according to demand-production relationship text data, wherein the demand-production relationship text data is text data representing the relationship between customer demand and comprehensive flexible production plan;
[0048] According to the relationship between customer demand and comprehensive flexible production plan in the demand-production relationship text database, event extraction is performed on customer demand text data and comprehensive flexible production plan text data to obtain customer demand events and comprehensive flexible production plan events, wherein the content of the event includes subject, type, time, location, attribute, and relationship, and customer demand event vectors and comprehensive flexible production plan event vectors are respectively established according to the content of the customer demand event and the content of the comprehensive flexible production plan event, and the customer demand event vector and the comprehensive flexible production plan event vector are linked to construct a knowledge graph;
[0049] The event is an action or state change with clear time and space attributes, the subject is an entity that participates in the event and has a causal relationship with the event, the relationship is the causal connection between events, and the attribute is a feature that describes the event;
[0050] In the knowledge graph, nodes are used to represent events with entity and attribute labels, including customer demand events and comprehensive flexible production plan events. The edges between nodes represent the relationships between events, which are directed edges. The relationships between events include direct relationships and indirect relationships.
[0051] Among them, the specific method of constructing the knowledge graph by linking the customer demand event vector and the comprehensive flexible production plan event vector is as follows:
[0052] The K-means clustering algorithm is used to identify and merge similar events. The specific method is as follows: In the K-means clustering algorithm, the silhouette coefficient is used to determine the K value, and the K-means++ algorithm is used to initialize the centroid. The following two steps are iterated until convergence: (1) each node is assigned to the nearest centroid to form K clusters; (2) the centroid of each cluster is recalculated;
[0053] Each node is assigned a cluster label, which indicates the cluster to which it belongs. Nodes with the same or similar cluster labels are merged to obtain the final vector of each node, and the nodes are connected according to the relationship between events to obtain a knowledge graph.
[0054] Furthermore, it also includes: a training adjustment and knowledge enhancement module, which is used to train and adjust the flexible production large language model using knowledge graph data; input a certain customer demand data in the feature network graph data into the trained and adjusted flexible production large language model to obtain a number of first flexible production plans, and input the obtained several first flexible production plans into the flexible production simulation model established by using the DQN algorithm for reward value evaluation, input the first flexible production plan with the highest reward value among the several first flexible production plans into the knowledge graph, and traverse all customer demand data in the feature network graph data according to the above process;
[0055] Furthermore, in the training adjustment and knowledge enhancement module, the specific method of using knowledge graph data to train and adjust the flexible production large language model is as follows:
[0056] Firstly, the feature network graph data and knowledge graph dataset are respectively input into different TTT layers of the flexible production large language model to obtain the weighted features of the feature network graph data and the weighted features of the knowledge graph data. Then, the weighted features of the feature network graph data and the weighted features of the knowledge graph data from different TTT layers are vectorized and concatenated to form a fused feature representation as training data to train the flexible production large language model.
[0057] Input a certain customer demand data in the feature network graph data into the trained and adjusted flexible production large language model to obtain several first flexible production plans, and input the obtained several first flexible production plans into the DQN algorithm for reward value evaluation, and input the first flexible production plan with the highest reward value among the several first flexible production plans into the knowledge graph. The specific method of traversing all customer demand data in the feature network graph data according to the above process is as follows:
[0058] A flexible production simulation model is established. The flexible production simulation model adopts the DQN algorithm to predict the actions in the flexible production plan according to the states in the comprehensive flexible production plan. The adjustment parameters and movements of the machines in the comprehensive flexible production plan are defined as actions, and the material variables and environmental variables in the comprehensive flexible production plan are defined as states. The input of the flexible production simulation model is the state, and the output is the action. The flexible production simulation model is expressed as follows:
[0059] Define a multidimensional vector S t Represents the state of the machine at time t, and the formula is: S t =[s t1 ,s t2 ,...,s tn ], where s tn Represents the nth feature in the state vector of the machine at time t, and defines a multidimensional vector A t Represents the probability distribution of the machine action at time t, the multidimensional vector A t Each dimension corresponds to an action, and the formula is expressed as: t =[a t1 ,a t2 ,...,a tm ], where a tm represents the probability of the mth action in the action vector of the machine at time t;
[0060] In the DQN algorithm, the q network converts the state S t Mapped to action probability distribution A t , the formula is: q(S t ,A t ; θ), where θ represents the parameter set of the DQN algorithm;
[0061] The reward obtained by the flexible production simulation model after completing the current action is defined as the immediate reward, and the total reward obtained by the flexible production simulation model after a series of actions is defined as the cumulative reward. The formula of the reward function is as follows:
[0062]
[0063] Among them, G T′ is the cumulative reward in period T′, R T′+k+1 is the immediate reward obtained in period T′+k+1, γ k is the immediate reward obtained by completing the current action within time step k;
[0064] The flexible production simulation model is trained. The specific training process is as follows: Initialize the current network Q(S t ,A t ; θ), define the target network Q′(St ,A t ; θ′), then the flexible production factory interacts with the knowledge graph to record the current state, action, reward and next state, represented as a tuple (S t ,A t ,γ k ,S t+1 ), the interaction process is as follows: The flexible production factory performs action A t After that, the state changes from S t Transfer to S t+1 , and get the current reward γ k , and stored in the experience replay buffer of the DQN algorithm, a batch of experience is randomly extracted from the experience replay buffer to train the Q network to update the parameters of the DQN algorithm. The training process includes the following steps: Use the target network to calculate the Q value Q(S) of the next state of the current network t+1 ,A t+1 ;θ), the formula is:
[0065]
[0066] The loss function L is calculated using the mean square error:
[0067] Use the gradient descent algorithm to minimize the loss function to update the parameters S of the DQN algorithm t , A t and θ, after updating, we get the trained flexible production simulation model;
[0068] Set the number of output results corresponding to the input of customer demand data into the flexible production large language model to n, input the customer demand data in the feature network graph data into the flexible production large language model to generate n comprehensive flexible production plans, then input the n flexible production plans into the flexible production simulation model to calculate their respective cumulative rewards, traverse the customer demand data in the feature network graph data, select the comprehensive flexible production plan with the highest cumulative reward value in turn for event extraction to obtain the comprehensive flexible production plan event, extract the customer demand data corresponding to the comprehensive flexible production plan with the highest cumulative reward value for event extraction to obtain the customer demand event, and finally input the comprehensive flexible production plan event and the customer demand event into the knowledge graph;
[0069] At the same time, the comprehensive flexible production plan predicted by the flexible production plan prediction module is extracted and the comprehensive flexible production plan events are also input into the knowledge graph.
[0070] Furthermore, in the flexible production plan prediction module, the flexible production large language model, the flexible production plan model, the knowledge graph and the current customer demand are input into the language model development framework and predicted according to the current customer demand to obtain the comprehensive flexible production plan prediction result. The specific method is as follows:
[0071] Input the flexible production large language model, the flexible production planning model and the knowledge graph into the langchain framework, construct the input data template, the restriction condition template, the short-term memory template and the long-term memory template in the langchain framework, encapsulate the input data template, the restriction condition template, the long-term memory template and the short-term memory template into the Prompt prompt word as the input of the langchain framework, the short-term memory is the result obtained in each round of iteration of the langchain framework, and the long-term memory is the result obtained at the end of the iteration of the langchain framework. In the first round of iteration, the current customer demand data and the actual production restriction conditions are respectively input into the data template and the restriction condition template, and the current customer demand data is multimodal data including text data, image data and code data. In the second round and each subsequent round of iteration, the short-term memory obtained in each round of iteration is stored in the short-term memory template, and the long-term memory obtained at the end of the iteration is stored in the long-term memory template. The long-term memory is the final comprehensive flexible production plan;
[0072] First, the langchain framework calls the knowledge graph. The langchain framework retrieves the corresponding comprehensive flexible production plan in the knowledge graph according to the current customer demand data in the prompt word. If the corresponding comprehensive flexible production plan can be retrieved, the langchain framework outputs the comprehensive flexible production plan as the prediction result. If the corresponding comprehensive flexible production plan is not retrieved, the langchain framework calls the flexible production large language model and the flexible production plan model to predict the flexible production plan. The prediction process is as follows:
[0073] Input the prompt word Prompt into the flexible production large language model, the flexible production large language model predicts the customer demand data in the prompt word Prompt to obtain the first flexible production plan, and the flexible production large language model also performs generative language expansion on the customer demand data in the prompt word Prompt to obtain feature-enhanced customer demand data, the feature-enhanced customer demand data is in text mode, the langchain framework inputs the feature-enhanced customer demand data into the flexible production plan model to obtain the second flexible production plan, and the langchain framework then merges the first flexible production plan and the second flexible production plan to obtain a comprehensive flexible production plan;
[0074] After completing each round of iteration, the langchain framework determines whether the comprehensive flexible production plan obtained in this round of iteration meets customer needs based on the restrictions in the Prompt prompt word. If the comprehensive flexible production plan obtained in this round of iteration cannot meet customer needs, the comprehensive flexible production plan obtained in this round of iteration is stored in the Prompt prompt word as short-term memory. The langchain framework calls the flexible production large language model and the flexible production plan model for a new round of iteration based on the customer demand data and all short-term memories in the Prompt prompt word. During the prediction process, the langchain framework optimizes the flexible production large language model and the flexible production plan model based on all short-term memories to obtain the result of the next round of iteration; if the comprehensive flexible production plan obtained in this round of iteration meets customer needs, the comprehensive flexible production plan is output as the prediction result.
[0075] A flexible production plan prediction method based on knowledge graph and language model includes the following steps:
[0076] Aggregate the historical production data of the flexible factory to obtain the characteristic network graph data;
[0077] The natural language algorithm is trained using feature network graph data to obtain a flexible production large language model;
[0078] Several modern heuristic algorithm layers are used as stacking modules to form a stacking framework, and the stacking framework is trained using feature network graph data to obtain a flexible production planning model.
[0079] Input the image data in the feature network graph data into the flexible production big language model to convert it into text data, then merge the text data obtained by image data conversion with the text data in the feature network graph data and classify them according to the data meaning to obtain customer demand text data and comprehensive flexible production plan text data, input the feature network graph data into the flexible production big language model to obtain demand-production relationship text data, perform event extraction on the customer demand text data and comprehensive flexible production plan text data in the historical production data of the flexible factory to obtain customer demand events and comprehensive flexible production plan events, and link the customer demand events and comprehensive flexible production plan events according to the demand-production relationship text data to obtain a knowledge graph;
[0080] The flexible production large language model, flexible production planning model, knowledge graph and current customer demand are input into the language model development framework and prediction is made based on current customer demand to obtain the comprehensive flexible production plan prediction result.
[0081] A computer program product includes a computer program / instruction, which, when executed by a processor, implements the above-mentioned flexible production plan prediction method based on knowledge graph and language model.
[0082] The beneficial effects of the present invention are:
[0083] 1. By generating a knowledge graph, the problem of data flow breakpoints in the traditional flexible production decision-making system is effectively overcome. This method significantly improves the system's instant decision-making ability by integrating and analyzing customer demand data and flexible production decision data, ensuring that flexible production decisions can respond to market changes more quickly and accurately.
[0084] 2. Through the multimodal data processing method based on the feature network graph, this method can simultaneously process multi-source heterogeneous data from the Internet of Things, customer feedback, market dynamics, etc. By optimizing the data processing process, this method not only improves the accuracy of flexible production decisions, but also promotes the improvement of production efficiency and the reduction of costs, which can significantly improve the operational benefits of enterprises.
[0085] 3. By training the flexible production large language model, the system is able to self-update and continuously optimize. The model can automatically learn and adapt to new production environments and market demands, thereby improving processing performance and decision-making efficiency. This self-evolution capability ensures that the system can maintain efficient and stable operation in the face of complex and changing production environments.
[0086] 4. Through the self-update of the knowledge graph and the training of the flexible production planning model, the knowledge reserve and decision-making ability of the flexible production large language large model in the professional field are further enhanced. Through the synergy between the three, more specific flexible production plans are predicted. At the same time, the interpretability of the flexible production large language large model and the flexible production planning model is improved, making the decision-making process more transparent and easy to understand, and enhancing the trust and cooperation between humans and machines. These advantages jointly enhance the application effect and value of the system in actual production. BRIEF DESCRIPTION OF THE DRAWINGS
[0087] Figure 1 This is a block diagram of the flexible production planning prediction system based on knowledge graph and language model.
[0088] Figure 2 This is the overall route of the system of the present invention.
[0089] Figure 3 The method flow for obtaining characteristic network graph data.
[0090] Figure 4 Workflow for training and adjusting the flexible production large prediction model for knowledge graph.
[0091] Figure 5 This is the training process and decision-making process of the present invention. DETAILED DESCRIPTION
[0092] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0093] Example 1
[0094] refer to Figure 1 , a flexible production planning prediction system based on knowledge graph and language model, including:
[0095] The feature network diagram establishment module is used to aggregate the flexible factory historical production data to obtain feature network diagram data. The historical data and feature network diagram data are classified based on data modality and include text data, image data and code data. The historical data and feature network diagram data are classified based on data meaning and include customer demand data and comprehensive flexible production plan data, such as Figure 2 As shown;
[0096] A flexible production large language model building module is used to use the TTT layer to replace the self-attention mechanism in the Transformer algorithm to obtain an improved Transformer algorithm, and use the feature network graph data to train the improved Transformer algorithm to obtain a flexible production large language model;
[0097] A flexible production planning model building module is used to combine several modern heuristic algorithm layers as stacking modules to form a stacking framework, and train the stacking framework using feature network graph data to obtain a flexible production planning model;
[0098] A knowledge graph establishment module is used to input the image data in the feature network graph data into the flexible production large language model to convert it into text data, then merge the text data obtained by the image data conversion with the text data in the feature network graph data and classify them according to the data meaning to obtain customer demand text data and comprehensive flexible production plan text data, input the feature network graph data into the flexible production large language model to obtain demand-production relationship text data, perform event extraction on the customer demand text data and the comprehensive flexible production plan text data to obtain customer demand events and comprehensive flexible production plan events, and link the customer demand events and the comprehensive flexible production plan events according to the demand-production relationship text data to obtain a knowledge graph;
[0099] The flexible production plan prediction module is used to input the flexible production large language model, flexible production plan model, knowledge graph and current customer demand into the language model development framework and make predictions based on current customer demand to obtain comprehensive flexible production plan prediction results.
[0100] (1) The specific method of the feature network diagram building module to aggregate the flexible factory historical production data to obtain the feature network diagram data is as follows:
[0101] Collect historical data from IoT devices, including customer multimodal data and historical production line multimodal data. Customer multimodal data includes text data such as order information and basic customer information, as well as image and video data such as customer behavior. Production line multimodal data includes text data such as production logs, image and video data such as equipment operation status, and code data for controlling equipment operation.
[0102] Establish the feature matrix E representing historical data i , the formula is as follows:
[0103]
[0104] in, Represent the text data feature vector a, image data feature vector b and code data feature vector c respectively, establish a feature network graph consisting of nodes and edges between nodes, and convert the feature matrix E representing historical data i As the initial representation of each node, the weights between nodes are the edges of the feature network graph, and i represents the sequence number of the historical data and its corresponding node number;
[0105] Use the GCN aggregator to aggregate the information of node i and all its neighbor nodes j and update the representation of the node. The specific steps are: use the weight matrix W l The representations of node i and all its neighboring nodes j are linearly transformed and then normalized. The representations of all neighboring nodes j of node i after normalization are summed. Then, the representation of node i in the next layer in the GCN aggregator is processed by activation function to obtain the node representation of node i after aggregation by the GCN aggregator. The formula is expressed as:
[0106]
[0107] in, represents the representation of node i at the l+1th layer in the GCN aggregator, represents the representation of node i’s neighbor node j in the GCN aggregator at layer l, σ represents the activation function, and W l represents the weight matrix of the lth layer in the GCN aggregator, N i represents the set of neighbor nodes j of node i, and d(i,j) represents the distance between node i and its neighbor node j;
[0108] The GAT aggregator uses the attention mechanism to aggregate the information of node i and all its neighboring nodes j, and updates the node representation. The specific steps are: use the additive attention mechanism to calculate the attention weight between node i and all its neighboring nodes j and weight the neighboring nodes j of node i, sum the representations of all weighted neighboring nodes j, and obtain the representation of node i in the next layer of the GAT aggregator for activation function processing to obtain the node representation of node i after aggregation by the GAT aggregator. The formula is expressed as:
[0109]
[0110] in, represents the attention weight between node i and its neighbor node j, represents the representation of node i’s neighbor node j at the lth layer in the GAT aggregator, represents the representation of node i at the l+1th layer in the GAT aggregator;
[0111] HAN aggregator and GNN aggregator are used to aggregate according to the homogeneous relationship and heterogeneous relationship between node i and its neighbor node j respectively. The specific steps are: in HAN aggregator, the content attention mechanism is used to calculate the attention weights between homogeneous nodes and aggregate them, and in GNN aggregator, the key-value attention mechanism is used to calculate the attention weights between heterogeneous nodes and aggregate them. The formula is expressed as:
[0112]
[0113] in, They represent the attention scores between node i and its neighbor node j in homogeneous relationship and the attention scores between node i and its neighbor node j in heterogeneous relationship, represents the representation of node i at layer l in the HAN aggregator, represents the representation of node i’s neighbor node j at the lth layer in the HAN aggregator, represents the representation of node i at layer l in the GNN aggregator, represents the representation of node i’s neighbor node j at the lth layer in the GNN aggregator, and They represent the weight matrix that converts the representation of node i into the query vector and the weight matrix that converts the representation of node i’s neighbor node j into the query vector, respectively. represents the weight matrix that converts the representation of node i’s neighbor node j into a key vector, represents the weight matrix that converts the representation of node i into a value vector, softmax represents the softmax function, represents the l+1th layer representation of node i obtained by aggregating homogeneous nodes in the HAN aggregator, represents the l+1th layer representation of node i obtained by aggregating heterogeneous nodes in the GNN aggregator, and T represents transpose;
[0114] Finally, an asynchronous update is performed. The specific steps are: use the update gate selection mechanism to select the best aggregation method according to the representation of node i, and then use the best aggregation method to update the representation of node i. The formula is expressed as:
[0115]
[0116]
[0117] Among them, β represents the selection mechanism of the update gate, δ is a function parameterized by the multi-layer perceptron, and the function δ is used to select the best node representation as the final node representation among the node representations obtained by the GCN aggregator, GAT aggregator, HAN aggregator and GNN aggregator through the selection mechanism of the update gate. The final representation of node i is Determined by the update gate selection mechanism, Z i The representation function δ represents the selection result of the final representation of node i. The weight in the aggregator corresponding to the final representation of node i is the final representation of the edge. The final representation of node i and the final representation of the edge constitute the feature network graph data. According to the meaning of the final representation of node i, the feature network graph data is divided into customer demand data and comprehensive flexible production plan data.
[0118] Since historical data has rich modalities, establishing a feature network graph can simultaneously process multi-source heterogeneous data from the Internet of Things, customer feedback, market dynamics, etc., which can improve information processing capabilities and enhance generalization capabilities.
[0119] GCN, GAT, HAN, and GNN are all aggregation algorithms for constructing feature network graphs. The feature network graph is constructed by using four aggregation algorithms, and then the optimal aggregation algorithm is obtained by asynchronously updating the node representations obtained by the four algorithms. The feature network graph obtained by using the optimal aggregation algorithm is more suitable for the technical background of flexible production of this patent. The association relationship information between different modal data is established through the feature network graph to obtain pre-processed modal data. The association relationship information is used to characterize the internal connection or mutual relationship between different modal data. This method not only improves the accuracy of flexible production decisions, but also promotes the improvement of production efficiency and the reduction of costs, which can significantly improve the operating efficiency of the enterprise.
[0120] (2) Flexible production large language model establishment module The specific method of obtaining the flexible production large language model is as follows:
[0121] The flexible production large language model adopts the Transformer algorithm, in which the TTT layer is used to replace the self-attention mechanism in the Transformer algorithm. The TTT layer includes a multi-layer perceptron.
[0122] The forward propagation function of the flexible production large language model is written as follows: First, the input sequence of the current time step is combined with the hidden state of the previous time step by improving the encoder in the Transformer algorithm to obtain the context vector, and the context vector is input into the multi-layer perceptron of the TTT layer. For a multi-layer perceptron with l layers, the output z of the lth layer l and activate output a l It can be expressed as:
[0123]
[0124] a l-1 =φ l (z l )
[0125] in, is the weight matrix of the lth layer in the multilayer perceptron, b l is the bias vector of the lth layer in the multilayer perceptron, and the hidden state includes the weight matrix and the bias vector b l , a l-1 is the activation output of the l-1th layer. When the input layer l=1, a 0 is the activation output of the first layer, φ l is the activation function ReLU of the lth layer;
[0126] Then in the TTT layer, the gradient descent method is used to update the hidden state, which is the weight matrix and the bias vector. The back propagation algorithm is used to calculate the loss function. The gradient of the multilayer perceptron parameters is:
[0127]
[0128] in, To represent the loss function L with respect to the weight matrix W of the lth layer l The gradient of To represent the loss function L with respect to the bias vector b of the lth layer l The gradient of , L is the loss function;
[0129] Then use the gradient descent method to update the weight matrix and bias vector of the multilayer perceptron:
[0130]
[0131] in, Indicates that the weight matrix of the lth layer is updated using the gradient descent method. To indicate the use of gradient descent to update the bias vector of the lth layer, η is the learning rate;
[0132] The context vector output by the encoder and the updated hidden state in the multi-layer perceptron of the TTT layer are input into the softmax function of the decoder in the improved Transformer algorithm. The softmax function obtains the output result of the Transformer algorithm based on the context vector and the updated hidden state.
[0133] The feature network graph data is divided into a training set and a validation set, and the improved Transformer algorithm is trained. During training, the input sequence of the improved Transformer algorithm is the customer demand data in the feature network graph data, and the corresponding output is a comprehensive flexible production plan. During training, the customer demand data in the feature network graph data is converted into the input sequence of the improved Transformer algorithm: the final representations of all nodes are serialized, and node indexes are added to the sequence to identify specific nodes. The weight matrix representing the final representation of the edge is added to the sequence to obtain the input sequence during training. After the improved Transformer algorithm is trained, a flexible production large language model is obtained.
[0134] The Transformer algorithm is a natural language processing model that can process multimodal data. Training the Transformer can make it focus on a certain field. Test-Time Training (TTT for short) is an innovative machine learning model training method. Its core idea is to further train and adjust the model during the test phase. In the field of natural language processing, TTT can be used for tasks such as text classification, machine translation, and named entity recognition. By adjusting for each test instance, the model can more accurately understand the meaning and contextual information of the text, thereby improving the accuracy of the task. By using the TTT layer to replace the self-attention mechanism in the Transformer, the generalization ability and accuracy of the flexible production large language model can be improved: by adjusting for each test instance, TTT can make the flexible production large language model better adapt to the distribution and characteristics of the test data, thereby improving the accuracy of the task. TTT allows the flexible production large language model to be adjusted and optimized in real time during the test phase, so as to better adapt to the changing environment and data distribution.
[0135] (3) Flexible production planning model establishment module The specific method of obtaining the flexible production planning model is as follows:
[0136] Firstly, the stacking framework is selected as the structure of the flexible production planning model, and the genetic algorithm layer, particle swarm optimization layer and simulated annealing layer are used as the stacking modules of the stacking framework. Each stacking module adopts a linear stacking method: the output of one stacking module is used as the input of the next stacking module, and the target performance parameters of the flexible production planning model are determined;
[0137] Then, the customer demand data in the feature network graph data is serialized and input into the flexible production large language model for generative language expansion to obtain feature-enhanced customer demand data as the input of the flexible production planning model. The feature-enhanced customer demand data is in text mode. The genetic algorithm layer, the particle swarm optimization layer, and the simulated annealing layer are arranged and combined in sequence, and the stacking frames of different orders of the stacked modules obtained by the arrangement and combination are input with feature-enhanced input sequences for training. Finally, cross-validation is used according to the target performance parameters to evaluate the generalization ability of the model for the target performance, and the stacking frame with the largest generalization ability is selected as the trained flexible production planning model.
[0138] Stacking genetic algorithm, particle swarm optimization and simulated annealing can combine the advantages of these three optimization algorithms to show more powerful performance in solving complex optimization problems.
[0139] Since the large language model of flexible production has high generalization ability, it is suitable for a wide variety of tasks. However, the parameters of specific production lines cannot be answered in flexible production. By establishing a flexible production planning model, the knowledge reserve and decision-making ability in the professional field of flexible production are enhanced. At the same time, the interpretability of the system is improved, making the decision-making process more transparent and easy to understand, and enhancing the trust and cooperation between man and machine.
[0140] (4) The specific method of obtaining the knowledge graph by the knowledge graph building module is as follows:
[0141] Extracting text data of customer demand and comprehensive flexible production plan and image data of customer demand and comprehensive flexible production plan from feature network graph data, inputting the image data of customer demand and comprehensive flexible production plan into flexible production big language model respectively, obtaining customer demand text data converted from image data and comprehensive flexible production plan text data converted from image data respectively, merging customer demand text data obtained from image conversion and customer demand text data extracted from feature network graph data to obtain customer demand text database, merging comprehensive production plan text data obtained from image conversion and comprehensive production plan text data extracted from feature network graph data to obtain comprehensive flexible production plan text database, inputting feature network data set into flexible production big language model to obtain demand-production relationship text data, establishing demand-production relationship text database according to demand-production relationship text data, wherein the demand-production relationship text data is text data representing the relationship between customer demand and comprehensive flexible production plan;
[0142] According to the relationship between customer demand and comprehensive flexible production plan in the demand-production relationship text database, event extraction is performed on customer demand text data and comprehensive flexible production plan text data to obtain customer demand events and comprehensive flexible production plan events, wherein the content of the event includes subject, type, time, location, attribute, and relationship, and customer demand event vectors and comprehensive flexible production plan event vectors are respectively established according to the content of the customer demand event and the content of the comprehensive flexible production plan event, and the customer demand event vector and the comprehensive flexible production plan event vector are linked to construct a knowledge graph;
[0143] The event is an action or state change with clear time and space attributes, the subject is an entity that participates in the event and has a causal relationship with the event, the relationship is the causal connection between events, and the attribute is a feature that describes the event;
[0144] In the knowledge graph, nodes are used to represent events with entity and attribute labels, including customer demand events and comprehensive flexible production plan events. The edges between nodes represent the relationships between events, which are directed edges. The relationships between events include direct relationships and indirect relationships.
[0145] Among them, the specific method of constructing the knowledge graph by linking the customer demand event vector and the comprehensive flexible production plan event vector is as follows:
[0146] The K-means clustering algorithm is used to identify and merge similar events. The specific method is as follows: In the K-means clustering algorithm, the silhouette coefficient is used to determine the K value, and the K-means++ algorithm is used to initialize the centroid. The following two steps are iterated until convergence: 1) each node is assigned to the nearest centroid to form K clusters; 2) the centroid of each cluster is recalculated;
[0147] Each node is assigned a cluster label, which indicates the cluster to which it belongs. Nodes with the same or similar cluster labels are merged to obtain the final vector of each node, and the nodes are connected according to the relationship between events to obtain a knowledge graph.
[0148] The purpose of establishing a knowledge graph is to adjust the logical connections between historical data through the intervention of expert expertise and obtain a more professional database. This is different from the feature network diagram, which is obtained by automatic aggregation through algorithms.
[0149] (5) In order to make the flexible production large language model more suitable for the flexible production environment, since the knowledge graph is established based on the logic of experts in this field, and the feature network graph is only generated by the algorithm, the flexible production large language model is further trained using the knowledge graph to make the flexible production large language model more consistent with the logic of actual production. The specific steps include: training adjustment and knowledge enhancement module, which are used to train and adjust the flexible production large language model using knowledge graph data, such as Figure 3 As shown, the specific method is as follows:
[0150] First, the feature network graph data and knowledge graph datasets are input into different TTT layers in the flexible production large language model to obtain the weighted features of the feature network graph data and the weighted features of the knowledge graph data. Then, the weighted features of the feature network graph data and the weighted features of the knowledge graph data from different TTT layers are vectorized and concatenated to form a fused feature representation as training data to train the flexible production large language model. This allows the flexible production large language model to be trained and adjusted based on a knowledge graph that is more in line with actual logic, making it more in line with actual application scenarios.
[0151] Input a certain customer demand data in the feature network graph data into the trained and adjusted flexible production large language model to obtain several first flexible production plans, and input the obtained several first flexible production plans into the DQN algorithm for reward value evaluation, and input the first flexible production plan with the highest reward value among the several first flexible production plans into the knowledge graph. According to the above process, traverse all customer demand data in the feature network graph data. The specific method is as follows:
[0152] A flexible production simulation model is established. The flexible production simulation model adopts the DQN algorithm to predict the actions in the flexible production plan according to the states in the comprehensive flexible production plan. The adjustment parameters and movements of the machines in the comprehensive flexible production plan are defined as actions, and the material variables and environmental variables in the comprehensive flexible production plan are defined as states. The input of the flexible production simulation model is the state, and the output is the action. The flexible production simulation model is expressed as follows:
[0153] Define a multidimensional vector S t Represents the state of the machine at time t, and the formula is: S t =[s t1 ,s t2 ,...,s tn ], where s tn Represents the nth feature in the state vector of the machine at time t, and defines a multidimensional vector A t Represents the probability distribution of the machine action at time t, the multidimensional vector A t Each dimension corresponds to an action, and the formula is expressed as: t =[a t1 ,a t2 ,...,a tm ], where a tm represents the probability of the mth action in the action vector of the machine at time t;
[0154] In the DQN algorithm, the Q network converts the state S t Mapped to action probability distribution A t , the formula is: Q(S t ,A t ; θ), where θ represents the parameter set of the DQN algorithm;
[0155] The reward obtained by the flexible production simulation model after completing the current action is defined as the immediate reward, and the total reward obtained by the flexible production simulation model after a series of actions is defined as the cumulative reward. The formula of the reward function is as follows:
[0156]
[0157] Among them, G T′ is the cumulative reward in period T′, R T′+k+1 is the immediate reward obtained in period T′+k+1, γ k is the immediate reward obtained by completing the current action within time step k;
[0158] The flexible production simulation model is trained. The specific training process is as follows: Initialize the current network Q(S t ,A t ; θ), define the target network Q′(S t ,A t ; θ′), then the flexible production factory interacts with the knowledge graph to record the current state, action, reward and next state, represented as a tuple (S t ,A t ,γ k ,S t+1 ), the interaction process is as follows: The flexible production factory performs action A t After that, the state changes from St Transfer to S t+1 , and get the current reward γ k , and stored in the experience replay buffer of the DQN algorithm, a batch of experience is randomly extracted from the experience replay buffer to train the Q network to update the parameters of the DQN algorithm. The training process includes the following steps: Use the target network to calculate the Q value Q(S) of the next state of the current network t+1 ,A t+1 ;θ), the formula is:
[0159]
[0160] The loss function L is calculated using the mean square error:
[0161] Use the gradient descent algorithm to minimize the loss function to update the parameters S of the DQN algorithm t , A t and θ, after updating, we get the trained flexible production simulation model;
[0162] Set the number of output results corresponding to the customer demand data input into the flexible production big language model to n, input the customer demand data in the feature network graph data into the flexible production big language model to generate n comprehensive flexible production plans, and then input the n flexible production plans into the flexible production simulation model to calculate their respective cumulative rewards, traverse the customer demand data in the feature network graph data, and select the comprehensive flexible production plan with the highest cumulative reward value in turn for event extraction to obtain the comprehensive flexible production plan event, perform event extraction on the customer demand data corresponding to the comprehensive flexible production plan with the highest cumulative reward value to obtain the customer demand event, and finally input the comprehensive flexible production plan event and the customer demand event into the knowledge graph, and at the same time, perform event extraction on the comprehensive flexible production plan predicted by the flexible production plan prediction module to obtain the comprehensive flexible production plan event, which is also input into the knowledge graph.
[0163] By establishing a flexible production simulation model and simulating the actual production environment, we can obtain some simulated flexible production plans. The flexible production plans generated by the actual forecasting process are stored in the knowledge graph, which can greatly increase the richness of the knowledge graph, increase the knowledge reserve for future forecasting calls, and improve the forecast accuracy.
[0164] (6) Figure 4 As shown, the specific method of the flexible production plan forecasting module for forecasting is as follows:
[0165] Input the flexible production large language model, the flexible production planning model and the knowledge graph into the langchain framework, construct the input data template, the restriction condition template, the short-term memory template and the long-term memory template in the langchain framework, encapsulate the input data template, the restriction condition template, the long-term memory template and the short-term memory template into the Prompt prompt word as the input of the langchain framework, the short-term memory is the result obtained in each round of iteration of the langchain framework, and the long-term memory is the result obtained at the end of the iteration of the langchain framework. In the first round of iteration, the current customer demand data and the actual production restriction conditions are respectively input into the data template and the restriction condition template, and the current customer demand data is multimodal data including text data, image data and code data. In the second round and each subsequent round of iteration, the short-term memory obtained in each round of iteration is stored in the short-term memory template, and the long-term memory obtained at the end of the iteration is stored in the long-term memory template. The long-term memory is the final comprehensive flexible production plan;
[0166] First, the langchain framework calls the knowledge graph. The langchain framework retrieves the corresponding comprehensive flexible production plan in the knowledge graph according to the current customer demand data in the prompt word. If the corresponding comprehensive flexible production plan can be retrieved, the langchain framework outputs the comprehensive flexible production plan as the prediction result. If the corresponding comprehensive flexible production plan is not retrieved, the langchain framework calls the flexible production large language model and the flexible production plan model to predict the flexible production plan. The prediction process is as follows:
[0167] Input the prompt word Prompt into the flexible production large language model, the flexible production large language model predicts the customer demand data in the prompt word Prompt to obtain the first flexible production plan, and the flexible production large language model also performs generative language expansion on the customer demand data in the prompt word Prompt to obtain feature-enhanced customer demand data, the feature-enhanced customer demand data is in text mode, the langchain framework inputs the feature-enhanced customer demand data into the flexible production plan model to obtain the second flexible production plan, and the langchain framework then merges the first flexible production plan and the second flexible production plan to obtain a comprehensive flexible production plan;
[0168] After completing each round of iteration, the langchain framework determines whether the comprehensive flexible production plan obtained in this round of iteration meets customer needs based on the restrictions in the Prompt prompt word. If the comprehensive flexible production plan obtained in this round of iteration cannot meet customer needs, the comprehensive flexible production plan obtained in this round of iteration is stored in the Prompt prompt word as short-term memory. The langchain framework calls the flexible production large language model and the flexible production plan model for a new round of iteration based on the customer demand data and all short-term memories in the Prompt prompt word. During the prediction process, the langchain framework optimizes the flexible production large language model and the flexible production plan model based on all short-term memories to obtain the result of the next round of iteration; if the comprehensive flexible production plan obtained in this round of iteration meets customer needs, the comprehensive flexible production plan is output as the prediction result.
[0169] The LangChain framework is a powerful framework designed for natural language processing (NLP) and large language model (LLM) applications. Its architecture can be divided into multiple levels and modules, each of which has different functions and responsibilities. This patent uses the LangChain framework to call the flexible production large language model and the flexible production planning model, and uses the knowledge graph as the knowledge base. At the same time, it combines the prediction results of the flexible production large language model and the flexible production planning model to obtain a comprehensive flexible production plan. This is because the flexible production large language model has a strong generalization ability, and the production parameters of the specific production line cannot be well predicted. It is more limited to the work arrangement of personnel and a larger range of production plans. The flexible production planning model combines genetic algorithms, particle swarm optimization and simulated annealing, which can well predict the optimal production line parameters. Therefore, the combination of the two can obtain a comprehensive flexible production plan that is complete and comprehensive. At the same time, the more prediction work is performed, the more data is added to the knowledge graph, and the self-update of the knowledge graph is realized, thereby achieving the purpose of self-learning.
[0170] Example 2
[0171] A flexible production plan prediction method based on knowledge graph and language model includes the following steps:
[0172] Aggregate the flexible factory historical production data to obtain feature network diagram data. The historical data and feature network diagram data are classified based on data modality and include text data, image data, and code data. The historical data and feature network diagram data are classified based on data meaning and include customer demand data and comprehensive flexible production plan data.
[0173] The TTT layer is used to replace the self-attention mechanism in the Transformer algorithm to obtain an improved Transformer algorithm, and the feature network graph data is used to train the improved Transformer algorithm to obtain a flexible production large language model;
[0174] Several modern heuristic algorithm layers are used as stacking modules to form a stacking framework, and the stacking framework is trained using feature network graph data to obtain a flexible production planning model.
[0175] Input the image data in the feature network graph data into the flexible production big language model to convert it into text data, then merge the text data obtained by image data conversion with the text data in the feature network graph data and classify them according to the data meaning to obtain customer demand text data and comprehensive flexible production plan text data, input the feature network graph data into the flexible production big language model to obtain demand-production relationship text data, perform event extraction on the customer demand text data and the comprehensive flexible production plan text data to obtain customer demand events and comprehensive flexible production plan events, and link the customer demand events and the comprehensive flexible production plan events according to the demand-production relationship text data to obtain a knowledge graph;
[0176] The flexible production large language model, flexible production planning model, knowledge graph and current customer demand are input into the language model development framework and prediction is made based on current customer demand to obtain the comprehensive flexible production plan prediction result.
[0177] Example 3
[0178] A computer program product includes a computer program / instruction, which, when executed by a processor, implements the flexible production plan prediction method based on knowledge graph and language model in Example 2.
[0179] The contents not described in detail in this specification belong to the prior art known to those skilled in the art. It should be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0180] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0181] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0182] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0183] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit its protection scope. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the field should understand that after reading the present invention, those skilled in the art can still make various changes, modifications or equivalent substitutions to the specific implementation methods of the invention, but these changes, modifications or equivalent substitutions are all within the protection scope of the pending claims of the invention.
Claims
1. A flexible production planning prediction system based on knowledge graph and language model, characterized in that: include: A feature network diagram building module is used to aggregate the historical production data of the flexible factory to obtain feature network diagram data; Flexible production large language model building module, used to train the natural language algorithm using feature network graph data to obtain a flexible production large language model; A flexible production planning model building module is used to combine several modern heuristic algorithm layers as stacking modules to form a stacking framework, and train the stacking framework using feature network graph data to obtain a flexible production planning model; A knowledge graph establishment module is used to input the image data in the feature network graph data into the flexible production large language model to convert it into text data, then merge the text data obtained by the image data conversion with the text data in the feature network graph data and classify them according to the data meaning to obtain customer demand text data and comprehensive flexible production plan text data, input the feature network graph data into the flexible production large language model to obtain demand-production relationship text data, perform event extraction on the customer demand text data and the comprehensive flexible production plan text data in the historical production data of the flexible factory to obtain customer demand events and comprehensive flexible production plan events, and link the customer demand events and the comprehensive flexible production plan events according to the demand-production relationship text data to obtain a knowledge graph; The flexible production plan prediction module is used to input the flexible production large language model, flexible production plan model, knowledge graph and current customer demand into the language model development framework and make predictions based on current customer demand to obtain comprehensive flexible production plan prediction results.
2. The flexible production plan prediction system based on knowledge graph and language model according to claim 1 is characterized in that: In the characteristic network diagram establishment module, the specific method of aggregating the flexible factory historical production data to obtain the characteristic network diagram data is as follows: Establish the feature matrix E representing historical data i , the formula is as follows: in, Represent the text data feature vector a, image data feature vector b and code data feature vector c respectively, establish a feature network graph consisting of nodes and edges between nodes, and convert the feature matrix E representing historical data i As the initial representation of each node, the weights between nodes are the edges of the feature network graph, and i represents the sequence number of the historical data and its corresponding node number; Use the GCN aggregator to aggregate the information of node i and all its neighbor nodes j and update the representation of the node. The specific steps are: use the weight matrix W l The representations of node i and all its neighboring nodes j are linearly transformed and then normalized. The representations of all neighboring nodes j of node i after normalization are summed. Then, the representation of node i in the next layer in the GCN aggregator is processed by activation function to obtain the node representation of node i after aggregation by the GCN aggregator. The formula is expressed as: in, represents the representation of node i at the l+1th layer in the GCN aggregator, represents the representation of node i’s neighbor node j in the GCN aggregator at layer l, σ represents the activation function, and W l represents the weight matrix of the lth layer in the GCN aggregator, N i represents the set of neighbor nodes j of node i, and d(i,j) represents the distance between node i and its neighbor node j; The GAT aggregator uses the attention mechanism to aggregate the information of node i and all its neighboring nodes j, and updates the node representation. The specific steps are: use the additive attention mechanism to calculate the attention weight between node i and all its neighboring nodes j and weight the neighboring nodes j of node i, sum the representations of all weighted neighboring nodes j, and obtain the representation of node i in the next layer of the GAT aggregator for activation function processing to obtain the node representation of node i after aggregation by the GAT aggregator. The formula is expressed as: in, represents the attention weight between node i and its neighbor node j, represents the representation of node i’s neighbor node j at the lth layer in the GAT aggregator, represents the representation of node i at the l+1th layer in the GAT aggregator; HAN aggregator and GNN aggregator are used to aggregate according to the homogeneous relationship and heterogeneous relationship between node i and its neighbor node j respectively. The specific steps are: in HAN aggregator, the content attention mechanism is used to calculate the attention weights between homogeneous nodes and aggregate them, and in GNN aggregator, the key-value attention mechanism is used to calculate the attention weights between heterogeneous nodes and aggregate them. The formula is expressed as: in, They represent the attention scores between node i and its neighbor node j in homogeneous relationship and the attention scores between node i and its neighbor node j in heterogeneous relationship, represents the representation of node i at layer l in the HAN aggregator, represents the representation of node i’s neighbor node j at the lth layer in the HAN aggregator, represents the representation of node i at layer l in the GNN aggregator, represents the representation of node i’s neighbor node j at the lth layer in the GNN aggregator, and They represent the weight matrix that converts the representation of node i into the query vector and the weight matrix that converts the representation of node i’s neighbor node j into the query vector, respectively. represents the weight matrix that converts the representation of node i’s neighbor node j into a key vector, represents the weight matrix that converts the representation of node i into a value vector, softmax represents the softmax function, represents the l+1th layer representation of node i obtained by aggregating homogeneous nodes in the HAN aggregator, represents the l+1th layer representation of node i obtained by aggregating heterogeneous nodes in the GNN aggregator, and T represents transpose; Finally, an asynchronous update is performed. The specific steps are: use the update gate selection mechanism to select the best aggregation method according to the representation of node i, and then use the best aggregation method to update the representation of node i. The formula is expressed as: Among them, β represents the selection mechanism of the update gate, δ is a function parameterized by the multi-layer perceptron, and the function δ is used to select the best node representation as the final node representation among the node representations obtained by the GCN aggregator, GAT aggregator, HAN aggregator and GNN aggregator through the selection mechanism of the update gate. The final representation of node i is Determined by the update gate selection mechanism, Z i The representation function δ represents the selection result of the final representation of node i. The weight in the aggregator corresponding to the final representation of node i is the final representation of the edge. The final representation of node i and the final representation of the edge constitute the feature network graph data. According to the meaning of the final representation of node i, the feature network graph data is divided into customer demand data and comprehensive flexible production plan data.
3. The flexible production plan prediction system based on knowledge graph and language model according to claim 1 is characterized in that: In the flexible production large language model establishment module, the specific method of using the feature network graph data to train the natural language algorithm to obtain the flexible production large language model is as follows: The flexible production large language model adopts the Transformer algorithm, in which the TTT layer is used to replace the self-attention mechanism in the Transformer algorithm. The TTT layer includes a multi-layer perceptron. The forward propagation function of the flexible production large language model is written as follows: First, the input sequence of the current time step is combined with the hidden state of the previous time step by improving the encoder in the Transformer algorithm to obtain the context vector, and the context vector is input into the multi-layer perceptron of the TTT layer. For a multi-layer perceptron with l layers, the output z of the lth layer l and activate output a l It can be expressed as: and l-1 =φ l (from l ) in, is the weight matrix of the lth layer in the multilayer perceptron, b l is the bias vector of the lth layer in the multilayer perceptron, and the hidden state includes the weight matrix and the bias vector b l , a l-1 is the activation output of the l-1th layer. When the input layer l=1, a 0 is the activation output of the first layer, φ l is the activation function ReLU of the lth layer; Then in the TTT layer, the gradient descent method is used to update the hidden state, which is the weight matrix and the bias vector. The back propagation algorithm is used to calculate the loss function. The gradient of the multilayer perceptron parameters is: in, To represent the loss function L with respect to the weight matrix W of the lth layer l The gradient of To represent the loss function L with respect to the bias vector b of the lth layer l The gradient of , L is the loss function; Then use the gradient descent method to update the weight matrix and bias vector of the multilayer perceptron: in, Indicates that the weight matrix of the lth layer is updated using the gradient descent method. To indicate the use of gradient descent to update the bias vector of the lth layer, η is the learning rate; The context vector output by the encoder and the updated hidden state in the multi-layer perceptron of the TTT layer are input into the softmax function of the decoder in the improved Transformer algorithm. The softmax function obtains the output result of the Transformer algorithm based on the context vector and the updated hidden state. The feature network graph data is divided into a training set and a validation set, and the improved Transformer algorithm is trained. During training, the input sequence of the improved Transformer algorithm is the customer demand data in the feature network graph data, and the corresponding output is a comprehensive flexible production plan. During training, the customer demand data in the feature network graph data is converted into the input sequence of the improved Transformer algorithm: the final representations of all nodes are serialized, and node indexes are added to the sequence to identify specific nodes. The weight matrix representing the final representation of the edge is added to the sequence to obtain the input sequence during training. After the improved Transformer algorithm is trained, a flexible production large language model is obtained.
4. The flexible production plan prediction system based on knowledge graph and language model according to claim 1 is characterized in that: In the flexible production planning model building module, several modern heuristic algorithm layers are used as stacking modules to form a stacking framework. The specific method of using the characteristic network graph data to train the stacking framework to obtain the flexible production planning model is as follows: Firstly, a stacking framework is selected as the structure of the flexible production planning model, and the genetic algorithm layer, particle swarm optimization layer and simulated annealing layer are used as stacking modules of the stacking framework. Each stacking module adopts a linear stacking method: the output of one stacking module is used as the input of the next stacking module, and the target performance parameters of the flexible production planning model are determined; Then, the customer demand data in the feature network graph data is serialized and input into the flexible production large language model for generative language expansion to obtain feature-enhanced customer demand data as the input of the flexible production planning model. The feature-enhanced customer demand data is in text mode. The genetic algorithm layer, the particle swarm optimization layer, and the simulated annealing layer are arranged and combined in sequence, and the stacking frames of different orders of the stacked modules obtained by the arrangement and combination are input with feature-enhanced input sequences for training. Finally, cross-validation is used according to the target performance parameters to evaluate the generalization ability of the model for the target performance, and the stacking frame with the largest generalization ability is selected as the trained flexible production planning model.
5. The flexible production plan prediction system based on knowledge graph and language model according to claim 1 is characterized in that: The knowledge graph establishment module inputs the image data in the feature network graph data into the flexible production large language model to convert it into text data, then merges the text data obtained by the image data conversion with the text data in the feature network graph data and classifies them according to the data meaning to obtain customer demand text data and comprehensive flexible production plan text data, inputs the feature network graph data into the flexible production large language model to obtain demand-production relationship text data, extracts events from the customer demand text data and the comprehensive flexible production plan text data to obtain customer demand events and comprehensive flexible production plan events, and links customer demand events and comprehensive flexible production plan events according to the demand-production relationship text data to obtain the specific method of the knowledge graph as follows: Extracting text data of customer demand and comprehensive flexible production plan and image data of customer demand and comprehensive flexible production plan from feature network graph data, inputting the image data of customer demand and comprehensive flexible production plan into flexible production big language model respectively, obtaining customer demand text data converted from image data and comprehensive flexible production plan text data converted from image data respectively, merging customer demand text data obtained from image conversion and customer demand text data extracted from feature network graph data to obtain customer demand text database, merging comprehensive production plan text data obtained from image conversion and comprehensive production plan text data extracted from feature network graph data to obtain comprehensive flexible production plan text database, inputting feature network data set into flexible production big language model to obtain demand-production relationship text data, establishing demand-production relationship text database according to demand-production relationship text data, wherein the demand-production relationship text data is text data representing the relationship between customer demand and comprehensive flexible production plan; According to the relationship between customer demand and comprehensive flexible production plan in the demand-production relationship text database, event extraction is performed on customer demand text data and comprehensive flexible production plan text data to obtain customer demand events and comprehensive flexible production plan events, wherein the content of the event includes subject, type, time, location, attribute, and relationship, and customer demand event vectors and comprehensive flexible production plan event vectors are respectively established according to the content of the customer demand event and the content of the comprehensive flexible production plan event, and the customer demand event vector and the comprehensive flexible production plan event vector are linked to construct a knowledge graph; The event is an action or state change with clear time and space attributes, the subject is an entity that participates in the event and has a causal relationship with the event, the relationship is the causal connection between events, and the attribute is a feature that describes the event; In the knowledge graph, events with entity and attribute labels are represented by nodes, including customer demand events and comprehensive flexible production plan events. The relationships between events are represented by edges between nodes, which are directed edges. The relationships between events include direct relationships and indirect relationships. Among them, the specific method of constructing the knowledge graph by linking the customer demand event vector and the comprehensive flexible production plan event vector is as follows: The K-means clustering algorithm is used to identify and merge similar events. The specific method is as follows: In the K-means clustering algorithm, the silhouette coefficient is used to determine the K value, and the K-means++ algorithm is used to initialize the centroid. The following two steps are iterated until convergence: (1) each node is assigned to the nearest centroid to form K clusters; (2) the centroid of each cluster is recalculated; Each node is assigned a cluster label, which indicates the cluster to which it belongs. Nodes with the same or similar cluster labels are merged to obtain the final vector of each node, and the nodes are connected according to the relationship between events to obtain a knowledge graph.
6. The flexible production plan prediction system based on knowledge graph and language model according to claim 1 is characterized in that: Also includes: The training adjustment and knowledge enhancement module is used to train and adjust the flexible production large language model using knowledge graph data; A certain customer demand data in the feature network graph data is input into the trained and adjusted flexible production large language model to obtain several first flexible production plans, and the several first flexible production plans are input into the flexible production simulation model established by the DQN algorithm for reward value evaluation, and the first flexible production plan with the highest reward value among the several first flexible production plans is input into the knowledge graph, and all customer demand data in the feature network graph data are traversed according to the above process.
7. The flexible production plan prediction system based on knowledge graph and language model according to claim 6 is characterized in that: In the training adjustment and knowledge enhancement module, the specific method of using knowledge graph data to train and adjust the flexible production large language model is as follows: Firstly, the feature network graph data and knowledge graph dataset are respectively input into different TTT layers of the flexible production large language model to obtain the weighted features of the feature network graph data and the weighted features of the knowledge graph data. Then, the weighted features of the feature network graph data and the weighted features of the knowledge graph data from different TTT layers are vectorized and concatenated to form a fused feature representation as training data to train the flexible production large language model. The method of inputting a certain customer demand data in the feature network graph data into the trained and adjusted flexible production large language model to obtain several first flexible production plans, and inputting the obtained several first flexible production plans into the DQN algorithm for reward value evaluation, and inputting the first flexible production plan with the highest reward value among the several first flexible production plans into the knowledge graph, and traversing all the customer demand data in the feature network graph data according to the above process is as follows: A flexible production simulation model is established. The flexible production simulation model adopts the DQN algorithm to predict the actions in the flexible production plan according to the states in the comprehensive flexible production plan. The adjustment parameters and movements of the machines in the comprehensive flexible production plan are defined as actions, and the material variables and environmental variables in the comprehensive flexible production plan are defined as states. The input of the flexible production simulation model is the state, and the output is the action. The flexible production simulation model is expressed as follows: Define a multidimensional vector S t Represents the state of the machine at time t, and the formula is: S t =[s t1 ,s t2 ,...,s tn ], where s tn Represents the nth feature in the state vector of the machine at time t, and defines a multidimensional vector A t Represents the probability distribution of the machine action at time t, the multidimensional vector A t Each dimension in A corresponds to an action, and the formula is expressed as: t =[a t1 ,a t2 ,...,a tm ], where a tm represents the probability of the mth action in the action vector of the machine at time t; In the DQN algorithm, the Q network converts the state S t Mapped to action probability distribution A t , the formula is: Q(S t ,A t ; θ), where θ represents the parameter set of the DQN algorithm; The reward obtained by the flexible production simulation model after completing the current action is defined as the immediate reward, and the total reward obtained by the flexible production simulation model after a series of actions is defined as the cumulative reward. The formula of the reward function is as follows: Among them, G T′ is the cumulative reward in period T′, R T′+k+1 is the immediate reward obtained in period T′+k+1, γ k is the immediate reward obtained by completing the current action within time step k; The flexible production simulation model is trained. The specific training process is as follows: Initialize the current network Q(S t ,A t ; θ), define the target network Q′(S t ,A t ; θ′), then the flexible production factory interacts with the knowledge graph to record the current state, action, reward and next state, represented as a tuple (S t ,A t ,γ k ,S t+1 ), the interaction process is as follows: The flexible production factory performs action A t After that, the state changes from S t Transfer to S t+1 , and get the current reward γ k , and stored in the experience replay buffer of the DQN algorithm, a batch of experience is randomly extracted from the experience replay buffer to train the Q network to update the parameters of the DQN algorithm. The training process includes the following steps: Use the target network to calculate the Q value Q(S) of the next state of the current network t+1 ,A t+1 ;θ), the formula is: The loss function L is calculated using the mean square error: Use the gradient descent algorithm to minimize the loss function to update the parameters S of the DQN algorithm t , A t and θ, after updating, we get the trained flexible production simulation model; Set the number of output results corresponding to the input of customer demand data into the flexible production large language model to n, input the customer demand data in the feature network graph data into the flexible production large language model to generate n comprehensive flexible production plans, then input the n flexible production plans into the flexible production simulation model to calculate their respective cumulative rewards, traverse the customer demand data in the feature network graph data, select the comprehensive flexible production plan with the highest cumulative reward value in turn for event extraction to obtain the comprehensive flexible production plan event, extract the customer demand data corresponding to the comprehensive flexible production plan with the highest cumulative reward value for event extraction to obtain the customer demand event, and finally input the comprehensive flexible production plan event and the customer demand event into the knowledge graph; At the same time, the comprehensive flexible production plan predicted by the flexible production plan prediction module is extracted and the comprehensive flexible production plan events are also input into the knowledge graph.
8. The flexible production plan prediction system based on knowledge graph and language model according to claim 1 is characterized by: In the flexible production plan prediction module, the flexible production large language model, the flexible production plan model, the knowledge graph and the current customer demand are input into the language model development framework and predicted according to the current customer demand to obtain the comprehensive flexible production plan prediction result. The specific method is as follows: Input the flexible production large language model, the flexible production planning model and the knowledge graph into the langchain framework, construct the input data template, the restriction condition template, the short-term memory template and the long-term memory template in the langchain framework, encapsulate the input data template, the restriction condition template, the long-term memory template and the short-term memory template into the Prompt prompt word as the input of the langchain framework, the short-term memory is the result obtained in each round of iteration of the langchain framework, and the long-term memory is the result obtained at the end of the iteration of the langchain framework. In the first round of iteration, the current customer demand data and the actual production restriction conditions are respectively input into the data template and the restriction condition template, and the current customer demand data is multimodal data including text data, image data and code data. In the second round and each subsequent round of iteration, the short-term memory obtained in each round of iteration is stored in the short-term memory template, and the long-term memory obtained at the end of the iteration is stored in the long-term memory template. The long-term memory is the final comprehensive flexible production plan; First, the langchain framework calls the knowledge graph. The langchain framework retrieves the corresponding comprehensive flexible production plan in the knowledge graph according to the current customer demand data in the prompt word. If the corresponding comprehensive flexible production plan can be retrieved, the langchain framework outputs the comprehensive flexible production plan as the prediction result. If the corresponding comprehensive flexible production plan is not retrieved, the langchain framework calls the flexible production large language model and the flexible production plan model to predict the flexible production plan. The prediction process is as follows: Input the prompt word Prompt into the flexible production large language model, the flexible production large language model predicts the customer demand data in the prompt word Prompt to obtain the first flexible production plan, and the flexible production large language model also performs generative language expansion on the customer demand data in the prompt word Prompt to obtain feature-enhanced customer demand data, the feature-enhanced customer demand data is in text mode, the langchain framework inputs the feature-enhanced customer demand data into the flexible production plan model to obtain the second flexible production plan, and the langchain framework then merges the first flexible production plan and the second flexible production plan to obtain a comprehensive flexible production plan; After completing each round of iteration, the langchain framework determines whether the comprehensive flexible production plan obtained in this round of iteration meets customer needs based on the constraints in the Prompt prompt. If the comprehensive flexible production plan obtained in this round of iteration cannot meet customer needs, the comprehensive flexible production plan obtained in this round of iteration is stored in the Prompt prompt as short-term memory. The langchain framework calls the flexible production large language model and the flexible production plan model for a new round of iteration based on the customer demand data and all short-term memories in the Prompt prompt to obtain the result of the next round of iteration. During the prediction process, the langchain framework optimizes the flexible production large language model and the flexible production plan model based on all short-term memories to obtain the result of the next round of iteration. If the comprehensive flexible production plan obtained in this round of iteration meets customer demand, the comprehensive flexible production plan is output as the prediction result.
9. A flexible production plan prediction method based on knowledge graph and language model, characterized in that: The following steps are involved: Aggregate the historical production data of the flexible factory to obtain the characteristic network graph data; The natural language algorithm is trained using feature network graph data to obtain a flexible production large language model; Several modern heuristic algorithm layers are used as stacking modules to form a stacking framework, and the stacking framework is trained using feature network graph data to obtain a flexible production planning model. Input the image data in the feature network graph data into the flexible production big language model to convert it into text data, then merge the text data obtained by image data conversion with the text data in the feature network graph data and classify them according to the data meaning to obtain customer demand text data and comprehensive flexible production plan text data, input the feature network graph data into the flexible production big language model to obtain demand-production relationship text data, perform event extraction on the customer demand text data and comprehensive flexible production plan text data in the historical production data of the flexible factory to obtain customer demand events and comprehensive flexible production plan events, and link the customer demand events and comprehensive flexible production plan events according to the demand-production relationship text data to obtain a knowledge graph; The flexible production large language model, flexible production planning model, knowledge graph and current customer demand are input into the language model development framework and prediction is made based on current customer demand to obtain the comprehensive flexible production plan prediction result.
10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by the processor, the flexible production plan prediction method based on knowledge graph and language model described in claim 9 is implemented.
Citation Information
Patent Citations
Flexible production scheduling method and device based on hybrid genetic algorithm
CN116993126A
Intelligent scheduling system based on industrial large model
CN117610896A
Flexible production management system and method based on digital twinning
CN118261741A
Flexible production system for aluminum electrolysis cell
CN219861615U
Industrial internet system based on machine vision
CN116777375A
Cited By
Intelligent decision analysis method and system of manufacturing system based on digital twinning
CN120218679A
Flexible production line reconstruction method fusing GraphRAG and improved Whisper
CN120952716A
Oil and gas field production intelligent decision model algorithm construction method
CN122433021A