Particle accelerator system loop parameter online intelligent regulation and control method and device based on large language model

Through the online intelligent control method of loop parameters of particle accelerator system based on large language model, the automatic tuning of LLRF system PI parameters is realized, the problem of inefficiency in the existing technology is solved, debugging efficiency is improved and cost is reduced.

CN120583579AActive Publication Date: 2025-09-02INST OF MODERN PHYSICS CHINESE ACADEMY OF SCI

Patent Information

Application Number
CN202510648827.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-20
Publication Date
2025-09-02
Estimated Expiration
2045-05-20

AI Technical Summary

Technical Problem

The prior art is difficult to achieve intelligent optimization and adaptive adjustment of PI parameters, resulting in limited improvement in the performance of LLRF system, especially in large accelerators with low efficiency of manual adjustment and large differences in results.

Method used

The online intelligent control method of loop parameters of particle accelerator system based on the large language model is adopted. By obtaining the operating data of the radio frequency cavity in real time, the large language model is used to analyze the system status, infer the PI parameter values, and conduct rationality checks, and ultimately realize automated PI parameter tuning.

Benefits of technology

The full process automation of LLRF system PI parameter tuning is realized, the debugging efficiency is improved by 4 to 5 times, the manual debugging time and professional skills requirements are reduced, and different types of LLRF systems are adapted to different types of LLRF systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120583579A_ABST
    Figure CN120583579A_ABST
Patent Text Reader

Abstract

The invention discloses a particle accelerator system loop parameter on-line intelligent regulation and control method and device based on a large language model, and the method comprises the steps: obtaining the cavity operation data of a radio frequency cavity in real time, calculating the system state parameter of the current cavity, judging whether the system state parameter meets an adjustment and optimization termination condition or not, and continuing if the adjustment and optimization termination condition is not met; converting the system state parameter and the PI parameter tuning target into a structured system state description described by a natural language, and generating a task execution cue word; analyzing a system state by using a large language model based on the task execution cue word, and reasoning a PI parameter value; analyzing the output of the large language model, accurately extracting PI parameter values, and performing rationality check on the accurately extracted PI parameter values; and performing application execution on the extracted PI parameter value, and repeating the tuning process until tuning is completed. Therefore, an effective solution is provided for automatic PI parameter tuning, and the time cost and professional skill requirements of manual debugging are remarkably reduced while the quality of tuning is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method, device, equipment and medium for online intelligent control of loop parameters of a particle accelerator system based on a large language model, and relates to the field of particle accelerators. Background Art

[0002] With the rapid development of microelectronics technology, the new generation of particle accelerators generally adopts digital low-level radio frequency (LLRF) systems. Among them, digital proportional and integral (PI) controllers are widely used due to their simple structure, model independence, good adaptability and strong reliability.

[0003] The tuning and optimization of PI parameters are key to improving the performance of LLRF systems. In the field of low-level RF, the stability of the RF field is directly related to the beam index and is a key factor in determining the performance of the LLRF system. In addition, the nonlinearity of the RF power source and the Lorentz detuning of the RF cavity increase the complexity of parameter tuning. Research teams from internationally advanced laboratories such as the German Electron Synchrotron Radiation Research Center (DESY) and the High Energy Accelerator Research Organization (KEK) in Japan usually use a two-dimensional parameter scanning method to tune the PI parameters. Although the above method can effectively obtain the optimal PI parameters, the parameter tuning process is time-consuming and inefficient, often requires a lot of machine time, and is difficult to adapt to dynamic factors such as equipment aging and changes in operating conditions.

[0004] Existing techniques also employ manual tuning, gradually finding the optimal PI parameters by observing the system's response. However, this process presents the following problems: First, the tuning process relies heavily on operator experience and lacks objective quantitative standards, resulting in significant variability in tuning results between operators. Second, manual tuning is labor-intensive and inefficient for multiple RF cavities, especially in large accelerators, where dozens or even hundreds of independent control loops may need to be adjusted.

[0005] In summary, the tuning of PI parameters is crucial to the stability of the RF field and the longitudinal performance of the particle beam. Existing technologies struggle to achieve intelligent optimization and adaptive adjustment of PI parameters, a problem that hinders improvements in LLRF system performance. Summary of the Invention

