Raw material mixing control method and system based on multi-agent reinforcement learning
Patent Information
- Authority / Receiving Office
- EP · EP
- Patent Type
- Applications
- Current Assignee / Owner
- METTLER TOLEDO (CHANGZHOU) PRECISION INSTR CO LTD
- Filing Date
- 2024-08-14
- Publication Date
- 2026-06-24
AI Technical Summary
Current raw material mixing control methods face challenges such as imprecise control of discharging speeds, lack of intelligent control over stirring speeds, reliance on manual troubleshooting, and susceptibility to noise and interference.
A raw material mixing control method and system based on multi-agent reinforcement learning, where each material tank is treated as an independent agent, and a multi-agent reinforcement learning model is constructed to adjust feeding speeds and control stirring speeds intelligently.
The method enables precise and intelligent control of raw material mixing, reducing the need for manual intervention, improving operational efficiency, and enhancing the stability and robustness of the mixing control system.
Smart Images

Figure CN2024111957_20022025_PF_FP_ABST
Abstract
Description
RAW MATERIAL MIXING CONTROL METHOD AND SYSTEM BASED ON MULTI-AGENT REINFORCEMENT LEARNINGTechnical Field
[0001] The present application mainly relates to the field of intelligent control, and in particular, to a raw material mixing control method and system based on multi-agent reinforcement learning, and a computer-readable medium storing computer program code.Background Art
[0002] Large industrial devices often require complex and precise control. Raw material mixing control is used as an example, which is generally implemented by mounting a load cell under each of a plurality of material tanks to obtain weight information about each material tank, and controlling a discharging speed of each material tank based on a change in weight, material level information, etc. In addition, each load cell may transmit its own other characteristic sensing data, such as a voltage, a current, a temperature, a load, to a control terminal, and the control terminal may display these data information to a user, to enable manual intervention when a problem occurs. However, the current control method has the following problems:
[0003] (1) The discharging speed of each material tank cannot be precisely controlled based only on weight, material level and other information.
[0004] (2) A stirring speed of a raw material mixing pool is usually constant, and there is currently a lack of intelligent means to automatically control the stirring speed.
[0005] (3) Once an abnormality occurs in a material tank, the entire system will be in a breakdown state, requiring manual troubleshooting for problem solving, which may affect the working efficiency.
[0006] (4) It is necessary to manually set control parameters, which is easily affected by noise, interference and other factors, and the control precision is not high.
[0007] Therefore, it is desirable to employ a more intelligent control method to overcome the above problems.Summary of the Invention
[0008] The technical problem to be solved by the present application is to provide a raw material mixing control method and system based on multi-agent reinforcement learning, and a computer-readable medium storing computer program code, which can realize intelligent control of raw material mixing.
[0009] In order to solve the above technical problem, the present application provides a raw material mixing control method based on multi-agent reinforcement learning, which is used to control a raw material mixing apparatus including n material tanks, n being a positive integer greater than or equal to 2, the method including: constructing a multi-agent reinforcement learning model with each material tank as an independent agent, where model parameters of the multi-agent reinforcement learning model include a state, an action, and a reward, with the state including an actual weight of each material tank, the action including adjusting a feeding speed of a single material tank, and the reward involving giving a positive reward if a mixing proportion reaches a target proportion; training the multi-agent reinforcement learning model to obtain a trained model; obtaining a current state of each of the n material tanks in the raw material mixing apparatus, inputting the current state into the trained model, and outputting, by the trained model, a target action corresponding to the current state of each of the material tanks; and controlling an action of each of the material tanks to be the target action.
[0010] In an embodiment of the present application, the step of constructing a multi-agent reinforcement learning model includes: obtaining n policies corresponding to n agents; calculating a cumulative expected reward of each agent according to the n policies; estimating a policy gradient of each agent according to the cumulative expected reward, the policy gradient being related to an action value function of the agent; predicting the action value function by using a Transformer network, so as to obtain a prediction function; and obtaining a deterministic policy gradient under a deterministic policy by using the prediction function.
[0011] In an embodiment of the present application, the step of calculating a cumulative expected reward of each agent according to the n policies includes:
[0012] calculating a cumulative expected reward J (θi) of an ith agent by using the following formula:
[0013] where θ = [θ1, θ2, …, θn] represents policy parameters of the n agents, θi represents a policy parameter of the ith agent, π= [π1, π2, …, πn] represents the policies of the n agents, represents a policy executed by the ith agent with the policy parameter θi, represents an action ai of the ith agent under the policy pπ represents a probability that an agent is in a state s under the policy π, γ represents a conversion factor, t represents a time step at which the agent performs an action, ai represents an action taken by the ith agent, and ri, t represents an instant reward obtained by the ith agent after taking the action ai at the tth time step.
[0014] In an embodiment of the present application, the step of estimating a policy gradient of each agent according to the cumulative expected reward includes: calculating the estimated policy gradient J (θi) of the ith agent by using the following formula:
[0015] where oi represents an observation of the ith agent, x= [o1, o2, …, On] represents an observed vector, that is, a state of the multi-agent reinforcement learning model, represents an action value function of the ith agent, and represents an optimization function of the policy gradient.
[0016] In an embodiment of the present application, the prediction function is obtained by using the following formula:
[0017] where Attention represents a Transformer attention model, MLP represents a fully connected layer, represents the prediction function, and where the Transformer attention model is used to process the state x into a vector of a fixed length.
[0018] In an embodiment of the present application, the step of obtaining a deterministic policy gradient under a deterministic policy by using the prediction function includes:
[0019] calculating the deterministic policy gradient of the ith agent by using the following formula:
[0020] where D represents an experience store which contains a tuple (x, x′1, a1, …, an,r1, …, rn) representing rewards r1, …, rn obtained by an agent when executing actions a1, …, an in the state x, and actions taken by the agent in the next state x′, and represents the optimization function of the deterministic policy gradient.
[0021] In an embodiment of the present application, a loss function corresponding to the optimization function of the deterministic policy gradient of the ith agent is:
[0022] where is a set of target policies each having a delay parameter θ′i, ri represents an instant reward obtained by the ith agent after taking the action ai, and j represents a jth agent, with j = i + 1.
[0023] In an embodiment of the present application, the step of predicting the action value function by using a Transformer network includes: inputting the state x into the Transformer network, and outputting, by the Transformer network, a state-encoded vector hx=Encoder (x) of a length d, wherein Encoder represents an encoder in a Transformer structure; representing the action ai of each agent as a one-hot-encoded vector bi, and concatenating the one-hot-encoded vector bi with the state-encoded vector hx to form an input vector vi= [hx, bi] , where bi=β1a1+…+βnan, with β1+…+βn=1; and inputting the input vector vi into the Transformer network to obtain the prediction function where the Transformer network includes the Transformer attention model and the fully connected layer.
[0024] In an embodiment of the present application, after being inputted into the Transformer network, the state x is preprocessed by using the following formula:
[0025] Inputnew=TEM (Inputorigin) + (PE×OutputEPL)
[0026] where Inputorigin represents the state x, TEM represents a word embedding module, PE represents position encoding, OutputEPL represents an output of an external parameter layer (EPL) which is updated in real time during model training, and Inputnew represents a new state into the Transformer network after preprocessing.
[0027] In an embodiment of the present application, the Transformer network includes at least two multi-layer perceptrons and at least two multi-head attention modules.
[0028] In an embodiment of the present application, the multi-layer perceptrons and the multi-head attention modules process the new state Inputnew by using the following formulas:
[0029] InoutMHAM=MLP1 (Inputnew) +MLP2 (Inputnwe)
[0030] where MLP is a multi-layer perceptron containing a plurality of fully connected layers, InoutMHAM represents an input of the multi-head attention module, represents an output of the multi-head attention module, MHAM represents the multi-head attention module, and RC represents a residual connection.
[0031] In an embodiment of the present application, the Transformer network further includes a regularization layer (NL) and a feedforward network layer (FFN) , and the output of the multi-head attention modules further undergoes processing steps represented by the following formulas:
[0032] Output=NL (RC (NLoutput) +FFN (NLoutput) )
[0033] where represents an output of an nth multi-head attention module, and Output represents an output of the Transformer network.
[0034] In an embodiment of the present application, the Transformer network outputs the state-encoded vector hx=Encoder (x) after performing execution a plurality of times.
[0035] In an embodiment of the present application, the state further includes any of the following: the feeding speed of each material tank, an inclined state of each material tank, a temperature and a humidity of each material tank, a temperature of a mixing pool, a proportion of a mixture in the mixing pool, and a distance between each material tank and the mixing pool.
[0036] In an embodiment of the present application, the action further includes any of the following: adjusting a stirring speed of a mixing pool, adjusting a posture of a material tank, adjusting a position of a material tank outlet, and adjusting a distance between a material tank and the mixing pool.
[0037] In an embodiment of the present application, the reward further involves any of the following: giving a negative reward if the mixing proportion deviates from the target proportion; giving the negative reward if the material tank has a problem such as the inclination or a weight abnormality; giving the positive reward if a task is completed within a specified time; giving the positive reward if a device has short failure time or downtime after the task is completed; and giving the positive reward if no fault occurs in the device after the task is completed.
[0038] In an embodiment of the present application, the method further includes: establishing a time-sensitive network, where each material tank is regarded as a slave node in the time-sensitive network, and a master node is set, which synchronizes a clock of each slave node in real time when the raw material mixing apparatus is operating.
[0039] In order to solve the above technical problem, the present application further presents a raw material mixing control system based on multi-agent reinforcement learning, which is used to control a raw material mixing apparatus including n material tanks, n being a positive integer greater than or equal to 2, the system including: a memory configured to store instructions executable by a controller; and the controller configured to execute the instructions to implement the method described above.
[0040] To solve the above-mentioned technical problem, the present application further proposes a computer-readable medium storing computer program code, where when the computer program code is executed by a processor, the method described above is implemented.
[0041] The raw material mixing control method of the present application uses the multi-agent reinforcement learning model to highly intelligently control the action of each material tank, which is highly precise and easy to operate, without a need for human intervention, thereby enabling intelligent control of the raw material mixing apparatus. The use of the Transformer structure instead of a conventional neural network structure may accelerate the convergence of the model, and improve the prediction precision. In addition, the combination with the time-sensitive network further improves the real-time performance of the system, and can ensure reliable transmission of data,thereby improving the stability of the system.Brief Description of the Drawings
[0042] The accompanying drawings are included to provide a further understanding of the present application and are incorporated in and constitute a part of the present application, show the embodiments of the present application, and serve to, together with the present application, explain the principles of the present application. In the accompanying drawings:
[0043] FIG. 1 is an exemplary flowchart of a raw material mixing control method according to an embodiment of the present application;
[0044] FIG. 2 is an exemplary schematic diagram of a structure of a multi-agent reinforcement learning model;
[0045] FIG. 3 is a Transformer network structure according to an embodiment of the present application;
[0046] FIG. 4 is a schematic diagram of a structure of a raw material mixing control system according to an embodiment of the present application; and
[0047] FIG. 5 is a system block diagram of a raw material mixing control system according to an embodiment of the present application.Detailed Description of Embodiments
[0048] To describe the technical solutions in embodiments of the present application more clearly, the accompanying drawings required for describing the embodiments will be briefly described below. Apparently, the accompanying drawings in the following description show merely some examples or embodiments of the present application, and those of ordinary skill in the art may also apply the present application to other similar scenarios according to these accompanying drawings without any creative effort. Unless it is obvious from the context or otherwise stated, the same reference numerals in the accompanying drawings represent the same structure or operation.
[0049] As shown in the present application and the claims, unless the context expressly indicates otherwise, the words ″a″ , ″an″ , ″said″ , and / or ″the″ do not specifically refer to the singular, but may also include the plural. Generally,the terms ″include″ and ″comprise″ only suggest that the expressly identified steps and elements are included, but these steps and elements do not constitute an exclusive list, and the method or device may further include other steps or elements.
[0050] Unless specifically stated otherwise, the relative arrangement of components and steps, numerical expressions, and numerical values set forth in these embodiments do not limit the scope of the present application. In addition, it should be understood that, for ease of description, the sizes of various parts shown in the accompanying drawings are not drawn to scale. The technologies, methods, and devices known to those of ordinary skill in the related art may not be discussed in detail, but where appropriate, the technologies, methods, and devices should be regarded as part of the authorized specification. In all examples shown and discussed here, any specific value should be interpreted as merely exemplary and not as limiting.Therefore, other examples of the exemplary embodiment may have different values. It should be noted that similar reference numerals and letters refer to similar items in the following accompanying drawings. Therefore, once a specific item is defined in one of the accompanying drawings, there is no need for further discussion on the item in the subsequent accompanying drawings.
[0051] In addition, it should be noted that the use of words such as “first” and “second” to define parts is merely for the convenience of distinguishing between corresponding parts. Unless otherwise stated, the above words have no special meaning and therefore cannot be understood as limitation of the protection scope of the present application. Furthermore, although the terms used in the present application are selected from well-known common terms, some of the terms mentioned in the specification of the present application may have been selected by the applicant according to his or her determination, and the detailed meaning thereof is described in the relevant section described herein. Furthermore, the present application must be understood, not simply by the actual terms used but also by the meanings encompassed by each term.
[0052] In the present application, a flowchart is used to illustrate the operations performed by a system according to the embodiments of the present application. It should be understood that the preceding or following operations are not necessarily performed exactly in order. Instead, the various steps may be processed in reverse order or simultaneously. In addition, other operations are added to these processes, or operations of a certain step or several steps are removed from these processes.
[0053] The raw material mixing control method of the present application is used to control a raw material mixing apparatus including n material tanks, where n is a positive integer greater than or equal to 2. The function of the raw material mixing apparatus is to input materials from each of the n material tanks into a raw material mixing pool to form a required raw material mixture. Each material tank has a corresponding group of sensors. The group of sensors may include a load cell, a flow meter, a temperature and humidity sensor, a distance sensor, etc., which are used to obtain, in real time or regularly, a weight, a feeding speed, an inclined state, a temperature, and a humidity, of the material tank, a proportion of the mixture, a distance between the material tank and the mixing pool, etc. Therefore, it may be considered that all the parameter information required in the raw material control method of the present application are available. The present application does not limit specific raw materials.
[0054] FIG. 1 is an exemplary flowchart of a raw material mixing control method according to an embodiment of the present application. Referring to FIG. 1, the raw material mixing control method according to this embodiment includes the following steps:
[0055] Step S110: constructing a multi-agent reinforcement learning model with each material tank as an independent agent, where model parameters of the multi-agent reinforcement learning model include a state, an action, and a reward, with the state including an actual weight of each material tank, the action including adjusting a feeding speed of a single material tank, and the reward involving giving a positive reward if a mixing proportion reaches a target proportion;
[0056] Step S120: training the multi-agent reinforcement learning model to obtain a trained model;
[0057] Step S130: obtaining a current state of each of n material tanks in a raw material mixing apparatus, inputting the current state into the trained model, and outputting, by the trained model, a target action corresponding to the current state of each of the material tanks; and
[0058] Step S140: controlling an action of each of the material tanks to be the target action.
[0059] The raw material mixing control method according to the present application may use the multi-agent reinforcement learning model to highly intelligently control the action of each material tank, which is highly precise and easy to operate, without a need for human intervention, thereby enabling intelligent control of the raw material mixing apparatus. The above steps S110 to S140 will be described in detail below.
[0060] FIG. 2 is an exemplary schematic diagram of a structure of a multi-agent reinforcement learning model. Referring to FIG. 2, the multi-agent reinforcement learning model includes a plurality of agents, e.g., agents 1 to n, corresponding to n material tanks with each material tank as an independent agent.
[0061] A structure of the multi-agent reinforcement learning model constructed in step S110 is shown in FIG. 2. Each agent has a corresponding observation, action, policy, and reward. In a Markov process, a learner and decision-maker is called an agent, and a part that interacts with the agent is called an environment. The agent continuously interacts with the environment.Such interaction process can be considered to have a plurality of moments. At each moment, the agent selects an action based on a state of the environment and according to a specific policy, the environment transitions to the next state at a specific state transition probability, and a reward is fed back to the agent based on the state at that moment. The agent can adjust its policy based on feedback from the environment, and learn from the environment until an optimal policy that can obtain most rewards or an optimal reward is ultimately learned. A complete Markov decision process may be represented by a sequence consisting of the state, the action, and the reward at each moment.The observation shown in FIG. 2 is an observed state of the environment. In the present application, the state includes at least an actual weight of each material tank, the action includes at least adjusting a feeding speed of a single material tank, and the reward involves at least giving a positive reward if a mixing proportion reaches a target proportion.
[0062] In some embodiments, the state further includes any of the following:the feeding speed of each material tank, an inclined state of each material tank, a temperature and a humidity of each material tank, a temperature of a mixing pool, a proportion of a mixture in the mixing pool, and a distance between each material tank and the mixing pool. It should be noted that in order to obtain the state, the raw material mixing apparatus should also be equipped with a corresponding signal sensing apparatus, such as a load cell, a flow meter, an accelerometer, a temperature and humidity meter, a distance sensor, etc.
[0063] In some embodiments, the action further includes any of the following: adjusting a stirring speed of a mixing pool, adjusting a posture of a material tank, adjusting a position of a material tank outlet, and adjusting a distance between a material tank and the mixing pool. Likewise, in order to perform the action, the raw material mixing apparatus should be equipped with a corresponding adjustment apparatus.
[0064] In some embodiments, the reward further involves any of the following:
[0065] giving a negative reward if the mixing proportion deviates from the target proportion;
[0066] giving the negative reward if the material tank has a problem such as the inclination or a weight abnormality;
[0067] giving the positive reward if a task is completed within a specified time;
[0068] giving the positive reward if a device has short failure time or downtime after the task is completed; and
[0069] giving the positive reward if no fault occurs in the device after the task is completed.
[0070] The above positive rewards and negative rewards all belong to the rewards shown in FIG. 2. It can be understood that positive rewards and negative rewards are opposite, and their corresponding adjustment directions can also be opposite.
[0071] In step S120, relevant data sets are collected to train the constructed multi-agent reinforcement learning model, so as to obtain the trained model.
[0072] In some embodiments, the step of constructing a multi-agent reinforcement learning model includes:
[0073] step S210: obtaining n policies corresponding to the n agents;
[0074] step S220: calculating a cumulative expected reward of each agent according to the n policies;
[0075] step S230: estimating a policy gradient of each agent according to the cumulative expected reward, the policy gradient being related to an action value function of the agent;
[0076] step S240: predicting the action value function by using a Transformer network, so as to obtain a prediction function; and
[0077] step S250: obtaining a deterministic policy gradient under a deterministic policy by using the prediction function.
[0078] In step S210, the policies are function approximators with adjustable parameters, such as deep neural networks. θ= [θ1, θ2, …, θn] is used to represent policy parameters of the n agents, and π= [π1, π2, …, πn] is used to represent the policies of the n agents. During a model learning process, the policy parameters are continuously updated based on actions, states, and rewards, to find the optimal policy that maximizes an expected cumulative long-term reward received during a task. The policy of each agent is a probability distribution over its action space.
[0079] In step S220, a cumulative expected reward J (θi) of an ith agent can be calculated by using the following formula:
[0080] where θ= [θ1, θ2, …, θn] represents policy parameters of the n agents, θi represents a policy parameter of the ith agent, π= [π1, π2, …, πn] represents the policies of the n agents, represents a policy executed by the ith agent with the policy parameter θi, represents an action ai of the ith agent under the policy pπ represents a probability that an agent is in a state s under the policy π, γ represents a conversion factor, t represents a time step at which the agent performs an action, ai represents an action taken by the ith agent, and ri, t represents an instant reward obtained by the ith agent after taking the action ai at the tth time step.
[0081] In step S230, the estimated policy gradient J (θi) of the ith agent can be calculated by using the following formula:
[0082] where oi represents an observation of the ith agent, x= [o1, o2, …, on] represents an observed vector, that is, a state of the multi-agent reinforcement learning model, represents an action value function of the ith agent, and represents an optimization function of the policy gradient.
[0083] In step S240, the prediction function can be obtained by using the following formula:
[0084] where Attention represents a Transformer attention model, MLP represents a fully connected layer, represents the prediction function, and where the Transformer attention model is used to process the state x into a vector of a fixed length.
[0085] It should be noted that the use of the Transformer network structure by the present application instead of a conventional neural network structure may accelerate the convergence of the model, and improve the prediction precision. The Transformer network usually includes an encoder and a decoder. FIG. 3 is a Transformer network according to an embodiment of the present application, where two multi-layer perceptrons and multi-head attention modules are part of structures of an encoder and a decoder, respectively. In the Transformer structure, the encoder and decoder usually have the same structure, and a data processing process of encoding and decoding is jointly implemented through multi-layer perceptrons 310 and 311, and multi-head attention modules 320 and 321.
[0086] In some embodiments, the step of predicting the action value function by using a Transformer network includes:
[0087] step S241: inputting the state x into the Transformer network, and outputting, by the Transformer network, a state-encoded vector hx=Encoder (x) of a length d, where Encoder represents an encoder in a Transformer structure, d may be a preset fixed value, and according to this step, the length of the state-encoded vector is d regardless of the length of the state x;
[0088] step S242: representing the action ai of each agent as a one-hot-encoded vector bi, and concatenating the one-hot-encoded vector bi with the state-encoded vector hx to form an input vector vi= [hx, bi] , where bi=β1a1+…+βnan, with β1+…+βn=1; and
[0089] step S243: inputting the input vector vi into the Transformer network to obtain the prediction function where the Transformer network includes the Transformer attention model and the fully connected layer. Referring to FIG. 3, a Transformer attention model includes the two multi-head attention modules 320 and 321, and each of the multi-layer perceptrons 310 and 311 includes a plurality of fully connected layers.
[0090] In the embodiment shown in FIG. 3, the Transformer network includes the two multi-layer perceptrons 310 and 311 and the two multi-head attention modules 320 and 321. In other embodiments, other numbers of multi-layer perceptrons and multi-head attention modules may be included.
[0091] Referring to FIG. 3, after being inputted into the Transformer network, the state x is preprocessed by using the following formula:
[0092] Inputnew=TEM (Inputorigin) + (PE×OutputEPL) (4)
[0093] where Inputorigin represents the state x, TEM represents a word embedding module 331, PE represents position encoding 332, OutputEPL represents an output of an external parameter layer 333 (EPL) which is updated in real time during model training, and Inputnew represents a new state into the Transformer network after preprocessing. The position encoding 332 is performed based on true values of actions, rewards, and states, and may be token encoding in a language model. The external parameter layer is a self-trained parameter module used to correct the position encoding.
[0094] In some embodiments, the multi-layer perceptrons and multi-head attention modules use the following formulas to process the new state Inputnew:
[0095] InoutMHAM=MLP1 (Inputnew) +MLP2 (Inputnew) (5)
[0096] where MLP is a multi-layer perceptron containing a plurality of fully connected layers, InoutMHAM represents an input of the multi-head attention module, represents an output of one of the multi-head attention modules, MHAM represents the multi-head attention modules, and RC represents a residual connection.
[0097] Referring to FIG. 3, the Transformer network further includes a regularization layer 340 (NL) and a feedforward network layer 350 (FFN) , and the output of the multi-head attention modules further undergoes processing steps represented by the following formulas:
[0098] Output=NL (RC (NLoutput) +FFN (NLoutput) ) (8)
[0099] where represents an output of an nth multi-head attention module, and Output represents an output of the Transformer network.
[0100] Referring to FIG. 3, the Transformer network outputs the state-encoded vector hx=Encoder (x) after performing execution N times. In some embodiments, N = 6. The number N can be determined based on a comprehensive evaluation result of the rewards and the actions.
[0101] In step S250, calculating the deterministic policy gradient of the ith agent by using the following formula:
[0102] where D represents an experience store which contains a tuple (x, x′, a1, …, an,r1, …, rn) representing rewards r1, …, rn obtained by an agent when executing actions a1, …, an in the state x, and actions taken by the agent in the next state x′, and represents the optimization function of the deterministic policy gradient.
[0103] In order to obtain an optimal solution of the optimization function, the following loss function can be used:
[0104] where is a set of target policies each having a delay parameter θ′i, ri represents an instant reward obtained by the ith agent after taking the action ai, and j represents a jth agent, with j = i + 1.
[0105] According to the steps described above, the deterministic policy gradient may be obtained, and the policy of each agent may be adjusted. After the multi-agent reinforcement learning model is trained, optimal model parameters thereof can be obtained. In the present application, the above multi-agent reinforcement learning model is constructed, which, through training, makes it possible for a raw material mixing control system to learn an appropriate working state, ensuring normal operation of the apparatus. In addition, the raw material mixing control system further learns, in an abnormal state, how to set an appropriate discharging speed for each material tank, and a stirring speed of a mixing pool, etc. based on the current state, ensuring quickly return of the system to the normal operation. When the raw material mixing control method starts running, the control process can be completed autonomously, which reduces or even eliminates the need for manual intervention, thereby greatly improving the efficiency of system operation, as well as the stability and robustness of the mixing control system.
[0106] FIG. 4 is a schematic diagram of a structure of a raw material mixing control system according to an embodiment of the present application.Referring to FIG. 4, the raw material mixing control system 400 includes n material tanks and a system control end 410. The system control end 410 establishes a communication connection with each material tank, and each material tank is also connected to a raw material mixing pool 420. The raw material mixing control system shown in FIG. 4 can be used to implement the raw material mixing control method described above. The system control end 410 may specifically be implemented as a computer program carrier, a server, a computer, etc.
[0107] Specifically, in some embodiments, the raw material mixing control method further includes: establishing a time-sensitive network (TSN) , where each material tank is regarded as a slave node in the time-sensitive network, and a master node is set, which synchronizes a clock of each slave node in real time when the raw material mixing apparatus is operating. Referring to FIG. 4, after the TSN is established, the system control end 410 is used as the TSN master node, and each material tank is used as the TSN slave node. As shown in FIG. 4, a data flow between the TSN master node and each TSN slave node is bidirectional, which ensures information interaction between each material tank and the system control end 410, and also allows each material tank to share its own information with other material tanks.
[0108] The TSN network can provide a high-precision clock synchronization mechanism, so that the time of different nodes are synchronized to the nanosecond level, thereby enabling high-precision data synchronization between the different nodes. When the entire system starts running, the TSN master node may synchronize the clock of each TSN slave node to achieve real-time data transmission. In addition, the simultaneous transmission of a plurality of data streams may be supported by the TSN, and the control of flow may enable priority transmission of real-time data, thereby ensuring real-time performance. The TSN also supports priority setting of the data streams, which can prioritize different data streams to ensure timely transmission of high-priority data streams, and further improve the real-time performance of the system. In addition, the TSN can ensure the timeliness of the real-time data by ensuring a network delay, thereby making the system more reliable.Furthermore, it can ensure the reliable transmission of data by means of a data redundancy and retransmission mechanism, thereby improving the stability of the system. The TSN ensures the real-time performance and reliability of data interaction in the raw material mixing control system 400 of the present application. The raw material mixing control method according to the present application combines the TSN communication network architecture to ensure the synchronization of speed and control of each material tank, the mixing pool, and the system control end, thereby implementing distributed system control, collaborative decision-making, and resource sharing, and improving the adaptability of raw material mixing control, without the need for manual intervention.
[0109] The present application further includes a raw material mixing control system, including a memory and a processor. The memory is configured to store instructions executable by the processor. The processor is configured to execute the instructions to implement the raw material mixing control method described above.
[0110] FIG. 5 is a system block diagram of a raw material mixing control system according to an embodiment of the present application. Referring to FIG. 5, the raw material mixing control system 500 may include an internal communications bus 501, a processor 502, a read-only memory (ROM) 503, a random access memory (RAM) 504, and a communications port 505. When applied to a personal computer, the raw material mixing control system 500 may further include a hard disk 506. The internal communications bus 501 can implement data communication between components of the raw material mixing control system 500. The processor 502 can perform determination and give a prompt. In some embodiments, the processor 502 may include one or more processors. The communications port 505 can implement data communication between the raw material mixing control system 500 and the outside. In some embodiments, the raw material mixing control system 500 can receive information and data from and send information and data to a network through the communications port 505. The raw material mixing control system 500 may further include different forms of program storage units and data storage units, such as the hard disk 506, the read-only memory (ROM) 503, and the random access memory (RAM) 504, which can store various data files used for computer processing and / or communication, and possible program instructions executed by the processor 502. The processor executes these instructions to implement the main part of the method. A processing result from the processor is transmitted to user equipment through the communications port and displayed in a user interface.
[0111] The raw material mixing control method described above may be implemented as a computer program, stored in the hard disk 506, and can be loaded into the processor 502 for execution, so as to implement the raw material mixing control method of the present application.
[0112] The present application further includes a computer-readable medium storing computer program code. When the computer program code is executed by a processor, the raw material mixing control method described above is implemented.
[0113] The raw material mixing control method may also be stored, as an article of manufacture, in the computer-readable storage medium when implemented as the computer program. For example, the computer-readable storage media may include, but are not limited to, a magnetic storage device (e.g., a hard disk, a floppy disk, and a magnetic stripe) , an optical disc (e.g., a compact disc (CD) , and a digital versatile disc (DVD) ) , a smart card, and a flash memory device (e.g., an electrically erasable programmable read-only memory (EPROM) , a card, a stick, and a key driver) . In addition, various storage media described herein can represent one or more devices and / or other machine-readable media for storing information. The term ″machine-readable medium″ may include, but is not limited to, wireless channels and various other media (and / or storage media) capable of storing, containing, and / or carrying code and / or instructions and / or data.
[0114] It should be understood that the embodiments described above are merely illustrative. The embodiments described herein can be implemented in hardware, software, firmware, middleware, microcode, or any combination thereof. For hardware implementation, the processor may be implemented in one or more application-specific integrated circuits (ASIC) , digital signal processors (DSP) , digital signal processing devices (DSPD) , programmable logic devices (PLD) , field programmable gate arrays (FPGA) , processors, controllers, microcontrollers, microprocessors, and / or other electronic units designed to perform the functions described herein, or a combination thereof.
[0115] Some aspects of the present application may be completely executed by hardware, or may be completely executed by software (including firmware, resident software, microcode, etc. ) , or may be executed by a combination of hardware and software. The hardware or software described above may all be referred to as ″data block″ , ″module″ , ″engine″ , ″unit″ , ″component″ , or ″system″ . The processor may be one or more application-specific integrated circuits (ASIC) , digital signal processors (DSP) , digital signal processing devices (DAPD) , programmable logic devices (PLD) , field-programmable gate arrays (FPGA) , processors, controllers, microcontrollers,microprocessors, or a combination thereof. In addition, various aspects of the present application may be embodied as a computer product in one or more computer-readable media, and the product includes computer-readable program code. For example, the computer-readable media may include, but are not limited to, a magnetic storage device (e.g., a hard disk, a floppy disk, a tape... ) , an optical disc (e.g., a compact disc (CD) , a digital versatile disc (DVD) ... ) , a smart card, and a flash memory device (e.g., a card, a stick, a key driver... ) .
[0116] The computer-readable medium may include a propagation data signal containing computer program code, for example, on a baseband or as a part of a carrier. The propagation signal may take various forms, including an electromagnetic form, an optical form, etc., or a suitable combination form.The computer-readable medium may be any computer-readable medium other than a computer-readable storage medium. The medium may be connected to an instruction execution system, apparatus, or device to implement communication, propagation, or transmission of a program for use. The program code located on the computer-readable medium can be propagated through any suitable medium, including radio, a cable, a fiber-optic cable, a radio frequency signal, or a similar medium, or any combination of the foregoing media.
[0117] The basic concepts have been described above. Obviously, for those skilled in the art, the foregoing disclosure of the present invention is merely an example, and does not constitute a limitation to the present application. Those skilled in the art may make various modifications, improvements, and amendments to the present application, although it is not explicitly stated here. Such modifications, improvements, and amendments are suggested in the present application, and therefore, such modifications, improvements, and amendments still fall within the spirit and scope of exemplary embodiments of the present application.
[0118] Also, the present application uses specific words to describe the embodiments of the present application. For example, ″one embodiment″ , ″an embodiment″ , and / or ″some embodiments″ mean a feature, structure, or characteristic associated with at least one embodiment of the present application. Therefore, it should be emphasized and noted that two or more references to ″an embodiment″ , ″one embodiment″ , or ″an alternative embodiment″ in various places in this specification do not necessarily indicate the same embodiment. In addition, some features, structures, or characteristics in one or more embodiments of the present application may be combined appropriately.
[0119] In some embodiments, numbers for describing the number of compositions and attributes are used. It should be understood that such numbers used in the description of the embodiments are modified by the modifier ″about″ , ″approximately″ , or ″substantially″ in some examples. Unless otherwise stated, ″about″ , ″approximately″ , or ″substantially″ indicates that the number is allowed to vary by ±20%. Correspondingly, in some embodiments, the numerical parameters used in the specification and claims are approximate values, and the approximate values can be changed according to the required characteristics of individual embodiments. In some embodiments, for the numerical parameters, the specified significant digits should be taken into consideration, and a general digit reservation method should be used. Although the numerical ranges and parameters used to confirm the breadth of the ranges of the numerical parameters in some embodiments of the present application are approximate values, such numerical values need to be set as precisely as possible within a feasible range in specific embodiments.
Claims
1.A raw material mixing control method based on multi-agent reinforcement learning, which is used to control a raw material mixing apparatus comprising n material tanks, n being a positive integer greater than or equal to 2, characterized in that the method comprises:constructing a multi-agent reinforcement learning model with each material tank as an independent agent, wherein model parameters of the multi-agent reinforcement learning model comprise a state, an action, and a reward, with the state comprising an actual weight of each material tank, the action comprising adjusting a feeding speed of a single material tank, and the reward involving giving a positive reward if a mixing proportion reaches a target proportion;training the multi-agent reinforcement learning model to obtain a trained model;obtaining a current state of each of the n material tanks in the raw material mixing apparatus, inputting the current state into the trained model, and outputting, by the trained model, a target action corresponding to the current state of each of the material tanks; and controlling an action of each of the material tanks to be the target action.2.The raw material mixing control method according to claim 1, characterized in that the step of constructing a multi-agent reinforcement learning model comprises:obtaining n policies corresponding to n agents;calculating a cumulative expected reward of each agent according to the n policies;estimating a policy gradient of each agent according to the cumulative expected reward, the policy gradient being related to an action value function of the agent;predicting the action value function by using a Transformer network, so as to obtain a prediction function; andobtaining a deterministic policy gradient under a deterministic policy by using the prediction function.3.The raw material mixing control method according to claim 2, characterized in that the step of calculating a cumulative expected reward of each agent according to the n policies comprises:calculating a cumulative expected reward J (θi) of an ith agent by using the following formula:wherein θ= [θ1, θ2, ..., θn] represents policy parameters of the n agents, θi represents a policy parameter of the ith agent, π= [π1, π2, ..., πn] represents the policies of the n agents, represents a policy executed by the ith agent with the policy parameter θi, represents an action ai of the ith agent under the policypπ represents a probability that an agent is in a state s under the policy π, γ represents a conversion factor, t represents a time step at which the agent performs an action, ai represents an action taken by the ith agent, and ri, t represents an instant reward obtained by the ith agent after taking the action ai at the tth time step.4.The raw material mixing control method according to claim 3, characterized in that the step of estimating a policy gradient of each agent according to the cumulative expected reward comprises: calculating the estimated policy gradient J (θi) of the ith agent by using the following formula: wherein oi represents an observation of the ith agent, x= [o1, o2, ..., on] represents an observed vector, that is, a state of the multi-agent reinforcement learning model, represents an action value function of the ith agent, andrepresents an optimization function of the policy gradient.5.The raw material mixing control method according to claim 4, characterized in that the prediction function is obtained by using the following formula: wherein Attention represents a Transformer attention model, MLP represents a fully connected layer, represents the prediction function, and wherein the Transformer attention model is used to process the state x into a vector of a fixed length.6.The raw material mixing control method according to claim 5, characterized in that the step of obtaining a deterministic policy gradient under a deterministic policy by using the prediction function comprises:calculating the deterministic policy gradient of the ith agent by using the following formula:wherein D represents an experience store which contains a tuple (x, x′, a1, ..., an, r1, ..., rn) representing rewards r1, ..., rn obtained by an agent when executing actions a1, ..., an in the state x, and actions taken by the agent in the next state x′, andrepresents the optimization function of the deterministic policy gradient.7.The raw material mixing control method according to claim 6, characterized in that a loss function corresponding to the optimization function of the deterministic policy gradient of the ith agent is: whereinis a set of target policies each having a delay parameter θ′i, ri represents an instant reward obtained by the ith agent after taking the action ai, and j represents a jth agent, with j = i + 1.8.The raw material mixing control method according to claim 5, characterized in that the step of predicting the action value function by using a Transformer network comprises:inputting the state x into the Transformer network, and outputting, by the Transformer network, a state-encoded vector hx=Encoder (x) of a length d, wherein Encoder represents an encoder in a Transformer structure;representing the action ai of each agent as a one-hot-encoded vector bi, and concatenating the one-hot-encoded vector bi with the state-encoded vector hx to form an input vector vi= [hx, bi] , wherein bi=β1a1+…+βnan, with β1+…+βn=1; andinputting the input vector vi into the Transformer network to obtain the prediction functionwherein the Transformer network comprises the Transformer attention model and the fully connected layer.9.The raw material mixing control method according to claim 8, characterized in that after being inputted into the Transformer network, the state x is preprocessed by using the following formula: Inputnew=TEM (Inputorigin) + (PE×OutputEPL)wherein Inputorigin represents the state x, TEM represents a word embedding module, PE represents position encoding, OutputEPL represents an output of an external parameter layer (EPL) which is updated in real time during model training, and Inputnew represents a new state into the Transformer network after preprocessing.10.The raw material mixing control method according to claim 9, characterized in that the Transformer network comprises at least two multi-layer perceptrons and at least two multi-head attention modules.11.The raw material mixing control method according to claim 10, characterized in that the multi-layer perceptrons and the multi-head attention modules process the new state Inputnew by using the following formulas: InoutMHAM=MLP1 (Inputnew) +MLP2 (Inputnew) wherein MLP is a multi-layer perceptron containing a plurality of fully connected layers, InoutMHAM represents an input of the multi-head attention module, represents an output of the multi-head attention module, MHAM represents the multi-head attention module, and RC represents a residual connection.12.The raw material mixing control method according to claim 11, characterized in that the Transformer network further comprises a regularization layer (NL) and a feedforward network layer (FFN) , and the output of the multi-head attention module further undergoes processing steps represented by the following formulas: Output=NL (RC (NLoutput) +FFN (NLoutput) )whereinrepresents an output of an nth multi-head attention module, and Output represents an output of the Transformer network.13.The raw material mixing control method according to claim 12, characterized in that the Transformer network outputs the state-encoded vector hx=Encoder (x) after performing execution a plurality of times.14.The raw material mixing control method according to claim 1, characterized in that the state further comprises any of the following: the feeding speed of each material tank, an inclined state of each material tank, a temperature and a humidity of each material tank, a temperature of a mixing pool, a proportion of a mixture in the mixing pool, and a distance between each material tank and the mixing pool.15.The raw material mixing control method according to claim 1, characterized in that the action further comprises any of the following: adjusting a stirring speed of a mixing pool, adjusting a posture of a material tank, adjusting a position of a material tank outlet, and adjusting a distance between a material tank and the mixing pool.16.The raw material mixing control method according to claim 1, characterized in that the reward further involves any of the following:giving a negative reward if the mixing proportion deviates from the target proportion;giving the negative reward if the material tank has a problem such as the inclination or a weight abnormality;giving the positive reward if a task is completed within a specified time;giving the positive reward if a device has short failure time or downtime after the task is completed; andgiving the positive reward if no fault occurs in the device after the task is completed.17.The raw material mixing control method according to claim 1, characterized by further comprising: establishing a time-sensitive network, wherein each material tank is regarded as a slave node in the time-sensitive network, and a master node is set, which synchronizes a clock of each slave node in real time when the raw material mixing apparatus is operating.18.A raw material mixing control system based on multi-agent reinforcement learning, which is used to control a raw material mixing apparatus comprising n material tanks, n being a positive integer greater than or equal to 2, characterized in that the system comprises:a memory configured to store instructions executable by a controller; andthe controller configured to execute the instructions to implement a method according to any one of claims 1 to 17.19.A computer-readable medium storing computer program code, wherein when the computer program code is executed by a processor, a method according to any one of claims 1 to 17 is implemented.