Method and device for determining trigger time of relay action instruction and electronic equipment
By acquiring the relay's drive voltage and ambient temperature, nodes within the search range are determined and optimized, solving the problem of inaccurate relay action delay, achieving high-precision zero-crossing control, avoiding arc discharge, and extending equipment lifespan.
Patent Information
- Application Number
- CN202511292580.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-10
- Publication Date
- 2025-11-14
AI Technical Summary
In the existing technology, the action delay of the relay is affected by factors such as driving voltage fluctuations, ambient temperature changes and mechanical component aging, resulting in low zero-crossing control accuracy, difficulty in accurately matching the AC zero-crossing point, causing arc discharge, and shortening the service life of the relay.
By acquiring the relay's drive voltage and ambient temperature, multiple nodes within the search range are identified, optimization is performed, the target delay time is obtained, the trigger time of the action command is accurately determined, and the zero-crossing control accuracy is improved.
It improves the accuracy of zero-crossing control, avoids arc discharge, and extends the service life of the equipment.
Smart Images

Figure CN120954937A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of equipment control technology, and in particular to a method, apparatus and electronic device for determining the trigger time of a relay action command. Background Technology
[0002] With the continuous advancement of power electronics technology, relays, as a core actuator, are widely used in various fields such as smart meters, smart homes, and industrial automation, undertaking the critical task of circuit switching control. In AC load control applications, if the closing time of the relay contacts fails to precisely match the power supply voltage waveform, a large inrush current can easily be generated at the moment of contact closure. This inrush current can not only impact the load equipment but also potentially cause problems such as electric arcing, electromagnetic interference, and contact erosion, thus severely affecting the service life of the relay.
[0003] Currently, existing technologies typically use fixed lead time or lookup table methods to compensate for relay operating delays. For example, the average operating time of the relay under standard operating conditions is pre-calibrated and used as a fixed compensation time to issue drive commands in advance.
[0004] However, the actual operating time of a relay is affected by various factors, including fluctuations in the driving voltage, changes in ambient temperature, and the aging of mechanical components. These factors cause the relay's operating delay to exhibit significant time-varying and uncertainties. Therefore, a fixed compensation strategy is difficult to adapt to dynamic operating conditions, easily leading to insufficient or excessive compensation, thereby reducing the accuracy of zero-crossing control, making it difficult to accurately match the AC zero-crossing point, which can cause arcing and reduce the relay's service life. Summary of the Invention
[0005] This application provides a method, apparatus, and electronic device for determining the trigger time of a relay action command, in order to solve the technical defects of existing relays in actual use, such as low zero-crossing control accuracy, which makes it difficult to accurately match the zero-crossing point of AC power, thereby causing arc discharge and reducing the service life of the relay.
[0006] In a first aspect, this application provides a method for determining the trigger time of a relay action command, comprising:
[0007] The first driving voltage and the first ambient temperature of the relay are obtained, and a first search range corresponding to the relay is determined based on the first driving voltage and the first ambient temperature. The search range includes multiple nodes, and the nodes are used to indicate the corresponding candidate action delay duration.
[0008] The delay duration of the candidate action corresponding to the node is optimized to obtain a processing result, which is used to indicate the target delay duration of the relay.
[0009] The trigger time for the relay's action command is determined based on the target delay duration.
[0010] Optionally, before obtaining the first drive voltage and the first ambient temperature of the relay, the method further includes:
[0011] The second ambient temperature and the first operating data of the relay are obtained. The first operating data includes: a second driving voltage and a first action delay duration. The first action delay duration is used to indicate the interval between when the relay receives an action command and when it actually completes the action.
[0012] Determine the correlation between the second ambient temperature, the second driving voltage, and the first action delay duration;
[0013] Based on the aforementioned correlation, a relay action delay prediction model is constructed. The prediction model is used to predict the relay action delay based on the relay's driving voltage and ambient temperature.
[0014] Optionally, determining the first search range corresponding to the relay based on the first driving voltage and the first ambient temperature includes:
[0015] The first driving voltage and the first ambient temperature are input into the prediction model to obtain the predicted value of the action delay time.
[0016] The first search range is determined based on the predicted action delay duration.
[0017] Optionally, the optimization process for the delay duration of the candidate action corresponding to the node to obtain the processing result includes:
[0018] For any one of the multiple candidate action delay durations, determine the second action delay duration corresponding to the candidate action delay duration;
[0019] The fitness value of the candidate action delay duration is determined based on the candidate action delay duration and the second action delay duration corresponding to the action delay duration;
[0020] Based on multiple fitness values, the delay duration of the candidate action corresponding to the maximum fitness value is determined as the target delay duration.
[0021] Optionally, determining the candidate action delay duration corresponding to the maximum fitness value as the target delay duration includes:
[0022] Determine the node positions of multiple nodes;
[0023] Based on the node positions, determine the node distance between any two nodes among the plurality of nodes;
[0024] Based on the distances between multiple nodes, determine the maximum node distance and then determine whether the maximum node distance is less than a distance threshold.
[0025] If the maximum node distance is less than the distance threshold, multiple nodes are determined to have converged, and the candidate action delay time corresponding to the maximum fitness value is determined as the target delay time.
[0026] Optionally, the method further includes:
[0027] If the maximum node distance is not less than the distance threshold, the candidate action delay time corresponding to the maximum fitness value is determined as the global optimal node position;
[0028] Determine the historical fitness value of any one of the multiple nodes;
[0029] Based on the historical fitness values, determine the optimal position of any of the nodes;
[0030] Based on the optimal position of any one of the nodes and the globally optimal node position, the multiple nodes are updated to obtain a new node group.
[0031] Iterate the fitness values of the new node group until the new node group converges.
[0032] Optionally, determining the trigger time of the relay's action command based on the target delay duration includes:
[0033] Determine the voltage zero-crossing point of the relay circuit, wherein the voltage zero-crossing point represents the moment when the voltage changes from positive to negative or from negative to positive and the voltage is zero;
[0034] The trigger time for the relay's action command is determined based on the voltage zero-crossing point and the target delay duration.
[0035] Secondly, this application provides a device for determining the triggering time of a relay operation command, comprising:
[0036] The acquisition module is used to acquire the first driving voltage and the first ambient temperature of the relay;
[0037] The determination module is used to determine a first search range corresponding to the relay based on the first driving voltage and the first ambient temperature, wherein the search range includes multiple nodes, and the nodes are used to indicate the corresponding candidate action delay duration;
[0038] The processing module is used to optimize the delay duration of the candidate action corresponding to the node and obtain the processing result, which is used to indicate the target delay duration of the relay.
[0039] The determining module is further configured to determine the trigger time of the relay's action command based on the target delay duration.
[0040] Optionally, the acquisition module is further configured to acquire the second ambient temperature and the first operating data of the relay, wherein the first operating data includes: a second driving voltage and a first action delay duration, wherein the first action delay duration is used to indicate the interval between the relay receiving the action command and actually completing the action;
[0041] The determining module is further configured to determine the correlation between the second ambient temperature and the second driving voltage and the first action delay duration;
[0042] The processing module is further configured to construct a relay action delay prediction model based on the correlation relationship. The prediction model is used to predict the relay action delay based on the relay's driving voltage and ambient temperature.
[0043] Optionally, the processing module is further configured to input the first driving voltage and the first ambient temperature into the prediction model to obtain a predicted value of the action delay duration;
[0044] The determining module is further configured to determine a first search range based on the predicted action delay duration value.
[0045] Optionally, the determining module is further configured to determine a second action delay duration corresponding to any one of the multiple candidate action delay durations;
[0046] The determining module is further configured to determine the fitness value of the candidate action delay duration based on the candidate action delay duration and the second action delay duration corresponding to the action delay duration;
[0047] The determining module is further configured to determine the delay duration of the candidate action corresponding to the maximum fitness value as the target delay duration based on multiple fitness values.
[0048] Optionally, the device further includes: a determination module;
[0049] The determining module is also used to determine the node positions of multiple nodes;
[0050] The determining module is further configured to determine the node distance between any two nodes among the plurality of nodes based on the node position;
[0051] The determining module is further configured to determine the maximum node distance based on the multiple node distances;
[0052] The judgment module is used to determine whether the maximum node distance is less than a distance threshold;
[0053] The determining module is further configured to determine that multiple nodes have converged when the maximum node distance is less than the distance threshold, and to determine the candidate action delay time corresponding to the maximum fitness value as the target delay time.
[0054] Optionally, the determining module is further configured to determine the candidate action delay time corresponding to the maximum fitness value as the global optimal node position when the maximum node distance is not less than the distance threshold.
[0055] The determining module is also used to determine the historical fitness value of any one of the multiple nodes;
[0056] The determining module is further configured to determine the optimal position of any one of the nodes based on the historical fitness value;
[0057] The processing module is also used to update the plurality of nodes based on the optimal position of any one of the nodes and the globally optimal node position to obtain a new node group.
[0058] The processing module is also used to iterate the fitness value of the new node group until the new node group converges.
[0059] Optionally, the determining module is further configured to determine the voltage zero-crossing point of the relay circuit, wherein the voltage zero-crossing point represents the moment when the voltage changes from positive to negative or from negative to positive and the voltage is zero.
[0060] The determining module is further configured to determine the trigger time of the relay's action command based on the voltage zero-crossing time and the target delay duration.
[0061] Thirdly, this application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;
[0062] The memory stores computer-executed instructions;
[0063] The processor executes computer execution instructions stored in the memory to implement the method for determining the trigger time of the relay action instruction as described in the first aspect and various possible implementations of the first aspect above.
[0064] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions thereon, which, when executed by a processor, are used to implement the method for determining the trigger time of a relay action instruction as described in the first aspect and various possible implementations of the first aspect.
[0065] Fifthly, this application provides a program product, including a computer program, which, when executed by a processor, implements the method for determining the trigger time of a relay action instruction as described above.
[0066] This application provides a method, apparatus, and electronic device for determining the trigger time of a relay action command. The method obtains a first driving voltage and a first ambient temperature of the relay, and determines a first search range corresponding to the relay based on the first driving voltage and the first ambient temperature. The search range includes multiple nodes, which are used to indicate the corresponding candidate action delay duration. The candidate action delay durations corresponding to the nodes are optimized to obtain a processing result. The processing result is used to indicate the target delay duration of the relay. Based on the target delay duration, the trigger time of the relay action command is determined, thereby improving the accuracy of zero-crossing control, avoiding arc discharge, and extending the service life of the equipment. Attached Figure Description
[0067] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0068] Figure 1 A flowchart illustrating a method for determining the triggering time of a relay action command provided in this application. Figure 1 ;
[0069] Figure 2 A flowchart illustrating a method for determining the triggering time of a relay action command provided in this application. Figure 2 ;
[0070] Figure 3 A flowchart illustrating a method for determining the triggering time of a relay action command provided in this application. Figure 3 ;
[0071] Figure 4 A schematic diagram of the structure of a device for determining the trigger time of a relay action command provided in this application;
[0072] Figure 5 This is a schematic diagram of a device for determining the trigger time of a relay action command, as provided in this application.
[0073] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0074] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0075] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of the relevant data all comply with relevant laws, regulations, and standards, necessary confidentiality measures have been taken, they do not violate public order and good morals, and corresponding operation portals are provided for users to choose to authorize or refuse.
[0076] Furthermore, the technical solution involved in this application, which involves big data analysis of user information (including but not limited to personal biometrics, identity data, consumption data, asset data, electronic terminal operation data, etc.) and the use of artificial intelligence technology for automated decision-making, and makes decisions that have a significant impact on personal rights based on the results of automated decision-making, provides users with corresponding operation entry points for users to choose to agree to or reject the results of automated decision-making; if the user chooses to reject, the process will proceed to the expert decision-making process.
[0077] It should be noted that the method, apparatus and electronic equipment for determining the trigger time of relay action command provided in this application can be used in the field of network security technology, or in any field other than network security. The application field of the method, apparatus and electronic equipment for determining the trigger time of relay action command in this application is not limited.
[0078] With the continuous development of power electronics technology, relays, as key actuators, have been widely used in smart meters, smart homes, and industrial automation, undertaking the core function of circuit switching control. In AC load control scenarios, if the relay contacts fail to close precisely at the zero-crossing point of the power supply voltage, a significant inrush current will be generated at the moment of closure. This inrush current not only causes electrical shock to the load equipment but also easily leads to contact arcing, electromagnetic interference, and contact erosion, thereby affecting the stability and reliability of system operation and significantly shortening the service life of the relay.
[0079] Currently, in existing technologies, compensation for relay operation delay is typically achieved using a fixed advance amount or a lookup table method. For example, by pre-calibrating the average operating time of the relay under standard operating conditions and using it as a fixed compensation value, the drive command can be issued in advance to achieve coarse control over the contact closing time.
[0080] However, the actual operating time of a relay is affected by various factors, including driving voltage fluctuations, ambient temperature changes, and the aging of mechanical components. These factors result in significant time-varying and uncertain operating delays. Therefore, a fixed compensation strategy is difficult to adapt to changes in dynamic operating conditions, easily leading to insufficient or excessive compensation. This reduces the accuracy of zero-crossing control, makes it difficult to ensure reliable contact closure near the voltage zero-crossing point, increases the risk of arcing, affects system stability, accelerates contact wear, and shortens the relay's lifespan.
[0081] To address the aforementioned issues, this application proposes a method for determining the trigger time of a relay action command. This method involves acquiring the first driving voltage and first ambient temperature of the relay, and determining a first search range corresponding to the relay based on these parameters. The search range includes multiple nodes, each indicating a corresponding candidate action delay duration. The delay durations of the candidate actions corresponding to the nodes are optimized to obtain a processing result, which indicates the target delay duration of the relay. Based on the target delay duration, the trigger time of the relay action command is determined, thereby improving the accuracy of zero-crossing control, preventing arc discharge, and extending the equipment's service life.
[0082] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0083] Figure 1 A flowchart illustrating a method for determining the triggering time of a relay action command provided in this application embodiment. Figure 1 .like Figure 1As shown, the method for determining the trigger time of the relay action command provided in this embodiment includes:
[0084] S101, Obtain the first driving voltage and the first ambient temperature of the relay.
[0085] The first driving voltage indicates the supply voltage to the control relay coil. The first ambient temperature indicates the temperature of the operating environment of the relay, including the ambient air temperature or the influence of the internal thermal field of the equipment.
[0086] The first driving voltage and the first ambient temperature are highly time-varying and cannot be relied upon as factory nominal values or historical fixed values. They must be collected in real time during each control cycle.
[0087] The voltage of the relay coil power supply circuit is sampled using an analog-to-digital converter, and the real-time first driving voltage is obtained after filtering and calibration.
[0088] The initial ambient temperature of the area near the relay is measured by integrating a temperature sensor, such as an NTC thermistor, DS18B20, or a temperature sensor built into the MCU.
[0089] One possible implementation is that when the relay detects a "power-on" command, the control unit of the circuit containing the relay immediately initiates the data acquisition process.
[0090] Specifically, the voltage at the relay coil terminals was read using an analog-to-digital converter, and the first driving voltage was measured to be 11.8V. The first ambient temperature of the relay was obtained as 42℃ using an NTC sensor mounted near the relay.
[0091] S102. Determine the first search range corresponding to the relay based on the first driving voltage and the first ambient temperature, wherein the search range includes multiple nodes, and the nodes are used to indicate the corresponding candidate action delay time.
[0092] Determining the first search range corresponding to the relay based on the first driving voltage and the first ambient temperature is a key step in achieving efficient and accurate optimization. Using a pre-built action delay prediction model, the real-time collected operating parameters, namely the first driving voltage and the first ambient temperature, are input into the prediction model to obtain a reasonable action delay prediction value. Multiple candidate action delay durations are then set as the first search range, centered on this prediction value.
[0093] Determining the first search range requires balancing coverage and convergence efficiency. A range that is too wide will result in an excessively large search space for the optimization algorithm, leading to slow convergence; a range that is too narrow may miss the true optimal solution, causing optimization failure. Therefore, the first search range is typically determined by setting upper and lower boundaries based on the predicted value and combining it with the fluctuation range or standard deviation of historical data.
[0094] The initial search range includes multiple nodes, each representing a specific candidate action delay duration, such as 9.6ms, 9.8ms, and 10.0ms. These nodes form the initial node group, used for subsequent fitness evaluation and iterative optimization.
[0095] By anchoring the first search range to the high-probability optimal region under the current working conditions, the convergence speed and stability of the optimization algorithm are significantly improved, realizing the transformation from blind search to intelligent guided search and improving optimization efficiency.
[0096] S103. Optimize the delay time of the candidate action corresponding to the node to obtain the processing result, which is used to indicate the target delay time of the relay.
[0097] Among them, optimizing the delay time of the candidate action corresponding to the node refers to performing optimization calculations based on multiple candidate action delay times within the determined first search range. By evaluating the effect of each candidate action delay time on the circuit zero-crossing control under the current working condition, the candidate action delay time gradually approaches the optimal solution, and finally outputs an approximately optimal delay compensation time as the target delay time of the relay.
[0098] One possible implementation involves using multiple nodes within a first search range as an initial node group, with each node representing a candidate action delay duration. For each action delay duration, this delay is used as a compensation time to determine the trigger time of the corresponding circuit drive signal, and an action command is executed once at the trigger time. The deviation between the actual closing time and the voltage zero-crossing point is measured. A fitness function is constructed to determine the fitness value corresponding to each action delay duration. If multiple nodes indicate convergence, the candidate action delay duration with the best fitness is taken as the result of this optimization process, i.e., the target delay duration of the relay under the current operating condition.
[0099] By optimizing the delay duration of candidate actions corresponding to nodes, the optimal compensation time under the current voltage, temperature, and other operating conditions can be selected from multiple possible solutions. Based on the target delay duration, the trigger time of the relay's action command can be determined, thereby improving the accuracy and reliability of voltage zero-crossing control.
[0100] S104. Determine the trigger time of the relay action command based on the target delay duration.
[0101] The target delay time represents the optimal compensation time required for the relay to fully close its contacts from receiving the drive signal under the current drive voltage and ambient temperature conditions.
[0102] The next zero-crossing moment of the AC power supply is determined using a hardware zero-crossing detection circuit or a software signal processing algorithm. Based on this next zero-crossing moment and the target delay time, the trigger time for the relay's action command is determined. An action command is issued at the trigger time, allowing sufficient response time for the relay to ensure its contacts close when the voltage reaches zero.
[0103] The drive signal is issued one target delay time before the voltage zero-crossing point, so that the actual closing time of the relay contacts is as close as possible to the zero-crossing point of the power supply voltage, thereby suppressing current surges and arcs to the greatest extent.
[0104] This embodiment provides a method for determining the trigger time of a relay action command. The method obtains the first driving voltage and the first ambient temperature of the relay, and determines the first search range corresponding to the relay based on the first driving voltage and the first ambient temperature. The search range includes multiple nodes, which are used to indicate the corresponding candidate action delay duration. The candidate action delay duration corresponding to the node is optimized to obtain the processing result. The processing result is used to indicate the target delay duration of the relay. Based on the target delay duration, the trigger time of the relay action command is determined, thereby improving the accuracy of zero-crossing control, avoiding arc discharge, and extending the service life of the equipment.
[0105] Figure 2 A flowchart illustrating a method for determining the triggering time of a relay action command provided in this application embodiment. Figure 2 .like Figure 2 As shown, in Figure 1 Based on the embodiments, the method for determining the trigger time of the relay action command is described in detail, including:
[0106] S201. Obtain the second ambient temperature of the relay and the first operating data, the first operating data including: the second driving voltage and the first action delay duration.
[0107] Specifically, the second ambient temperature, the second driving voltage, and the first action delay time of the relay are acquired. The second ambient temperature, the second driving voltage, and the first action delay time are experimental data obtained before online operation, unlike the first ambient temperature and the first driving voltage, which are online operation data.
[0108] During the testing phase, the relay was subjected to multi-condition, repetitive tests in a controlled environment to obtain the second ambient temperature, second driving voltage, and first action delay duration, which were used to construct an action delay prediction model. The first action delay duration indicates the time interval between the relay receiving the action command and actually completing the action.
[0109] One possible implementation involves setting the ambient temperature and driving voltage to trigger the relay to close, and recording the actual delay time of each action.
[0110] Specifically, the ambient temperature was set to 40℃ and the driving voltage to 11.5V. Ten consecutive relay closing operations were performed, and the action delay for each operation was recorded. The delay data were 9.8ms, 10.0ms, and 9.9ms.
[0111] Repeat the above process, performing relay closing operations at different temperatures, such as 25°C, 50°C, and 60°C, and at different voltages, such as 11.0V, 12.0V, and 13.0V combinations, to obtain the actual operating delay time of the relay under different operating conditions.
[0112] In the laboratory phase, the second ambient temperature, second driving voltage, and first action delay time of the relay were obtained. These measured data truly reflect the behavioral characteristics of the relay under different operating conditions, providing a reliable basis for the training of subsequent prediction models.
[0113] S202, Determine the correlation between the second ambient temperature and the second driving voltage and the first action delay time.
[0114] S203. Based on the correlation, construct a prediction model for the delay time of relay action.
[0115] After collecting a large amount of relay operation data in the laboratory phase, it is necessary to further analyze the intrinsic correlation between the second ambient temperature, the second driving voltage, and the first action delay duration. This correlation reflects the dependence of the relay's operating characteristics on key operating parameters and forms the basis for constructing an action delay prediction model. Based on this correlation, a relay action delay prediction model is constructed. This model is used to predict the relay's action delay duration based on the relay's driving voltage and ambient temperature.
[0116] S204. Obtain the first driving voltage and the first ambient temperature of the relay.
[0117] Step S204 is similar to step S101 above, and will not be repeated here.
[0118] S205. Input the first driving voltage and the first ambient temperature into the prediction model to obtain the predicted value of the action delay time.
[0119] S206. Determine the first search range based on the predicted action delay duration.
[0120] The prediction model was trained on a large amount of measured data in the laboratory phase and can reflect the combined effects of driving voltage and ambient temperature on the mechanical response time of the relay. The predicted action delay time output by the prediction model represents a priori estimate of the relay response behavior under the current operating conditions.
[0121] Before the relay is about to execute the action command, real-time parameters under the current operating condition are collected, namely the first driving voltage and the first ambient temperature. The first driving voltage and the first ambient temperature are used as input variables and input into the action delay duration prediction model to obtain the predicted action delay duration value corresponding to the current operating condition output by the model.
[0122] Based on this predicted value, the system further determines a reasonable first search range, which is a finite interval containing the actual optimal delay time. Specifically, the first search range is usually determined by setting upper and lower limits based on the predicted value, combined with the fluctuation characteristics of historical data or engineering experience.
[0123] The setting of the first search range realizes the transformation from blind global search to local optimization based on operating conditions, which significantly improves the optimization efficiency and is a prerequisite for achieving high-precision zero-crossing control.
[0124] One possible implementation is to input the first driving voltage of 11.8V and the first ambient temperature of 45℃ into the action delay duration prediction model. The prediction model is based on the correlation between the driving voltage, ambient temperature and action delay duration, and outputs the predicted action delay duration corresponding to the 11.8V driving voltage and the 45℃ ambient temperature, for example: 10ms.
[0125] Based on known engineering experience, set the search offset. The range is determined based on the predicted action delay duration and the offset: .
[0126] Multiple candidate action delay durations are generated within the above range to obtain the first search range, such as (9.5, 9.7, 9.9, 10.1, 10.3, 10.5, 10.6), which serves as the initial node for optimization.
[0127] S207. For any candidate action delay duration among multiple candidate action delay durations, determine the second action delay duration corresponding to the candidate action delay duration.
[0128] S208. Determine the fitness value of the candidate action delay duration based on the candidate action delay duration and the second action delay duration corresponding to the action delay duration.
[0129] Specifically, for any one of the multiple candidate action delay durations, the trigger time of the relay action command is determined based on this candidate value, and the action command is executed at the trigger time. A high-precision time detection mechanism measures the actual time interval from the relay issuing the drive signal to the actual closure of the contacts, thereby determining the second action delay duration corresponding to that candidate action delay duration. The second action delay duration reflects the actual response of the relay to the delay duration under the current operating conditions and is the direct basis for evaluating the validity of the candidate value.
[0130] Based on the degree of matching between the candidate action delay duration and the corresponding second action delay duration, a fitness function is constructed to calculate the fitness value of the candidate value.
[0131] The fitness function is designed to measure control accuracy and stability. The higher the fitness value, the closer the delay time of the candidate action is to the true optimal compensation time.
[0132] S209. Based on multiple fitness values, the delay duration of the candidate action corresponding to the maximum fitness value is determined as the target delay duration.
[0133] In this process, a global comparison is made based on the fitness values corresponding to the delay durations of multiple candidate actions. The delay duration of the candidate action corresponding to the maximum fitness value is identified as the optimal solution in the current optimization process and is determined as the target delay duration of the relay.
[0134] S210. Determine the time when the voltage of the relay circuit crosses zero.
[0135] Among them, the zero-crossing point of voltage represents the moment when the voltage changes from positive to negative or from negative to positive and the voltage is zero.
[0136] S211. Determine the trigger time of the relay's action command based on the voltage zero-crossing point and the target delay time.
[0137] Specifically, by detecting changes in the AC power supply voltage waveform, the system identifies the point in time when the voltage instantaneously reaches zero during the transition from the positive half-cycle to the negative half-cycle (falling zero crossing) or from the negative half-cycle to the positive half-cycle (rising zero crossing), thus determining the zero-crossing point of the relay circuit. The zero-crossing point is a crucial reference for achieving precise zero-crossing control.
[0138] Based on the voltage zero-crossing point and the target delay duration, determine the trigger time for the relay's action command. Using the target delay duration as an advance compensation time, subtract this value from the next upcoming voltage zero-crossing point to calculate the precise time when the drive command should be issued.
[0139] One possible implementation method, .
[0140] At the moment the action command is triggered, an action command is sent to the relay drive circuit, causing the relay to start responding. After the action delay of the target delay time, the contacts close just near the zero-crossing point of the voltage, realizing zero-crossing connection and minimizing current surges and arcs.
[0141] By accurately determining the zero-crossing point of the voltage and calculating the trigger time of the action command in conjunction with the target delay time, high-precision control of the zero-crossing point is achieved. This ensures that the relay operates at the optimal time, thereby improving the relay's service life.
[0142] This embodiment provides a method for determining the trigger time of a relay action command. The method obtains the second ambient temperature, second driving voltage, and first action delay duration during relay operation; establishes a correlation between the ambient temperature, driving voltage, and action delay duration; and constructs a prediction model for predicting the action delay duration based on this correlation. It then obtains the first driving voltage and first ambient temperature under the current operating conditions, inputs them into the prediction model to obtain a predicted value for the action delay duration, and determines a first search range based on this predicted value. Within this range, it evaluates the fitness of multiple candidate action delay durations, calculates the fitness value based on their corresponding second action delay durations, and determines the candidate action delay duration with the highest fitness value as the target delay duration. Finally, it determines the voltage zero-crossing point of the relay circuit and, based on the zero-crossing point and the target delay duration, determines the trigger time of the relay action command. This improves the accuracy of zero-crossing control, avoids arc discharge, and extends the service life of the equipment.
[0143] Figure 3 A flowchart illustrating a method for determining the triggering time of a relay action command provided in this application embodiment. Figure 3 .like Figure 3 As shown, in Figure 1 Based on the embodiments, a possible implementation method for determining the candidate action delay duration corresponding to the maximum fitness value as the target delay duration is described in detail, including:
[0144] S301. Determine the node positions of multiple nodes.
[0145] S302. Based on node location, determine the node distance between any two nodes among multiple nodes.
[0146] S303. Determine the maximum node distance based on the distances between multiple nodes.
[0147] In the relay action delay optimization control process, an intelligent optimization algorithm is used to iteratively optimize the delay durations of multiple candidate actions. Specifically, N nodes are randomly or uniformly generated within the first search range [9.5ms, 10.7ms]. Each node corresponds to a specific candidate action delay duration, and the N nodes form an initial node group for subsequent fitness evaluation and iterative updates.
[0148] Node location refers to the coordinates of each node in the space within an optimization algorithm. The absolute value of the coordinates of any two nodes is the node distance. Node distance reflects the degree of separation between the delay times of two actions within the search range and is an important indicator of the dispersion of the node cluster. A larger distance indicates a wider distribution of nodes and stronger exploration capabilities; a smaller distance indicates that the nodes tend to cluster and are close to convergence.
[0149] From the distance set of all node pairs, determine the maximum node distance. The maximum node distance represents the maximum span of the current node group in space and is used to determine whether the entire node group has converged sufficiently.
[0150] One possible implementation initializes three nodes within the first search range [9.5ms, 10.7ms], and their positions are shown in Table 1:
[0151] Table 1
[0152]
[0153] Based on the above node positions, determine the node distance between any two nodes;
[0154]
[0155]
[0156]
[0157] Determine the maximum node distance. Specifically, iterate through all node distances, determine if the maximum node distance occurs between node 1 and node 3, and then determine the corresponding node distances between node 1 and node 3.
[0158] This represents the maximum node distance. That is:
[0159]
[0160] S304. Determine whether the maximum node distance is less than the distance threshold. If yes, proceed to step S305; otherwise, proceed to step S306.
[0161] S305. Determine that multiple nodes have converged, and determine the candidate action delay time corresponding to the maximum fitness value as the target delay time.
[0162] The process of determining whether the maximum node distance is less than a preset distance threshold is used to assess the current particle swarm's aggregation level. If the maximum node distance is less than the distance threshold, it indicates that all nodes have highly aggregated in the solution space, the search range is sufficiently convergent, and the algorithm has reached a stable state. At this point, multiple nodes are considered to have converged. When multiple nodes indicate convergence, the delay duration of the candidate action with the highest fitness value is determined as the target delay duration, serving as the final result of this optimization.
[0163] One possible implementation is that the maximum node distance of the current particle swarm is 0.18ms, and the preset distance threshold is 0.2ms.
[0164] If 0.18ms < 0.2ms, then multiple nodes have converged. Among all candidate action delay durations, find the candidate action delay duration with the largest corresponding fitness value. Specifically, the candidate action delay duration with the largest fitness value is 10.05ms. Set 10.05ms as the target delay duration and end the optimization process.
[0165] S306. Determine the candidate action delay time corresponding to the maximum fitness value as the global optimal node position.
[0166] If the maximum node distance is greater than the distance threshold, the particle swarm is determined to have not converged. The candidate action delay time corresponding to the current maximum fitness value is determined as the globally optimal node position.
[0167] Specifically, the maximum node distance is 0.25ms, and the distance threshold is 0.2ms. If 0.25ms > 0.2ms, it is determined that the node group has not converged. The candidate action corresponding to the current maximum fitness value is delayed for a period of time, for example, 10.05ms, and used as the global optimal solution for the next round of iteration. This process continues to optimize until the node group converges.
[0168] S307. Determine the historical fitness value of any one of the multiple nodes.
[0169] S308. Based on historical fitness values, determine the optimal position of any node.
[0170] S309. Based on the optimal position of any node and the globally optimal node position, update multiple nodes to obtain a new node group.
[0171] S310. Iterate the fitness values of the new node group until the new node group converges.
[0172] In this process, the fitness value of any one of the multiple nodes in each iteration is determined, the highest fitness value in the history of that node is selected, and the delay time of the candidate action at the corresponding moment is recorded as the individual optimal position of that node, i.e., its own best solution.
[0173] Based on the individual optimal position and the global optimal position of the node, the velocity and position update formula corresponding to the node swarm optimization algorithm is used to adjust the movement direction and step size of the node in space, and the position of each node is iteratively updated to generate a new generation of node swarm.
[0174] Re-evaluate the fitness values of each node in the new node group and repeat the above process to continuously optimize the search until the node group meets the convergence condition. This achieves efficient and accurate optimization of the target delay time.
[0175] This embodiment provides a method for determining the trigger time of a relay action command. The method determines the initial positions of multiple nodes, calculates the distance between any two nodes, and obtains the maximum node distance. It then determines whether this distance is less than a preset threshold. If it is, the node group is considered converged, and the candidate action delay time corresponding to the maximum fitness value is used as the target delay time. Otherwise, the position corresponding to the maximum fitness value is used as the global optimal position. The individual optimal position is determined by combining the historical fitness of each node, and the node group is updated based on the individual and global optimal positions. A new node group is generated, and its fitness is iterated until convergence. By constructing a relay action delay prediction model and combining it with an optimization algorithm, dynamic optimization of the trigger time is achieved, improving the accuracy of zero-crossing control, avoiding arc discharge, and extending the equipment's service life.
[0176] Figure 4 This is a schematic diagram of a device for determining the trigger time of a relay operation command, as provided in this application. Figure 4 As shown, this application provides a device for determining the triggering time of a relay operation command. The device 400 for determining the triggering time of a relay operation command includes:
[0177] The acquisition module 401 is used to acquire the first driving voltage and the first ambient temperature of the relay;
[0178] The determination module 402 is used to determine the first search range corresponding to the relay based on the first driving voltage and the first ambient temperature. The search range includes multiple nodes, and the nodes are used to indicate the corresponding candidate action delay time.
[0179] Processing module 403 is used to optimize the delay time of the candidate action corresponding to the node and obtain the processing result. The processing result is used to indicate the target delay time of the relay.
[0180] The determination module 402 is also used to determine the trigger time of the relay action command based on the target delay duration.
[0181] Optionally, the acquisition module 401 is also used to acquire the second ambient temperature of the relay and the first operating data, the first operating data including: the second driving voltage and the first action delay duration, the first action delay duration being used to indicate the interval between the relay receiving the action command and actually completing the action;
[0182] The determination module 402 is also used to determine the correlation between the second ambient temperature and the second driving voltage and the first action delay time;
[0183] The processing module 403 is also used to construct a relay action delay prediction model based on the correlation relationship. The prediction model is used to predict the relay action delay based on the relay's drive voltage and ambient temperature.
[0184] Optionally, the processing module 403 is also used to input the first driving voltage and the first ambient temperature into the prediction model to obtain the predicted value of the action delay duration;
[0185] The determination module 402 is also used to determine the first search range based on the predicted value of the action delay duration.
[0186] Optionally, the determining module 402 is further configured to determine the second action delay duration corresponding to any one of the multiple candidate action delay durations;
[0187] The determination module 402 is also used to determine the fitness value of the candidate action delay duration based on the candidate action delay duration and the second action delay duration corresponding to the action delay duration;
[0188] The determination module 402 is also used to determine the delay duration of the candidate action corresponding to the maximum fitness value as the target delay duration based on multiple fitness values.
[0189] Optionally, the device may also include: a judgment module 404;
[0190] The determination module 402 is also used to determine the node positions of multiple nodes;
[0191] The determination module 402 is also used to determine the node distance between any two nodes among a plurality of nodes based on the node position;
[0192] The determination module 402 is also used to determine the maximum node distance based on the distances between multiple nodes;
[0193] Decision module 404 is used to determine whether the maximum node distance is less than the distance threshold.
[0194] The determination module 402 is also used to determine the convergence of multiple nodes when the maximum node distance is less than the distance threshold, and to determine the candidate action delay time corresponding to the maximum fitness value as the target delay time.
[0195] Optionally, the determining module 402 is further configured to determine the candidate action delay time corresponding to the maximum fitness value as the globally optimal node position when the maximum node distance is not less than the distance threshold.
[0196] The determination module 402 is also used to determine the historical fitness value of any one of the multiple nodes;
[0197] The determination module 402 is also used to determine the optimal position of any node based on historical fitness values;
[0198] The processing module 403 is also used to update multiple nodes based on the optimal position of any node and the globally optimal node position to obtain a new node group.
[0199] The processing module 403 is also used to iterate the fitness values of the new node group until the new node group converges.
[0200] Optionally, the determining module 402 is also used to determine the voltage zero-crossing moment of the relay circuit, which represents the moment when the voltage changes from positive to negative or from negative to positive and the voltage is zero.
[0201] The determining module 402 is also used to determine the trigger time of the relay action command based on the voltage zero-crossing point and the target delay time.
[0202] The relay action command triggering time determination device provided in this application embodiment is similar in principle and technical effect to the implementation of each part in the aforementioned relay action command triggering time determination method, and will not be repeated here.
[0203] Figure 5 This is a schematic diagram of a device for determining the trigger time of a relay action command, as provided in this application. Figure 5 As shown, this application provides a device for determining the trigger time of a relay action command. The device 500 for determining the trigger time of a relay action command includes: a receiver 501, a transmitter 502, a processor 503, and a memory 504.
[0204] Receiver 501 is used to receive instructions and data;
[0205] Transmitter 502 is used to send commands and data;
[0206] Memory 504 is used to store instructions executed by the computer;
[0207] Processor 503 is used to execute computer execution instructions stored in memory 504 to implement the various steps of the method for determining the trigger time of the relay action instruction in the above embodiments. For details, please refer to the relevant descriptions in the foregoing embodiments of the method for determining the trigger time of the relay action instruction.
[0208] Optionally, the memory 504 can be either standalone or integrated with the processor 503.
[0209] When the memory 504 is set up independently, the electronic device also includes a bus for connecting the memory 504 and the processor 503.
[0210] The implementation principle and technical effects of the electronic device provided in this embodiment can be found in the foregoing embodiments, and will not be repeated here.
[0211] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the method of any of the foregoing embodiments.
[0212] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the method of any of the foregoing embodiments.
[0213] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this application.
[0214] It should be further noted that although the steps in the flowchart are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0215] It should be understood that the above-described device embodiments are merely illustrative, and the device of this application can also be implemented in other ways. For example, the division of units / modules in the above embodiments is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units, modules, or components may be combined, or integrated into another system, or some features may be ignored or not executed.
[0216] Furthermore, unless otherwise specified, the functional units / modules in the various embodiments of this application can be integrated into one unit / module, or each unit / module can exist physically separately, or two or more units / modules can be integrated together. The integrated units / modules described above can be implemented in hardware or as software program modules.
[0217] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification.
[0218] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0219] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A method for determining the trigger time of a relay action command, characterized in that, The method includes: The first driving voltage and the first ambient temperature of the relay are obtained, and a first search range corresponding to the relay is determined based on the first driving voltage and the first ambient temperature. The search range includes multiple nodes, and the nodes are used to indicate the corresponding candidate action delay duration. The delay duration of the candidate action corresponding to the node is optimized to obtain a processing result, which is used to indicate the target delay duration of the relay. The trigger time for the relay's action command is determined based on the target delay duration.
2. The method according to claim 1, characterized in that, Before obtaining the first driving voltage and the first ambient temperature of the relay, the method further includes: The second ambient temperature and the first operating data of the relay are obtained. The first operating data includes: a second driving voltage and a first action delay duration. The first action delay duration is used to indicate the interval between when the relay receives an action command and when it actually completes the action. Determine the correlation between the second ambient temperature, the second driving voltage, and the first action delay duration; Based on the aforementioned correlation, a relay action delay prediction model is constructed. The prediction model is used to predict the relay action delay based on the relay's driving voltage and ambient temperature.
3. The method according to claim 2, characterized in that, Determining the first search range corresponding to the relay based on the first driving voltage and the first ambient temperature includes: The first driving voltage and the first ambient temperature are input into the prediction model to obtain the predicted value of the action delay time. The first search range is determined based on the predicted action delay duration.
4. The method according to claim 3, characterized in that, The optimization process for the delay duration of the candidate action corresponding to the node, to obtain the processing result, includes: For any one of the multiple candidate action delay durations, determine the second action delay duration corresponding to the candidate action delay duration; The fitness value of the candidate action delay duration is determined based on the candidate action delay duration and the second action delay duration corresponding to the action delay duration; Based on multiple fitness values, the delay duration of the candidate action corresponding to the maximum fitness value is determined as the target delay duration.
5. The method according to claim 4, characterized in that, The step of determining the candidate action delay duration corresponding to the maximum fitness value as the target delay duration includes: Determine the node positions of multiple nodes; Based on the node positions, determine the node distance between any two nodes among the plurality of nodes; Based on the distances between multiple nodes, determine the maximum node distance and then determine whether the maximum node distance is less than a distance threshold. If the maximum node distance is less than the distance threshold, multiple nodes are determined to have converged, and the candidate action delay time corresponding to the maximum fitness value is determined as the target delay time.
6. The method according to claim 5, characterized in that, The method further includes: If the maximum node distance is not less than the distance threshold, the candidate action delay time corresponding to the maximum fitness value is determined as the global optimal node position; Determine the historical fitness value of any one of the multiple nodes; Based on the historical fitness values, determine the optimal position of any of the nodes; Based on the optimal position of any one of the nodes and the globally optimal node position, the multiple nodes are updated to obtain a new node group. Iterate the fitness values of the new node group until the new node group converges.
7. The method according to claim 6, characterized in that, Determining the trigger time of the relay's action command based on the target delay duration includes: Determine the voltage zero-crossing point of the relay circuit, wherein the voltage zero-crossing point represents the moment when the voltage changes from positive to negative or from negative to positive and the voltage is zero; The trigger time for the relay's action command is determined based on the voltage zero-crossing point and the target delay duration.
8. A device for determining the triggering time of a relay action command, characterized in that, The device includes: The acquisition module is used to acquire the first driving voltage and the first ambient temperature of the relay; The determination module is used to determine a first search range corresponding to the relay based on the first driving voltage and the first ambient temperature, wherein the search range includes multiple nodes, and the nodes are used to indicate the corresponding candidate action delay duration; The processing module is used to optimize the delay duration of the candidate action corresponding to the node and obtain the processing result, which is used to indicate the target delay duration of the relay. The determining module is further configured to determine the trigger time of the relay's action command based on the target delay duration.
9. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1 to 7.
11. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method of any one of claims 1 to 7.