Particle accelerator system ring parameter online intelligent regulation method and device based on large language model
By adopting an online intelligent control method for the loop parameters of a particle accelerator system based on a large language model, the automatic tuning of PI parameters is realized, which solves the problems of long time consumption and reliance on manual adjustment in the existing technology, and improves the debugging efficiency and system adaptability.
Patent Information
- Application Number
- CN202510648827.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-20
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2045-05-20
AI Technical Summary
In existing technologies, the PI parameter tuning process is time-consuming and inefficient, making it difficult to achieve intelligent optimization and adaptive adjustment. Furthermore, relying on manual adjustment results in discrepancies, and the workload is enormous, especially in large accelerators.
An online intelligent control method for loop parameters of a particle accelerator system based on a large language model is adopted. By acquiring the operating data of the radio frequency cavity in real time, the system status is analyzed using a large language model, the PI parameter values are inferred, and a rationality check is performed, ultimately achieving automated PI parameter optimization.
It has achieved full automation of PI parameter tuning in LLRF systems, improving debugging efficiency by 4 to 5 times, reducing manual debugging time and professional skill requirements, and is adaptable to different types of LLRF systems.
Smart Images

Figure CN120583579B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method, apparatus, device, and medium for online intelligent control of loop parameters in a particle accelerator system based on a large language model, and pertains to the field of particle accelerators. Background Technology
[0002] With the rapid development of microelectronics technology, new-generation particle accelerator devices generally adopt digital low-level radio-frequency (LLRF) systems. Among them, digital proportional-integral (PI) controllers are widely used due to their advantages such as simple structure, model independence, good adaptability and high reliability.
[0003] Tuning and optimizing PI parameters is crucial for improving the performance of LLRF systems. In the low-level radio frequency (RF) domain, the stability of the RF field directly affects beam current performance and is a key factor determining LLRF system performance. Furthermore, the nonlinearity of the RF power source and the Lorentz detuning of the RF cavity increase the complexity of parameter tuning. Research teams at leading international laboratories such as the German Electron Synchrotron Radiation Facility (DESY) and the High Energy Accelerator Research Organization (KEK) in Japan typically employ two-dimensional parameter scanning methods for PI parameter tuning. While these methods can effectively obtain optimal PI parameters, the tuning process is time-consuming, inefficient, and often requires significant machine time. Moreover, they are difficult to adapt to dynamic factors such as equipment aging and changes in operating conditions.
[0004] Existing technologies also employ manual adjustment methods, gradually finding the optimal PI parameters by observing the system's response. However, this process has the following problems: First, the adjustment process heavily relies on the operator's experience and lacks objective quantitative standards, leading to significant differences in adjustment results among different operators; second, for multiple RF cavities, manual parameter adjustment is extremely labor-intensive and inefficient, especially in large accelerators where dozens or even hundreds of independent control loops may need to be adjusted.
[0005] In summary, the tuning of the PI parameter is related to the stability of the radio frequency field and the longitudinal performance of the particle beam. Current technologies struggle to achieve intelligent optimization and adaptive adjustment of the PI parameter, a problem that hinders the improvement of LLRF system performance. Summary of the Invention
[0006] This invention aims to at least solve one of the technical problems existing in the prior art. Therefore, in response to the above-mentioned problems, the purpose of this invention is to provide a method, apparatus, device, and medium for online intelligent control of loop parameters in a particle accelerator system based on a large language model. This method enables intelligent optimization and adaptive adjustment of parameters, improving system response speed, stability, and robustness, and providing technical support for the intelligent control of accelerator LLRF systems.
[0007] To achieve the above-mentioned objectives, the technical solution adopted by this invention is as follows:
[0008] In a first aspect, the present invention provides an online intelligent control method for loop parameters of a particle accelerator system based on a large language model, the method comprising:
[0009] Real-time acquisition of the RF cavity's operating data, including the current PI parameters and the RF cavity's original cavity pressure V. c and the original forward voltage V f ;
[0010] Based on the original cavity pressure V c and the original forward voltage V f Calculate the current system state parameters of the cavity and determine whether the optimization termination condition is met. If it is met, the optimization is completed and exited; otherwise, continue.
[0011] The system state parameters and PI parameter tuning objectives are transformed into a structured system state description in natural language, and task execution prompts are generated.
[0012] Based on task execution prompts, the system state is analyzed using a large language model to infer the next PI parameter value;
[0013] The output of the large language model is analyzed to accurately extract the PI parameter values, and the reasonableness of the accurately extracted PI parameter values is checked.
[0014] Apply the extracted PI parameter values and repeat the above tuning process until tuning is complete.
[0015] In some possible implementations, in an LLRF system with separate amplitude and phase control, the amplitude control loop and the phase control loop each employ independent PI controllers. The parameter tuning of the two control loops does not interfere with each other. In each PI control, K p Represents proportional gain, K i These represent integral gains, and they all act on the same control loop.
[0016] In some possible implementations, the system state parameters refer to those based on the original cavity pressure V. c and the original forward voltage V f Calculate the RMS of amplitude / phase.
[0017] In some possible implementations, when calculating the original cavity pressure V c Phase signal ∠V c and the original forward voltage V f Phase signal ∠V f The specific formula for the system state parameter RMS is:
[0018]
[0019] In the formula, n is the number of sampling points, ∠V i Represents ∠V f or ∠V c , This represents the mean.
[0020] In some possible implementations, the optimization termination condition is: the number of system interactions reaches a preset upper limit or the system stability meets preset requirements.
[0021] Some possible implementations involve analyzing the system state using a large language model based on task execution prompts to infer the next PI parameter value, including:
[0022] Construct a multi-turn inference framework to enable interaction between the large language model and the LLRF system response;
[0023] For each round of reasoning, design specific task execution prompts;
[0024] During inference, a dialogue history list is created to store the complete inference trajectory, including system state description, model inference process and parameter adjustment results;
[0025] Based on the system state description, model reasoning process, and parameter adjustment results, new parameter adjustment suggestions are generated.
[0026] Output structured tuning suggestions, including parameter K. p and K i The specific value.
[0027] Some possible implementations include parsing the output of a large language model, accurately extracting the PI parameter values, and performing a validity check on the accurately extracted PI parameter values, including:
[0028] Based on the adjustment suggestions of the large language model, a method combining regular expressions and named entity recognition is used to extract K. p and K i Numerical parameters;
[0029] Establish quantification mapping rules for fuzzy expressions;
[0030] Check the rationality of the parameters to ensure that the extracted parameters are within a safe range;
[0031] Generate parameter commands in a standard format.
[0032] Secondly, the present invention provides an online intelligent control device for loop parameters of a particle accelerator system based on a large language model, comprising:
[0033] The data acquisition module is configured to acquire the cavity operation data of the RF cavity in real time. This cavity operation data includes the current PI parameters and the original cavity pressure V of the RF cavity. c and the original forward voltage V f ;
[0034] The performance evaluation module evaluates the original chamber pressure V. c and the original forward voltage V f Calculate the current system state parameters of the cavity and determine whether the optimization termination condition is met. If it is met, the optimization is completed and exited; otherwise, continue.
[0035] The signal-to-text conversion module is configured to convert system state parameters and PI parameter tuning targets into structured system state descriptions in natural language and generate task execution prompts.
[0036] The large language model reasoning module is configured to analyze the system state based on task execution prompts using a large language model and infer the next PI parameter value.
[0037] The text parameter interpretation module is configured to parse the output of the large language model, accurately extract the PI parameter values, and perform a reasonableness check on the accurately extracted PI parameter values.
[0038] The parameter parsing and execution module is configured to apply the extracted PI parameter values and repeat the above tuning process until the tuning is complete.
[0039] Thirdly, the electronic device provided by the present invention includes: at least one processor; and a memory communicatively connected to the processor; wherein the memory stores instructions executable by the processor, the instructions being executed by the processor to enable the processor to perform the method described thereon.
[0040] Fourthly, the present invention provides a computer-readable storage medium for storing one or more programs, said one or more programs including computer instructions for causing a computer to perform the method.
[0041] Because the present invention adopts the above technical solution, it has the following characteristics:
[0042] 1. Fully automated and efficient: This invention automates the entire process of PI parameter tuning in LLRF systems without manual intervention. Compared with the traditional mesh scanning method, this invention speeds up PI optimization by 4 to 5 times, significantly improving debugging efficiency.
[0043] 2. Good scalability: This invention does not require separate model training for each device, and can be easily adapted to different types of LLRF systems through a natural language interface.
[0044] 3. High cost-effectiveness: This invention makes full use of the existing large language model capabilities, combines professional physics and control theory to achieve expert-level parameter tuning, and does not require separate training of models for different devices, thus reducing the cost of technical implementation.
[0045] In summary, this invention can be widely applied to the optimization of feedback control parameters in the radio frequency low-level system of particle accelerators. Attached Figure Description
[0046] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts. In the drawings:
[0047] Figure 1 This is a simplified diagram of the PI controller for an existing LLRF system.
[0048] Figure 2 The low-level online measurement of the radio frequency cavity voltage signal V in this embodiment of the invention c V f The experimental flowchart.
[0049] Figure 3 This is a flowchart illustrating the online optimization of loop parameters in an LLRF system based on a large language model, as described in an embodiment of the present invention.
[0050] Figure 4 The left image shows a technical background prompt template for the large language model, and the right image shows a task interaction prompt template.
[0051] Figure 5 The figure shows the intelligent optimization path of the large language model on CM2-5 in this embodiment of the invention. Four different positions were selected as K. pp ,K pi Starting from the given point, three independent test experiments were conducted for each starting position. The optimal K was marked with contour lines in the figure. pp ,K pi area.
[0052] Figure 6 The figure shows the intelligent optimization path of the large language model on CM3-5 in this embodiment of the invention. Four different positions were selected as K. pp ,K pi Starting from the given point, three independent test experiments were conducted for each starting position. The optimal K was marked with contour lines in the figure. pp ,K pi area.
[0053] Figure 7 This is a structural diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0054] It should be understood that the terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “described” as used herein may also include the plural forms. The terms “comprising,” “including,” “containing,” and “having” are inclusive and therefore indicate the presence of the stated features, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The method steps, processes, and operations described herein are not construed as requiring them to be performed in a particular order described or illustrated unless the order of performance is explicitly indicated. It should also be understood that additional or alternative steps may be used.
[0055] Although terms such as first, second, third, etc., may be used in this document to describe multiple elements, components, regions, layers, and / or segments, these elements, components, regions, layers, and / or segments should not be limited by these terms. These terms may be used only to distinguish one element, component, region, layer, or segment from another. Unless the context clearly indicates otherwise, terms such as "first," "second," and other numerical terms used herein do not imply order or sequence. Therefore, the first element, component, region, layer, or segment discussed below may be referred to as the second element, component, region, layer, or segment without departing from the teachings of the exemplary embodiments.
[0056] For ease of description, spatial relative terms may be used in the text to describe the relationship of one element or feature relative to another element or feature as shown in the figure. These relative terms include, for example, "inside," "outside," "middle," "outer," "below," "above," etc. Such spatial relative terms are intended to include different orientations of the device in use or operation, other than those depicted in the figure.
[0057] Existing methods primarily rely on grid scanning or expert experience adjustments, which cannot achieve efficient and reliable PI parameter tuning. This invention provides a method and apparatus for online intelligent control of loop parameters in a particle accelerator system based on a large language model, comprising: real-time acquisition of cavity operation data of the radio frequency cavity, wherein the cavity operation data includes the current PI parameters and the original cavity pressure V of the radio frequency cavity. c and the original forward voltage V f According to the original cavity pressure V c and the original forward voltage V fThe process involves calculating the current system state parameters of the cavity and determining whether the tuning termination condition is met. If met, the tuning is complete and exits; otherwise, it continues. The system state parameters and the PI parameter tuning target are transformed into a structured system state description in natural language, and task execution prompts are generated. Based on the task execution prompts, a large language model is used to analyze the system state and infer the next PI parameter value. The output of the large language model is parsed to accurately extract the PI parameter values, and the reasonableness of the accurately extracted PI parameter values is checked. The extracted PI parameter values are applied and executed, and the above tuning process is repeated until tuning is complete. Therefore, this invention provides an effective solution for automated PI parameter tuning, significantly reducing the time cost and professional skill requirements of manual debugging while ensuring high-quality tuning.
[0058] Exemplary embodiments of the present invention will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the invention and to fully convey its scope to those skilled in the art. The large language model used in the embodiments of the present invention is the open-source DeepSeek-R1. It should be noted that the methods described in the present invention are not limited to this model, and other large language models can be used; this is just one example, not a limitation.
[0059] Example 1: As Figure 3 As shown in this embodiment, the online intelligent control method for loop parameters of a particle accelerator system based on a large language model includes:
[0060] S1, Data Acquisition.
[0061] In this embodiment, data acquisition refers to acquiring the cavity operation data of the radio frequency cavity in real time from the LLRF system, including:
[0062] Based on the control relationship between the output and input of PI control in the radio frequency cavity, the controlled object and the parameter K to be tuned are extracted using EPICS. p and K i .
[0063] Based on online measurement of the cavity sampling signal P of the RF cavity t and cavity incident signal P f Obtain the original cavity pressure V of the radio frequency cavity. c and the original forward voltage V f .
[0064] Establish a data caching mechanism within the same group K p and K i Under the settings, several sets of raw cavity pressure V can be collected.c and the original forward voltage V f Signals are used to eliminate the effects of random errors.
[0065] S2, Performance Evaluation.
[0066] In this embodiment, the performance evaluation is based on the original cavity pressure V. c and the original forward voltage V f The system calculates the current system state parameters and determines whether the optimization termination condition is met. If the optimization termination condition is met, the optimization is completed and the system exits. If the optimization termination condition is not met, the system continues.
[0067] Furthermore, the system state parameters in this embodiment refer to those based on the original cavity pressure V. c and the original forward voltage V f Calculate the RMS of amplitude / phase.
[0068] Furthermore, the optimization termination condition in this embodiment is: the number of system interactions reaches a preset upper limit or the system stability reaches a preset requirement.
[0069] S4, Signal-to-Text Conversion.
[0070] In this embodiment, signal-to-text conversion refers to converting the extracted system state parameters and PI parameter tuning objectives into a structured system state description in natural language, and generating task execution prompts.
[0071] Furthermore, the system response characteristics are analyzed, and system state parameters such as the original cavity pressure V are extracted. c and the original forward voltage V f The calculated amplitude / phase RMS is used as an evaluation metric to measure the cavity's stability. Structured system state descriptions are generated for different response modes, yielding task execution prompts, such as "Currently V...". c The RMS phase is 0.15°, V f The RMS phase is 4.8°, V f The RMS should be kept within a reasonable range; an excessively large RMS indicates that K is not in a reasonable range. p The value is too high, while ensuring V f Minimize V under the premise of RMS stability c "The RMS of the phase".
[0072] S5, Large Language Model Reasoning.
[0073] In this embodiment, large language model inference refers to using a large language model, such as DeepSeek-R1, to analyze the system state description and infer the next PI parameter value. Specifically, it involves using a large language model to analyze the system state description, combining it with built-in specialized physics knowledge, and based on the cached historical tuning trajectory, to infer the next optimal PI parameter value: K. p and K i And provide structured adjustment suggestions.
[0074] Furthermore, the specific implementation process of large language model inference includes:
[0075] A multi-turn inference framework is constructed to enable interaction between the large language model and the LLRF system response. The multi-turn inference framework has two meanings: one is that it is difficult to complete the task through a single interaction and multiple optimizations are required, so it is set to multi-turn; the other is that the model can take into account previous decision-making ideas when it makes inferences each time.
[0076] Establish a dialogue history list to store the complete inference trajectory, including system state description, model inference process, and parameter adjustment results.
[0077] For each round of reasoning, a dedicated system prompt is designed, integrating PID control theory, RF cavity physical model, and historical empirical rules.
[0078] Based on the current system status description and historical adjustment effects, new parameter adjustment suggestions are generated. These suggestions are presented using a specific paradigm, with design prompts that clearly describe the system status and historical adjustment effects. Figure 4 As shown, this content is input into a large language model, such as deep seek-r1. The large language model will output the next step result based on the input content, that is, new parameter adjustment suggestions.
[0079] Output structured adjustment suggestions, including K p and K i The specific value.
[0080] S6, Text-Parameter Parsing.
[0081] In this embodiment, text-parameter parsing refers to processing the natural language suggestions output by the large language model to accurately extract K. p and K i Numerical parameters and a reasonableness check are performed.
[0082] Furthermore, the specific implementation process of text-parameter parsing includes:
[0083] Based on the above suggestions for adjusting the large language model, a method combining regular expressions and named entity recognition is used to extract K. p and Ki Numerical parameters, for example, for the adjustment suggestion "Kp:0.04" given by the large language model, first search for the entity Kp, and then use the regular expression "r'\d*\.?\d+" to search for the number 0.04, thereby extracting the model's suggested value.
[0084] For vague statements (such as "slightly increase K") p Establish quantization mapping rules, for example, slightly increase K. p The next step is to increase the recommended step size of Kp by 1 / 5 from the original value.
[0085] Parameter rationality check ensures that the extracted parameters are within a safe range. For example, a search area is given, and if the value is outside the search area, the value is pruned so that the maximum and minimum values do not exceed the boundary.
[0086] Generate parameter commands in a standard format, such as "SET_KP=0.1,SET_KI=0.005".
[0087] S7, Parameter Execution.
[0088] In this embodiment, parameter execution involves extracting parameter K. p and K i This process is automatically applied to the LLRF control system, repeating the above steps until the optimization task is completed.
[0089] Furthermore, parameter execution is responsible for applying the parsed parameters to the control system, writing the new parameter K to the LLRF controller via EPICS. p and K i The design parameters are executed and a verification mechanism is implemented to verify whether the parameters have been successfully applied through feedback.
[0090] The following detailed embodiments illustrate the practical application of the online intelligent control method for loop parameters of particle accelerator systems based on a large language model.
[0091] Example 1: The radio frequency cavity used in this example is a half-wavelength radio frequency cavity (HWR010, with a relativistic velocity of 0.1). The resonant frequency of the cavity is 162.5MHz, and the loaded quality factor Q is... L Approximately 5×10 5 .like Figure 2As shown, this invention includes an online data acquisition system comprising a digital low-level system 1, a solid-state power source 2, a directional coupler 3, an input coupler 4, a radio frequency cavity 5, a signal extraction coupler 6, and a host computer 7. The output of the digital low-level system 1 is connected to the input of the solid-state power source 2. The output of the solid-state power source 2 is connected to the input of the directional coupler 3. The output of the directional coupler 3 is fed into the radio frequency cavity 5 via the input coupler 4. The directional coupler 3 is used to extract the cavity incident signal P from the radio frequency cavity 5. f and cavity reflection signal P r The signal extraction coupler 6 is connected to the radio frequency cavity 5 to extract the cavity sampling signal P. t Cavity incident signal P f Cavity reflection signal P r and cavity sampling signal P t After down-conversion, the signal is sent to digital low-level system 1. Digital low-level system 1 is based on the cavity incident signal P. f and cavity reflection signal P r Demodulate the corresponding original cavity pressure V c and the original forward voltage V f The data is then uploaded to the host computer via the data bus.
[0092] Based on the above-mentioned online data acquisition system, the online intelligent control method for loop parameters of a particle accelerator system based on a large language model provided in this embodiment includes:
[0093] I. Data Collection.
[0094] like Figure 2 As shown, the digital low-level system 1 employs a cavity voltage amplitude / phase control method, which includes two PI control systems, with amplitude and phase adjusted separately. The adjustment principle is as follows: Figure 1 As shown. In scanning V c Amplitude PI parameter (K) ap ,K ai When ), make the PI parameter (K) of the phase pp ,K pi It remains in the optimal position and does not change. Similarly, during the scan of K... pp ,K pi At that time, keep K ap ,K ai The optimal position remains unchanged. The PI parameter tuning method for amplitude and phase is equivalent to two PI scan tasks that do not interfere with each other.
[0095] This embodiment uses the PI tuning task of cavity pressure phase as an example for each group of K. pp ,K pi First, the parameters are set into the corresponding RF cavity using EPICS. After each set of PI parameters is successfully set, six sets of raw cavity pressure V are continuously recorded.c and the original forward voltage V f It is placed in the buffer, where the original cavity pressure V c and the original forward voltage V f All data are vectors. After collecting 6 sets of data, the original cavity pressure V for each set was calculated. c Phase signal ∠V c and the original forward voltage V f Phase signal ∠V f The system state parameter RMS, used as a quantitative indicator of steady-state performance, is calculated as follows:
[0096]
[0097] In the formula, n is the number of sampling points (in CAFE2, n = 10000), ∠V i Represents ∠V f or ∠V c Each point in, This represents the mean.
[0098] Subsequently, the arithmetic mean of the six sets of system state parameters RMS after removing the maximum and minimum values was calculated, and this average value was used as the current K. pp ,K pi The representative values of the steady-state performance of the system under the parameter combinations are denoted as V. c _rms and V f _rms.
[0099] II. Design of prompting strategies for large language models.
[0100] In this embodiment, the design of the technical background framework prompts is a crucial step in ensuring that the model understands the task requirements and produces a high-quality response. The design of the technical background framework prompts in this embodiment is as follows: Figure 4 As shown, it includes the following parts:
[0101] 1) Technical background construction.
[0102] In this embodiment, the technical background is as follows: You are a professional PI control system parameter tuning expert, and your task is to optimize the parameters of an LLRF (Low Level Radio Frequency) system based on its performance indicators. This system operates in continuous wave mode.
[0103] 2) Adjust the target.
[0104] In this embodiment, the adjustment objectives include: a primary objective and parameters. The primary objective is to continuously reduce the rms of the system cavity pressure phase, and the parameters are two parameters, Kp and Ki.
[0105] 3) Expert guidance.
[0106] In this embodiment, expert experience guidance includes: 1. Prioritizing the use of historical best values as benchmarks: the optimal value of Kp is around 0.11, and adjustments are prioritized within this range; the optimal value of Ki is around 4e... -3 1. Prioritize adjustments within the vicinity of the optimal value; 2. Conduct small-scale exploration and fine-tuning within the vicinity of the optimal value; 3. Only expand the exploration range when the effect within the optimal value range is not ideal.
[0107] 4) Parameter constraints.
[0108] In this embodiment, the parameter constraints include: Kp ranging from 0.01 to 0.5 (recommended step size: 0.02); Ki ranging from 2e... -4 up to 9e -3 (Suggested step size: 0.001).
[0109] 5) Reasoning requirements.
[0110] In this embodiment, the reasoning requirement is that each adjustment must consider: (1) the distance between the current parameter and the historical best value; (2) whether the previous adjustments have progressed in the right direction; and (3) the gap with the target performance.
[0111] 6) Output format.
[0112] In this embodiment, the output format is to provide suggestions in a structured manner. For example, provide parameters in the following format (one value per line, no explanation required):
[0113] Kp: A specific value, such as 0.1;
[0114] Ki: A specific numerical value, such as 0.1.
[0115] Based on the above information, the role of the large language model is defined. Subsequently, each time an optimization task is submitted to the large language model, EPICS is used to retrieve the current K from the LLRF system. pp ,K pi The parameter is used to obtain the system performance index V under the parameter setting. c _rms and V f _rms, and then convert this information into Figure 4 The task execution prompt word format shown is sent to the large language model for processing, where:
[0116] For example: The task execution prompt is:
[0117] Current parameter settings: Kp: 0.04; Ki: 0.0002;
[0118] Current system performance metrics: Vc_rms: 0.15; Vf_rms: 4.88;
[0119] Target performance requirements: Vc_rms < 0.03; Vf_rms should be kept within a reasonable range, an excessively large value indicates that the Kp value is too high;
[0120] Parameter adjustment reference: 1. Recommended step size (can be fine-tuned according to actual conditions): Kp reference step size: 0.02; Ki reference step size: 8e -4 2. System response requirements: If Vf_rms increases significantly, Kp should be reduced appropriately; Ki is too large and it is easy to cause system oscillation and instability; minimize Vc_rms while ensuring the stability of Vf_rms.
[0121] Provide parameters in the following format (one value per line, no explanation required): Kp: specific value, such as 0.1; Ki: specific value, such as 0.1.
[0122] Note: All prompt words are designed only to provide a hint to the large language model; the actual thinking and decision-making are completed by the large language model itself.
[0123] III. Large Language Model Reasoning
[0124] In this embodiment, the large language model analyzes the gap between system performance and the target based on the knowledge in the technical background framework prompts and the current state information in the task execution prompts. Combining the basic principles of PI control and the characteristics of the RF cavity system, it infers K... pp ,K pi The next optimal adjustment parameters. Since the large language model has already learned the basic principles of PI control during training, it is essentially an expert with background knowledge, capable of thinking, reasoning, and decision-making. Prompt words inform it of the current and historical system states, and it will perform inferences based on these state changes.
[0125] IV. Management of Historical Dialogues
[0126] In this embodiment, the interaction history between the system and the large language model is stored and managed to ensure that the model can make decisions based on a complete parameter tuning trajectory. The system's role setting prompts, task execution prompt 1, model adjustment suggestion 1, task execution prompt 2, model adjustment suggestion 2, and so on are stored in chronological order, enabling the model to "remember" previous adjustment trajectories, understand parameter change trends and their effects, avoid repeated and ineffective adjustments, and achieve coherent learning and continuous optimization capabilities.
[0127] V. Parameter parsing and execution.
[0128] In this embodiment, the complete text response returned by the large language model is received. Regular expressions are used to locate and extract parameter lines, matching text lines in the format "Kp:value" and "Ki:value". The extracted text values are then converted to floating-point numbers (e.g., for the adjustment suggestion "Kp:0.04" given by the large language model, the entity "kp" is first retrieved, and then the regular expression "r'\d*\.?\d+" is used to retrieve the number 0.04, thus extracting the model's suggested value; the next step is to adjust Kp to 0.04). If parsing fails and a valid parameter value cannot be extracted, the most recent valid parameter is used; if the parameter exceeds the safe range, it is automatically truncated to the boundary value. The parsing result is returned in dictionary form: {"kp":float_value,"ki":float_value}. Subsequently, new parameters are written to the LLRF controller via the EPICS channel, and a parameter execution confirmation mechanism is designed to verify whether the parameters have been successfully applied through feedback.
[0129] VI. By repeating the above five steps, a fully automated interaction between the LLRF system and the large language model can be established, and the fully automated PI tuning task can be completed.
[0130] Example 2: This example provides an online intelligent control method for loop parameters of a particle accelerator system based on a large language model, including:
[0131] I. Data Collection.
[0132] In this embodiment, scanning K is generated within a certain range. pp ,K pi The grid is used, and each K is calculated using performance evaluation steps. pp ,K pi The parameters Vc_rms and Vf_rms are set. The results are as follows: Figure 5 and Figure 6 As shown, where, Figure 5 and Figure 6 The phase PI parameters K of the two radio frequency cavities CM2-5 and CM3-5 are respectively. pp ,K pi The scan results are shown. The optimal K is marked with contour lines in the figure. pp ,K pi Region. Through this process, the optimal PI region for CM2-5 and CM3-5 can be visually observed, providing a benchmark for verifying the search performance of the intelligent tuning system.
[0133] II. Iterative Optimization Phase.
[0134] In this embodiment, different K values are set. pp ,K pi , as the starting position for iterative search, such as Figure 5As shown, each starting position undergoes three independent search processes. Each optimization loop is executed according to... Figure 3 The process described sequentially executes steps such as data acquisition, performance evaluation, signal-to-text conversion, large language model inference, parameter parsing, and execution until the termination condition is met. The entire optimization process requires setting two key hyperparameters: the optimal Vc_rms threshold (set to 0.03) and the maximum number of iterations (set to 15). Considering that the actual optimal Vc_rms for CM2-5 and CM3-5 are both greater than 0.042, this value only plays an auxiliary role, namely, searching in the direction of decreasing Vc_rms. It remains applicable to RF cavities other than CM2-5 and CM3-5. The large language model used in this invention's testing is the 32B DeepSeek-r1. It should be noted that the method described in this invention is not limited to this model; other large language models (such as GPT) can also be used.
[0135] III. Success Rate Assessment.
[0136] In this embodiment, four cavities (CM2-5, CM2-6, CM3-5, and CM4-3) out of the 23 RF cavities in the CAFE2 device were selected for success rate testing. The testing method followed the iterative optimization strategy described above, performing multiple independent searches for each RF cavity from different starting points. The test results are shown in Table 1. The data shows that this intelligent tuning method can find near-globally optimal PI parameters with a high success rate, and the search process has good convergence. Figure 5 and Figure 6 As can be seen from the average number of searches required to reach the optimal PI position summarized in Table 1, 15 steps is a relatively reasonable maximum step size. Compared with the traditional grid-scan-based PI tuning method (scanning 60-80 sets of PI parameters), the present invention can accelerate the optimization speed by 4-5 times. Furthermore, the automated PI parameter tuning system proposed in this invention significantly reduces the time cost and professional skill requirements of manual tuning while ensuring high-quality tuning.
[0137] Table 1 Success Rate Test Results
[0138]
[0139] Example 2: Following the above example 1 which provided an online intelligent control method for loop parameters of a particle accelerator system based on a large language model, this example provides an online intelligent control device for loop parameters of a particle accelerator system based on a large language model. The device provided in this example can implement the online intelligent control method for loop parameters of a particle accelerator system based on a large language model as described in Example 1. This device can be implemented through software, hardware, or a combination of both. For ease of description, this example is described by dividing the functionality into various units. Of course, in implementation, the functions of each unit can be implemented in one or more software and / or hardware components. For example, the device may include integrated or separate functional modules or units to execute the corresponding steps in the methods of Example 1. Since the device in this example is basically similar to the method example, the description process of this example is relatively simple. For relevant details, please refer to the description in Example 1. The example of the online intelligent control device for loop parameters of a particle accelerator system based on a large language model provided by this invention is merely illustrative.
[0140] Specifically, the online intelligent control device for loop parameters of a particle accelerator system based on a large language model provided by the present invention includes:
[0141] The data acquisition module is configured to acquire the cavity operation data of the RF cavity in real time. This cavity operation data includes the current PI parameters and the original cavity pressure V of the RF cavity. c and the original forward voltage V f ;
[0142] The performance evaluation module evaluates the original chamber pressure V. c and the original forward voltage V f Calculate the current system state parameters of the cavity and determine whether the optimization termination condition is met. If it is met, the optimization is completed and exited; otherwise, continue.
[0143] The signal-to-text conversion module is configured to convert system state parameters and PI parameter tuning targets into structured system state descriptions in natural language and generate task execution prompts.
[0144] The large language model reasoning module is configured to analyze the system state based on task execution prompts using a large language model and infer the next PI parameter value.
[0145] The text parameter interpretation module is configured to parse the output of the large language model, accurately extract the PI parameter values, and perform a reasonableness check on the accurately extracted PI parameter values.
[0146] The parameter parsing and execution module is configured to apply the extracted PI parameter values and repeat the above tuning process until the tuning is complete.
[0147] Example 3: This example provides an electronic device corresponding to the online intelligent control method for loop parameters of a particle accelerator system based on a large language model provided in Example 1. The electronic device can be an electronic device for the client, such as a mobile phone, laptop, tablet computer, desktop computer, etc., to execute the method of Example 1.
[0148] like Figure 7 As shown, the electronic device includes a processor, a memory, a communication interface, and a bus. The processor, memory, and communication interface are connected via the bus to enable communication between them. The memory stores a computer program that can run on the processor. When the processor runs the computer program, it executes the method of Embodiment 1. The implementation principle and technical effects are similar to those of Embodiment 1, and will not be repeated here. Those skilled in the art will understand that... Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computing device on which the present application is applied. The specific computing device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0149] In a preferred embodiment, the logical instructions in the aforementioned memory can be implemented as software functional units and sold or used as independent products, and can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), and optical discs.
[0150] In a preferred embodiment, the processor can be any type of general-purpose processor such as a central processing unit (CPU) or a digital signal processor (DSP), and is not limited thereto.
[0151] Example 4: This example provides a computer-readable storage medium for storing one or more programs, the one or more programs including computer instructions, which, when executed by a computer, cause the computer to perform the method provided in Example 1 above.
[0152] In a preferred embodiment, the computer-readable storage medium may be a tangible device for holding and storing instructions executable, such as, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any combination thereof. The computer-readable storage medium stores computer program instructions that cause a computer to perform the method provided in Embodiment 1 above.
[0153] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (devices), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0154] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0155] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0156] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In the description of this specification, the terms "a preferred embodiment," "furthermore," "specifically," "in this embodiment," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the embodiments in this specification. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described can be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0157] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for online intelligent control of loop parameters in a particle accelerator system based on a large language model, characterized in that, The method includes: Real-time acquisition of the RF cavity's operating data, including the current PI parameters and the original cavity pressure of the RF cavity. V c and the original forward voltage V f ; Based on the original cavity pressure V c and the original forward voltage V f Calculate the current system state parameters of the cavity and determine whether the optimization termination condition is met. If it is met, the optimization is completed and exited; otherwise, continue. The system state parameters and PI parameter tuning objectives are transformed into a structured system state description in natural language, and task execution prompts are generated. Based on task execution prompts, a large language model is used to analyze the system state and infer the next PI parameter value, including: Construct a multi-turn inference framework to enable interaction between the large language model and the LLRF system response; For each round of reasoning, design specific task execution prompts; During inference, a dialogue history list is created to store the complete inference trajectory, including system state description, model inference process and parameter adjustment results; Based on the system state description, model reasoning process, and parameter adjustment results, new parameter adjustment suggestions are generated. Output structured adjustment suggestions; The output of the large language model is analyzed to accurately extract the PI parameter values, and the reasonableness of the accurately extracted PI parameter values is checked. Apply the extracted PI parameter values and repeat the above tuning process until tuning is complete.
2. The online intelligent control method for loop parameters of a particle accelerator system based on a large language model according to claim 1, characterized in that, In an LLRF system with separate amplitude and phase control, the amplitude control loop and the phase control loop each use independent PI controllers. The parameter tuning of the two control loops does not interfere with each other. In each PI control, Represents proportional gain. These represent integral gains, and they all act on the same control loop.
3. The online intelligent control method for loop parameters of a particle accelerator system based on a large language model according to claim 2, characterized in that, System state parameters refer to those based on the original cavity pressure. V c and the original forward voltage V f Calculate the RMS of amplitude / phase.
4. The online intelligent control method for loop parameters of a particle accelerator system based on a large language model according to claim 3, characterized in that, When calculating the original cavity pressure V c Phase signal and the original forward voltage V f Phase signal The specific formula for the system state parameter RMS is: ; In the formula, The number of sampling points. represent or , This represents the mean.
5. The online intelligent control method for loop parameters of a particle accelerator system based on a large language model according to claim 2, characterized in that, The optimization is terminated when the number of system interactions reaches the preset limit or the system stability meets the preset requirements.
6. The online intelligent control method for loop parameters of a particle accelerator system based on a large language model according to claim 2, characterized in that, The output of the large language model is parsed to accurately extract the PI parameter values, and the reasonableness of the accurately extracted PI parameter values is checked, including: Based on the adjustment suggestions of the large language model, a method combining regular expressions and named entity recognition is used to extract... and Numerical parameters; Establish quantification mapping rules for fuzzy expressions; Check the reasonableness of the parameters to ensure that the extracted parameters are within a safe range; Generate parameter commands in a standard format.
7. An apparatus for implementing the online intelligent control method for loop parameters of a particle accelerator system based on a large language model as described in any one of claims 1-6, characterized in that, include: The data acquisition module is configured to acquire the cavity operation data of the RF cavity in real time. This cavity operation data includes the current PI parameters and the original cavity pressure of the RF cavity. V c and the original forward voltage V f ; The performance evaluation module evaluates based on the original chamber pressure. V c and the original forward voltage V f Calculate the current system state parameters of the cavity and determine whether the optimization termination condition is met. If it is met, the optimization is completed and exited; otherwise, continue. The signal-to-text conversion module is configured to convert system state parameters and PI parameter tuning targets into structured system state descriptions in natural language and generate task execution prompts. The large language model reasoning module is configured to analyze the system state based on task execution prompts using a large language model and infer the next PI parameter value. The text parameter interpretation module is configured to parse the output of the large language model, accurately extract the PI parameter values, and perform a reasonableness check on the accurately extracted PI parameter values. The parameter parsing and execution module is configured to apply the extracted PI parameter values and repeat the above tuning process until the tuning is complete.
8. An electronic device, characterized in that, include: At least one processor; And a memory communicatively connected to the processor; wherein the memory stores instructions executable by the processor, the instructions being executed by the processor to enable the processor to perform the method according to any one of claims 1-6.
9. A computer-readable storage medium for storing one or more programs, characterized in that, The one or more programs include computer instructions for causing a computer to perform the method according to any one of claims 1-6.
Citation Information
Patent Citations
DC converter controller design method and device, and medium
CN119443006A
Method and system for calculating stability margin domain of control parameters of hydraulic turbine regulating system
US12196174B1