An adaptive fine-tuning-based storage ring beta function online correction system

CN122693497BActive Publication Date: 2026-10-09UNIV OF SCI & TECH OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611192219.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-08-07
Publication Date
2026-10-09
Estimated Expiration
2046-08-07

AI Technical Summary

Technical Problem

通用持续学习或参数高效微调方法若直接用于该场景,容易产生缺少物理解释的更新方向,并带来过拟合、遗忘或不可执行校正量等风险

Benefits of technology

首先,本申请能够在在线阶段缺少外部β函数真实值或真实校正量标签的情况下持续微调模型,使β函数校正过程保持闭环自适应能力。具体而言,本申请基于交互记忆样本、感知模块输出的β函数估计值、决策模块输出的物理修正量以及物理仿真器推演得到的执行后β函数状态,构建“感知-决策-物理”的物理闭环约束,并生成物理一致性监督信号,从而为感知模块和决策模块的在线微调提供无外部真值条件下的更新依据。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122693497B_ABST
    Figure CN122693497B_ABST
Patent Text Reader

Abstract

The embodiment of the application discloses a kind of based on adaptive fine-tuning's storage ring beta function online correction system, including perception module, decision module, execution module, memory module and learning module.Perception module according to multichannel observation tensor output beta function estimate value and uncertainty;Decision module determines the physical correction amount of quadrupole magnet focusing strength according to beta function residual and working point residual;Execution module safely writes the physical correction amount, memory module records effective interactive data;Learning module is based on interactive memory sample and physical simulator constructs physical consistency supervision signal, determines frequency domain routing gate weight according to uncertainty and dictionary non-negative weight, and based on the joint loss containing physical forward consistency loss, online updates the lightweight adaptive parameter in perception module and decision module.Using the embodiment of the application, the adaptive ability of the system to long-term state drift, unseen working conditions and multi-source error disturbance can be improved under the condition of lacking external true value label.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the interdisciplinary field of intelligent control of particle accelerators and machine learning, and in particular to an online correction system for the storage ring β function based on adaptive fine-tuning. Background Technology

[0002] In the daily operation and beam tuning of particle accelerators, precise control of the β function is a crucial prerequisite for ensuring beam quality, improving injection efficiency, and collider brightness. However, during long-term operation of the storage ring, factors such as DC drift of the quadrupole magnet power supply, magnetic power supply ripple, magnet aging, beam position monitor gain error, and zero-point offset accumulate continuously, causing the actual β function to deviate from the designed optical state, resulting in β-beating, and affecting light source brightness, beam lifetime, and operational stability.

[0003] Existing beta function correction methods typically rely on offline measurements, diagnostic perturbations, or fixed models obtained through offline training. Traditional methods often require interrupting user execution and applying additional perturbations; while machine learning methods can reduce online inference costs, they mostly rely on offline ground truth samples for training, with model parameters fixed during the online phase. Because it is difficult to obtain external true beta function values ​​or labels of the true optimal correction amount during user execution, existing methods generally lack the supervision signals needed for continuous online fine-tuning.

[0004] Furthermore, storage ring beta function correction is not only a data fitting problem, but also requires satisfying optical constraints such as betatron phase, frequency domain mode, and physically executable directions of the quadrupole magnet. Directly applying general continuous learning or parameter-efficient fine-tuning methods to this scenario can easily lead to update directions lacking physical interpretation, and introduce risks such as overfitting, forgetting, or unexecutable corrections. Simultaneously, different error sources have different residual spectrum characteristics and time scales, making it difficult for existing unified update strategies to allocate fine-tuning intensity based on drift sources and model uncertainty differences.

[0005] Therefore, there is an urgent need for an online correction system for the storage ring β function based on adaptive fine-tuning. This system should be able to generate online fine-tuning signals using real-time interactive data, a physical simulator, and an error source dictionary without interrupting user operation or relying on external truth labels. Under physical constraints, the system should perform lightweight and differentiated updates to the sensing and decision modules, thereby improving the system's adaptability to long-term state drift and multi-source error disturbances. Summary of the Invention

[0006] To achieve the above objectives, this application provides an online correction system for the storage loop β function based on adaptive fine-tuning. The system includes a perception module, a decision-making module, an execution module, a memory module, and a learning module, forming a closed loop of state perception, correction decision-making, safe execution, interactive memory, and online learning. The sensing module is used to construct a multi-channel observation tensor based on the current beam closure trajectory deviation of the storage ring, the current focusing intensity of the quadrupole magnet, and the ideal value of the β function obtained by the physical simulator, and outputs the estimated value of the β function and uncertainty at the center position of the quadrupole magnet; the decision module is used to determine the physical correction amount of the focusing intensity of the quadrupole magnet based on the estimated value of the β function, the reference value of the β function, the current operating point, and the reference operating point; the execution module is used to write the physical correction amount into the quadrupole magnet power supply after safe limiting; the memory module is used to write the data corresponding to the control cycle that has not triggered rollback into the interactive memory pool; the learning module is used to construct the β function residual spectrum based on the interactive memory samples and perform error source dictionary decomposition to obtain the dictionary non-negative weights and reconstruction residual ratio, generate a physical consistency supervision signal based on the interactive memory samples and the physical simulator, determine the frequency domain routing gating weights based on the dictionary non-negative weights and uncertainty, and update the frequency domain low-rank adaptation parameters, uncertainty header parameters, frequency domain routing gating parameters, and decision subspace adapter parameters in the decision module online based on the joint loss including physical forward consistency loss. By using the above settings, the adaptive capability of the storage ring β function online correction system to long-term state drift, unseen operating conditions, and multi-source error disturbances can be improved under online operation conditions where external truth labels are lacking.

[0007] This application provides an online correction system for the storage ring β function based on adaptive fine-tuning, the online correction system for the storage ring β function based on adaptive fine-tuning includes: The sensing module is used to construct a multi-channel observation tensor in each control cycle based on the current beam closure trajectory deviation of the storage ring, the current focusing intensity of the quadrupole magnet, and the ideal value of the β function obtained under the focusing intensity; and to determine the estimated value and uncertainty of the β function at the center position of the quadrupole magnet based on the multi-channel observation tensor. The decision module is used to calculate the β function residual based on the estimated β function value and the reference β function value, and to calculate the operating point residual based on the current operating point and the reference operating point; and to determine the physical correction amount of the focusing intensity based on the β function residual and the operating point residual. The execution module is used to write the physical correction amount to the corresponding quadrupole magnet power supply after scalar gain adjustment and safety limiting, and to perform rollback protection and scalar gain adaptive update according to the change of the relative error index of the β function before and after writing. The memory module is used to write the interaction data corresponding to the control cycle that has not triggered a rollback operation into the interaction memory pool; The learning module is used to select interactive memory samples from the interactive memory pool when the online learning trigger conditions are met; construct a β function residual spectrum based on the interactive memory samples and perform error source dictionary decomposition to obtain dictionary non-negative weights and reconstruction residual ratios; generate a physical consistency supervision signal based on the interactive memory samples and the physical simulator; determine the frequency domain routing gating weights based on the uncertainty and the dictionary non-negative weights; and update the lightweight adaptation parameters in the perception module and the decision module based on the frequency domain routing gating weights and the joint loss including physical forward consistency loss. The physical forward consistency loss is determined based on the physical consistency supervision signal and is used to constrain the closed-loop inference consistency between the perception module, the decision module, and the physical simulator.