[0006] The present invention aims to address at least one of the technical problems existing in the prior art. To address this issue, the present invention provides a method, apparatus, device, and medium for online intelligent control of loop parameters in a particle accelerator system based on a large language model. These methods enable intelligent optimization and adaptive adjustment of parameters, improving system response speed, stability, and robustness, and providing technical support for intelligent control of accelerator LLRF systems.

[0007] In order to achieve the above-mentioned object of the invention, the technical solution adopted by the present invention is:

[0008] In a first aspect, the present invention provides a method for online intelligent control of loop parameters of a particle accelerator system based on a large language model, the method comprising:

[0009] Real-time acquisition of the RF cavity operation data, including the current PI parameters and the original cavity pressure V of the RF cavity c and the original forward voltage V f ;

[0010] According to the original cavity pressure V c and the original forward voltage V f , calculate the system state parameters of the current cavity and determine whether the tuning termination conditions are met. If so, the tuning is completed and exited; if not, continue;

[0011] Convert system state parameters and PI parameter tuning targets into structured system state descriptions described in natural language, and generate task execution prompts;

[0012] Based on the task execution prompt words, the system status is analyzed using a large language model to infer the next PI parameter value;

[0013] Parse the output of the large language model, accurately extract the PI parameter values, and perform rationality checks on the accurately extracted PI parameter values;

[0014] The extracted PI parameter values ​​are applied and executed, and the above tuning process is repeated until the tuning is completed.

[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 use independent PI controllers, and the parameter settings of the two control loops do not interfere with each other. In each PI control, K p Represents the proportional gain, K i Represents the integral gain, and they work together in the same control loop.

[0016] In some possible implementations, the system state parameter refers to the original cavity pressure V c and the original forward voltage V f Calculate the RMS of the magnitude / 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 of the system state parameter RMS is:

[0018]

[0019] Where n is the number of sampling points, ∠V i Represents ∠V f or ∠V c , Represents the mean.

[0020] In some possible implementations, the tuning termination condition is: the number of system interactions reaches a preset upper limit or the stability of the system meets a preset requirement.

[0021] In some possible implementations, a large language model is used to analyze the system state based on the task execution prompt words and infer the next PI parameter value, including:

[0022] Build a multi-round reasoning framework to enable interaction between the large language model and the LLRF system response;

[0023] For each round of reasoning, design dedicated task execution prompts;

[0024] During inference, a conversation history list is created to store the complete inference trajectory, including system status description, model inference process, and parameter adjustment results;

[0025] Generate new parameter adjustment suggestions based on system status description, model reasoning process and parameter adjustment results;

[0026] Output structured adjustment suggestions, including parameter K p and K i The specific value of .

[0027] Some possible implementations of parsing the output of a large language model, accurately extracting PI parameter values, and performing a rationality check on the accurately extracted PI parameter values ​​include:

[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 Numeric parameters;

[0029] Establish quantitative mapping rules for fuzzy expressions;

[0030] Check the rationality of parameters to ensure that the extracted parameters are within a safe range;

[0031] Generates parameter instructions in standard format.

[0032] In a second aspect, 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 obtain the cavity operation data of the RF cavity in real time, wherein the 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] Performance evaluation module, evaluates the original cavity pressure V c and the original forward voltage V f , calculate the system state parameters of the current cavity and determine whether the tuning termination conditions are met. If so, the tuning is completed and exited; if not, continue;

[0035] The signal-to-text conversion module is configured to convert system state parameters and PI parameter tuning targets into a structured system state description described in natural language and generate task execution prompt words;

[0036] The large language model inference module is configured to use the large language model to analyze the system status based on the task execution prompt words and infer the next PI parameter value;

[0037] A text parameter interpretation module is configured to parse the output of the large language model, accurately extract PI parameter values, and perform rationality checks 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 completed.

[0039] In a third aspect, the present invention provides an electronic device comprising: at least one processor; and a memory communicatively connected to the processor; wherein the memory stores instructions executable by the processor, and the instructions are executed by the processor to enable the processor to execute the described method.

[0040] In a fourth aspect, the present invention provides a computer-readable storage medium storing one or more programs, wherein the one or more programs include computer instructions, and the computer instructions are used to enable a computer to execute the method described.

[0041] The present invention adopts the above technical solution, which has the following characteristics:

[0042] 1. Fully automatic and efficient: The present invention realizes the full process automation of PI parameter tuning of the LLRF system without manual intervention. Compared with the traditional grid scanning method, the present invention speeds up the PI optimization by 4 to 5 times, greatly improving the debugging efficiency.

[0043] 2. Good scalability: The present 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 fully utilizes the capabilities of existing large language models and combines professional physics and control theory to achieve expert-level parameter adjustment. It also eliminates the need to train models separately for different devices, reducing the cost of technical implementation.

[0045] In summary, the present invention can be widely applied to the optimization of feedback control parameters of a radio frequency low-level system of a particle accelerator. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Various other advantages and benefits will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiment below. The accompanying drawings are for illustration purposes only and are not to be considered as limiting the present invention. Throughout the drawings, the same reference numerals are used to denote the same components. In the drawings:

[0047] Figure 1 This is a simplified diagram of the PI controller of the LLRF system in the prior art.

[0048] Figure 2 The low-level online measurement of the RF cavity voltage signal V in the embodiment of the present invention c 、V f Experimental block diagram.

[0049] Figure 3 This is a flowchart of online optimization of LLRF system loop parameters for a large language model according to an embodiment of the present invention.

[0050] Figure 4 This is the prompt word design of the large language model in an embodiment of the present invention. The left picture is the technical background prompt word template of the large language model, and the right picture is the task interaction prompt word template.

[0051] Figure 5 This is the intelligent tuning path of the large language model on CM2-5 according to the embodiment of the present invention. In the figure, four different positions are selected as K pp ,K pi For each starting position, three independent test experiments were carried out. The optimal K pp ,K pi area.

[0052] Figure 6 This is the intelligent tuning path of the large language model on CM3-5 according to the embodiment of the present invention. In the figure, four different positions are selected as K pp ,K pi For each starting position, three independent test experiments were carried out. The optimal K pp ,K pi area.

[0053] Figure 7 FIG. 4 is a structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0054] It should be understood that the terms used herein are for the purpose of describing specific example embodiments only and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "comprise", "include", "contain" and "have" are inclusive and therefore specify the presence of stated features, steps, operations, elements and / or parts, but do not exclude the presence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not to be construed as necessarily requiring them to be performed in the specific order described or illustrated, unless the order of execution is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0055] Although the terms first, second, third, etc. can be used in the text to describe multiple elements, components, regions, layers and / or sections, these elements, components, regions, layers and / or sections should not be limited by these terms. These terms can only be used to distinguish an element, component, region, layer or section from another region, layer or section. Unless the context clearly indicates otherwise, terms such as "first", "second" and other numerical terms do not imply order or sequence when used in the text. Therefore, the first element, component, region, layer or section discussed below can be referred to as the second element, component, region, layer or section without departing from the teaching of the example embodiments.

