Proton therapy safety system dual-channel diagnosis function block and reconstruction method thereof
By using the FBD basic function block to simulate and replicate the target dual-channel input diagnostic function block in the domestic proton therapy safety system, the problem of the lack of complex function blocks in the domestic system was solved, the consistency of functions with foreign systems was achieved, and the development cost and time were reduced.
Patent Information
- Application Number
- CN202511621129.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-07
- Publication Date
- 2026-01-02
AI Technical Summary
The lack of safety-certified complex functional blocks in domestically produced proton therapy safety systems results in long development cycles, high costs, and safety risks, making it impossible to directly match foreign systems.
A demo program was created using multiple FBD basic function blocks. By simulating and replicating the input and output functions of the target dual-channel input diagnostic function block, the same functions as foreign systems were achieved. The dual-channel diagnostic function block was reconstructed using a domestic platform.
It saves development time and certification costs for complex functional blocks, improves development efficiency and system reliability, avoids security risks, and achieves functional consistency with foreign systems.
Smart Images

Figure CN121243658A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of safety control systems, and particularly relates to a proton therapy safety system double-channel diagnosis function block and a reconstruction method thereof. BACKGROUND
[0002] As a high-precision radiotherapy technology, proton therapy can achieve precise positioning and treatment of tumors and significantly reduce damage to surrounding normal tissues by utilizing the physical properties of proton particles. In a proton therapy system, the therapy safety system is a core device for ensuring patient safety and treatment effectiveness, and its functions include precise positioning and adjustment of the proton beam, dose monitoring and control, patient safety education and training, and other aspects. With the widespread application and continuous development of proton therapy technology, the proton therapy safety system has become a research hotspot in the medical field.
[0003] During the operation of a proton therapy system, the safety control system is a key link for ensuring the safety of the treatment center equipment and personnel, and can effectively prevent and avoid potential personal safety accidents. The double-channel input diagnosis function block, as an important component of the safety control system, is mainly used for redundant detection and logical judgment of input signals to ensure the reliability and safety of the system. However, the mainstream safety control systems on the market currently rely on imported equipment.
[0004] Currently, a certain brand of safety control system has a significant advantage in the richness of the function block library. In addition to basic function blocks such as AND-NOT gate, switch delay, addition-subtraction-multiplication-division, RS flip-flop, etc., the function block library also contains a large number of complex function blocks for different industries, such as the double-channel input diagnosis function block. These complex function blocks have passed SIL3 safety certification and can be directly called during programming, but the internal logic and algorithm implementation of the complex function blocks are in a "black box" state, and the core technical logic cannot be mastered.
[0005] In contrast, the function block library of domestic safety systems still has obvious deficiencies in richness. The domestic system platform mainly provides basic function blocks and lacks complex function blocks that have passed safety certification. When the same function as the complex function block of the foreign safety system needs to be implemented, the developer cannot find the corresponding complex function block in the library for direct use. If a similar complex function block is redeveloped on the domestic safety platform, on the one hand, the internal logic of the complex function block cannot be referenced, and continuous testing and trial-and-error are required, resulting in a long development cycle and safety certification time. It is difficult to master the internal logic and algorithm of the complex function block in a short time, and the function result verification and certification of the developed function block are difficult, with the risk of development failure, making it difficult to match the project progress. On the other hand, the development of complex function blocks also increases the additional research and development workload, which may lead to potential safety hazards of inconsistent module design with foreign complex function blocks. SUMMARY
[0006] To address the problems in the prior art, this invention aims to provide a dual-channel diagnostic functional block for a proton therapy safety system and its reconstruction method. By using a demo program created from a basic module, the complex functional module is redesigned and reconstructed to achieve the same functionality as the complex functional module of the target safety system. This avoids the need for redevelopment and certification of complex functional blocks with the same function at the R&D level, saving development time and certification costs, and has high economic efficiency and practicality.
[0007] To achieve the above objectives, the present invention provides a dual-channel diagnostic function block for a proton therapy safety system, comprising: multiple FBD basic function blocks, multiple reconfigurable input pins, and multiple reconfigurable output pins; the FBD basic function blocks cooperate to simulate and replicate the input and output functions of a target dual-channel input diagnostic function block; the target dual-channel input diagnostic function block includes multiple target input pins and multiple target output pins; the input function of the reconfigurable input pins is consistent with that of the target input pins, and the output function of the reconfigurable output pins is consistent with that of the target output pins.
[0008] In one implementation, the FBD basic functional block includes AND modules AND61~AND65, which include six AND digital input variables IN11~IN16 and one AND digital output variable Q1. The value of the AND digital output variable Q1 is 1 only when the value of all the AND digital input variables IN11~IN16 is 1; the value of the AND digital output variable Q1 is 0 when the value of any of the AND digital input variables IN11~IN16 is 0.
[0009] In one implementation, the FBD basic function block includes a logic OR module OR6, which includes six logic OR digital input variable terminals IN51~IN56 and one logic OR digital output variable terminal Q5; the value of the logic OR digital output variable terminal Q5 is 0 only when the values of all the logic OR digital input variable terminals IN51~IN56 are 0; the value of the logic OR digital output variable terminal Q5 is 1 when any of the logic OR digital input variable terminals IN51~IN56 is 1.
[0010] In one implementation, the FBD basic function block includes a numerical comparison module CMPR, which includes two analog input variable terminals IN21 and IN22 and five state output variable terminals GT, GE, EQ, LE, and LT. When the value of the first analog input variable terminal IN21 is greater than the value of the second analog input variable terminal IN22, the value of the first state output variable terminal GT is 1; When the value of the first analog input variable terminal IN21 is greater than or equal to the value of the second analog input variable terminal IN22, the value of the second state output variable terminal GE is 1; When the value of the first analog input variable terminal IN21 is equal to the value of the second analog input variable terminal IN22, the value of the third state output variable terminal EQ is 1; When the value of the first analog input variable terminal IN21 is less than or equal to the value of the second analog input variable terminal IN22, the value of the fourth state output variable terminal LE is 1; When the value of the first analog input variable terminal IN21 is less than the value of the second analog input variable terminal IN22, the value of the fifth state output variable terminal LT is 1.
[0011] In one implementation, the FBD basic functional block includes an open delay module TON. The open delay module TON includes an open delay digital input variable terminal IN3, an open delay integer input variable terminal PT, an open delay digital output variable terminal Q2, and an open delay integer output variable terminal ET. The open delay digital input variable terminal IN3 is a timing control pulse. When the value of the open delay digital input variable terminal IN3 is 1, the delay count is activated. At this time, the value of the open delay integer output variable terminal ET is incremented by 1 each cycle. At any time, when the value of the open delay digital input variable terminal IN3 is... When the value is 0, both the open-delay digital output variable terminal Q2 and the open-delay integer output variable terminal ET are cleared to zero. The value of the open-delay integer input variable terminal PT is used as the delay time parameter, and the value of the open-delay digital output variable terminal Q2 is used as the timing output. When the value of the open-delay digital output variable terminal Q2 is 1, the delay count ends. The value of the open-delay integer output variable terminal ET is used as the current timing value. When the value of the open-delay integer output variable terminal ET is equal to the value of the open-delay integer input variable terminal PT, the value of the open-delay digital output variable terminal Q2 is 1.
[0012] In one implementation, the FBD basic function block includes an RS flip-flop module LTCH, which includes a digital set terminal S, a digital reset terminal R, a first digital output variable terminal Q_RS, and a second digital output variable terminal Q_SR. When R=0 and S=1, then Q_RS=1 and Q_SR=1; When R=1 and S=0, then Q_RS=0 and Q_SR=0; When R=0 and S=0, the values of Q_RS and Q_SR remain unchanged; When R=1 and S=1, then Q_RS=0 and Q_SR=1.
[0013] In one implementation, the FBD basic functional block includes a multi-value selection module MUX5. The MUX5 includes a channel number selection terminal SEL, five analog input channels IN41~IN45, and an analog output terminal Q3. The analog input channels IN41~IN45 default to 0 when not connected. The channel number selection terminal SEL takes integer values from 1 to 5. When the channel number selection terminal SEL is 1~5, the analog output terminal Q3 outputs the analog values corresponding to the analog input channels IN41~IN45 respectively. When the input value of the channel number selection terminal SEL is less than 1, it takes the value 1. When the input value of the channel number selection terminal SEL is greater than 5, it takes the value 5. When the channel number selection terminal SEL is not connected, the analog value of the first analog input channel IN41 is used as the output value of the analog output terminal Q3 by default.
[0014] In one implementation, the FBD basic function block includes a multi-multiply-add module MULADD, which includes six analog input variable terminals K1, X1, K2, X2, K3, and X3, and one analog output variable terminal Q4; the values of the unlinked analog input variable terminals K1, X1, K2, X2, K3, and X3 are 0; Q4 = K1*X1 + K2*X2 + K3*X3.
[0015] As one implementation, it includes five logic AND modules AND61~AND65, one logic OR module OR6, one numerical comparison module CMPR, one open delay module TON, one RS flip-flop module LTCH, one multi-value selection module MUX5, one multi-multiply-add module MULADD, four reconstruction input pins and four reconstruction output pins. A first reconfiguration input pin is connected to a logic AND digital input variable terminal IN11 of the first logic AND module AND61, and the other five logic AND digital input variable terminals IN12~IN16 of the first logic AND module AND61 have an input value of 1; A second reconfiguration input pin is connected to a logic AND digital input variable terminal IN11 of the second logic AND module AND62, and the other five logic AND digital input variable terminals IN12~IN16 of the second logic AND module AND62 have an input value of 1; The first AND module AND61's logic AND digital output variable terminal Q1 is connected to the third AND module AND63's first logic AND digital input variable terminal IN11 and the numerical comparison module CMPR's first analog input variable terminal IN21; the second AND module AND62's logic AND digital output variable terminal Q1 is connected to the third AND module AND63's second logic AND digital input variable terminal IN12 and the numerical comparison module CMPR's second analog input variable terminal IN22; The input values of the other four logical AND digital input variable terminals IN13~IN16 of the third logical AND module AND63 are 1; the logical AND digital output variable terminal Q1 of the third logical AND module AND63 is connected to the first logical AND digital input variable terminal IN11 of the fourth logical AND module AND64. The third state output variable output terminal EQ of the numerical comparison module CMPR is inverted and connected to the first logic AND digital input variable terminal IN11 of the fifth logic AND module AND65 and the open delay digital input variable terminal IN3 of the open delay module TON. The input value of the channel number selection terminal SEL of the multi-value selection module MUX5 is 1; the first analog input channel terminal IN41 of the multi-value selection module MUX5 is used as the input terminal for the number of error time cycles; the input values of the other four analog input channels IN42~IN45 are 0; the analog output terminal Q3 is connected to the open-delay integer input variable terminal PT of the open-delay module TON and the first analog input variable terminal K1 of the multi-multiply-add module MULADD; The input value of the second analog input variable terminal X1 of the multi-multiply adder module MULADD is 50; the input values of the other analog input variable terminals K2, X2, K3, and X3 are 0; the analog output variable terminal Q4 of the multi-multiply adder module MULADD is connected to a fifth reconstructed input pin. The open-delay digital output variable terminal Q2 of the open-delay module TON is connected to the digital set terminal S of the RS trigger module LTCH; A third reconfiguration input pin is connected to the first logic OR digital input variable terminal IN51 of the logic OR module OR6; A fourth reconfiguration input pin is connected to the second logic OR digital input variable terminal IN52 of the OR module OR6; The input values of the other four logical OR digital input variable terminals IN53~IN56 of the logical OR module OR6 are 0; the logical OR digital output variable terminal Q5 of the logical OR module OR6 is connected to the digital reset terminal R of the RS flip-flop module LTCH. The second digital output variable terminal Q_SR of the RS flip-flop module LTCH is connected to the second logic AND digital input variable terminal IN12 of the fourth logic AND module AND64 and a second reconstructed output pin; the second digital output variable terminal Q_SR of the RS flip-flop module LTCH is inverted and connected to the second logic AND digital input variable terminal IN12 of the fifth logic AND module AND65; The input values of the other four logical AND digital input variable terminals IN13~IN16 of the fourth logical AND module AND64 are 1; the logical AND digital output variable terminal Q1 of the fourth logical AND module AND64 is connected to a third reconfiguration output pin; The input values of the other four logical AND digital input variable terminals IN13~IN16 of the fifth logical AND module AND65 are 1; the logical AND digital output variable terminal Q1 of the fifth logical AND module AND65 is connected to a first reconfigured output pin.
[0016] The present invention discloses a method for reconstructing a dual-channel diagnostic function block of a proton therapy safety system, used to construct the dual-channel diagnostic function block of the proton therapy safety system as described in the present invention, comprising the following steps: S1: Analyze a target dual-channel input diagnostic function block to clarify the input and output functions of each target input and output pin of the target dual-channel input diagnostic function block; S2: Create the dual-channel diagnostic function block of the proton therapy safety system, wherein the number of reconstructed input pins of the dual-channel diagnostic function block of the proton therapy safety system is consistent with the number of target input pins, and the number of reconstructed output pins is consistent with the number of target output pins; use multiple FBD basic function blocks to simulate and replicate the input and output functions of the target dual-channel input diagnostic function block and associate them with the reconstructed input pins and the reconstructed output pins; S3: Perform logic testing on the dual-channel diagnostic function block of the proton therapy safety system, force the value of the reconstructed input pin, draw a timing diagram according to the output value of the corresponding reconstructed output pin when the reconstructed input pin is input differently, and confirm that the function of the dual-channel diagnostic function block of the proton therapy safety system is consistent with the function of the target dual-channel input diagnostic function block.
[0017] Because the present invention adopts the above technical solution, it has the following beneficial effects: This approach utilizes multiple FBD (Functional Business Environment) basic function blocks to create demo programs, enabling the functional redesign of complex functional modules. This achieves complete functionality identical to the target security system's complex functional modules, avoiding the need for redevelopment and certification of identical complex functional blocks at the R&D level, thus offering high economic efficiency and practicality. The use of the FBD language for programming, with its intuitive graphical programming method, helps improve development efficiency and system reliability. By keeping the original functional module's input / output pins unchanged, the input / output pins in the demo program are modified to the corresponding measurement points when called in a domestic system, thereby achieving complete functionality identical to a complex functional module of a foreign security system. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying 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.
[0019] Figure 1 This is a schematic diagram of the structure of the target dual-channel input diagnostic function block in an embodiment of this application; Figure 2 This is a schematic diagram of the results of the dual-channel diagnostic function block of the proton therapy safety system according to an embodiment of this application; Figure 3 A flowchart illustrating the reconstruction method of the dual-channel diagnostic function block of the proton therapy safety system according to an embodiment of this application; Figure 4 This is a timing diagram for the logic test of the reconstruction method of the dual-channel diagnostic function block of the proton therapy safety system according to an embodiment of this application. Detailed Implementation
[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] Please see Figure 1 In this embodiment, the input and output pins of a target dual-channel input diagnostic function block are defined as follows: First target input pin IN1: Input the first signal sent by the sensor or button; Second target input pin IN2: Input the second signal sent by the sensor or button; The fifth target input pin, DISCTIME, is the error time. It is the maximum time that the two input signals can be out of sync, with each signal being either 1 or 0. Exceeding this time will trigger an error alarm signal.
[0022] The third target input pin ACK_NEC: Whether to perform automatic alarm confirmation. 0 means that the system automatically confirms the alarm, and 1 means that manual confirmation is required.
[0023] The fourth target input pin ACK: alarm confirmation pulse. A short pulse of 1 is given to this point to confirm the alarm, and then it is automatically reset to 0.
[0024] The second target output pin Q: output signal, a reliable value output after the dual channels have been diagnosed.
[0025] The third target output pin ACK_REQ: Alarm confirmation is required. When the current alarm is not confirmed and the input signal returns to a consistent 0 or 1 after the alarm, this signal is 1, indicating that an alarm has occurred; when the current alarm is not confirmed and the input signal does not remain consistent and is not 0 or 1, this signal is 0.
[0026] The first target output pin DISC_FLT: Error alarm. When two input signals have an error, are logically different, and exceed the maximum error time, this alarm is set to 1. Regardless of whether an error alarm has occurred or is occurring, this signal will always be 1 until the error alarm is cleared and confirmed by automatic or manual alarm. Only then will the signal become 0.
[0027] Please see Figure 1 and Figure 2 An embodiment of the present invention discloses a dual-channel diagnostic function block for a proton therapy safety system, comprising: multiple FBD basic function blocks, multiple reconfigurable input pins, and multiple reconfigurable output pins; the FBD basic function blocks cooperate to simulate and replicate the input and output functions of a target dual-channel input diagnostic function block; the target dual-channel input diagnostic function block includes multiple target input pins and multiple target output pins; the input function of the reconfigurable input pins is consistent with that of the target input pins, and the output function of the reconfigurable output pins is consistent with that of the target output pins.
[0028] In this embodiment, the dual-channel input diagnostic function was reconstructed using a domestic platform, employing 7 types and a total of 10 FBD basic function blocks, involving 9 input and output pins. The specific module types and pins are as follows: The basic functional blocks of the FBD include AND61~AND65, OR6, CMPR, TON, LTCH, MUX5, and MULADD.
[0029] The AND modules AND61~AND65 implement the AND operation for six digital input variables, including six AND digital input variables IN11~IN16 and one AND digital output variable Q1. The value of the output variable Q1 is 1 only when the value of all the AND digital input variables IN11~IN16 is 1; the value of the output variable Q1 is 0 when any of the AND digital input variables IN11~IN16 is 0.
[0030] The OR module OR6 implements a logical OR operation on six digital input variables, including six logical OR digital input variable terminals IN51~IN56 and one logical OR digital output variable terminal Q5; the value of the logical OR digital output variable terminal Q5 is 0 only when the values of all the logical OR digital input variable terminals IN51~IN56 are 0; the value of the logical OR digital output variable terminal Q5 is 1 when any of the logical OR digital input variable terminals IN51~IN56 is 1.
[0031] The numerical comparison module CMPR: realizes the comparison status output of two analog input variables; including two analog input variable terminals IN21 and IN22 and five status output variable terminals GT, GE, EQ, LE, LT; When the value of the first analog input variable terminal IN21 is greater than the value of the second analog input variable terminal IN22, the value of the first state output variable terminal GT is 1; When the value of the first analog input variable terminal IN21 is greater than or equal to the value of the second analog input variable terminal IN22, the value of the second state output variable terminal GE is 1; When the value of the first analog input variable terminal IN21 is equal to the value of the second analog input variable terminal IN22, the value of the third state output variable terminal EQ is 1; When the value of the first analog input variable terminal IN21 is less than or equal to the value of the second analog input variable terminal IN22, the value of the fourth state output variable terminal LE is 1; When the value of the first analog input variable terminal IN21 is less than the value of the second analog input variable terminal IN22, the value of the fifth state output variable terminal LT is 1.
[0032] The open delay module TON: When the open delay digital input variable IN3 is 1, the output of the open delay digital output variable Q2 is 1 at the time of the delay between the open delay integer input variable PT and Q2. It includes an open delay digital input variable IN3, an open delay integer input variable PT, an open delay digital output variable Q2, and an open delay integer output variable ET. The open delay digital input variable IN3 is a timing control pulse. When the value of the open delay digital input variable IN3 is 1, the delay count is activated. At this time, the value of the open delay integer output variable ET is incremented by 1 each cycle. At any time when the open delay... When the value of the delay digital input variable IN3 is 0, the open delay digital output variable Q2 and the open delay integer output variable ET are simultaneously cleared to zero; the value of the open delay integer input variable PT is used as the delay time parameter, and the value of the open delay digital output variable Q2 is used as the timing output. When the value of the open delay digital output variable Q2 is 1, the delay counting ends; the value of the open delay integer output variable ET is used as the current timing value. When the value of the open delay integer output variable ET is equal to the value of the open delay integer input variable PT, the value of the open delay digital output variable Q2 is 1.
[0033] In this embodiment, the delay time is calculated based on the number of scan cycles, rather than the PT delay time that can be directly input in some systems. For example, if the delay module TON needs to delay for 500ms and output 1 when the input is kept at 1, then when the logical page scan cycle is set to 50ms, 500 / 50=10 needs to be input into the integer input variable PT of the delay module, which means that the output will be 1 after 10 page scan cycles. Similarly, when the page scan cycle is 100ms, if a delay of 500ms is required, 500 / 100=5 needs to be input into the integer input variable PT of the delay module, and so on.
[0034] The RS flip-flop module LTCH: RS and SR flip-flops, includes a digital set terminal S, a digital reset terminal R, a first digital output variable terminal Q_RS and a second digital output variable terminal Q_SR; When R=0 and S=1, then Q_RS=1 and Q_SR=1; When R=1 and S=0, then Q_RS=0 and Q_SR=0; When R=0 and S=0, the values of Q_RS and Q_SR remain unchanged; When R=1 and S=1, then Q_RS=0 and Q_SR=1.
[0035] The multi-value selection module MUX5 enables numerical selection and output of five analog input channels based on selection variables. It includes a channel number selection terminal SEL, five analog input channel terminals IN41~IN45, and an analog output terminal Q3. The values of the analog input channel terminals IN41~IN45 are defaulted to 0 when no connection is made. The channel number selection terminal SEL takes integer values from 1 to 5. When the value of SEL is 1~5, the analog output terminal Q3 will output the analog values corresponding to the analog input channels IN41~IN45 respectively. When the input value of SEL is less than 1, the value is 1; when the input value of SEL is greater than 5, the value is 5. When SEL is not connected, the analog value of the first analog input channel IN41 is used as the output value of the analog output terminal Q3 by default.
[0036] For example, when the input value of the channel number selection terminal SEL is 3, the analog output terminal Q3 outputs the signal of the third analog input channel IN43. When the input value of the channel number selection terminal SEL is 1, the analog output terminal Q3 outputs the signal of the first analog input channel IN41. The MULADD module performs multiplication and summation of three sets of analog inputs; it includes six analog input variables K1, X1, K2, X2, K3, and X3, and one analog output variable Q4; the values of the unlinked analog input variables K1, X1, K2, X2, K3, and X3 are 0.0; Q4 = K1*X1 + K2*X2 + K3*X3.
[0037] This embodiment of a dual-channel diagnostic function block for a proton therapy safety system includes five AND modules AND61~AND65, one OR module OR6, one numerical comparison module CMPR, one open delay module TON, one RS flip-flop module LTCH, one multi-value selection module MUX5, one multi-multiply-add module MULADD, four reconstruction input pins, and four reconstruction output pins. A first reconfiguration input pin is connected to the first logic AND digital input variable terminal IN11 of the first logic AND module AND61, and the other five logic AND digital input variable terminals IN12~IN16 of the first logic AND module AND61 have an input value of 1; A second reconfiguration input pin is connected to the first logic AND digital input variable terminal IN11 of the second logic AND module AND62, and the other five logic AND digital input variable terminals IN12~IN16 of the second logic AND module AND62 have an input value of 1; The first AND module AND61's logic AND digital output variable terminal Q1 is connected to the third AND module AND63's first logic AND digital input variable terminal IN11 and the numerical comparison module CMPR's first analog input variable terminal IN21; the second AND module AND62's logic AND digital output variable terminal Q1 is connected to the third AND module AND63's second logic AND digital input variable terminal IN12 and the numerical comparison module CMPR's second analog input variable terminal IN22; The input values of the other four logical AND digital input variable terminals IN13~IN16 of the third logical AND module AND63 are 1; the logical AND digital output variable terminal Q1 of the third logical AND module AND63 is connected to the first logical AND digital input variable terminal IN11 of the fourth logical AND module AND64. The third state output variable output terminal EQ of the numerical comparison module CMPR is inverted and connected to the first logic AND digital input variable terminal IN11 of the fifth logic AND module AND65 and the open delay digital input variable terminal IN3 of the open delay module TON. The input value of the channel number selection terminal SEL of the multi-value selection module MUX5 is 1; the first analog input channel terminal IN41 of the multi-value selection module MUX5 is used as the input terminal for the number of error time cycles; the input values of the other four analog input channels IN42~IN45 are 0; the analog output terminal Q3 is connected to the open-delay integer input variable terminal PT of the open-delay module TON and the first analog input variable terminal K1 of the multi-multiply-add module MULADD; The input value of the second analog input variable terminal X1 of the multi-multiply adder module MULADD is 50; the input values of the other analog input variable terminals K2, X2, K3, and X3 are 0; the analog output variable terminal Q4 of the multi-multiply adder module MULADD is connected to a fifth reconstructed input pin. The open-delay digital output variable terminal Q2 of the open-delay module TON is connected to the digital set terminal S of the RS trigger module LTCH; A third reconfiguration input pin is connected to the first logic OR digital input variable terminal IN51 of the logic OR module OR6; A fourth reconfiguration input pin is connected to the second logic OR digital input variable terminal IN52 of the OR module OR6; The input values of the other four logical OR digital input variable terminals IN53~IN56 of the logical OR module OR6 are 0; the logical OR digital output variable terminal Q5 of the logical OR module OR6 is connected to the digital reset terminal R of the RS flip-flop module LTCH. The second digital output variable terminal Q_SR of the RS flip-flop module LTCH is connected to the second logic AND digital input variable terminal IN12 of the fourth logic AND module AND64 and a second reconstructed output pin; the second digital output variable terminal Q_SR of the RS flip-flop module LTCH is inverted and connected to the second logic AND digital input variable terminal IN12 of the fifth logic AND module AND65; The input values of the other four logical AND digital input variable terminals IN13~IN16 of the fourth logical AND module AND64 are 1; the logical AND digital output variable terminal Q1 of the fourth logical AND module AND64 is connected to a third reconfiguration output pin; The input values of the other four logical AND digital input variable terminals IN13~IN16 of the fifth logical AND module AND65 are 1; the logical AND digital output variable terminal Q1 of the fifth logical AND module AND65 is connected to a first reconfigured output pin.
[0038] In this embodiment, the first reconstructed input pin is connected to the first logic AND digital input variable terminal IN11 of the first logic AND module AND61, which corresponds to the first target input pin IN1 in the target dual-channel input diagnostic function block; The second reconfiguration input pin is connected to the first logic AND digital input variable terminal IN11 of the second logic AND module AND62, corresponding to the second target input pin IN2 in the target dual-channel input diagnostic function block; The fifth reconstructed input pin is connected to the analog output variable terminal Q4 of the multi-multiply-add module MULADD, corresponding to the fifth target input pin DISCTIME in the target dual-channel input diagnostic function block; In this embodiment, the first analog input channel terminal IN41 of the multi-value selection module MUX5 is used as an input terminal for the number of error time cycles, and as a direct pin for setting the delay output time of the on delay module TON. The input value is the number of scan cycles. This value, together with the first analog input variable terminal K1 of the multi-multiply-add module MULADD (the logic page scan cycle is 50ms, so it is set to 50), is output to the analog output variable terminal Q4 for time display. The analog output variable terminal Q4 does not directly participate in the logic operation.
[0039] The third reconfiguration input pin is connected to the first logic OR digital input variable terminal IN51 of the logic OR module OR6, which corresponds to the fourth target input pin ACK in the target dual-channel input diagnostic function block. This pin is responsible for manually resetting the alarm signal. The fourth reconfiguration input pin is connected to the second logic OR digital input variable terminal IN52 of the logic OR module OR6, which corresponds to the third target input pin ACK_NEC in the target dual-channel input diagnostic function block; when this pin is set to 1, the alarm will be automatically reset and confirmed.
[0040] The second reconstructed output pin is connected to the first digital output variable terminal Q_RS of the RS flip-flop module LTCH, corresponding to the first target output pin DISC_FLT in the target dual-channel input diagnostic function block; this pin is always 1 before an alarm has occurred and has been confirmed. The third reconfiguration output pin is connected to the logic and digital output variable terminal Q1 of the fourth logic AND module AND64, corresponding to the second target output pin Q in the target dual-channel input diagnostic function block; this pin will output 1 only when both input signals are 1 and no alarm occurs.
[0041] The first reconfiguration output pin is connected to the logic and digital output variable terminal Q1 of the fifth logic AND module AND65, corresponding to the third target output pin ACK_REQ in the target dual-channel input diagnostic function block. When an alarm occurs and is not acknowledged, and both input signals return to the same state (either 1 or 0), this pin outputs 1, indicating to the operator that there is an alarm that needs to be acknowledged.
[0042] In this embodiment, the logic layout implements the diagnostic function for redundant dual-channel signals. The first and second reconstruction input pins of the two input channels change to 1 within the set error time. The "signal output after judgment" is 1, which means that the signal is normal and reliable.
[0043] When the changes in the two channels are inconsistent, and neither changes to 1 simultaneously within the time difference, the second reconstruction output pin will output "error alarm" as 1. When an error alarm exists, the output Q1 of the third reconstruction output pin will always be 0 to avoid outputting an incorrect signal that could cause the safety system to malfunction. If an alarm has occurred but the system automatically recovers without acknowledging the error alarm signal, the "alarm needs acknowledgment" signal will change to 1, reminding the operator that an alarm has occurred and needs to be acknowledged.
[0044] The alarm signal can be set to automatic or manual confirmation. When set to automatic confirmation, the "Automatic Alarm Confirmation" signal is 1. When the input signal returns to normal and is either 1 or 0, the alarm will be automatically confirmed. Otherwise, a "Confirmation Pulse" needs to be manually provided to confirm the alarm.
[0045] The error time is achieved by setting the "error time cycle number" of the on-delay module TON. In this embodiment, the time is set as the scan cycle number instead of being set directly. In this embodiment, the page scan cycle is 50ms. Therefore, to set the delay time of the on-delay module TON, the desired time needs to be divided by 50ms to obtain the cycle number, which is then given to the integer input variable PT of the on-delay module TON. For example, the cycle number for 500ms should be set to 10, for 1s it should be set to 20, and so on.
[0046] Please see Figure 3 The present invention discloses a method for reconstructing a dual-channel diagnostic functional block of a proton therapy safety system, used to construct the dual-channel diagnostic functional block of the proton therapy safety system as described in the present invention, comprising the following steps: S1: Analyze a target dual-channel input diagnostic function block to clarify the input and output functions of each target input and output pin of the target dual-channel input diagnostic function block; S2: Create the dual-channel diagnostic function block of the proton therapy safety system, wherein the number of reconstructed input pins of the dual-channel diagnostic function block of the proton therapy safety system is consistent with the number of target input pins, and the number of reconstructed output pins is consistent with the number of target output pins; use multiple FBD basic function blocks to simulate and replicate the input and output functions of the target dual-channel input diagnostic function block and associate them with the reconstructed input pins and the reconstructed output pins; In this embodiment, the dual-channel diagnostic function block of the proton therapy safety system retains the input and output pins of the target dual-channel input diagnostic function block, treating it as a black-box function block. The original complex function block function is replicated using the FBD basic module in the domestic safety system software platform and associated with the corresponding input and output pins.
[0047] S3: Perform logic testing on the dual-channel diagnostic function block of the proton therapy safety system, force the value of the reconstructed input pin, draw a timing diagram according to the output value of the corresponding reconstructed output pin when the reconstructed input pin is input differently, and confirm that the function of the dual-channel diagnostic function block of the proton therapy safety system is consistent with the function of the target dual-channel input diagnostic function block.
[0048] Please see Figure 4 If the timing diagram of the test of the dual-channel diagnostic function block of the proton therapy safety system is consistent with the timing diagram of the target dual-channel input diagnostic function block, then the reconstruction of the target dual-channel input diagnostic function block is considered to have been successfully completed.
[0049] It should be noted that while the preferred embodiments of the present invention are provided in the specification and accompanying drawings, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. These embodiments are not intended to impose additional limitations on the content of the present invention; their purpose is to provide a more thorough and comprehensive understanding of the disclosure of the present invention. Furthermore, the above-described technical features can be combined with each other to form various embodiments not listed above, all of which are considered to be within the scope of the present invention specification. Moreover, those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims.
[0050] The present invention has been described in detail above with reference to the accompanying drawings and embodiments. Those skilled in the art can make various modifications to the present invention based on the above description. Therefore, certain details in the embodiments should not be construed as limiting the present invention, and the scope of protection of the present invention shall be defined by the appended claims.
Claims
1. A dual-channel diagnostic function block for a proton therapy safety system, characterized in that, include: The system comprises multiple FBD basic function blocks, multiple reconfigurable input pins, and multiple reconfigurable output pins. The FBD basic function blocks work in conjunction with the analog replication of the input and output functions of a target dual-channel input diagnostic function block. The target dual-channel input diagnostic function block includes multiple target input pins and multiple target output pins. The input function of the reconfigurable input pins is consistent with that of the target input pins, and the output function of the reconfigurable output pins is consistent with that of the target output pins.
2. The dual-channel diagnostic functional block of the proton therapy safety system according to claim 1, characterized in that, The FBD basic functional block includes AND modules AND61~AND65, which include six logical AND digital input variables IN11~IN16 and one logical AND digital output variable Q1. The value of the logical AND digital output variable Q1 is 1 only when the value of all the logical AND digital input variables IN11~IN16 is 1; the value of the logical AND digital output variable Q1 is 0 when any of the logical AND digital input variables IN11~IN16 is 0.
3. The dual-channel diagnostic functional block of the proton therapy safety system according to claim 2, characterized in that, The FBD basic functional block includes a logic OR module OR6, which includes six logic OR digital input variable terminals IN51~IN56 and one logic OR digital output variable terminal Q5. The value of the logic OR digital output variable terminal Q5 is 0 only when the values of all the logic OR digital input variable terminals IN51~IN56 are 0; the value of the logic OR digital output variable terminal Q5 is 1 when any of the logic OR digital input variable terminals IN51~IN56 is 1.
4. The dual-channel diagnostic functional block of the proton therapy safety system according to claim 3, characterized in that, The FBD basic function block includes a numerical comparison module CMPR, which includes two analog input variable terminals IN21 and IN22 and five state output variable terminals GT, GE, EQ, LE, and LT. When the value of the first analog input variable terminal IN21 is greater than the value of the second analog input variable terminal IN22, the value of the first state output variable terminal GT is 1; When the value of the first analog input variable terminal IN21 is greater than or equal to the value of the second analog input variable terminal IN22, the value of the second state output variable terminal GE is 1; When the value of the first analog input variable terminal IN21 is equal to the value of the second analog input variable terminal IN22, the value of the third state output variable terminal EQ is 1; When the value of the first analog input variable terminal IN21 is less than or equal to the value of the second analog input variable terminal IN22, the value of the fourth state output variable terminal LE is 1; When the value of the first analog input variable terminal IN21 is less than the value of the second analog input variable terminal IN22, the value of the fifth state output variable terminal LT is 1.
5. The dual-channel diagnostic functional block of the proton therapy safety system according to claim 4, characterized in that, The FBD basic functional block includes an on-delay module TON, which includes an on-delay digital input variable IN3, an on-delay integer input variable PT, an on-delay digital output variable Q2, and an on-delay integer output variable ET. The on-delay digital input variable IN3 is a timing control pulse. When the value of IN3 is 1, the delay count is active, and the value of ET is incremented by 1 each cycle. At any time, when the value of IN3 is 0, both Q2 and ET are simultaneously cleared to zero. The value of PT serves as the delay time parameter, and the value of Q2 serves as the timing output. When the value of Q2 is 1, the delay count ends. The value of the open-delay integer output variable terminal ET is used as the current timing value. When the value of the open-delay integer output variable terminal ET is equal to the value of the open-delay integer input variable terminal PT, the value of the open-delay digital output variable terminal Q2 is 1.
6. The dual-channel diagnostic functional block of the proton therapy safety system according to claim 5, characterized in that, The FBD basic function block includes an RS trigger module LTCH, which includes a digital set terminal S, a digital reset terminal R, a first digital output variable terminal Q_RS, and a second digital output variable terminal Q_SR. When R=0 and S=1, then Q_RS=1 and Q_SR=1; When R=1 and S=0, then Q_RS=0 and Q_SR=0; When R=0 and S=0, the values of Q_RS and Q_SR remain unchanged; When R=1 and S=1, then Q_RS=0 and Q_SR=1.
7. The dual-channel diagnostic functional block of the proton therapy safety system according to claim 6, characterized in that, The FBD basic function block includes a multi-value selection module MUX5, which includes a channel number selection terminal SEL, five analog input channel terminals IN41~IN45, and an analog output terminal Q3. The value of the analog input channel terminals IN41~IN45 is 0 by default when there is no connection. The value of the channel number selection terminal SEL includes integers from 1 to 5. When the value of the channel number selection terminal SEL is 1~5, the analog output terminal Q3 will output the analog value corresponding to the analog input channel terminals IN41~IN45 respectively. When the input value of the channel number selection terminal SEL is less than 1, the value is 1; when the input value of the channel number selection terminal SEL is greater than 5, the value is 5; when the channel number selection terminal SEL is not connected, the analog value of the first analog input channel IN41 is taken as the output value of the analog output terminal Q3 by default.
8. The dual-channel diagnostic functional block of the proton therapy safety system according to claim 7, characterized in that, The FBD basic function block includes a multi-multiply-add module MULADD, which includes six analog input variable terminals K1, X1, K2, X2, K3, and X3, and one analog output variable terminal Q4; the values of the unlinked analog input variable terminals K1, X1, K2, X2, K3, and X3 are 0; Q4 = K1*X1 + K2*X2 + K3*X3.
9. The dual-channel diagnostic functional block of the proton therapy safety system according to claim 8, characterized in that, It includes five logic AND modules AND61~AND65, one logic OR module OR6, one numerical comparison module CMPR, one open delay module TON, one RS flip-flop module LTCH, one multi-value selection module MUX5, one multi-multiply-add module MULADD, five reconstructed input pins and three reconstructed output pins; A first reconfiguration input pin is connected to a logic AND digital input variable terminal IN11 of the first logic AND module AND61, and the other five logic AND digital input variable terminals IN12~IN16 of the first logic AND module AND61 have an input value of 1; A second reconfiguration input pin is connected to a logic AND digital input variable terminal IN11 of the second logic AND module AND62, and the other five logic AND digital input variable terminals IN12~IN16 of the second logic AND module AND62 have an input value of 1; The first AND module AND61's logic AND digital output variable terminal Q1 is connected to the third AND module AND63's first logic AND digital input variable terminal IN11 and the numerical comparison module CMPR's first analog input variable terminal IN21; the second AND module AND62's logic AND digital output variable terminal Q1 is connected to the third AND module AND63's second logic AND digital input variable terminal IN12 and the numerical comparison module CMPR's second analog input variable terminal IN22; The input values of the other four logical AND digital input variable terminals IN13~IN16 of the third logical AND module AND63 are 1; the logical AND digital output variable terminal Q1 of the third logical AND module AND63 is connected to the first logical AND digital input variable terminal IN11 of the fourth logical AND module AND64. The third state output variable output terminal EQ of the numerical comparison module CMPR is inverted and connected to the first logic AND digital input variable terminal IN11 of the fifth logic AND module AND65 and the open delay digital input variable terminal IN3 of the open delay module TON. The input value of the channel number selection terminal SEL of the multi-value selection module MUX5 is 1; the first analog input channel terminal IN41 of the multi-value selection module MUX5 is used as the input terminal for the number of error time cycles; the input values of the other four analog input channels IN42~IN45 are 0; the analog output terminal Q3 is connected to the open-delay integer input variable terminal PT of the open-delay module TON and the first analog input variable terminal K1 of the multi-multiply-add module MULADD; The input value of the second analog input variable terminal X1 of the multi-multiply adder module MULADD is 50; the input values of the other analog input variable terminals K2, X2, K3, and X3 are 0; the analog output variable terminal Q4 of the multi-multiply adder module MULADD is connected to a fifth reconstructed input pin. The open-delay digital output variable terminal Q2 of the open-delay module TON is connected to the digital set terminal S of the RS trigger module LTCH; A third reconfiguration input pin is connected to the first logic OR digital input variable terminal IN51 of the logic OR module OR6; A fourth reconfiguration input pin is connected to the second logic OR digital input variable terminal IN52 of the OR module OR6; The input values of the other four logical OR digital input variable terminals IN53~IN56 of the logical OR module OR6 are 0; the logical OR digital output variable terminal Q5 of the logical OR module OR6 is connected to the digital reset terminal R of the RS flip-flop module LTCH. The second digital output variable terminal Q_SR of the RS flip-flop module LTCH is connected to the second logic AND digital input variable terminal IN12 of the fourth logic AND module AND64 and a second reconstructed output pin; the second digital output variable terminal Q_SR of the RS flip-flop module LTCH is inverted and connected to the second logic AND digital input variable terminal IN12 of the fifth logic AND module AND65; The input values of the other four logical AND digital input variable terminals IN13~IN16 of the fourth logical AND module AND64 are 1; the logical AND digital output variable terminal Q1 of the fourth logical AND module AND64 is connected to a third reconfiguration output pin; The input values of the other four logical AND digital input variable terminals IN13~IN16 of the fifth logical AND module AND65 are 1; the logical AND digital output variable terminal Q1 of the fifth logical AND module AND65 is connected to a first reconfigured output pin.
10. A method for reconstructing a dual-channel diagnostic function block of a proton therapy safety system, used to construct the dual-channel diagnostic function block of the proton therapy safety system as described in any one of claims 1 to 9, comprising the steps of: S1: Analyze a target dual-channel input diagnostic function block to clarify the input and output functions of each target input and output pin of the target dual-channel input diagnostic function block; S2: Create the dual-channel diagnostic function block of the proton therapy safety system, wherein the number of reconstructed input pins of the dual-channel diagnostic function block of the proton therapy safety system is consistent with the number of target input pins, and the number of reconstructed output pins is consistent with the number of target output pins; use multiple FBD basic function blocks to simulate and replicate the input and output functions of the target dual-channel input diagnostic function block and associate them with the reconstructed input pins and the reconstructed output pins; S3: Perform logic testing on the dual-channel diagnostic function block of the proton therapy safety system, force the value of the reconstructed input pin, draw a timing diagram according to the output value of the corresponding reconstructed output pin when the reconstructed input pin is input differently, and confirm that the function of the dual-channel diagnostic function block of the proton therapy safety system is consistent with the function of the target dual-channel input diagnostic function block.