[0008] Optionally, in constructing a multi-channel observation tensor based on the current beam closure trajectory deviation of the storage ring, the current focusing intensity of the quadrupole magnet, and the ideal value of the β function obtained under the focusing intensity, and determining the estimated value and uncertainty of the β function at the center position of the quadrupole magnet based on the multi-channel observation tensor, the sensing module is specifically used for: The beam position monitor obtains the current horizontal and vertical beam closure trajectory deviation of the storage ring from the accelerator in real time; and the quadrupole magnet control system reads the current focusing intensity of the quadrupole magnet. The ideal value of the β function is obtained by solving the Twiss equation under the focusing intensity without superimposed additional perturbations using a physical simulator. The beam closure trajectory deviation, the focusing intensity, and the ideal value of the β function are spliced ​​together to obtain the multi-channel observation tensor; The multi-channel observation tensor is decomposed into a focus intensity branch input and an orbit branch input, wherein the focus intensity branch input includes the focus intensity and the ideal value of the β function, and the orbit branch input includes the beam closure orbit deviation; A physical phase code is constructed based on the betatron phase at the center position of each quadrupole magnet, and the physical phase code is introduced into the focus intensity branch input and the orbit branch input; The focus intensity branch input and the orbit branch input are respectively input into the corresponding branches of the one-dimensional Fourier neural operator backbone network and fused to obtain a shared feature tensor. By inputting the shared feature tensor into the mean header and uncertainty header respectively, the estimated value of the β function and the uncertainty at the center position of the quadrupole magnet are obtained.

[0009] Optionally, in determining the physical correction amount for the focus intensity based on the β function residual and the operating point residual, the decision module is specifically configured to: The residual of the β function and the residual of the operating point are concatenated to obtain the residual tensor; The residual tensor is input into the decision network to obtain the standardized quadrupole magnet correction. The standardized quadrupole magnet correction is de-standardized to obtain the physical correction of the quadrupole magnet focusing intensity in physical dimensions.

[0010] Optionally, in the process of writing the corresponding quadrupole magnet power supply after adjusting the scalar gain and applying a safety limit to the physical correction amount, and performing rollback protection and adaptive scalar gain update based on the change in the relative error index of the β function before and after writing, the execution module is specifically used for: The physical correction amount is safely limited based on the scalar gain and the single-step correction upper limit, and the safely limited physical correction amount is written into the corresponding quadrupole magnet power supply through the quadrupole magnet control system. After the writing is completed and the beam state is stabilized, the data is re-acquired and the actual value of the β function relative error index after writing is calculated. If the actual value of the β function relative error index after writing deteriorates by more than a preset deterioration threshold compared to the actual value of the β function relative error index before writing, a rollback operation is triggered, and the scalar gain is reduced. If the actual value of the β function relative error index after writing does not deteriorate by more than the preset deterioration threshold compared to the actual value of the β function relative error index before writing, the scalar gain is updated according to the actual value of the β function relative error index after writing.

[0011] Optionally, in writing the interaction data corresponding to the control cycle that did not trigger a rollback operation into the interaction memory pool, the memory module is specifically used for: After the control cycle ends without triggering a rollback operation, the multi-channel observation tensor before execution, the multi-channel observation tensor after execution, the β function estimate and uncertainty output by the sensing module before execution, the physical correction amount after the actual write safety limit, and the β function residual and operating point residual after execution are used as interactive memory samples and written into the interactive memory pool in a first-in-first-out manner.

[0012] Optionally, in the step of constructing the β-function residual spectrum based on the interactive memory samples and performing error source dictionary decomposition to obtain dictionary non-negative weights and reconstructed residual ratios, the learning module is specifically used for: Based on the post-execution β-function residuals in the interactive memory samples, a β-function residual spectrum is constructed. The β-function residual spectrum is then decomposed using an error source dictionary to obtain the non-negative weights corresponding to each dictionary primitive in the error source dictionary. A reconstructed spectrum of the β-function residual spectrum is constructed based on these non-negative weights. The reconstructed residual ratio is calculated based on the β-function residual spectrum and the reconstructed spectrum. If the reconstructed residual ratio is greater than a preset threshold, the current β-function residual spectrum is determined to be difficult to interpret by the error source dictionary, and the current operating condition is identified as an unseen operating condition or a β-function distribution out-of-distribution operating condition. The error source dictionary includes multiple dictionary primitives, which are generated by the physical simulator scanning for error sources during the offline phase.

[0013] Optionally, in generating the physical consistency supervision signal based on the interactive memory samples and the physical simulator, the learning module is specifically used for: Based on the pre-execution multi-channel observation tensor in the interactive memory sample, the pre-execution β function estimate and uncertainty are obtained through the perception module; Based on the residual between the estimated value of the β function before execution and the reference value of the β function, and combined with the operating point residual, the quadrupole magnet focusing intensity correction amount is obtained through the decision module. The current quadrupole magnet focusing intensity and the quadrupole magnet focusing intensity correction amount are input into the physical simulator to obtain the post-execution β function derivation value, which is used to construct a physical consistency monitoring signal. The learning module is also used to: obtain the post-execution β function estimate and post-execution uncertainty through the perception module based on the post-execution multi-channel observation tensor in the interactive memory sample; The heteroscedastic Gaussian negative log-likelihood loss is calculated based on the post-execution β function derivation value, the post-execution β function estimate value, and the post-execution uncertainty. Calculate the closure loss based on the post-execution β function estimate, the β function reference value, and the post-execution uncertainty. Based on the closed-loop deduction relationship between the perception module, the decision module, and the physical simulator, calculate the physical forward consistency loss; The adaptive elastic weight solidification anchoring loss is calculated based on the offset of the lightweight adaptation parameters relative to the pre-trained parameters, the parameter importance weights, and the mode-level uncertainty obtained by projecting the post-execution uncertainty onto each retained frequency mode. The joint loss is calculated based on the heteroscedastic Gaussian negative log-likelihood loss, the closure loss, the physical forward consistency loss, and the adaptive elastic weight fixed anchoring loss.

[0014] Optionally, the lightweight adaptation parameters include the frequency domain low-rank adaptation parameters, uncertainty header parameters, frequency domain routing gating parameters in the perception module, and decision subspace adapter parameters in the decision module; regarding updating the lightweight adaptation parameters in the perception module and the decision module according to the frequency domain routing gating weights and the joint loss including physical forward consistency loss, the learning module is specifically used for: When fine-tuning the perception module online, the parameters of the one-dimensional Fourier neural operator backbone network in the perception module are kept frozen. The frequency domain low-rank adaptation incremental injection intensity on each retained frequency module is adjusted according to the frequency domain routing gate weight. The frequency domain low-rank adaptation parameters, uncertainty head parameters and frequency domain routing gate parameters are updated according to the joint loss. When fine-tuning the decision module online, the backbone parameters of the pre-trained decision network are kept frozen, and the parameters of the decision subspace adapter are updated according to the joint loss. The decision subspace adapter is set in the bypass of the pre-trained decision network. The decision subspace adapter is used to incrementally correct the quadrupole magnet focusing intensity correction output by the pre-trained decision network, and the incremental correction output by the decision subspace adapter is restricted to the physical response subspace spanned by the right singular vector of the subspace response matrix.

[0015] The embodiments of this application have the following beneficial technical effects: First, this application enables continuous fine-tuning of the model in the absence of external true values ​​or true correction labels for the β function during the online phase, maintaining the closed-loop adaptive capability of the β function correction process. Specifically, this application constructs a physical closed-loop constraint of "perception-decision-physics" based on interactive memory samples, the estimated β function output by the perception module, the physical correction output by the decision module, and the post-execution β function state derived by the physical simulator, and generates a physical consistency supervision signal, thereby providing an update basis for the online fine-tuning of the perception and decision modules under conditions without external truth values.

[0016] Secondly, this application can improve the estimation capability of the β function while constraining the model update range and the direction of the correction update, thereby improving the stability of online correction. Specifically, in the perception module, this application uses frequency domain low-rank adaptation parameters, uncertainty head parameters, and frequency domain routing gating parameters for lightweight updates to adapt to phase correlation errors and frequency domain drift; in the decision module, this application incrementally corrects the output of the decision network through a decision subspace adapter, and restricts this incremental correction to the physical response subspace spanned by the right singular vector of the subspace response matrix, thereby maintaining low training overhead in the online update process and ensuring the physical executability of the quadrupole magnet correction direction.