[0056] For ease of description, spatially relative terms may be used herein to describe the relationship of one element or feature relative to another element or feature as shown in the figures, such as "inside," "outside," "inner side," "outer side," "lower," "upper," etc. Such spatially relative terms are intended to encompass different orientations of the device in use or operation in addition to the orientation depicted in the figures.

[0057] Since the existing methods mainly rely on grid scanning or expert experience adjustment, it is impossible to achieve efficient and reliable PI parameter tuning. The present invention provides a method and device for online intelligent control of loop parameters of a particle accelerator system based on a large language model, including: obtaining cavity operation data of a radio frequency cavity in real time, 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 f, calculate the system state parameters of the current cavity, and determine whether the tuning termination conditions are met. If they are met, the tuning is completed and exited, otherwise it continues; the system state parameters and PI parameter tuning targets are converted into structured system state descriptions described in natural language, and task execution prompts are generated; based on the task execution prompts, the system state is analyzed using a large language model to infer the next PI parameter value; the output of the large language model is parsed, the PI parameter value is accurately extracted, and the rationality of the accurately extracted PI parameter value is checked; the extracted PI parameter value is applied and executed, and the above tuning process is repeated until the tuning is completed. Therefore, the present invention provides an effective solution for automated PI parameter tuning, which significantly reduces the time cost and professional skill requirements of manual debugging while ensuring the quality of tuning.

[0058] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to fully convey the scope of the present invention 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 method described in the present invention is not limited to this model, and other large language models can be used. This is an example and is not limited to this.

[0059] Example 1: Figure 3 As shown, the method for online intelligent control of loop parameters of a particle accelerator system based on a large language model provided in this embodiment includes:

