Method and system for ensuring consistency of operating environment of synchrotron radiation light source IOC
Patent Information
- Application Number
- CN202610931285.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-26
- Publication Date
- 2026-09-11
AI Technical Summary
当前常规备份方案多采用定时全量拷贝模式,无法实时感知文件修改、删除等动态变更,临时文件、缓存文件会产生大量无效同步数据,且缺少文件与IOC实例的绑定关联关系,一旦控制资源发生改动,难以精准定位受影响的IOC,同步冗余量大、备份时效性差
[0014] Based on the above, by using kernel-level file event real-time monitoring combined with an event filtering and merging mechanism, and in conjunction with a pre-built IOC runtime dependency model, we can accurately bind changed files to IOC instances. Incremental synchronization is performed only on affected instances, significantly reducing invalid backup data and improving synchronization efficiency. The entire synchronization process fully preserves the source directory structure and file access permissions. The centralized backup server is divided into independent storage directories according to IOC instances and retains standardized synchronization logs, which can completely retain the resource change records corresponding to each group of IOCs. This ensures the consistency between backup resources and the local operating environment from the bottom layer, and completely solves the defects of traditional scheduled full backups, such as insufficient timeliness, loss of permissions, and unclear correlation.
Smart Images

Figure CN122733607A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of operational environment consistency assurance technology, and particularly relates to a method and system for ensuring operational environment consistency of synchrotron radiation source IOC. Background Technology
[0002] The synchrotron radiation source beamline control system relies on the EPICS architecture to deploy a large number of IOC instances. Each beamline control host independently stores its corresponding control interface, scripts, and configuration files, resulting in dispersed management of dependent resources across different hosts and IOC instances. Current conventional backup solutions mostly adopt a timed full copy mode, which cannot detect dynamic changes such as file modifications and deletions in real time. Temporary files and cached files generate a large amount of invalid synchronization data, and there is a lack of binding association between files and IOC instances. Once control resources are modified, it is difficult to accurately locate the affected IOCs, resulting in large synchronization redundancy and poor backup timeliness. At the same time, the synchronization process often loses the original directory level and file access permissions, making it easy to encounter permission anomalies and missing paths during subsequent environment recovery, and failing to guarantee that the IOC's operating environment is completely consistent.
[0003] Existing disaster recovery methods can only restore the entire machine's files, without performing fine-grained isolation backups for IOC instances. When a single beamline control host fails and goes offline, it is necessary to manually sort out the entire set of dependent resources for the corresponding IOC, manually select available hosts, and deploy files, making the recovery process cumbersome and time-consuming. Moreover, the system lacks continuous status awareness of host hardware, IOC processes, and backup networks, resulting in delayed fault detection and the inability to automatically rebuild the environment and restart instances. The continuous operation requirements of synchrotron radiation source beamline experiments cannot be guaranteed, posing a risk of experimental interruption and data acquisition failure. Summary of the Invention
[0004] In view of the aforementioned problems, and in conjunction with the first aspect of the present invention, embodiments of the present invention provide a method for ensuring the consistency of the operating environment dependent on a synchrotron radiation source IOC, comprising the following steps: Step 1: Perform real-time file event monitoring on the preset control resource directory on the harness control host; the control resource directory contains control interface files, control scripts and configuration files that the IOC instance depends on for startup and operation; Step 2: If file creation, modification, deletion, movement, or attribute change events are detected in the control resource directory, extract the target control resource file that has been changed; Step 3: Based on the pre-built IOC runtime dependency model, identify at least one target IOC instance affected by changes to the target control resource file; the IOC runtime dependency model is used to characterize the one-to-one correspondence between each IOC instance and the set of control resource files it depends on; Step 4: Initiate an incremental file synchronization process for the identified target IOC instance. While fully preserving the source directory structure and file access permissions, synchronize the target control resource files to the centralized backup directory of the centralized backup server and generate synchronization logs bound to the target IOC instance. Step 5: If a fault or offline unavailability is detected in the bundle control host, based on the control resource files and IOC runtime dependency model of the most recently successfully synchronized one, restore all control resource files and runtime dependency environment corresponding to the target IOC instance on the other normal bundle control hosts, so that the restored target IOC instance meets the normal operating conditions.
[0005] Preferably, step one includes configuring and modeling the runtime dependency environment before execution: The control resource catalog to be monitored and protected is pre-configured on each bundle control host; based on the preset configuration file, directory naming rules or IOC running parameters, the running dependency relationship is established for each IOC instance, the IOC running dependency relationship model is generated, and the set of all dependent control resource files corresponding to a single IOC instance is defined, which serves as the basic unit for file change association identification, incremental synchronization and environment recovery.
[0006] Preferably, step one includes loading the synchronization strategy and monitoring parameters before starting: Load file event monitoring parameters and synchronization strategies during system startup; The monitoring parameters include at least the source control resource directory path, the centralized backup server address, file filtering rules, and the synchronization log storage path; the file synchronization backup process retains the source directory structure and access permissions throughout, ensuring the consistency of the operating environment after recovery.
[0007] Preferably, step two and step three include an event filtering and instance-level association identification step: After capturing file change events, filter change events for hidden files, temporary files, and files that are not related to IOC operation, and merge similar file events that are repeatedly triggered within a short period of time; Then, by combining the IOC runtime dependency model, the target IOC instance associated with the change file is determined.
[0008] Preferably, after step four synchronization is completed, the backup storage and status recording steps are performed: the synchronized control resource files are stored in the independent backup directory of the corresponding target IOC instance in the centralized backup server; the synchronization log records the synchronization timestamp, synchronization file list, synchronization success / failure status, and updates the latest valid backup status of the target IOC instance.
[0009] Preferably, during or after the execution of step four, a step of continuous monitoring of the running status is also included: It continuously collects data on the running status of the control host and the IOC instances within the host, including the running status of the IOC process, the running status of the host hardware, and the network connectivity status between the host and the centralized backup server, and captures abnormal faults of the host or IOC instances in real time.
[0010] Preferably, step five includes an anomaly identification and recovery target selection step: when it is determined that the bundle control host or its IOC instance is abnormally unavailable, all online available bundle control hosts are filtered to generate a candidate host set; Select the target host for recovery based on the preset recovery strategy; The recovery strategy includes three evaluation criteria: host availability, hardware resource availability, and compatibility with the target IOC operating environment.
[0011] Preferably, after step five is completed, the instance startup and closed-loop operation steps are executed: Read the backup file on the selected target host to rebuild the complete IOC runtime dependency environment, start the target IOC instance, and complete the loading of runtime parameters and redirection of device communication connections; The system automatically jumps to the process of real-time monitoring of file events and continuous monitoring of host and IOC status, forming a closed loop to ensure the consistency of the IOC's operating environment.
[0012] Preferably, in step one, file event monitoring is implemented based on the operating system kernel-level file event notification mechanism, which detects file changes in real time and pushes event notifications.
[0013] A system for ensuring the consistency of the operating environment of a synchrotron radiation source IOC includes multiple beamline control hosts, at least one centralized backup server, and functional modules deployed within the beamline control hosts; each beamline control host and the centralized backup server communicates via a dedicated control local area network. The functional modules include: a file event monitoring module, which is used to perform kernel-level real-time file event monitoring on the preset control resource directory of the harness control host, and capture file creation, modification, deletion, movement, and attribute change events; The dependency management module is used to configure, build, and persistently maintain the IOC runtime dependency model, and store the corresponding mapping relationship between each IOC instance and the dependency control resource file; The synchronization trigger module is used to receive filtered valid file change events, match them with the associated target IOC instance, and trigger the incremental file synchronization task of the corresponding instance. The centralized backup module is deployed on the centralized backup server. It is used to store synchronously uploaded control resource files, maintain the source directory structure and access permissions, generate and store the synchronization logs of the bound IOC instances, and record the latest backup status of each IOC instance. The disaster recovery module is used to continuously monitor the operating status of the host and IOC, identify abnormal host failures, filter available candidate hosts, read the corresponding backup files from the centralized backup module, rebuild the complete IOC operating environment on the target host, and start the recovered IOC instance.
[0014] Based on the above, by using kernel-level file event real-time monitoring combined with an event filtering and merging mechanism, and in conjunction with a pre-built IOC runtime dependency model, we can accurately bind changed files to IOC instances. Incremental synchronization is performed only on affected instances, significantly reducing invalid backup data and improving synchronization efficiency. The entire synchronization process fully preserves the source directory structure and file access permissions. The centralized backup server is divided into independent storage directories according to IOC instances and retains standardized synchronization logs, which can completely retain the resource change records corresponding to each group of IOCs. This ensures the consistency between backup resources and the local operating environment from the bottom layer, and completely solves the defects of traditional scheduled full backups, such as insufficient timeliness, loss of permissions, and unclear correlation.
[0015] This solution features fully automated fault detection and intelligent disaster recovery capabilities. It continuously collects the operating status of host hardware, IOC processes, and backup links. When the host fails offline, it can automatically select the best-suited backup beamline host, rebuild the complete operating environment based on historical synchronous backup files with one click, and restart the IOC instance without manual intervention to manage resources and deployment configurations. After recovery, it automatically switches back to the file monitoring and status inspection process, forming a closed-loop guarantee for the entire process. This effectively shortens the downtime of the beamline control system, meets the needs of long-term uninterrupted experimental operation of synchrotron radiation sources, and reduces data loss and equipment debugging costs caused by experimental interruptions. Attached Figure Description
[0016] Figure 1 This is a schematic diagram of the system architecture for ensuring the consistency of the IOC operating environment in the control system of a synchrotron radiation source device according to the present invention.
[0017] Figure 2 This is a schematic diagram of the method for ensuring the consistency of the IOC operating environment for the control system of a synchrotron radiation source device according to the present invention.
[0018] Figure 3 This is a schematic diagram illustrating the runtime dependency relationship between the IOC instance and the control resource file of this invention. Detailed Implementation
[0019] The present invention will now be described in detail with reference to the accompanying drawings. Figure 1 This is a flowchart illustrating a method for ensuring consistency of the operating environment dependent on the IOC of a synchrotron radiation source according to an embodiment of the present invention. The following is a detailed description of this method for ensuring consistency of the operating environment dependent on the IOC of a synchrotron radiation source.
[0020] A. On the harness control host, real-time file event monitoring is performed on the preset control resource directory, which includes at least the control interface files, control scripts and configuration files that the IOC instance depends on for startup and operation; B. When a file creation, modification, deletion, movement, or attribute change event is detected in the control resource directory, the target control resource file that has been changed is obtained; C. Based on a pre-established IOC runtime dependency model, identify at least one target IOC instance affected by changes to the target control resource file, wherein the IOC runtime dependency model is used to describe the correspondence between each IOC instance and the set of control resource files on which its operation depends; D. For the target IOC instance, trigger the incremental file synchronization process. While keeping the source directory structure and access permissions unchanged, synchronize the target control resource files to the centralized backup directory on the server side and generate a synchronization log associated with the target IOC instance. E. When a control host is detected to be abnormal or unavailable, based on the control resource file status obtained from the most recently successfully synchronized event and the IOC runtime dependency model, the control resource file and runtime resource environment corresponding to the target IOC instance are restored on other control hosts so that the restored target IOC instance meets the requirements for a runnable state.
[0021] The system solution includes: A. File event monitoring module, used to perform real-time file event monitoring on the preset control resource directory in the control host; B. Dependency Management Module, used to establish and maintain the runtime dependency model between IOC instances and the control resource files they depend on for operation; C. Synchronization trigger module, used to trigger the incremental file synchronization process for the target IOC instance after detecting a file event and identifying the target IOC instance; D. Centralized backup module, used to store synchronized files while maintaining consistent directory structure and access permissions, and to generate synchronized logs associated with the target IOC instance; E. Disaster recovery module, used to restore the control resource files and runtime resource environment corresponding to the target IOC instance on other control hosts based on the IOC runtime dependency model when the control host is abnormal or unavailable.
[0022] See Figure 1This invention relates to a beamline control system for a synchrotron radiation source device. The system comprises multiple beamline control hosts and at least one centralized backup server. Each beamline control host is used to deploy and run IOC instances related to a specific beamline and user, and stores the control interface files, control scripts, configuration files, and related runtime resources required for the IOC instances to run. The centralized backup server is used to uniformly store backup data of control resource files from each beamline control host to support the consistency assurance and recovery of the IOC runtime environment.
[0023] Each bundle control host communicates with the centralized backup server via a local area network or a dedicated control network, thereby enabling synchronized management of control resource files and centralized protection of the environment on which IOC instances depend for operation without changing the existing control system architecture.
[0024] In this embodiment, the system operates according to... Figure 2 The method flow shown executes the IOC runtime environment consistency guarantee method, which specifically includes the following steps.
[0025] On each harness control host, a control resource directory that needs to be monitored and protected is pre-configured. The control resource directory includes at least the harness control interface file, control script, IOC configuration file and related runtime resources that the IOC instance depends on for startup and operation.
[0026] In one implementation, the system establishes a corresponding runtime dependency relationship for each IOC instance, which describes the set of control resource files that the IOC instance depends on for operation. The runtime dependency relationship can be defined through preset configuration files, directory naming rules, or runtime parameters, and serves as the basic management unit for subsequent file event identification, instance-level synchronization, and runtime dependency environment recovery. See also Figure 3 The runtime dependencies are used to explicitly define the correspondence between control resource files and IOC instances.
[0027] Upon system startup, file event monitoring parameters and synchronization strategies are loaded. These parameters include at least the source control resource directory path, the centralized backup server address, file filtering rules, and the synchronization log storage path. During file synchronization and backup, the source directory structure and access permissions remain unchanged to ensure consistency of the runtime environment during subsequent IOC runtime dependency environment recovery.
[0028] The system performs real-time file event monitoring on a preset control resource directory through an event monitoring interface to capture operations such as file creation, modification, deletion, movement, and attribute changes. In one embodiment, the file event monitoring is implemented based on the operating system kernel-level file event notification mechanism to generate timely event notifications when file changes occur.
[0029] After a file event is detected, the event is filtered and merged to exclude file change events involving hidden files, temporary files, or files unrelated to the runtime environment, and to merge similar events that are repeatedly triggered within a short period of time. At the same time, based on the IOC runtime dependency relationship, the target IOC instance associated with the control resource file that has been changed is determined.
[0030] After confirming the existence of a valid file change event related to the operation of the target IOC instance, an incremental file synchronization task is triggered for the target IOC instance to synchronize the changed control resource files to the centralized backup server, while keeping the source directory structure and access permissions unchanged during the synchronization process.
[0031] The synchronized control resource files are stored in the backup directory corresponding to the target IOC instance in the centralized backup server, and a synchronization log is generated to record the synchronization timestamp, file list, and synchronization success or failure status information. At the same time, the most recent successful backup status of the target IOC instance is updated.
[0032] During or after the file synchronization process, the running status of the bundle control host and its hosted IOC instances is continuously monitored. The monitoring includes at least the control process status, host running status, and network connectivity detection, so as to promptly detect any abnormal situations that may affect the normal operation of the IOC instances.
[0033] When a bundle control host or its hosted IOC instance is detected to be abnormal or unavailable, the system enters a runtime environment recovery process. This process generates a candidate host set from other available bundle control hosts and selects a target host based on a preset recovery strategy. The recovery strategy includes at least host availability, resource availability, and compatibility with the target IOC instance's runtime environment.
[0034] Based on the control resource file status obtained from the most recent successful synchronization, the control resource file corresponding to the target IOC instance is read from the centralized backup server, and the configuration file, control script and related runtime dependency resources are restored on the target host, thereby rebuilding the IOC runtime dependency environment consistent with that before the anomaly occurred.
[0035] The corresponding IOC instance is started on the target host, and the necessary running parameters are loaded and connection redirection operations are completed to restore it to normal operating state. Then the system re-enters the file event monitoring and running status monitoring process, thus forming a closed-loop mechanism for ensuring the consistency of the running dependent environment with the IOC instance as the core.
[0036] It should be noted that, in order to simplify the description of the present invention and thus help to understand one or more embodiments of the invention, multiple features may sometimes be grouped into one embodiment, drawing or description thereof in the foregoing description of the embodiments of the present invention.
[0037] The embodiments of this application have been described above with reference to the accompanying drawings. Unless otherwise specified, the embodiments and features in the embodiments of this application can be combined with each other. This application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A method for ensuring the consistency of the operating environment dependent on the IOC of a synchrotron radiation source, characterized in that: Includes the following steps: Step 1: Perform real-time file event monitoring on the preset control resource directory on the harness control host; the control resource directory contains control interface files, control scripts and configuration files that the IOC instance depends on for startup and operation; Step 2: If file creation, modification, deletion, movement, or attribute change events are detected in the control resource directory, extract the target control resource file that has been changed; Step 3: Based on the pre-built IOC runtime dependency model, identify at least one target IOC instance affected by changes to the target control resource file; the IOC runtime dependency model is used to characterize the one-to-one correspondence between each IOC instance and the set of control resource files it depends on; Step 4: Initiate an incremental file synchronization process for the identified target IOC instance. While fully preserving the source directory structure and file access permissions, synchronize the target control resource files to the centralized backup directory of the centralized backup server and generate synchronization logs bound to the target IOC instance. Step 5: If a fault or offline unavailability is detected in the bundle control host, based on the control resource files and IOC runtime dependency model of the most recently successfully synchronized one, restore all control resource files and runtime dependency environment corresponding to the target IOC instance on the other normal bundle control hosts, so that the restored target IOC instance meets the normal operating conditions.
2. The method for ensuring the consistency of the operating environment dependent on the synchrotron radiation source IOC according to claim 1, characterized in that: Step one also includes configuring and modeling the runtime dependencies: The control resource catalog to be monitored and protected is pre-configured on each bundle control host; based on the preset configuration file, directory naming rules or IOC running parameters, the running dependency relationship is established for each IOC instance, the IOC running dependency relationship model is generated, and the set of all dependent control resource files corresponding to a single IOC instance is defined, which serves as the basic unit for file change association identification, incremental synchronization and environment recovery.
3. The method for ensuring the consistency of the operating environment dependent on the synchrotron radiation source IOC according to claim 2, characterized in that: Step one, before starting, also includes loading the synchronization strategy and monitoring parameters: Load file event monitoring parameters and synchronization strategies during system startup; The monitoring parameters include at least the source control resource directory path, the centralized backup server address, file filtering rules, and the synchronization log storage path; File synchronization backup preserves the source directory structure and access permissions throughout the process, ensuring consistency of the operating environment after recovery.
4. The method for ensuring the consistency of the operating environment dependent on the synchrotron radiation source IOC according to claim 2, characterized in that: The steps between Step Two and Step Three include event filtering and instance-level association identification: After capturing file change events, filter change events for hidden files, temporary files, and files that are not related to IOC operation, and merge similar file events that are repeatedly triggered within a short period of time; Then, by combining the IOC runtime dependency model, the target IOC instance associated with the change file is determined.
5. The method for ensuring the consistency of the operating environment dependent on the synchrotron radiation source IOC according to claim 1, characterized in that: Step 4: After synchronization is complete, perform backup storage and status recording steps: Store the synchronized control resource files into the independent backup directory of the corresponding target IOC instance within the centralized backup server; The synchronization log records the synchronization timestamp, the list of synchronized files, the success / failure status of synchronization, and updates the latest valid backup status of the target IOC instance.
6. The method for ensuring the consistency of the operating environment dependent on the synchrotron radiation source IOC according to claim 5, characterized in that: Step four, during or after execution, also includes a step of continuous monitoring of the running status: It continuously collects data on the running status of the control host and the IOC instances within the host, including the running status of the IOC process, the running status of the host hardware, and the network connectivity status between the host and the centralized backup server, and captures abnormal faults of the host or IOC instances in real time.
7. The method for ensuring the consistency of the operating environment dependent on the synchrotron radiation source IOC according to claim 5, characterized in that: Step 5 includes an anomaly identification and recovery target selection step: when it is determined that the bundle control host or its IOC instance is abnormally unavailable, all online available bundle control hosts are filtered to generate a candidate host set; Select the target host for recovery based on the preset recovery strategy; The recovery strategy includes three evaluation criteria: host availability, hardware resource availability, and compatibility with the target IOC operating environment.
8. The method for ensuring the consistency of the operating environment dependent on the synchrotron radiation source IOC according to claim 1, characterized in that: After step five is completed, execute the instance startup and closed-loop operation steps: Read the backup file on the selected target host to rebuild the complete IOC runtime dependency environment, start the target IOC instance, and complete the loading of runtime parameters and redirection of device communication connections; The system automatically jumps to the process of real-time monitoring of file events and continuous monitoring of host and IOC status, forming a closed loop to ensure the consistency of the IOC's operating environment.
9. The method for ensuring the consistency of the operating environment dependent on the synchrotron radiation source IOC according to claim 1, characterized in that: In step one, file event monitoring is implemented based on the operating system kernel-level file event notification mechanism, which detects file changes in real time and pushes event notifications.
10. A system for ensuring the consistency of the operating environment dependent on a synchrotron radiation source IOC, characterized in that, The method for ensuring the consistency of the operating environment of the synchrotron radiation source IOC as described in any one of claims 1-9 includes multiple beamline control hosts, at least one centralized backup server, and functional modules deployed within the beamline control hosts. Each cable control host and centralized backup server communicate via a dedicated control local area network; The functional modules include: a file event monitoring module, which is used to perform kernel-level real-time file event monitoring on the preset control resource directory of the harness control host, and capture file creation, modification, deletion, movement, and attribute change events; The dependency management module is used to configure, build, and persistently maintain the IOC runtime dependency model, and store the corresponding mapping relationship between each IOC instance and the dependency control resource file; The synchronization trigger module is used to receive filtered valid file change events, match them with the associated target IOC instance, and trigger the incremental file synchronization task of the corresponding instance. The centralized backup module is deployed on the centralized backup server. It is used to store synchronously uploaded control resource files, maintain the source directory structure and access permissions, generate and store the synchronization logs of the bound IOC instances, and record the latest backup status of each IOC instance. The disaster recovery module is used to continuously monitor the operating status of the host and IOC, identify abnormal host failures, filter available candidate hosts, read the corresponding backup files from the centralized backup module, rebuild the complete IOC operating environment on the target host, and start the recovered IOC instance.