[0017] Furthermore, this application can adaptively adjust the fine-tuning strategy based on the source of drift and model uncertainty, thereby improving its adaptability to multi-source drift. Specifically, this application performs non-negative sparse decomposition on the residual spectrum of the β function after execution using an error source dictionary to obtain dictionary non-negative weights reflecting the sources of drift, and identifies unseen operating conditions or out-of-distribution drift by reconstructing the residual ratio; at the same time, it adaptively allocates the online fine-tuning intensity by combining the mode-level uncertainty output by the sensing module, avoiding indiscriminate updates to all parameters or all frequency modes.

[0018] Therefore, this application forms an overall technical solution that combines physical closed-loop fine-tuning without external truth value, controlled fine-tuning through perception and decision-making collaboration, and adaptive fine-tuning driven by error sources, which balances correction accuracy, update stability, and multi-source drift adaptability during long-term online operation. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This illustration shows a schematic diagram of the architecture of an online correction system for the storage ring β function based on adaptive fine-tuning, according to an embodiment of this application. Figure 2 A flowchart illustrating an embodiment of the online correction method for the storage ring β function based on adaptive fine-tuning provided in this application is shown. Figure 3 A schematic diagram of the structure of a computer device provided in one embodiment of this application is shown. Detailed Implementation

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

[0022] Please refer to Figure 1 This illustration shows a schematic diagram of the architecture of an online correction system for the storage ring β function based on adaptive fine-tuning, provided in one embodiment of this application. The online correction system for the storage ring β function based on adaptive fine-tuning includes: The sensing module is used to construct a multi-channel observation tensor in each control cycle based on the current beam closure trajectory deviation of the storage ring, the current focusing intensity of the quadrupole magnet, and the ideal value of the β function obtained under the focusing intensity; and to determine the estimated value and uncertainty of the β function at the center position of the quadrupole magnet based on the multi-channel observation tensor. The decision module is used to calculate the β function residual based on the β function estimate and the β function reference value, and to calculate the operating point residual based on the current operating point and the reference operating point; and to determine the physical correction amount of the focus intensity based on the β function residual and the operating point residual. The execution module is used to write the physical correction amount to the corresponding quadrupole magnet power supply after scalar gain adjustment and safety limiting, and to perform rollback protection and scalar gain adaptive update according to the change of the relative error index of the β function before and after writing. The memory module is used to write the interaction data corresponding to the control cycle that has not triggered a rollback operation into the interaction memory pool; The learning module, when online learning trigger conditions are met, selects interactive memory samples from the interactive memory pool, constructs a β-function residual spectrum based on the interactive memory samples, and performs error source dictionary decomposition to obtain dictionary non-negative weights and reconstruction residual ratios. It generates a physical consistency monitoring signal based on the interactive memory samples and the physical simulator; determines the frequency domain routing gating weights based on uncertainty and dictionary non-negative weights; and updates the lightweight adaptation parameters in the perception and decision modules based on the frequency domain routing gating weights and the joint loss, including physical forward consistency loss. The physical forward consistency loss is determined based on the physical consistency monitoring signal and is used to constrain the closed-loop inference consistency between the perception module, decision module, and physical simulator. The beam closure trajectory deviation refers to the deviation between the actual position of the beam particles near the closed trajectory and the ideal designed trajectory. Ideally, the beam particles should circulate along the designed trajectory at the center of the vacuum tube. In reality, due to quadrupole magnet strength deviation, magnet errors, etc., the beam trajectory will deviate from the designed trajectory. The focusing intensity refers to the readback value of the current actual excitation intensity of the quadrupole magnet. Quadrupole magnets can generate linear lateral focusing forces, which, depending on the sign of the focusing intensity, can focus or defocus beam particles in the vertical or horizontal direction. The β function is one of the most fundamental functions in particle accelerator physics, describing the distribution of the envelope amplitude of the lateral oscillation of particles in the storage ring along the orbit.

[0023] Among them, the ideal value of the β function refers to the theoretical β function value obtained by the physical simulator under the current focusing intensity; the estimated value of the β function is the current β function estimation result output by the sensing module based on the multi-channel observation tensor; and the reference value of the β function is the β function value corresponding to the preset target optical state.

[0024] The β-function residual characterizes the deviation of the estimated β-function value from the reference β-function value. The current operating point represents the number of transverse oscillation cycles per revolution of the particle in the current operating state of the storage ring, which can be read by the accelerator control system or beam diagnostic system. The reference operating point is the operating point corresponding to the preset target optical state. The operating point residual characterizes the deviation of the current operating point from the reference operating point. The β-function relative error index characterizes the global relative deviation of the estimated β-function value from the reference β-function value. The decision module generates a physical correction for the quadrupole magnet focusing intensity based on the β-function residual and the operating point residual, ensuring that the correction process simultaneously considers β-function distortion and operating point offset.

[0025] The physical simulator is used to construct a simulated storage ring corresponding to the actual storage ring based on the magnetic component layout, magnet parameters, beam energy, and optical parameters of the actual storage ring, and to solve for the optical state of the simulated storage ring. When the key parameters of the simulated storage ring match those of the actual storage ring, the β function, operating point, and error source perturbation response calculated by the physical simulator can serve as a physical approximation of the optical state of the actual storage ring, used to generate the ideal value of the β function, the error source dictionary, and the supervision signal during the online learning phase. The physical simulator can be implemented using Accelerator Toolbox, pyAT, MADX, Elegant, Bmad, or other beam dynamics simulation programs; in this embodiment, the physical simulator is implemented using pyAT.

[0026] The interactive memory samples are used to record the pre- and post-execution states, the actual physical corrections written, and the post-execution β-function residuals and operating point residuals during effective control cycles without triggering rollback. The error source dictionary characterizes the feature patterns of typical error sources in the β-function residual spectrum; the dictionary's non-negative weights represent the degree of matching between the current β-function residual spectrum and the primitives of each error source dictionary; the reconstructed residual ratio measures whether the current β-function residual spectrum can be explained by the existing error source dictionary. The physical consistency supervision signal is a supervision signal constructed based on the pre- and post-execution states in the interactive memory samples, the β-function estimates and uncertainties output by the perception module, the quadrupole magnet focusing intensity correction output by the decision module, and the post-execution β-function inference values ​​generated by the physical simulator when the external β-function true value or true correction label cannot be directly obtained during online operation. The physical consistency supervision signal is used to construct the physical forward consistency loss in the joint loss to constrain the closed-loop inference consistency between the perception module, the decision module, and the physical simulator.

[0027] Thus, the perception module, decision-making module, execution module, memory module, and learning module work together: the perception module estimates the current state of the β function, the decision-making module generates a physical correction for the focusing intensity of the quadrupole magnet, the execution module completes safe write and rollback protection, the memory module saves valid interaction samples that have not triggered rollback, and the learning module generates a physical consistency supervision signal based on the interaction samples and the physical simulator, and updates the lightweight adaptation parameters in the perception and decision-making modules online according to the joint loss, thereby forming a storage-loop β function online correction closed loop with state perception, correction decision, safe execution, experience accumulation, and adaptive fine-tuning capabilities.

[0028] In a specific embodiment provided in this application, the sensing module is specifically used to construct a multi-channel observation tensor based on the current beam closure trajectory deviation of the storage ring, the current focusing intensity of the quadrupole magnet, and the ideal value of the β function obtained under the focusing intensity, and to determine the estimated value and uncertainty of the β function at the center position of the quadrupole magnet based on the multi-channel observation tensor. The beam position monitor obtains the current horizontal and vertical beam closure trajectory deviation of the storage ring from the accelerator in real time; and the quadrupole magnet control system reads the current focusing intensity of the quadrupole magnet. The ideal value of the β function is obtained by solving the Twiss equation under focused intensity without superimposed additional perturbations using a physical simulator. By stitching together the beam closure trajectory deviation, focusing intensity, and ideal value of the β function, a multi-channel observation tensor is obtained; The multi-channel observation tensor is decomposed into a focus intensity branch input and an orbit branch input. The focus intensity branch input includes the focus intensity and the ideal value of the β function, while the orbit branch input includes the beam closure orbit deviation. The physical phase code is constructed based on the betatron phase at the center position of each quadrupole magnet, and the physical phase code is introduced into the focus intensity branch input and the orbit branch input. The focus intensity branch input and the orbit branch input are respectively input into the corresponding branches of the one-dimensional Fourier neural operator backbone network and fused to obtain the shared feature tensor. By inputting the shared feature tensor into the mean header and uncertainty header respectively, the estimated value of the β function and the uncertainty at the center position of the quadrupole magnet are obtained.