[0060] S1. Data collection.

[0061] In this embodiment, data acquisition refers to obtaining the cavity operation data of the radio frequency cavity from the LLRF system in real time, including:

[0062] Based on the control relationship between the output and input of the PI control in the RF cavity, the controlled object and the parameter to be tuned K are extracted through EPICS. p and K i .

[0063] Based on online measurement of the cavity sampling signal P of the RF cavity t and the cavity incident signal P f , get the original cavity pressure V of the RF cavity c and the original forward voltage V f .

[0064] Establish a data cache mechanism in the same group K p and K i Under the setting, several sets of original cavity pressure V can be collectedc and the original forward voltage V f signal to eliminate the influence 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 , calculate the current system status parameters and determine whether the tuning termination conditions are met. If the tuning termination conditions are met, the tuning is completed and the system is exited. If the tuning termination conditions are not met, the system continues.

[0067] Furthermore, the system state parameter of this embodiment refers to the original cavity pressure V c and the original forward voltage V f Calculate the RMS of the magnitude / phase.

[0068] Furthermore, the tuning termination condition of this embodiment is: the number of system interactions reaches a preset upper limit or the stability of the system meets 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 targets into a structured system state description described in natural language, and generating task execution prompt words.

[0071] Furthermore, the system response characteristics are analyzed and the 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 indicator to measure the stability of the cavity. A structured system state description is generated for different response modes to obtain task execution prompts, such as "Current 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. If it is too large, it means K p The value is too high. f Minimize V under the premise of RMS stability c Phase RMS".

[0072] S5. Large language model reasoning.

[0073] In this embodiment, large language model reasoning refers to using a large language model such as DeepSeek-R1 to analyze the system state description and infer the next PI parameter value. That is, using the large language model to analyze the system state description, combined with built-in professional physical knowledge, and based on the cached historical tuning trajectory, the optimal PI parameter value for the next step is inferred: K p and K i , and give structured adjustment suggestions.

[0074] Furthermore, the specific implementation process of large language model reasoning includes:

[0075] A multi-round reasoning framework is constructed to enable interaction between the large language model and the LLRF system response. The multi-round reasoning framework has two meanings: one is that it is difficult to complete the task through a single interaction and requires multiple rounds of tuning to complete; the other is that it allows the model to take into account previous decision-making ideas each time it performs reasoning.

[0076] Create a conversation history record list to store the complete reasoning trajectory, including system status description, model reasoning process and parameter adjustment results.

[0077] For each round of reasoning, a dedicated system prompt word is designed, integrating PID control theory, RF cavity physical model and historical experience rules.

[0078] Generate new parameter adjustment suggestions based on the current system status description and historical adjustment effects. The system status description and historical adjustment effects are described in a paradigm by designing prompt words, such as Figure 4 As shown in the figure, these contents will be input into the 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, the new parameter adjustment suggestion.

[0079] Output structured adjustment suggestions, including K p and K i The specific value of .