[0029] The storage ring has two independent lateral movement directions, therefore the beam closure trajectory deviation is also divided into two planes: the horizontal plane beam closure trajectory deviation. Beam closure trajectory deviation in the vertical plane The number of single-plane beams and the number of beam position monitors Same. Focus intensity The number of quadrupole magnets involved in the correction link Similarly, the same set of quadrupole magnets simultaneously affects the β function in both the horizontal and vertical planes.

[0030] The ideal value of the β function is the physical simulator at the current focus intensity. The ideal value of the β function at the center of the quadrupole magnet is obtained by solving the following. The beam closure trajectory deviation, focusing intensity, and the ideal value of the β function together constitute the multi-channel observation tensor. , is used to characterize the current storage ring state.

[0031] The focus intensity branch input includes the focus intensity K and the ideal value of the β function. The current magnetic focusing state and its ideal optical response are characterized; the orbit branch input includes the beam closure orbit deviation, which is used to characterize the behavior of the disturbance on the closed orbit.

[0032] To enable the network to perceive the true optical position of the storage ring before frequency domain modeling, this application introduces physical phase encoding at the center position of each quadrupole magnet. Let the betatron phase at the center position of the i-th quadrupole magnet be... The physical phase code is then: , in, For the preset frequency sequence, k is the frequency mode index, corresponding to the frequency domain mode number in the one-dimensional Fourier neural operator. The betatron phase represents the center position of the quadrupole magnet in the horizontal and vertical planes. , Calculated by a physical simulator using Twiss, no training is required. Unlike ordinary position coding based on uniform spatial indexing, this coding reflects the true optical phase of the preset optical sampling position in the storage ring, aligning the frequency domain characteristics of the one-dimensional Fourier neural operator with the betatron phase structure.

[0033] The ideal value of the focus intensity K and the β function The input is fed into the backbone network of a one-dimensional Fourier neural operator to obtain the K-branch feature vector of the output. The orbital branch is input into the backbone network of a one-dimensional Fourier neural operator to obtain the output orbital branch feature vector. , and A preset number of low-frequency patterns can be retained, such as the first 12 low-frequency patterns. Concatenating these two sets yields a shared feature tensor. .

[0034] The model's pre-level network is used to extract general features. This pre-level network includes a one-dimensional Fourier neural operator backbone network, which serves as the shared feature extraction part for both the mean head and the uncertainty head. The mean head outputs the standardized β residual based on the shared feature tensor; the standardized β residual is then de-standardized and added back to the β function reference value to obtain the β function estimate at the center of the quadrupole magnet. The uncertainty head outputs the β function estimate uncertainty at the center of the quadrupole magnet based on the shared feature tensor.

[0035] In one implementation, the uncertainty head employs an operator decomposition structure: first, weighted pooling is performed on the sequence of z(s) along the center positions of the quadrupole magnet to obtain the global branch vector. The physical phase code of the center position of the i-th quadrupole magnet is reused. As a base: , The uncertainty at the center position of the i-th quadrupole magnet is calculated as follows: , The uncertainty is then subjected to an exponential transformation and upper / lower bound clamping. The upper and lower bounds of the uncertainty are obtained statistically from the standard deviation of the β residuals on the offline validation set and written into the pre-training parameter package, without being re-estimated in the online phase.

[0036] In the offline phase, the uncertainty head employs a three-stage training approach: first, the mean head is trained with σ=1; then, the one-dimensional Fourier neural operator backbone network is frozen and σ is warmed up; finally, heteroscedastic Gaussian negative log-likelihood loss is used to jointly train the mean head and the uncertainty head. In the online phase, the three-stage training is not repeated. Instead, the heteroscedastic Gaussian negative log-likelihood loss term is retained in the joint loss calculated by the learning module, and the lightweight parameters of the uncertainty head are updated online based on the joint loss.

[0037] Mode-level uncertainty The uncertainty can be determined by projecting the uncertainty onto each frequency mode. For example, a real-valued Fast Fourier Transform is performed on the uncertainty vector at the center of the quadrupole magnet, and the first 12 frequency components are extracted to obtain the mode-level uncertainty. This is used for frequency domain routing gating during the online learning phase.

[0038] The β function estimate is used in the subsequent decision module to calculate the β function residual; the uncertainty is used for heteroscedastic Gaussian negative log-likelihood loss, closure loss weighting, and frequency domain routing gating in the online learning phase.

[0039] In a specific embodiment provided in this application, the decision module is specifically used for determining the physical correction amount of the focus intensity based on the β function residual and the operating point residual, in order to: The residuals of the β function and the operating point are concatenated to obtain the residual tensor; The residual tensor is input into the decision network to obtain the standardized quadrupole magnet correction. By denormalizing the standardized quadrupole magnet correction, the physical correction of the quadrupole magnet focusing intensity in physical dimensions is obtained.

[0040] For example, for horizontal and vertical planes respectively: , , , , in, , These are the β function residuals in the horizontal and vertical planes, respectively. , These are the estimated values ​​of the β function for the horizontal and vertical planes, respectively. , These are the reference values ​​for the β function in the horizontal and vertical planes, respectively. , These are the working point residuals in the horizontal and vertical planes, respectively. , These are the estimated working point values ​​for the horizontal and vertical planes, respectively. , These are the reference values ​​for the working points in the horizontal and vertical planes, respectively.

[0041] By concatenating the two, the residual tensor can be obtained. The residual tensor serves as the input to the decision network, characterizing the relationship between the horizontal and vertical plane β function distortions and the working point offset, thus avoiding residual errors left when correcting solely based on the single-plane β function residuals.

[0042] In one implementation, the decision network can employ a three-stage structure of local feature extraction, global correlation modeling, and regression output to process the residual tensor and obtain the standardized quadrupole magnet correction. Subsequently, the standardized quadrupole magnet correction was de-standardized to obtain the physical correction of the quadrupole magnet focusing intensity in physical dimensions.

[0043] Therefore, the decision module generates a physical correction amount for adjusting the focusing intensity of the quadrupole magnet based on the β function residuals of the horizontal and vertical planes and the operating point residuals.

[0044] In a specific embodiment provided in this application, after scalar gain adjustment and safety limiting of the physical correction amount, the corresponding quadrupole magnet power supply is written, and rollback protection and scalar gain adaptive update are performed based on the change in the relative error index of the β function before and after writing. The execution module is specifically used for: The physical correction amount is safely limited based on the scalar gain and the single-step correction upper limit, and the safely limited physical correction amount is written to the corresponding quadrupole magnet power supply through the quadrupole magnet control system. After the writing is completed and the beam state is stabilized, the data is re-acquired and the actual value of the β function relative error index after writing is calculated. If the actual value of the β function relative error index after writing deteriorates by more than a preset deterioration threshold compared to the actual value of the β function relative error index before writing, a rollback operation is triggered and the scalar gain is reduced. If the actual value of the β function relative error index after writing does not deteriorate by more than a preset deterioration threshold compared to the actual value of the β function relative error index before writing, the scalar gain is updated according to the actual value of the β function relative error index after writing.

[0045] For example, the physical correction amount after the safety limit is: , in, This is the scalar gain for the current control cycle. For the i-th physical correction value, This is the preset single-step correction limit.