[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 Numeric parameters and perform sanity checks.

[0082] Furthermore, the specific implementation process of text-parameter parsing includes:

[0083] From the above large language model adjustment suggestions, a method combining regular expressions and named entity recognition is used to extract K p and Ki For example, for the adjustment suggestion "Kp:0.04" given by the large language model, first search for the Kp entity, and then use the regular expression "r'\d*\.?\d+" to search for the number 0.04, thereby extracting the model's recommended value.

[0084] For vague statements (such as "slightly increase K p ") Establish a quantitative mapping rule, for example, slightly increase K p , the next step Kp value will be increased by 1 / 5 of the recommended step size on the original basis, etc.

[0085] Parameter rationality check ensures that the extracted parameters are within a safe range. For example, a search area will be given. If it exceeds the search area, the value will be clipped so that its maximum and minimum values ​​do not exceed the boundary.

[0086] Generate parameter instructions in standard format, such as "SET_KP=0.1,SET_KI=0.005".

[0087] S7, parameter execution.

[0088] In this embodiment, parameter execution is to extract the parameter K p and K i It is automatically applied to the LLRF control system and the above process is repeated until the optimization task is completed.

[0089] Furthermore, the parameter execution is responsible for applying the parsed parameters to the control system and writing the new parameters K to the LLRF controller via EPICS. p and K i ,Design parameter execution confirmation mechanism and verify whether the parameters are successfully applied through feedback.

[0090] The practical application of the method for online intelligent control of loop parameters of a particle accelerator system based on a large language model of the present invention is described in detail below through specific embodiments.

[0091] Example 1: The RF cavity used in this example is a half-wavelength RF cavity (HWR010, whose relativistic velocity is 0.1). The resonant frequency of the cavity is 162.5 MHz, and the loaded quality factor Q L About 5×10 5 .like Figure 2As shown, the present invention is provided with an online data acquisition system, including 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 end of the digital low-level system 1 is connected to the input end of the solid-state power source 2, the output end of the solid-state power source 2 is connected to the input end of the directional coupler 3, the output end of the directional coupler 3 is fed into the radio frequency cavity 5 through the input coupler 4, and the directional coupler 3 is used to extract the cavity incident signal P of the radio frequency cavity 5. f and cavity reflection signal P r The signal extraction coupler 6 is connected to the RF 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, it is sent to the digital low-level system 1. The 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 , and uploaded to the host computer 7 via the data bus.

[0092] Based on the above-mentioned online data acquisition system, the present embodiment provides a method for online intelligent control of loop parameters of a particle accelerator system based on a large language model, including:

[0093] 1. Data collection.

[0094] like Figure 2 As shown, the digital low-level system 1 adopts the amplitude / phase control method of the cavity pressure, that is, it includes two sets of PI control systems, and the amplitude and phase are adjusted separately. The adjustment principle is as follows Figure 1 As shown. When scanning V c PI parameter of amplitude (K ap ,K ai ), the phase PI parameter (K pp ,K pi ) in the optimal position and remain unchanged. Similarly, when scanning K pp ,K pi When K ap ,K ai The PI parameter tuning method for amplitude and phase is equivalent to two PI sweep tasks, which do not interfere with each other.

[0095] This embodiment is explained by taking the PI tuning task of the cavity pressure phase as an example. pp ,K pi Parameters, first use EPICS to set it into the corresponding RF cavity. After each set of PI parameters is successfully set, continuously record 6 sets of original cavity pressure Vc and the original forward voltage V f , put it into the buffer area, where the original cavity pressure V c and the original forward voltage V f All are vectors. After the 6 sets of data are collected, the original cavity pressure V of each set is calculated. c Phase signal ∠V c and the original forward voltage V f Phase signal ∠V f The system state parameter RMS, as a quantitative indicator of steady-state performance, is calculated as follows:

[0096]

[0097] Where n is the number of sampling points (in CAFE2, n = 10000), ∠V i Represents ∠V f or ∠V c For each point in Represents the mean.

[0098] Then, the arithmetic average of the six groups of system state parameters RMS calculated after removing the maximum and minimum values ​​is calculated, and the average value is used as the current K pp ,K pi The representative values ​​of the system steady-state performance under the parameter combination are denoted as V c _rms and V f _rms.

[0099] 2. Design of large language model prompt strategy.

[0100] In this embodiment, the design of technical background frame prompt words is a key step to ensure that the model understands the task requirements and produces high-quality responses. Figure 4 As shown, it includes the following parts:

[0101] 1) Technical background construction.

[0102] In this embodiment, the technical background is constructed as follows: You are a professional PI control system parameter adjustment expert, and your task is to optimize the parameters based on the performance indicators of the LLRF (low-level radio frequency) system, which operates in continuous wave mode.

[0103] 2) Adjust your goals.

[0104] In this embodiment, the adjustment targets include: a main target and parameters, wherein the main target is to continuously reduce the rms of the system cavity pressure phase, and the parameters are Kp and Ki.

[0105] 3) Guidance from expert experience.

[0106] In this embodiment, expert experience guidance includes: 1. Prioritizing the use of historical experience optimal values ​​as benchmarks: the optimal value of Kp is around 0.11, and it is preferred to adjust it around this range; the optimal value of Ki is around 4e -3 1. Optimize the value within a small range and make fine adjustments. 2. Perform small-scale exploration and fine-tuning near the optimal value. 3. Expand the exploration range only when the optimal value range is not satisfactory.

[0107] 4) Parameter constraints.

[0108] In this embodiment, the parameter constraints include: Kp range is 0.01 to 0.5 (recommended step size: 0.02); Ki range is 2e -4 to 9e -3 (Recommended 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 optimal value; (2) whether the previous adjustment was in the right direction; and (3) the gap with the target performance.

[0111] 6) Output format.