[0046] For example, the relative error index of the β function is:

[0047] in, The relative error index of the β function. For the first Estimates of the β function at the center position of each quadrupole magnet. For the first Reference value of β function at the center position of each quadrupole magnet This represents the number of center positions of the quadrupole magnet.

[0048] The above mechanism is used to adaptively adjust the subsequent correction step size based on the correction effect while ensuring write safety.

[0049] Please continue to refer to this. Figure 1 Regarding writing the interaction data corresponding to the control cycle that did not trigger a rollback operation into the interaction memory pool, the memory module is specifically used for: After the control cycle ends without triggering a rollback operation, the multi-channel observation tensor before execution, the multi-channel observation tensor after execution, the β function estimate and uncertainty output by the sensing module before execution, the physical correction amount after the actual write safety limit, and the β function residual and operating point residual after execution are used as interactive memory samples and written into the interactive memory pool in a first-in-first-out manner.

[0050] Each interactive memory sample includes:

[0051] in, and These are the multi-channel observation tensors before and after execution, respectively. These represent the estimated value of the β function output by the sensing module and its uncertainty, respectively. This is the physical correction amount after the actual write safety limit. The residual of the β function after execution. This refers to the residual at the work point after execution.

[0052] The interactive memory pool has a limited capacity and is managed using a first-in, first-out (FIFO) approach.

[0053] Please continue to refer to this. Figure 1 In terms of constructing the β-function residual spectrum based on the interactive memory samples and performing error source dictionary decomposition to obtain dictionary non-negative weights and reconstructed residual ratios, the learning module is specifically used for: The β function residual spectrum is constructed based on the post-execution β function residual in the interactive memory sample. The β function residual spectrum is then decomposed into an error source dictionary to obtain the non-negative weights corresponding to each dictionary primitive in the error source dictionary. The reconstructed spectrum of the β function residual spectrum is constructed based on the non-negative weights, and the reconstructed residual ratio is calculated based on the β function residual spectrum and the reconstructed spectrum. If the reconstructed residual ratio is greater than a preset reconstructed residual ratio threshold, it is determined that the current β function residual spectrum is difficult to explain by the error source dictionary, and the current working condition is determined to be an unseen working condition or a β function distribution out-of-distribution working condition. The error source dictionary includes multiple dictionary primitives, which are generated by the physical simulator scanning error sources during the offline stage.

[0054] In this embodiment, the online learning is triggered when the online learning triggering conditions are met. The online learning triggering conditions include at least one of the following: the number of control cycles since the last online learning reaches a preset learning interval; the actual value of the relative error index of the β function is higher than a preset convergence threshold for a consecutive preset number of control cycles; the improvement of the relative error index of the β function is lower than a preset improvement threshold; the reconstruction residual ratio obtained from the most recent error source dictionary decomposition is greater than or equal to a preset reconstruction residual ratio threshold; and the number of interactive memory samples in the interactive memory pool reaches a preset sample number threshold.

[0055] In one implementation, the learning module constructs a β function residual spectrum based on the post-execution β function residual in the interactive memory samples. For example, a real-valued Fast Fourier Transform is performed on the post-execution β function residual along the index direction of the quadrupole magnet's center position, and the first 12 low-frequency components are extracted to obtain the β function residual spectrum: , The learning module performs nonnegative sparse decomposition on the β function residual spectrum based on the error source dictionary, obtaining the nonnegative weights corresponding to each dictionary primitive. In the online phase, the current β function residual spectrum is represented as a nonnegative sparse combination of the error source dictionary primitives: , in, Let i be the dictionary primitive for the i-th error source, i=1,2,…,24; These are the non-negative weights of the dictionary primitives in the current residual spectrum. The dictionary non-negative weights are obtained by solving non-negative least squares with L1 regularization.

[0056] Furthermore, the learning module constructs a reconstructed spectrum of the β-function residual spectrum based on the non-negative weights, and calculates the reconstructed residual ratio based on the β-function residual spectrum and the reconstructed spectrum: , in, To reconstruct the residual ratio, The reconstructed spectrum is obtained based on the error source dictionary and non-negative weights. If the reconstructed residual ratio is greater than the preset reconstructed residual ratio threshold, it is determined that the current β function residual spectrum is difficult to interpret by the error source dictionary, and the current operating condition is regarded as an unseen operating condition or it is determined that the β function has out-of-distribution drift.

[0057] The error source dictionary comprises multiple dictionary primitives, generated offline by the physical simulator scanning for different error sources. For example, separate error source dictionaries can be set for the horizontal and vertical planes, each containing 24 dictionary primitives. Error sources include at least one of the following: magnet DC bias, magnetic power supply ripple, mechanical backlash, BPM gain error, BPM zero-point offset, support tilt, feed error, or transmission error. The resulting dictionary primitives have corresponding physical labels, used to explain the current β function drift source during the online phase.

[0058] Furthermore, the learning module is also used to: select interactive memory samples from the interactive memory pool when the online learning trigger conditions are met, and construct a physical consistency supervision signal for online fine-tuning based on the interactive memory samples.

[0059] Since the true value of the external β function or the label of the external true correction quantity is usually not available in the online phase, the learning module generates a physical consistency supervision signal by utilizing the closed-loop relationship between the perception module, the decision module and the physical simulator.

[0060] Specifically, the learning module obtains the pre-execution β function estimate and uncertainty through the perception module based on the pre-execution multi-channel observation tensor in the interactive memory sample; based on the difference between the pre-execution β function estimate and the β function reference value, and combined with the operating point residual, the decision module obtains the physical correction amount; then, the current quadrupole magnet focusing intensity and the physical correction amount are input into the physical simulator to obtain the post-execution β function extrapolation value corresponding to the physical correction amount.

[0061] For example, the derived value of the β function after execution is:

[0062] in, The value of the β function after execution is given, and F is the physical simulator. The focusing intensity of the quadrupole magnet during the current control cycle. The physical correction amount output by the decision module, or the physical correction amount after the safety limit is applied to the actual write during a rollback control cycle that has not been triggered. .

[0063] If the estimated β function output by the perception module after execution deviates from the inferred β function value, this deviation is used to construct heteroscedastic Gaussian negative log-likelihood loss, closure loss, or physical forward consistency loss to jointly adjust the lightweight adaptation parameters in the perception and decision modules. Thus, without external truth labels, the learning module uses the inferred β function value provided by the physical simulator to impose physical consistency constraints on the state estimation of the perception module and the generation of corrections by the decision module.

[0064] In one implementation, since the physical simulator is non-differentiable, when the joint loss needs to be backpropagated to the decision module via the physical simulator, the learning module uses the forward response matrix near the current focusing intensity of the quadrupole magnet. As a first-order linearly differentiable surrogate. Forward response matrix. This characterizes the local linear relationship between the perturbation of the quadrupole magnet's focusing intensity and the change in the β function near the current focusing intensity. In this case, the derived value of the β function after execution can be approximately expressed as:

[0065] in, This represents the change in the β function prediction caused by the physical correction. Forward response matrix. Initial calibration can be performed offline, and rolling calibration can be performed according to a preset period or changes in machine status. Furthermore, the learning module calculates the heteroscedastic Gaussian negative log-likelihood loss based on the post-execution β function estimate, uncertainty, and post-execution β function extrapolation; it calculates the closure loss based on the post-execution β function estimate, β function reference value, and uncertainty; it calculates the physical forward consistency loss based on the physical closed-loop output formed by the perception module, decision module, physical simulator, or its first-order linear differentiable agent; it calculates the adaptive elastic weight solidification anchoring loss based on the mode-level uncertainty; and it calculates the joint loss based on the heteroscedastic Gaussian negative log-likelihood loss, closure loss, physical forward consistency loss, and adaptive elastic weight solidification anchoring loss.

[0066] The lightweight adaptation parameters in the perception and decision modules are updated based on the joint loss. For example, the heteroscedastic Gaussian negative log-likelihood loss is: , in, This is the post-execution β function derivation value at the center position of the i-th quadrupole magnet, obtained by the physical simulator or its first-order linear differentiable proxy. and These represent the β function estimate and uncertainty at the center position of the i-th quadrupole magnet, output by the sensing module based on the multi-channel observation tensor after execution. This represents the number of center positions of the quadrupole magnet.

[0067] Closure loss is used to assess whether the perceived β function returns to its reference value after constraint execution. For example, the closure loss is: , in, This is the reference value for the β function at the center position of the i-th quadrupole magnet. A preset constant is used to prevent the denominator from being zero. Preset the signal threshold.

[0068] Physical forward consistency loss is used to constrain the physical closed-loop self-consistency between the perception module, the decision module, and the physical simulator or its forward response matrix agent.

[0069] For example, the physical forward consistency loss is: , in, This indicates the perception module. Let F represent the decision module, and let F represent the physics simulator or its first-order linearly differentiable agent. The focusing intensity of the quadrupole magnet during the current control cycle. For the working point residual, It is the covariance matrix or weight matrix composed of uncertainties.

[0070] To suppress the online fine-tuning of forgetting pre-training capabilities, an adaptive elastic weight-based anchoring loss is employed. , in, Indicates the first Low-rank adaptation parameters of each frequency mode Its initial value, This is the corresponding diagonal Fisher information matrix; Pre-train parameters for the decision module, Let this be its diagonal Fisher information matrix. The adaptive regularization coefficients are: , in, Let k be the uncertainty corresponding to the k-th frequency modulus. This represents the average value of the mode-level uncertainty. and These are preset coefficients. The high-uncertainty frequency band gains greater adaptability, while the low-uncertainty frequency band receives stronger anchoring protection. The ultimate joint objective is: , in, , , The weights corresponding to different loss terms.

[0071] Furthermore, the learning module uses joint loss as the optimization objective to fine-tune the lightweight adaptation parameters in the perception and decision modules.

[0072] For the perception module, to achieve lightweight online fine-tuning, the learning module does not directly update all complex frequency domain weights of the one-dimensional Fourier neural operator backbone network. Instead, it introduces a low-rank adaptation increment on each retained frequency modulus. Let the complex frequency domain weights after adaptation for the k-th frequency modulus be:

[0073] in, The frozen pre-trained complex frequency domain weights are the values ​​corresponding to the k-th frequency modulus. and For online trainable low-rank factors, This indicates the conjugate transpose. Let be the routing gating weight for the k-th frequency modulus in the current control cycle. During the online phase, the weights of the one-dimensional Fourier neural operator backbone network are kept frozen, and the low-rank factor, uncertainty head parameter, and frequency domain routing gating parameter are mainly updated, thereby reducing online training overhead and suppressing catastrophic forgetting.

[0074] To avoid indiscriminate updates to all frequency modes during online fine-tuning, the learning module constructs a frequency-domain routing gate driven by both mode-level uncertainty and error source dictionary decomposition results. The frequency-domain routing gate generates continuous activation weights for each retained frequency mode. ∈[0,1], used to control the injection intensity of the low-rank adaptation increment of the frequency modulus.

[0075] For example, the learning module is based on the current β function residual spectrum. and mode-level uncertainty Determine the significance of the residual of the k-th frequency modulus:

[0076] Simultaneously, the learning module projects the non-negative weights obtained from the error source dictionary decomposition onto the k-th frequency modulus to obtain the error source correlation strength:

[0077] in Let i be the non-negative weight of the dictionary primitive of the i-th error source. Let i represent the set of frequency moduli corresponding to the dictionary primitives of the i-th error source.

[0078] Based on the significance of residuals and the correlation strength of error sources, frequency-mode routing gating weights are generated:

[0079] In one implementation, the Gate can be a sigmoid gate:

[0080] in, , and These are trainable or preset gating parameters. Consequently, frequency moduli that are more significant in the current β function residual spectrum and more relevant to the error source dictionary interpretation receive higher fitting strength, while weaker frequency moduli maintain lower update strength.

[0081] When the reconstruction residual ratio When the residual ratio exceeds the preset reconstruction threshold, the learning module sets a minimum activation lower limit for each frequency modulus. This enables the perception module to perform low-intensity exploration of unseen operating conditions or out-of-distribution drift; at the same time, it enhances the anchoring strength in the adaptive elastic weight solidification anchoring loss to avoid excessive destruction of pre-training capabilities due to unknown drift. Frequency domain routing gating only affects the activation of the low-rank adapter on the learning side and does not directly change the safety limiting and writing strategy of the execution module.

[0082] For the decision module, the learning module can set up a decision subspace adapter in the bypass of the pre-trained decision network to incrementally correct the quadrupole magnet correction amount output by the pre-trained decision network during the online fine-tuning phase.

[0083] During online fine-tuning, the backbone parameters of the pre-trained decision network remain frozen, while the decision subspace adapter parameters participate in the update as part of the lightweight adaptation parameters. The closure loss and physical forward consistency loss in the joint loss are connected to the physics simulator or response matrix proxy through the physical correction output by the decision module, enabling the decision subspace adapter to be updated according to the joint loss.

[0084] For example, the final physical correction amount after online fine-tuning of the decision module is: , in, The principal correction is obtained after inverse standardization of the pre-trained decision network. This is the physical dimension increment correction amount output by the decision subspace adapter.

[0085] To ensure the physical feasibility of the incremental correction, in this embodiment, the learning module restricts the output of the decision subspace adapter to the subspace response matrix. Within the physical response subspace spanned by the right singular vectors. Subspace response matrix. The physical response subspace is used to construct the decision subspace adapter and represents the linear response of the quadrupole magnet focusing intensity perturbation to changes in the β function of the horizontal and vertical planes. It should be noted that the aforementioned forward response matrix... Subspace response matrix for the local forward variation of an approximate physical simulator used in the online learning phase near the current quadrupole magnet focusing intensity. The incremental correction direction used to constrain the decision subspace adapter, and both can be calibrated by a physics simulator, but for different purposes. For example, in the case of 32 quadrupole magnets, with the center positions of 32 quadrupole magnets in each plane:

[0086] In the offline phase, small positive and negative perturbations are applied to each quadrupole magnet, and the change of the β function is calculated using a physical simulator. The corresponding columns of the subspace response matrix are obtained using central difference. Then, singular value decomposition is performed on the subspace response matrix.

[0087] The first few right singular vectors are retained as feasible output subspaces of the decision subspace adapter. For example, the first 16 right singular vectors are retained and used to form the basis of the physical response subspace. The output of the decision subspace adapter can be expressed as:

[0088] in, For the hidden layer output of the decision subspace adapter, The coefficient matrix is ​​trainable online. Let be the physical response subspace basis composed of the right singular vectors of the subspace response matrix.

[0089] Therefore, the decision subspace adapter adjusts the quadrupole magnet correction amount within the main physical response subspace of the subspace response matrix, so that the incremental correction direction obtained by online fine-tuning remains within the physically controllable direction, avoiding the introduction of correction directions that have a weak impact on the β function, poor physical interpretability, or may destroy the beam stability.

[0090] During online operation, the subspace response matrix can be calibrated on a rolling basis according to a preset period or machine state change conditions. When the subspace response matrix is ​​updated, the learning module synchronously updates the physical response subspace basis, so that the feasible output subspace of the decision subspace adapter is consistent with the current machine state.

[0091] The embodiments of this application have the following beneficial technical effects: First, through the collaboration of the memory module, learning module, perception module, decision module, and physical simulator, this embodiment can construct a physical consistency supervision signal even in the absence of external true values ​​or true correction amount labels for the β function during the online phase, thus maintaining the closed-loop adaptive capability of the β function correction process. Specifically, the memory module stores valid interaction samples that have not triggered rollback. The learning module constructs a physical closed-loop constraint of "perception-decision-physics" based on the interaction samples, the estimated β function output by the perception module, the physical correction amount output by the decision module, and the post-execution β function state derived by the physical simulator. This provides an update basis for the online fine-tuning of the perception module and the decision module under conditions without external truth values.