[0112] In this example, 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: specific value, such as 0.1;

[0114] Ki: a specific value, such as 0.1.

[0115] Based on the above information, the role setting for the large language model is completed. Subsequently, each time a tuning task is submitted to the large language model, EPICS is used to obtain the current K from the LLRF system. pp ,K pi Parameters, use 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 indicators: 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; a larger 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 appropriately reduced; too large Ki can easily lead to unstable system oscillation; minimize Vc_rms while ensuring Vf_rms stability.

[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 specific thinking and decision-making are done by the large language model itself.

[0123] 3. Large language model reasoning.

[0124] In this embodiment, the large language model analyzes the gap between system performance and target based on the knowledge in the technical background framework prompt words and the current state information in the task execution prompt words, and combines the basic principles of PI control and the characteristics of the RF cavity system to infer K pp ,K pi The optimal adjustment parameters for the next step. Since the large language model has already learned the basic principles of PI control during training, it is equivalent to an expert with background knowledge and can complete the thinking, reasoning, and decision-making processes. Prompt words tell it the current and historical system status, and it will complete its own reasoning based on this state change process.

[0125] 4. Historical dialogue management.

[0126] In this embodiment, the interaction history between the system and the large language model is stored and managed, ensuring that the model can make decisions based on a complete parameter adjustment trajectory. The system stores the following information in chronological order: role setting prompts, task execution prompts 1, model adjustment suggestions 1, task execution prompts 2, model adjustment suggestions 2, and so on. This allows the model to "remember" previous adjustment trajectories, understand parameter change trends and their effects, avoid repeated and ineffective adjustments, and achieve continuous learning and continuous optimization capabilities.

[0127] 5. Parameter parsing and execution.

[0128] In this embodiment, the complete text response returned by the large language model is received, and the parameter line is located and extracted using a regular expression. The text lines in the format of "Kp: value" and "Ki: value" are matched, and then the extracted text value is converted to a floating-point number type (for example, for the adjustment advice "Kp:0.04" given by the large language model, the kp entity is first retrieved, and then the regular expression "r'\d*\.?\d+" is used to retrieve the number 0.04, thereby extracting the model's recommended value. The next step is to adjust Kp to 0.04). If the parsing fails and no valid parameter value can 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 the form of a dictionary: {"kp":float_value,"ki":float_value}. Subsequently, the new parameters are written to the LLRF controller through the EPICS channel, and a parameter execution confirmation mechanism is designed to verify whether the parameters are successfully applied through feedback.

[0129] 6. By repeating the above five steps, the interaction between the fully automatic LLRF system and the large language model can be established to complete the fully automatic PI tuning task.

[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, comprising:

[0131] 1. Data collection.

[0132] In this embodiment, by generating a scan K within a certain range pp ,K pi grid, and use the performance evaluation step to calculate each K pp ,K pi Vc_rms and Vf_rms under parameter setting. The results are as follows Figure 5 and Figure 6 As shown, Figure 5 and Figure 6 The phase PI parameters K of the two RF cavities CM2-5 and CM3-5 are pp ,K pi The optimal K is marked with contour lines. pp ,K pi Through this process, the optimal PI regions for CM2-5 and CM3-5 can be visually observed, providing a benchmark for verifying the search effect of the intelligent tuning system.

[0133] 2. Iterative optimization stage.

[0134] In this embodiment, different K pp ,K pi , as the starting position of the iterative search, such as Figure 5As shown in Figure 2, three independent search processes are performed for each starting position. Figure 3 The process shown in the figure sequentially executes the steps of data collection, performance evaluation, signal-to-text conversion, large language model inference, parameter parsing and execution until the termination condition is met. The entire tuning 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 of CM2-5 and CM3-5 are both greater than 0.042, this value only plays an auxiliary role, that is, searching in the direction of smaller and smaller Vc_rms, and it is still universal in RF cavities other than CM2-5 and CM3-5. The large language model used in the test of the present invention is 32B DeepSeek-r1. It should be noted that the method described in the present invention is not limited to this model, and other large language models (such as GPT) can pass.

[0135] 3. Success rate evaluation.

[0136] In this example, four cavities, CM2-5, CM2-6, CM3-5, and CM4-3, of the 23 RF cavities in the CAFE2 device were selected for success rate testing. The test method followed the above-mentioned iterative optimization strategy, performing multiple independent searches for each RF cavity from different starting points. The test results are shown in Table 1. The data shows that the intelligent tuning method can find PI parameters close to the global optimal with a high success rate, and the search process has good convergence ( Figure 5 and Figure 6 Table 1 summarizes the average number of searches required to find the optimal PI position, indicating that 15 steps is a relatively reasonable maximum step size. Compared to traditional grid-scanning PI tuning methods (which scan 60 to 80 sets of PI parameters), the present invention can accelerate optimization by 4 to 5 times. Furthermore, the automated PI parameter tuning system proposed in this invention significantly reduces the time and expertise required for manual debugging while ensuring high-quality tuning.

[0137] Table 1 Success rate test results

[0138]

[0139] Example 2: The aforementioned Example 1 provides a method for online intelligent control of loop parameters of a particle accelerator system based on a large language model. Correspondingly, this example provides an apparatus for online intelligent control of loop parameters of a particle accelerator system based on a large language model. The apparatus provided in this example can implement the method for online intelligent control of loop parameters of a particle accelerator system based on a large language model described in Example 1. The apparatus can be implemented via software, hardware, or a combination of software and hardware. For ease of description, this example is described separately by functional unit. Of course, during implementation, the functions of each unit can be implemented in the same or multiple software and / or hardware components. For example, the apparatus may include integrated or separate functional modules or units to perform the corresponding steps of each method in Example 1. Since the apparatus in this example is substantially similar to the method embodiment, the description of this example is relatively simple. For relevant details, please refer to the partial description of Example 1. The embodiment of the apparatus for online intelligent control of loop parameters of a particle accelerator system based on a large language model provided by this invention is merely illustrative.

[0140] Specifically, the present invention provides an online intelligent control device for loop parameters of a particle accelerator system based on a large language model, comprising:

[0141] The data acquisition module is configured to obtain the cavity operation data of the RF cavity in real time, wherein the 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] Performance evaluation module, evaluates the original cavity pressure V c and the original forward voltage V f , calculate the system state parameters of the current cavity and determine whether the tuning termination conditions are met. If so, the tuning is completed and exited; if not, continue;

[0143] The signal-to-text conversion module is configured to convert system state parameters and PI parameter tuning targets into a structured system state description described in natural language and generate task execution prompt words;

[0144] The large language model inference module is configured to use the large language model to analyze the system status based on the task execution prompt words and infer the next PI parameter value;

[0145] A text parameter interpretation module is configured to parse the output of the large language model, accurately extract PI parameter values, and perform rationality checks 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 completed.

[0147] Example 3: This example provides an electronic device corresponding to the online intelligent control method of 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 used for a client, such as a mobile phone, a laptop computer, a tablet computer, a 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, the memory and the communication interface are connected via the bus to complete communication between them. The memory stores a computer program that can be run on the processor. When the processor runs the computer program, it executes the method of embodiment 1. Its implementation principle and technical effect are similar to those of embodiment 1 and will not be repeated here. It can be understood by those skilled in the art that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computing device to which the solution of 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 a different component arrangement.

[0149] In a preferred embodiment, the logic instructions in the above-mentioned memory can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), optical disk and other media that can store program code.

[0150] In a preferred embodiment, the processor may be a central processing unit (CPU), a digital signal processor (DSP), or other general-purpose processors of various types, which are not limited herein.

[0151] Embodiment 4: This embodiment provides a computer-readable storage medium storing one or more programs, wherein the one or more programs include computer instructions. When the computer instructions are executed by a computer, the computer executes the method provided in the above embodiment 1.

[0152] In a preferred embodiment, a computer-readable storage medium may be a tangible device that retains and stores instructions executed by the computer, 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 execute the method provided in the first embodiment.

[0153] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (apparatus), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0154] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0155] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0156] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In the description of this specification, the reference terms "a preferred embodiment", "further", "specifically", "in the present embodiment", etc. mean that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the embodiment of this specification. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in a suitable manner in any one or more embodiments or examples. In addition, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are contradictory.