[0092] Secondly, by employing different lightweight adaptation methods for the perception and decision modules through the learning module, this embodiment can reduce the risk of online updates while adapting to machine state drift. Specifically, on the perception module side, the learning module freezes the one-dimensional Fourier neural operator backbone network and only updates the frequency domain low-rank adaptation parameters, uncertainty head parameters, and frequency domain routing gating parameters, enabling the perception module to perform controlled corrections for phase correlation errors and frequency domain drift. On the decision module side, the learning module freezes the pre-trained decision network backbone and generates incremental corrections through the decision subspace adapter, and these incremental corrections are restricted to the subspace response matrix. Within the physical response subspace spanned by the right singular vectors. Thus, online updates maintain the capabilities of the pre-trained model while ensuring good physical executability and stability of the quadrupole magnet correction direction.

[0093] Furthermore, through error source dictionary decomposition and uncertainty-driven routing in the learning module, this embodiment can adaptively allocate fine-tuning intensity based on drift sources and model uncertainties. Specifically, the learning module performs error source dictionary decomposition based on the residual spectrum of the β function after execution, obtaining dictionary non-negative weights and reconstruction residual ratios, which are used to identify current drift sources and unseen conditions. Simultaneously, combined with the mode-level uncertainty output by the sensing module, different activation intensities are allocated to the low-rank adaptation increments of different frequency modes, and the anchor loss constraint parameter offset is solidified through adaptive elastic weights. Thus, online fine-tuning is no longer an indiscriminate update of all parameters or all frequency modes, but rather matched with error sources and model uncertainties.

[0094] In summary, the embodiments of this application, through the collaboration of the perception module, decision-making module, execution module, memory module, and learning module, form an online correction scheme for the storage loop β function that combines physical closed-loop fine-tuning without external truth values, controlled fine-tuning through perception and decision-making collaboration, and adaptive fine-tuning driven by error sources. This scheme balances β function correction accuracy, online update stability, and multi-source drift adaptability during long-term online operation.

[0095] Please refer to Figure 2 This document illustrates a flowchart of an online correction method for the storage ring β function based on adaptive fine-tuning, according to an embodiment of this application. This method can be applied to computer devices, which refer to electronic devices capable of data computation and processing. The method may include the following steps: Step 201: Through the sensing module, in each control cycle, construct a multi-channel observation tensor based on the current beam closure trajectory deviation of the storage ring, the current focusing intensity of the quadrupole magnet, and the ideal value of the β function obtained by the physical simulator under the focusing intensity.

[0096] Step 202: Using the sensing module, determine the estimated value and uncertainty of the β function at the center position of the quadrupole magnet based on the multi-channel observation tensor.

[0097] Step 203: Calculate the β function residual based on the β function estimate and the β function reference value using the decision module, and calculate the operating point residual based on the current operating point and the reference operating point.

[0098] Step 204: Determine the physical correction amount for the focusing intensity of the quadrupole magnet based on the β function residual and the operating point residual through the decision module.

[0099] Step 205: Through the execution module, the physical correction amount is written to the corresponding quadrupole magnet power supply after scalar gain adjustment and safety limiting. Rollback protection and adaptive scalar gain update are then performed based on the change in the relative error index of the β function before and after writing. Step 206: Through the memory module, after the control cycle without triggering rollback operation ends, the multi-channel observation tensors before and after execution, the estimated value and uncertainty of the β function output by the sensing module before execution, the physical correction amount after safety limiting, and the β function residual and operating point residual after execution are written as interactive memory samples into the interactive memory pool. Step 207: Through the learning module, when the online learning trigger condition is met, interactive memory samples are selected from the interactive memory pool. A β function residual spectrum is constructed based on the interactive memory samples, and error source dictionary decomposition is performed to obtain the dictionary non-negative weights and the reconstructed residual ratio.

[0100] Step 208: Generate a physical consistency supervision signal based on interactive memory samples and a physical simulator through the learning module.

[0101] Step 209: Determine the frequency domain routing gate weights based on the uncertainty and dictionary non-negative weights using the learning module.

[0102] Step 210: Through the learning module, update the lightweight adaptation parameters in the perception module and the decision module according to the frequency domain routing gating weights and the joint loss including the physical forward consistency loss. The physical forward consistency loss is determined based on the physical consistency supervision signal.

[0103] Figure 3 The diagram illustrates the structure of a computer device according to an embodiment of this application, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the functions of the computer system based on the adaptive fine-tuning storage ring β function online correction method in any of the above embodiments.

[0104] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a computer, causes the computer to perform the functions of the computer system based on the adaptive fine-tuning storage ring β function online correction method in any of the above embodiments.

[0105] This application also provides a computer program product containing instructions that, when executed by a computer, cause the computer to perform the functions of the computer system based on the adaptive fine-tuning storage ring β function online correction method in any of the above embodiments.

[0106] It is understood that the specific examples in this application are only intended to help those skilled in the art better understand the implementation methods of this application, and are not intended to limit the scope of the invention.

[0107] It is understood that in the various embodiments of this application, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not limit the implementation process of the embodiments of this application in any way.

[0108] It is understood that the various implementation methods described in this application can be implemented individually or in combination, and the implementation methods in this application are not limited in this respect.

[0109] Unless otherwise stated, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The term "and / or" as used in this application includes any and all combinations of one or more of the associated listed items. The singular forms "a," "the," and "the" as used in the embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0110] It is understood that the processor in the embodiments of this application can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method embodiments can be completed by the integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory; the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0111] It is understood that the memory in the embodiments of this application may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Specifically, non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may be random access memory (RAM). It should be noted that the memory in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

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

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

[0114] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0115] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0116] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0117] If a function is implemented as a software functional unit and sold or used as an independent product, it 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 part of the technical solution, can be embodied in the form of a software product. The 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 of various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0118] The above are merely specific embodiments of this application, but the scope of protection of this invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this invention should be determined by the scope of the claims.

Claims

1. An online correction system for the storage ring β function based on adaptive fine-tuning, characterized in that, The online correction system for the storage ring β function based on adaptive fine-tuning includes: The sensing module is used to construct a multi-channel observation tensor in each control cycle based on the current beam closure trajectory deviation of the storage ring, the current focusing intensity of the quadrupole magnet, and the ideal value of the β function obtained under the focusing intensity; and to determine the estimated value and uncertainty of the β function at the center position of the quadrupole magnet based on the multi-channel observation tensor. The decision module is used to calculate the β function residual based on the estimated β function value and the reference β function value, and to calculate the operating point residual based on the current operating point and the reference operating point; and to determine the physical correction amount of the focusing intensity based on the β function residual and the operating point residual. The execution module is used to write the physical correction amount to the corresponding quadrupole magnet power supply after scalar gain adjustment and safety limiting, and to perform rollback protection and scalar gain adaptive update according to the change of the relative error index of the β function before and after writing. The memory module is used to write the interaction data corresponding to the control cycle that has not triggered a rollback operation into the interaction memory pool; The learning module is used to select interactive memory samples from the interactive memory pool when the online learning trigger conditions are met; construct a β-function residual spectrum based on the interactive memory samples and perform error source dictionary decomposition to obtain dictionary non-negative weights and reconstruction residual ratios; generate a physical consistency supervision signal based on the interactive memory samples and the physical simulator; determine the frequency domain routing gating weights based on the uncertainty and the dictionary non-negative weights; and update the lightweight adaptation parameters in the perception module and the decision module based on the frequency domain routing gating weights and the joint loss including physical forward consistency loss. The physical forward consistency loss is determined based on the physical consistency supervision signal and is used to constrain the closed-loop inference consistency among the perception module, the decision module, and the physical simulator.

2. The online correction system for the storage ring β function based on adaptive fine-tuning according to claim 1, characterized in that, In constructing a multi-channel observation tensor based on the current beam closure trajectory deviation of the storage ring, the current focusing intensity of the quadrupole magnet, and the ideal value of the β function obtained under the focusing intensity, and determining the estimated value and uncertainty of the β function at the center position of the quadrupole magnet based on the multi-channel observation tensor, the sensing module is specifically used for: The beam position monitor obtains the current horizontal and vertical beam closure trajectory deviation of the storage ring from the accelerator in real time; and the quadrupole magnet control system reads the current focusing intensity of the quadrupole magnet. The ideal value of the β function is obtained by solving the Twiss equation under the focusing intensity without superimposed additional perturbations using a physical simulator. The beam closure trajectory deviation, the focusing intensity, and the ideal value of the β function are spliced ​​together to obtain the multi-channel observation tensor; The multi-channel observation tensor is decomposed into a focus intensity branch input and an orbit branch input, wherein the focus intensity branch input includes the focus intensity and the ideal value of the β function, and the orbit branch input includes the beam closure orbit deviation; A physical phase code is constructed based on the betatron phase at the center position of each quadrupole magnet, and the physical phase code is introduced into the focus intensity branch input and the orbit branch input; The focus intensity branch input and the orbit branch input are respectively input into the corresponding branches of the one-dimensional Fourier neural operator backbone network and fused to obtain a shared feature tensor. By inputting the shared feature tensor into the mean header and uncertainty header respectively, the estimated value of the β function and the uncertainty at the center position of the quadrupole magnet are obtained.

3. The online correction system for the storage ring β function based on adaptive fine-tuning according to claim 2, characterized in that, In determining the physical correction amount for the focus intensity based on the β function residual and the operating point residual, the decision module is specifically used for: The residual of the β function and the residual of the operating point are concatenated to obtain the residual tensor; The residual tensor is input into the decision network to obtain the standardized quadrupole magnet correction. The standardized quadrupole magnet correction is de-standardized to obtain the physical correction of the quadrupole magnet focusing intensity in physical dimensions.

4. The online correction system for the storage ring β function based on adaptive fine-tuning according to claim 3, characterized in that, In the process of writing the corresponding quadrupole magnet power supply after adjusting the scalar gain and limiting the physical correction amount, and performing rollback protection and adaptive scalar gain update based on the change in the relative error index of the β function before and after writing, the execution module is specifically used for: The physical correction amount is safely limited based on the scalar gain and the single-step correction upper limit, and the safely limited physical correction amount is written into the corresponding quadrupole magnet power supply through the quadrupole magnet control system. After the writing is completed and the beam state is stabilized, the data is re-acquired and the actual value of the β function relative error index after writing is calculated. If the actual value of the β function relative error index after writing deteriorates by more than a preset deterioration threshold compared to the actual value of the β function relative error index before writing, a rollback operation is triggered, and the scalar gain is reduced. If the actual value of the β function relative error index after writing does not deteriorate by more than the preset deterioration threshold compared to the actual value of the β function relative error index before writing, the scalar gain is updated according to the actual value of the β function relative error index after writing.

5. The online correction system for the storage ring β function based on adaptive fine-tuning according to claim 4, characterized in that, Regarding the writing of interaction data corresponding to control cycles that do not trigger rollback operations into the interaction memory pool, the memory module is specifically used for: After the control cycle ends without triggering a rollback operation, the multi-channel observation tensor before execution, the multi-channel observation tensor after execution, the β function estimate and uncertainty output by the sensing module before execution, the physical correction amount after the actual write safety limit, and the β function residual and operating point residual after execution are used as interactive memory samples and written into the interactive memory pool in a first-in-first-out manner.

6. The online correction system for the storage ring β function based on adaptive fine-tuning according to claim 5, characterized in that, In the process of constructing the β-function residual spectrum based on the interactive memory samples and performing error source dictionary decomposition to obtain dictionary non-negative weights and reconstructed residual ratios, the learning module is specifically used for: Based on the post-execution β-function residuals in the interactive memory samples, a β-function residual spectrum is constructed. The β-function residual spectrum is then decomposed using an error source dictionary to obtain the non-negative weights corresponding to each dictionary primitive in the error source dictionary. A reconstructed spectrum of the β-function residual spectrum is constructed based on these non-negative weights. The reconstructed residual ratio is calculated based on the β-function residual spectrum and the reconstructed spectrum. If the reconstructed residual ratio is greater than a preset reconstructed residual ratio threshold, the current β-function residual spectrum is determined to be difficult to interpret by the error source dictionary, and the current operating condition is identified as an unseen operating condition or a β-function distribution out-of-distribution operating condition. The error source dictionary includes multiple dictionary primitives, which are generated by the physical simulator scanning for error sources during the offline phase.

7. The online correction system for the storage ring β function based on adaptive fine-tuning according to claim 6, characterized in that, In generating the physical consistency supervision signal based on the interactive memory samples and the physical simulator, the learning module is specifically used for: Based on the pre-execution multi-channel observation tensor in the interactive memory sample, the pre-execution β function estimate and uncertainty are obtained through the perception module; Based on the residual between the estimated value of the β function before execution and the reference value of the β function, and combined with the operating point residual, the quadrupole magnet focusing intensity correction amount is obtained through the decision module. The current quadrupole magnet focusing intensity and the quadrupole magnet focusing intensity correction amount are input into the physical simulator to obtain the post-execution β function derivation value, which is used to construct a physical consistency monitoring signal. The learning module is also used to: obtain the post-execution β function estimate and post-execution uncertainty through the perception module based on the post-execution multi-channel observation tensor in the interactive memory sample; The heteroscedastic Gaussian negative log-likelihood loss is calculated based on the post-execution β function derivation value, the post-execution β function estimate value, and the post-execution uncertainty. Calculate the closure loss based on the post-execution β function estimate, the β function reference value, and the post-execution uncertainty. Based on the closed-loop deduction relationship between the perception module, the decision module, and the physical simulator, calculate the physical forward consistency loss; The adaptive elastic weight solidification anchoring loss is calculated based on the offset of the lightweight adaptation parameters relative to the pre-trained parameters, the parameter importance weights, and the mode-level uncertainty obtained by projecting the post-execution uncertainty onto each retained frequency mode. The joint loss is calculated based on the heteroscedastic Gaussian negative log-likelihood loss, the closure loss, the physical forward consistency loss, and the adaptive elastic weight fixed anchoring loss.

8. The online correction system for the storage ring β function based on adaptive fine-tuning according to claim 7, characterized in that, The lightweight adaptation parameters include the frequency domain low-rank adaptation parameters, uncertainty header parameters, and frequency domain routing gating parameters in the perception module, as well as the decision subspace adapter parameters in the decision module; regarding updating the lightweight adaptation parameters in the perception module and the decision module based on the frequency domain routing gating weights and the joint loss including physical forward consistency loss, the learning module is specifically used for: When fine-tuning the perception module online, the parameters of the one-dimensional Fourier neural operator backbone network are kept frozen. The frequency domain low-rank adaptation incremental injection intensity on each retained frequency module is adjusted according to the frequency domain routing gate weight. The frequency domain low-rank adaptation parameters, uncertainty head parameters and frequency domain routing gate parameters are updated according to the joint loss. When fine-tuning the decision module online, the backbone parameters of the pre-trained decision network are kept frozen, and the parameters of the decision subspace adapter are updated according to the joint loss. The decision subspace adapter is set in the bypass of the pre-trained decision network. The decision subspace adapter is used to incrementally correct the quadrupole magnet focusing intensity correction output by the pre-trained decision network, and the incremental correction output by the decision subspace adapter is restricted to the physical response subspace spanned by the right singular vector of the subspace response matrix.

Citation Information

Patent Citations

  • Signal baseline correction method for adaptive selection of dual-cycle smoothing parameters

    CN115687867A

  • Intelligent automobile multi-task environment sensing system with cross-scene generalization and sustainable evolution

    CN121861608A