[0157] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A method for online intelligent control of loop parameters of a particle accelerator system based on a large language model, characterized in that: The method includes: Real-time acquisition of the RF cavity operation data, including the current PI parameters and the original cavity pressure V of the RF cavity c and the original forward voltage V f ; According to the original cavity pressure V c and the original forward voltage V f , calculate the system state parameters of the current cavity and determine whether the tuning termination conditions are met. If so, the tuning is completed and exited; if not, continue; Convert system state parameters and PI parameter tuning targets into structured system state descriptions described in natural language, and generate task execution prompts; Based on the task execution prompt words, the system status is analyzed using a large language model to infer the next PI parameter value; Parse the output of the large language model, accurately extract the PI parameter values, and perform rationality checks on the accurately extracted PI parameter values; The extracted PI parameter values ​​are applied and executed, and the above tuning process is repeated until the tuning is completed.

2. The method for online intelligent control of loop parameters of a particle accelerator system based on a large language model according to claim 1, characterized in that: In the LLRF system with separate amplitude and phase control, the amplitude control loop and the phase control loop each use independent PI controllers. The parameter settings of the two control loops do not interfere with each other. In each PI control, K p Represents the proportional gain, K i Represents the integral gain, and they work together in the same control loop.

3. The method for online intelligent control of loop parameters of a particle accelerator system based on a large language model according to claim 2, characterized in that: The system state parameter refers to the original cavity pressure V c and the original forward voltage V f Calculate the RMS of the magnitude / phase.

4. The method for online intelligent control of 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 ∠V c and the original forward voltage V f Phase signal ∠V f The specific formula of the system state parameter RMS is: Where n is the number of sampling points, ∠V i Represents ∠V f or ∠V c , Represents the mean.

5. The method for online intelligent control of loop parameters of a particle accelerator system based on a large language model according to claim 2, characterized in that: The tuning termination conditions are: the number of system interactions reaches the preset upper limit or the system stability meets the preset requirements.

6. The method for online intelligent control of loop parameters of a particle accelerator system based on a large language model according to claim 2, characterized in that: Based on the task execution prompt words, the system status is analyzed using a large language model to infer the next PI parameter value, including: Build a multi-round reasoning framework to enable interaction between the large language model and the LLRF system response; For each round of reasoning, design dedicated task execution prompts; During inference, a conversation history list is created to store the complete inference trajectory, including system status description, model inference process, and parameter adjustment results; Generate new parameter adjustment suggestions based on system status description, model reasoning process and parameter adjustment results; Output structured adjustment suggestions, including parameter K p and K i The specific value of .

7. The method for online intelligent control of loop parameters of a particle accelerator system based on a large language model according to claim 6, characterized in that: Parse the output of the large language model, accurately extract the PI parameter values, and perform rationality checks on the accurately extracted PI parameter values, including: 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 Numeric parameters; Establish quantitative mapping rules for fuzzy expressions; Check the rationality of parameters to ensure that the extracted parameters are within a safe range; Generates parameter instructions in standard format.

8. An online intelligent control device for loop parameters of a particle accelerator system based on a large language model, characterized in that: include: The data acquisition module is configured to obtain the cavity operation data of the RF cavity in real time, wherein the 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 ; Performance evaluation module, evaluates the original cavity pressure V c and the original forward voltage V f , calculate the system state parameters of the current cavity and determine whether the tuning termination conditions are met. If so, the tuning is completed and exited; if not, continue; The signal-to-text conversion module is configured to convert system state parameters and PI parameter tuning targets into a structured system state description described in natural language and generate task execution prompt words; The large language model inference module is configured to use the large language model to analyze the system status based on the task execution prompt words and infer the next PI parameter value; A text parameter interpretation module is configured to parse the output of the large language model, accurately extract PI parameter values, and perform rationality checks 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 completed.

9. 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, and the instructions are executed by the processor to enable the processor to perform the method according to any one of claims 1-7.

10. A computer-readable storage medium storing one or more programs, characterized in that: The one or more programs include computer instructions for causing a computer to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Parallel training acceleration method and system for large model parameter partitioning

    CN117744838A

  • DC converter controller design method and device, and medium

    CN119443006A

  • Hyper-parameter adaptive multi-objective optimization method

    CN119987939A

  • Self searching optimum control of scanning type PI parameter

    CN1945468A

  • Method and system for calculating stability margin domain of control parameters of hydraulic turbine regulating system

    US12196174B1

Cited By

  • Multi-agent collaborative particle accelerator debugging method, device, equipment and medium

    CN122194962A

  • Particle accelerator system loop parameter adaptive optimization method, device, equipment and medium

    CN122260806A