Weak current equipment data encryption transmission method and system

CN122994093APending Publication Date: 2026-10-27SHANGHAI PENG CHONG INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611471927.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-21
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

传统的数据加密方案多采用固定加密强度或单一维度的自适应机制,难以兼顾端到端时延约束与密码学安全底线

Benefits of technology

本发明突破了传统固定加密强度或单一维度自适应的局限,通过构建时延预算余量驱动的“轮次倍率-字段掩码”联动补偿机制,在低算力节点面临时延紧张时,能够动态缩减加密字段覆盖范围以换取单字段更高的加密轮次,既严格保障了弱电控制系统的实时性边界,又避免了因单纯降低轮次导致的安全强度跌破密码学底线,实现了实时性与安全性的最优平衡。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122994093A_ABST
    Figure CN122994093A_ABST
Patent Text Reader

Abstract

The present application relates to the field of digital information transmission, and particularly relates to a weak current equipment data encryption transmission method and system, the method comprising: a gateway acquires node real-time encryption time consumption and forms a baseline by smoothing, calculates a time delay budget margin and maps it to a round rate adjustment coefficient; selects a mask, performs symmetric encryption on fields with a first value of mask bits, and fills in decoy data constructed according to the statistical distribution of real data on fields with a second value; when the round rate adjustment coefficient is clamped at the lower limit and the time delay budget margin is still insufficient, reversely adjust the actual number of encryption rounds; the receiving end synchronously recalculates the mask to restore the encrypted fields and discard the decoy fields, performs anomaly detection on the statistical feature deviation of the decoy fields and feeds back the real-time encryption time consumption. Through the technical scheme of the present application, the encryption strength can be dynamically arranged in a heterogeneous computing bus, the fixed plaintext exposure target can be eliminated, and the real-time performance and security strength can be simultaneously guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of digital information transmission. In particular, it relates to a method and system for encrypted data transmission from low-voltage electrical equipment. Background Technology

[0002] With the rapid development of smart buildings and the Industrial Internet of Things (IIoT), the communication buses of low-voltage integrated systems (such as fire alarm systems and security alarm systems) often coexist with high-performance intelligent controllers and existing 8-bit microcontrollers with extremely limited computing power, forming a typical heterogeneous computing environment. Traditional data encryption schemes often employ fixed encryption strength or single-dimensional adaptive mechanisms, making it difficult to balance end-to-end latency constraints with cryptographic security baselines. Low-performance nodes, lacking hardware acceleration and affected by operating system task preemption, exhibit non-deterministic fluctuations in software encryption time, making fixed encryption prone to exceeding latency budgets. Furthermore, when latency is tight, existing schemes that simply reduce the number of encryption rounds may cause the security strength to fall below the cryptographic baseline for resistance to differential and linear attacks, failing to achieve simultaneous real-time performance and security guarantees in complex bus environments.

[0003] Furthermore, existing encryption schemes often degenerate into plaintext transmission of entire frames or fixed fields when latency is insufficient. Since the field lengths and order of communication protocols remain constant, this constant plaintext exposes the system to vulnerability to passive sniffing, traffic statistics analysis, and targeted replay or tampering attacks. Simultaneously, traditional schemes typically rely on additional independent check fields (such as MAC or CRC) for data integrity protection. This not only increases frame payload length and bus bandwidth overhead, further squeezing the already limited latency budget of low-performance nodes, but also makes the fixed-format check information easily bypassable by attackers, leaving the system lacking covert and low-overhead proactive defense capabilities.

[0004] Finally, electromagnetic interference is frequent in low-voltage bus environments, and channel quality and node load fluctuate significantly. Existing encryption parameter adjustment mechanisms often lack anti-oscillation design, and encryption strength is prone to frequent jumps with instantaneous states, which can easily lead to loss of synchronization of encoding dictionaries and inconsistency of protocol state machines at both ends of the transmission and reception, resulting in a large number of invalid frames and severely reducing the stability and effective throughput of bus communication. Summary of the Invention

[0005] To address the technical challenge of dynamically arranging encryption strength according to node computing power margin while satisfying end-to-end latency constraints in a heterogeneous computing bus, and simultaneously eliminating fixed plaintext exposure targets and suppressing traffic statistics characteristics, thereby achieving simultaneous assurance of real-time performance and security strength, this invention provides solutions in the following aspects.

[0006] In a first aspect, the present invention provides a method for encrypted data transmission of low-voltage equipment, comprising: a gateway acquiring the measured encryption time of a node in each control cycle, smoothing it to form an encryption time baseline, calculating a delay budget margin by combining an end-to-end delay budget with a bus transmission delay measurement, and mapping the smoothed delay budget margin to a round multiplier adjustment coefficient; a node using a field selection mask derived from a session key, a frame sequence count value, and a synchronization timestamp, performing symmetric encryption on fields with the first value of the mask bits, and filling fields with the second value of the mask bits with decoy data constructed according to the statistical distribution of real data; when the round multiplier adjustment coefficient is clamped to the lower limit and the delay budget margin is still insufficient, adjusting the actual number of encryption rounds performed in reverse according to the number of fields with the first value; the receiving end restoring the encrypted fields according to the synchronously recalculated mask and discarding the decoy fields, performing anomaly detection on the statistical characteristic deviation of the decoy fields, and feeding back the measured encryption time to the gateway before entering the next control cycle.

[0007] Preferably, the step of smoothing the encryption time baseline, calculating the delay budget margin by combining the end-to-end delay budget and the bus transmission delay measurement, and mapping the smoothed delay budget margin to the round multiplier adjustment coefficient includes: smoothing and updating the measured encryption time using an exponentially weighted moving average method to obtain the encryption time baseline; calculating the difference between the end-to-end delay budget, the bus transmission delay measurement, and the encryption time baseline to obtain the instantaneous difference of the delay budget margin, and performing a first-order low-pass filter on the instantaneous difference of the delay budget margin to obtain the smoothed delay margin value; and obtaining the round multiplier adjustment coefficient by performing a piecewise linear mapping and limiting the output range of the smoothed delay margin value.

[0008] Preferably, the node utilizes a field selection mask derived from the session key, frame sequence count value, and synchronization timestamp, including: using a concatenated bit string of the session key, frame sequence count value, and synchronization timestamp as input, generating a field selection mask using a keyed hash operation; parsing field boundaries from the frame payload according to the communication protocol specification, dividing the frame payload into a continuous set of data fields, and the length of the field selection mask is equal to the total number of encryptable fields in the data field set.

[0009] Preferably, the step of filling the field with the second value of the mask bit with decoy data constructed according to the statistical distribution of real data includes: obtaining the set of values ​​of the field in historical real data and the probability of occurrence of each value, and constructing a cumulative probability distribution; generating uniformly distributed random numbers, and filling the decoy data with the values ​​that the random numbers hit in the cumulative probability distribution.

[0010] Preferably, when the round multiplier adjustment coefficient is clamped at the lower limit and the delay budget margin is still insufficient, the actual number of encryption rounds is adjusted in reverse according to the number of fields taking the first value, which includes: when the round multiplier adjustment coefficient takes the minimum value and the delay budget margin is still lower than the preset low threshold of the mapping interval, the basic number of encryption rounds, the total number of encryptable fields in the frame payload, and the number of fields taking the first value in the current period field selection mask are obtained; the product of the minimum value, the basic number of encryption rounds, and the total number of encryptable fields is divided by the number of fields taking the first value and rounded up to obtain the actual number of encryption rounds.

[0011] Preferably, the anomaly detection of the statistical feature deviation of the decoy field includes: periodically statistically analyzing the empirical value distribution of the decoy field, calculating the relative entropy of the empirical value distribution relative to the preset distribution of the real field; synchronously verifying the statistical mean, variance, and transition probability between adjacent fields of the decoy field; if any verification quantity of the relative entropy or statistical mean, variance, or transition probability exceeds the corresponding preset alarm threshold, an anomaly is determined and an alarm and frame discard are triggered.

[0012] Secondly, the present invention also provides a data encryption transmission system for low-voltage electrical equipment, comprising: a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the above-mentioned data encryption transmission method for low-voltage electrical equipment is implemented.

[0013] The present invention has the following effects: This invention breaks through the limitations of traditional fixed encryption strength or single-dimensional adaptive encryption. By constructing a "round multiplier-field mask" linkage compensation mechanism driven by latency budget margin, it can dynamically reduce the coverage of encrypted fields to obtain a higher number of encryption rounds for a single field when low computing power nodes face latency pressure. This not only strictly guarantees the real-time boundary of the weak current control system, but also avoids the security strength from falling below the cryptographic bottom line due to simply reducing the number of rounds, thus achieving the optimal balance between real-time performance and security.

[0014] This invention innovatively introduces a decoy data filling technique based on the statistical distribution of real data, making the unencrypted field completely consistent with the real data in terms of statistical characteristics. This effectively obfuscates the plaintext exposure location, defends against traffic analysis and semantic inference attacks targeting some encryption schemes, and significantly improves the ability to resist passive sniffing.

[0015] This invention utilizes the statistical characteristic deviation of the decoy field for anomaly detection, hiding integrity verification during data transmission. It can detect tampering or replay attacks targeting the decoy field without additional verification overhead, thus enhancing the system's proactive defense capabilities.

[0016] By employing an asymmetric hysteresis adjustment mechanism, the frequent oscillations of encryption parameters caused by channel quality fluctuations are eliminated, invalid frames caused by coding dictionary out-of-sync are avoided, and the stability and effective throughput of bus communication are improved. This makes it particularly suitable for complex low-voltage integrated environments where heterogeneous computing power coexists. Attached Figure Description

[0017] Figure 1 This is a flowchart of a method for encrypting and transmitting data from low-voltage electrical equipment according to an embodiment of the present invention. Detailed Implementation

[0018] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.

[0019] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0020] Reference Figure 1 A method for encrypting data transmission in low-voltage electrical equipment includes steps S1-S3, as detailed below: Example 1: This example illustrates the collaborative execution of a gateway and intelligent nodes in a low-voltage integrated bus of a commercial complex. The gateway, as the bus management node, possesses strong computing power and is responsible for centralized calculation and parameter distribution; each connected node includes a new type of intelligent controller and an existing 8-bit microcontroller acquisition unit, with significant differences in computing power.

[0021] S1: The gateway obtains the actual encryption time of the node in each control cycle, forms an encryption time baseline after smoothing, calculates the delay budget margin by combining the end-to-end delay budget and the bus transmission delay measurement value, and maps the smoothed delay budget margin to the round multiplier adjustment coefficient.

[0022] It should be noted that the encryption time of existing 8-bit microcontroller units is not a constant value. These processors lack hardware multiplication and division units. When implementing symmetric encryption in software, the operation cycle of each round of byte substitution and round key addition fluctuates depending on the data alignment state. The encryption time per frame exhibits statistical characteristics of slow drifting with Gaussian white noise. Within the control cycle, nodes also undertake periodic tasks such as input sampling and communication protocol parsing in parallel. Operating system-level task preemption allows the encryption period to be nondeterministically delayed. Different instructions have different trigger phases; when an instruction arrives at a peak local sampling interruption period, the actual encryption time may deviate from the historical average. These constraints necessitate the introduction of a continuous tracking mechanism for instantaneous time fluctuations, rather than relying on one-time empirical configurations.

[0023] The aforementioned processor hardware features, encryption time offset, and latency budget settings are all device-differentiating features and are parameters that need to be confirmed by those skilled in the art.

[0024] Specifically, when the gateway receives a node response frame in each control cycle, it extracts the measured aggregate time consumed by the node to complete encryption in this cycle from the frame extension field. ,in To control the cycle number, the local timestamp of the frame's arrival at the gateway is recorded, forming a correlation record between arrival time and latency. The gateway maintains an encrypted latency baseline registration table by node identifier, and saves a smoothed encrypted latency baseline value that is updated over time for each node. The baseline smoothing value should not change drastically with a single fluctuation. Instead, it should be updated using an exponentially weighted moving average to reflect the steady-state level over historical periods and suppress the impact of transient noise.

[0025] Furthermore, the update rule for the encryption time baseline smoothing value is as follows: In the formula, The baseline is updated with a smoothing coefficient, taking the preset empirical value of 0.3 for the hyperparameter, which is dimensionless; This is the actual measured encryption aggregation time for the nodes in this cycle; This is the baseline smoothing value for encryption timeout in the previous control cycle, in milliseconds. The average value of three cold start encryption tests is initialized when a node first joins the network.

[0026] Subsequently, the gateway reads the end-to-end latency budget configuration value corresponding to the instruction category to which the node belongs. In this embodiment, the end-to-end delay budget configuration value of the fire alarm linkage command is used. The example value of 80 milliseconds is a parameter confirmed by those skilled in the art and issued by the building automation system during the engineering commissioning phase according to the actual requirements of the control loop, and is not derived from this solution. The logic for determining the end-to-end delay budget configuration value is as follows: based on the maximum allowable response time of the system specified in the national or industry mandatory standards (such as GB50116) for low-voltage systems (such as fire linkage and security alarms), after deducting the inherent delay of gateway logic processing, bus physical layer transmission and the mechanical action of node actuators, the remaining time margin is allocated to the network transmission and encryption links.

[0027] The gateway calculates the bus transmission queuing delay measurement based on the difference between the local timestamps of the command frames issued and the response frames received in the current cycle. The unit is milliseconds. Then, the instantaneous difference of the delay budget margin is calculated: In the formula, For the first The instantaneous difference in the latency budget margin for a given period, expressed in milliseconds, reflects the sufficiency of the computing power margin. A positive value indicates that after removing bus transmission delay and baseline encryption time, there is still time remaining that can be used to supplement encryption rounds or expand the coverage of encryption fields; A negative value indicates that the latency budget has been exhausted, and it is necessary to reduce the encryption strength or narrow the coverage of the encrypted fields to maintain real-time performance.

[0028] To avoid drastic changes in encryption strength caused by instantaneous jitter, a first-order low-pass filter is applied to the instantaneous difference in the delay budget margin to obtain a first-order smoothed value of the delay margin. : In the formula, The delay margin smoothing factor is taken as the baseline update smoothing coefficient of the preset hyperparameter empirical value, which is 0.4 and is dimensionless. This is the first-order smoothed value of the delay margin from the previous control cycle; Initialize to 10% of the latency budget configuration value, which is 8 milliseconds.

[0029] Those skilled in the art will understand that the baseline update smoothing coefficient With delay margin smoothing factor The value of needs to strike a balance between the system's noise immunity and stability and its responsiveness to sudden load changes. In a low-voltage bus environment, 8-bit microcontrollers, lacking hardware multiplication and division units, exhibit slow drift characteristics of Gaussian white noise jitter due to the lack of such units in their software encryption, and are also susceptible to preemption by the operating system.

[0030] like or If the value is too large (e.g., greater than 0.5), the system will be too sensitive to single abnormal jitters, which will cause frequent changes in the encryption round multiplier and cause instability in the bus protocol state machine; if the value is too small (e.g., less than 0.1), the system will be slow to respond and unable to adapt to the computing power squeeze caused by a sudden large number of sampling tasks on the node.

[0031] In this embodiment and The method for determining the optimal value is as follows: Based on the exponentially weighted moving average (EWMA) parameter tuning principle in control theory, Monte Carlo simulation is performed on a typical 8-bit MCU platform with the delay overshoot rate and average encryption strength as dual objectives, and an empirical value on the Pareto optimal frontier is selected. This value can effectively filter out millisecond-level instantaneous spikes caused by bus electromagnetic interference, while ensuring that when the node load experiences a sustained shift, it can converge to a new steady-state baseline within 3 to 5 control cycles.

[0032] Map the first-order smoothing value of the delay margin to the round multiplier adjustment coefficient. The mapping rule uses piecewise linear mapping and limits the output range to prevent unbounded divergence. In the formula, and These are the minimum and maximum round multipliers, respectively, taken from preset hyperparameter empirical values ​​of 1.0 and 1.6, and are dimensionless. and These are the low and high thresholds of the mapping interval, respectively, with preset hyperparameter empirical values ​​of 5 milliseconds and 25 milliseconds. When the first-order smoothing value of the time delay margin is lower than the low threshold of the mapping interval, the round multiplier adjustment coefficient is set to its minimum value; when it is higher than the high threshold of the mapping interval, it is set to its maximum value; when it is within the interval, the current multiplier is calculated linearly. Indicates except and Other than these cases. It should be noted that this coefficient is used to adjust the ratio of the actual number of execution rounds to the base number of rounds in the algorithm. Its value is not less than 1.0, indicating that the actual number of execution rounds is not less than the base number of rounds; its name does not imply any additional redundant rounds beyond the base number.

[0033] The 5-millisecond threshold is determined as follows: Under typical industrial / low-voltage bus (such as RS485 or KNX) baud rates, the sum of the minimum inter-frame interval, gateway interrupt response latency, and bus conflict backoff time is approximately 3 to 5 milliseconds. When the budget margin is lower than this value, it means that the node may time out at any time due to underlying bus timing violations, and the linkage compensation mode (narrowing the mask coverage) must be triggered immediately to ensure real-time performance. The 25-millisecond threshold is determined by the fact that this value represents the maximum security enhancement time window allowed by the system. In low-voltage control loops, if the margin is greater than 25ms, further increasing the number of encryption rounds will result in diminishing marginal returns on overall security. In this case, maintaining a high level of encryption strength is sufficient, and there is no need to further increase it to avoid wasting computing resources.

[0034] The minimum and maximum values ​​of the round multiplier are not arbitrarily set, but are constrained by cryptographic security limits and the physical constraints of weak-current node hardware. Regarding The basic number of rounds (e.g., 10 rounds) in symmetric encryption algorithms (such as AES or SM4) is the cryptographic baseline for ensuring their resistance to differential and linear attacks. This would lead to a downgrade in encrypted security strength, failing to meet the basic compliance requirements of low-voltage security systems; therefore, the lower limit must be strictly clamped at 1.0. Regarding... The determination is based on the time window allocation within a typical low-voltage bus control cycle (e.g., 100ms). After deducting the time for bus transmission, protocol parsing, and business logic execution (approximately 30-40ms), the maximum usable encryption time window for high-performance nodes is approximately 60-80ms. Based on a baseline of 10 rounds, 1.6 times (i.e., 16 rounds) is the maximum reasonable number of rounds that most lightweight encryption algorithms can reasonably extend in software implementation without triggering the MCU watchdog timeout and while meeting the enhanced security requirements against side-channel attacks. Beyond 1.6 times, the marginal improvement in security strength diminishes, and unnecessary CPU cycles are consumed, impacting concurrent tasks.

[0035] Standard basic encryption round count Taking the basic round number of 10 provided by the symmetric encryption algorithm, then the... The actual number of encryption rounds executed in the cycle is: In the formula, For the first The actual number of encryption rounds performed in a given period is calculated, and the product is rounded up to ensure the round count is an integer, with the unit being rounds. The gateway writes the round multiplier adjustment coefficient and the mask derivation parameters described in subsequent steps into the configuration extension area of ​​the instruction frame for the next control period and sends it to the corresponding node. After receiving the configuration, the node performs the encryption operation according to the new round count within the current period and carries the actual encryption time in the extended field of the response frame. This provides the gateway with a smoothed baseline value for the encryption time consumption during the next cycle update.

[0036] It is important to emphasize that the round multiplier adjustment coefficient and the mask derived parameter are jointly issued in the configuration extension area of ​​the same instruction frame. They are driven by the same delay budget margin and are mutually causal in the linkage compensation mode of step S2 below. This joint issuance method allows the node to simultaneously obtain adjustment instructions in both the time dimension (round multiplier) and the spatial dimension (mask coverage) within a single control cycle, rather than simply listing two independent parameters.

[0037] S2: The node uses the field selection mask derived from the session key, frame sequence count value and synchronization timestamp to perform symmetric encryption on the field with the first value of the mask bit, and fills the field with the second value of the mask bit with decoy data constructed according to the statistical distribution of real data; when the round multiplier adjustment coefficient is clamped at the lower limit and the delay budget margin is still insufficient, the actual number of encryption rounds is adjusted in reverse according to the number of fields with the first value.

[0038] It should be noted that even after round-based multiplier adjustments, the available encryption time for low-performance nodes is still strictly limited within the latency budget margin. Under the example parameters of this embodiment, if approximately 30 milliseconds are reserved for transmission and protocol processing time, and approximately 50 milliseconds are allocated for encryption, while fully encrypting a single data frame requires at least 60 milliseconds, the node must compromise between encrypting all fields and encrypting only a portion of the fields. If only a portion of the fields are encrypted, the remaining fields will exist in plaintext form on the same bus for an extended period. Attackers can passively sniff out the semantic structure of the instructions and then replay or tamper with the plaintext portion. Furthermore, the field lengths and arrangements of the control instruction frames are fixed in the protocol specification; directly truncating encryption would expose field boundaries, and the plaintext-to-ciphertext length ratio remains constant, providing statistical characteristics for traffic analysis. The example values ​​for the reserved time window and encryption time, along with the threat model, are parameters confirmed by those skilled in the art.

[0039] Specifically, each node maintains a frame sequence count value in each control cycle. This value is cleared to zero during node initialization and automatically incremented by 1 with each frame sent in the control response. The gateway shares the session key with the node during the session establishment phase. The session key is distributed by the key management module, and its lifecycle management strategy is a parameter confirmed by those skilled in the art; the gateway also sends the current synchronization timestamp with the instruction frame. .

[0040] To generate a field selection mask that changes frame by frame, the node takes a concatenated bit string of frame sequence count, session key, and synchronization timestamp as input and uses a keyed hash operation to generate the field selection mask. : In the formula, For keyed hash operations, this embodiment uses HMAC-SHA256 (i.e., hash message authentication code based on SHA-256) as an example implementation; This represents the concatenation of bit strings A and B (A and B are two example bit strings). This is the current synchronization timestamp issued by the gateway, used to prevent replay across sessions. It should be noted that the choice of keyed hashing is not a limitation of this scheme. Those skilled in the art will understand that any keyed pseudo-random hash function recalculated by both the sending and receiving ends with the same input set can implement this scheme, such as national cryptographic algorithms like HMAC-SM3. However, regardless of the function used, its output must simultaneously depend on the session key, the frame sequence count, and the session synchronization parameters, and both the sending and receiving ends must be able to recalculate the same mask sequence without additional signaling exchange, ensuring that the mask can be synchronously restored at the receiving end without being transmitted with the frame.

[0041] In this embodiment, the smallest granularity of the mask is not bits, but rather the protocol fields that can be parsed by the communication protocol specification. Specifically, the node parses the field boundaries from the frame payload according to the communication protocol specification, dividing the frame payload into a continuous set of data fields. Each field consists of a field identifier, field length, and field content defined by the protocol; a field selection mask is then used. The length is equal to the total number of encryptable fields in the frame payload. , its first The value of the nth mask bit being 1 indicates that the nth... The protocol field needs to be encrypted using symmetric encryption, with a value of 0 indicating that the first field is 0. The protocol fields are not encrypted but filled with decoy data. The field boundaries are consistent with the protocol byte alignment boundaries. Encryption or decoy filling operations are performed on the whole field as the operation unit, without changing the total length of the frame payload or the field arrangement order, thus maintaining byte alignment compatibility with existing communication protocols.

[0042] Furthermore, since protocol field boundaries may change with protocol version upgrades, nodes maintain a field boundary resolution table corresponding to the current protocol version. When the gateway sends mask derivation parameters, it also carries the field resolution rule version number in the configuration extension area of ​​the instruction frame, and nodes switch the corresponding field boundary resolution table accordingly. When the receiving end restores the mask, it resolves the field boundaries using the same field resolution rule version number, ensuring that the mapping relationship between mask bits and fields remains consistent between the sending and receiving ends. This mechanism enables this scheme to adapt to different communication protocol versions without modifying the encryption logic itself.

[0043] The node then labels each field using a field selection mask. For fields with mask bits set to 1, symmetric encryption is performed; for fields with mask bits set to 0, no real data is filled in. Instead, a pseudo-random bit sequence with the same distribution as the real data is generated by the node's internal random number generator and used as decoy to fill the field. The length of the decoy field is exactly the same as the length of the original field at that position, thus making it difficult for attackers to distinguish between the real and decoy fields while keeping the total frame payload length unchanged.

[0044] Furthermore, the construction rule for the decoy field is as follows: for each field with a mask bit set to 0, the node randomly samples the values ​​of that field based on the distribution of those values ​​in historical real data. Let the set of values ​​for this field be... Historical statistics yielded each value. probability of occurrence Then the value of the decoy field Determined according to the following rules: In the formula, Uniformly distributed random numbers generated by the node random source, with values ​​ranging from 1 to 2. interval; This determines the value of the field that is hit according to the cumulative probability distribution. The numerical data is derived from historical statistics. It requires collecting at least 500 frames of real data during node network access to complete offline learning. The data is obtained by statistically analyzing the frequency of each value in each field, expressed as a dimensionless probability value. Through this construction, the decoy fields maintain consistency with the real data at the single-field value distribution level, and the value transition relationships between adjacent fields are also constrained by the historical statistical transition probability matrix. This prevents attackers from distinguishing between real and decoy fields at the field value statistical level when only observing bus traffic.

[0045] Regarding the offline learning sample size (500 frames): The value space of common state variables of low-voltage equipment (such as temperature, switching status, valve opening, etc.) is usually tens to hundreds of discrete values. According to the law of large numbers in statistics, 500 independent and identically distributed samples are sufficient to converge the confidence interval of the empirical distribution to more than 95%. At the same time, histogram statistics of 500 frames of data can be completed in the limited RAM (such as a few KB) of an 8-bit MCU through a sliding window mechanism, without causing storage overflow.

[0046] Regarding the method for determining the preset alarm threshold: The alarm threshold needs to balance the false negative rate (no attack detected) and the false positive rate (misjudgment caused by natural channel errors). The determination method is as follows: Under normal operating conditions before system deployment, collect bus traffic for at least one complete business cycle and calculate the natural fluctuation range of the statistical characteristics (mean, variance) of the decoy field. Using statistical methods... The principle (i.e., mean plus or minus three standard deviations) or the corresponding quantile of relative entropy (such as the chi-square distribution critical value at 99% confidence level) is set as the alarm threshold. This logic can tolerate occasional bit errors caused by natural electromagnetic interference in weak electrical environments, and can accurately capture statistical biases caused by attackers falsifying data distributions.

[0047] For nodes with sufficient computing power to complete the encryption of the entire frame within the latency budget, the round multiplier adjustment coefficient ensures that the actual number of encryption rounds is sufficient to cover the entire frame of data. All mask bits of the field selection mask are set to 1, degenerating into complete encryption of the entire frame. For nodes with insufficient computing power, the encrypted data field and the decoy field are interleaved and arranged in the order determined by the mask to form the frame payload. The plaintext exposure position changes frame by frame with the change of the frame sequence count value, and cannot be stably identified by passive sniffing.

[0048] To reduce the real-time computational burden of keyed hashing on low-computing-power nodes, this embodiment also provides the following optional implementation: During the session establishment phase, the node pre-generates and caches a mask derivation seed based on the session key and synchronization timestamp; in subsequent control cycles, the node only needs to perform lightweight permutation operations such as bitwise XOR and cyclic shift on the cached mask derivation seed and frame sequence count value to obtain the field selection mask for the current frame, without performing a complete keyed hashing operation frame by frame; the node only re-executes the keyed hashing operation to update the mask derivation seed when the session key is updated or the synchronization timestamp changes. This method trades pre-computation for reduced online computational overhead, without changing the derivation structure of the field selection mask, which depends on the session key, frame sequence count value, and synchronization timestamp.

[0049] Linked compensation mode: It should be noted that when the node's computing power is insufficient to complete the basic round of encryption for the entire frame within the latency budget, if the round multiplier adjustment coefficient is already clamped to the minimum value... If the first-order smoothing value of the delay margin is still lower than the low threshold of the mapping interval, the node switches to the linkage compensation mode. In this mode, the actual number of encryption rounds executed is no longer determined solely by... Instead of confirming, the adjustment is made in reverse order based on the number of fields covered by the mask: In the formula, This represents the total number of encryptable fields in the frame payload. Select the number of fields with a value of 1 from the mask for the current period field, satisfying the following conditions: The physical meaning of this formula is: the node reallocates the available encryption time window within the latency budget among different field coverage ranges—the fewer fields the mask covers, the more actual encryption rounds are allocated to each covered field; the more fields the mask covers, the fewer execution rounds are required for each field. The total encryption time is approximately: In the formula, This is an estimated average encryption time for a single field under the base round, which varies with the node's computing power and is expressed in milliseconds per field. As can be seen from the above formula, under the linkage compensation mode, regardless of how the number of fields covered by the mask changes, the total encryption time of the entire frame load remains basically constant. This creates a continuous adjustment surface for security strength within the latency budget boundary, where either the field coverage range is traded for the encryption strength of a single field, or the encryption strength of a single field is traded for the field coverage range.

[0050] The aforementioned linkage compensation mode structurally binds steps S1 and S2: when there is no room for further reduction in the round multiplier adjustment, the system compresses the encryption time window by narrowing the number of fields covered by the mask, ensuring that real-time performance is not compromised; simultaneously, the fields that are retained and covered maintain an encryption strength no lower than the basic security level due to receiving more execution rounds. Conversely, when there is sufficient time delay margin, the number of fields covered by the mask increases until the entire frame is covered, the round multiplier increases synchronously, and the system security strength monotonically increases. The round multiplier and the number of fields covered by the mask are mutually causal and jointly adjusted; no single-dimensional independent implementation can simultaneously satisfy both the time delay constraint and the security strength constraint. The technical effect produced by their synergy is unattainable by implementing either mechanism alone.

[0051] It should also be noted that changing the actual number of rounds does not change the ciphertext length or field boundaries. The change in the number of rounds in the symmetric encryption algorithm does not alter the ciphertext output length. Therefore, in the linked compensation mode, the total length of the frame payload and the field arrangement remain unchanged. The receiving end does not need to know the specific value of the round multiplier to complete decryption using the synchronously recalculated mask, and protocol compatibility is unaffected.

[0052] S3: The receiving end restores the encrypted field according to the mask recalculated synchronously and discards the decoy field. It performs anomaly detection on the statistical feature deviation of the decoy field, and feeds back the measured encryption time to the gateway before entering the next control cycle.

[0053] It should be noted that if only the round multiplier adjustment logic in step S1 is retained without the field-level interleaving mapping logic in step S2, low-power nodes can only degenerate into transmitting whole-frame plaintext or fixed-field plaintext when time is insufficient. Attackers can directly read the constant fields in the control commands without decryption and construct precise location replay attacks accordingly; the plaintext positions of fixed fields provide constant features for statistical analysis, rendering some encryption ineffective. If only the field-level interleaving mapping logic in step S2 is retained without the round multiplier adjustment logic in step S1, high-power nodes cannot increase the encryption depth when there is sufficient latency margin, and low-power nodes cannot dynamically shrink the encryption window when there is limited latency margin. Furthermore, without linkage compensation, the shrinkage of the number of fields covered by the mask will directly lead to unconstrained changes in the encryption rounds of the covered fields, which may exceed the latency boundary or lower the security lower limit. The two logics work together to resolve the mutually exclusive contradiction between real-time performance and security strength from the time and space dimensions, respectively. Only when the two work together can the target point of fixed plaintext be eliminated while satisfying the time delay boundary. And when clamping the round multiplier, the closed-loop solvability is maintained through the coverage-round linkage. This is an unexpected technical effect that cannot be obtained by implementing a single logic independently.

[0054] Specifically, after receiving the node response frame, the receiving gateway recalculates the field selection mask using the same session key, the same frame sequence count value, and the same synchronization timestamp. The command frame configuration extension area uses the version number of the field parsing rule to parse field boundaries, and then splits the frame payload according to the mask. Encrypted data fields with mask bits set to 1 are symmetrically decrypted to restore the real control data; decoy fields with mask bits set to 0 are discarded and do not enter the business processing flow.

[0055] Simultaneously, the receiving end performs online verification of the statistical characteristics of the decoy field. The receiving end periodically calculates the empirical value distribution of the decoy field. , and the preset statistical characteristics registered when the node joins the network A comparison is made. The comparison uses relative entropy as a measure: In the formula, The relative entropy is the empirical distribution of the decoy field relative to the preset distribution of the real field, expressed in dimensionless units. Simultaneously, the receiving end synchronously verifies the statistical mean, variance, and transition probability between adjacent fields of the decoy field, comparing them with the preset statistical characteristics registered when the node joined the network. If any of the verification values—relative entropy, mean, variance, or transition probability—exceeds the corresponding preset alarm threshold, the frame is deemed highly likely to have been tampered with or replayed, triggering an alarm and frame discarding. This preset alarm threshold is determined during the engineering debugging phase, taking into account the specific communication protocol and bit error rate (BER) indicators; the specific value is confirmed by those skilled in the art. The determination logic for the preset alarm threshold is based on the natural drift range of statistical characteristics caused by the BER under normal communication conditions and channel electromagnetic interference. By injecting Gaussian white noise of varying intensities or simulating bus electromagnetic interference offline, the natural fluctuation confidence interval (e.g., 99% confidence level) of the statistical decoy field distribution characteristics is determined. Values ​​exceeding the upper bound of this confidence interval are set as alarm thresholds to balance the false alarm rate and the missed alarm rate.

[0056] Since both the decoy field and the real field are data blocks that are indistinguishable to an unknown third party, if an attacker tampers with the decoy field or replays the entire frame, the statistical feature verification at the receiving end will identify the anomaly due to the decoy distribution deviating from the preset features, thereby achieving integrity protection at unknown plaintext locations.

[0057] Furthermore, the node carries the measured aggregation time consumed by the encryption of this frame in the extended field of the response frame. The data is then sent to the receiving gateway. When the gateway receives the response frame in the next control cycle, it extracts the measured aggregate duration, updates the encryption latency baseline smoothing value, recalculates the instantaneous difference of the latency budget margin, the first-order smoothing value of the latency margin, and the round multiplier adjustment coefficient. Simultaneously, it generates a new synchronization timestamp and mask-derived parameters, which are sent with the instruction frame. This constitutes a periodic closed-loop linkage: when the round multiplier adjustment coefficient increases, the node executes more encryption rounds in the next cycle, thus increasing the encryption strength; when the latency margin is tight, the round multiplier adjustment coefficient decreases, the encryption window shrinks, and the node selects a mask based on the field to increase the proportion of decoy fields, using the random distribution of decoys to mask the location of the real data; when the round multiplier clamp is at the lower limit and still not satisfied, it switches to a linkage compensation mode, using the number of fields covered by the mask to adjust the rounds in reverse. The entire iterative process continues, and the security strength becomes an adjustable quantity that is continuously controlled by time and the node's computing power margin.

[0058] In the aforementioned closed loop, the complete data flow is: the gateway in the periodic... The system issues a command frame containing the round multiplier adjustment coefficient and mask derivation parameters; nodes select the mask according to the fields to perform partial encryption and decoy filling, and carry the actual encryption time in the response frame; the receiving end restores the real data, removes the decoy fields, and reports the measured time; the gateway updates the encryption time baseline smoothing value accordingly and calculates the round multiplier adjustment coefficient and mask derivation parameters for the next cycle, then enters the cycle. This framework does not change the encryption algorithm family of any node; it can simultaneously meet the security enhancement requirements of high-performance nodes and the real-time requirements of low-performance nodes within a single heterogeneous computing bus by adjusting the execution rounds and plaintext exposure structure.

[0059] Example 2: The difference between this example and Example 1 is that the mapping from the first-order smoothed value of the delay margin to the round multiplier adjustment coefficient does not use a piecewise linear mapping, but rather a discrete lookup table method. Specifically, the first-order smoothed value of the delay margin is divided into three intervals: low margin interval, medium margin interval, and high margin interval, corresponding to the low, medium, and high levels of the round multiplier adjustment coefficient, respectively. The low level corresponds to... High-end position corresponds to Take the mid-range setting and The intermediate value. The gear boundary threshold is calibrated during the engineering debugging phase in conjunction with the control cycle and the node computing power distribution. The specific value is a parameter confirmed by those skilled in the art. The logic for determining the gear boundary threshold is as follows: it is calibrated based on the ratio of the extreme encryption time of the weakest node (such as an 8-bit microcontroller) among all nodes connected to the bus to the system control cycle. The delay margin is divided into three physical time window boundaries: the basic rounds, the basic rounds plus compensation rounds, and the full-load operation.

[0060] Under this discrete mapping method, the semantics and linkage mechanism of the round multiplier adjustment coefficient defined in step S1 remain unchanged: when the round multiplier adjustment coefficient is at a low level and the delay margin is still insufficient, the node also switches to the linkage compensation mode, using the number of mask-covered fields to adjust the actual number of execution rounds in reverse. It should be noted that discrete level mapping and continuous piecewise linear mapping are equivalent transformations under the same adjustment concept. Their core lies in using the delay budget margin as input and the round multiplier adjustment coefficient as output, driving the frame-by-frame change of the same field selection mask and the decoy filling mechanism. This discretization method does not change the closed-loop linkage relationship between S1, S2 and S3, nor does it change the triggering conditions and calculation method of the linkage compensation mode.

[0061] The remaining implementation details of this embodiment are the same as those of Embodiment 1.

[0062] Example 3: This example differs from Example 1 in two aspects.

[0063] First, the granularity of field partitioning can be further aggregated or subdivided based on protocol fields. When a protocol field is too long, it can be divided into multiple subfields, each serving as an independent encryption or decoy filling unit. When the total length of multiple consecutive protocol fields does not exceed the preset byte alignment length, they can be merged into a single encryption block as a processing unit corresponding to a single mask bit. Both the subfield partitioning rules and the field merging rules are uniquely determined by the field parsing rule version number. Both the sending and receiving ends parse field boundaries based on the same version number, ensuring consistent mapping between mask bits and data blocks. This aggregation or subdivision does not change the derived structure of the mask as it changes with the frame, nor does it alter the filling rules constructed by the decoy field based on the statistical distribution of real data.

[0064] Second, the mask derivation method is not limited to the cascaded hash operation in the above embodiments. Provided that the output simultaneously depends on the session key, frame sequence count, and synchronization timestamp, mask derivation can also be implemented by first generating a mask derivation seed from the session key and synchronization timestamp through a keyed hash operation, and then performing counter-mode expansion on the seed using the frame sequence count as input. In this method, the node completes seed generation and caching during the session establishment phase, and only needs to perform a lightweight expansion operation on the seed for each frame to obtain the field selection mask for the current frame, thereby further reducing online computation overhead. Both the sending and receiving ends recalculate the mask using the same seed generation and expansion rules, still without needing to transmit the mask itself on the bus.

[0065] The remaining implementation details of this embodiment are the same as those of Embodiment 1.

[0066] A data encryption transmission system for low-voltage electrical equipment includes a processor and a memory. The memory stores computer program instructions, which, when executed by the processor, implement a data encryption transmission method for low-voltage electrical equipment according to a first aspect of the present invention.

[0067] A data encryption transmission system for low-voltage electrical equipment also includes other components well known to those skilled in the art, such as a communication bus and a communication interface. Their settings and functions are known in the art and will not be described in detail here.

[0068] It should be noted that those skilled in the art can make various modifications and improvements without departing from the inventive concept, and these all fall within the scope of protection of this invention. Therefore, the scope of protection of this patent should be determined by the appended claims.

Claims

1. A method for encrypted data transmission of low-voltage electrical equipment, characterized in that, include: In each control cycle, the gateway obtains the actual encryption time of the node, smooths it to form an encryption time baseline, combines the end-to-end latency budget with the bus transmission latency measurement value to calculate the latency budget margin, and maps the smoothed latency budget margin to the round multiplier adjustment coefficient. The node uses a field selection mask derived from the session key, frame sequence count value, and synchronization timestamp. It performs symmetric encryption on the field with the first value of the mask bit and fills the field with decoy data constructed according to the statistical distribution of real data with the second value of the mask bit. When the round multiplier adjustment coefficient is clamped at the lower limit and the delay budget margin is still insufficient, the actual number of encryption rounds is adjusted in reverse according to the number of fields with the first value. The receiving end restores the encrypted field according to the synchronously recalculated mask and discards the decoy field. It performs anomaly detection on the statistical feature deviation of the decoy field, and feeds back the measured encryption time to the gateway before entering the next control cycle.

2. The method for encrypted data transmission of low-voltage electrical equipment according to claim 1, characterized in that, The process involves smoothing to form an encryption latency baseline, calculating a latency budget margin by combining the end-to-end latency budget with bus transmission latency measurements, and mapping the smoothed latency budget margin to a round-rate adjustment coefficient, including: An exponentially weighted moving average method was used to smoothly update the measured encryption time to obtain the encryption time baseline. The difference between the end-to-end delay budget and the measured bus transmission delay and the encryption time baseline is calculated to obtain the instantaneous difference of the delay budget margin. The instantaneous difference of the delay budget margin is then subjected to a first-order low-pass filter to obtain the smoothed delay margin value. The smoothed delay margin value is obtained by piecewise linear mapping and limiting the output range to obtain the round multiplier adjustment coefficient.

3. The method for encrypted data transmission of low-voltage electrical equipment according to claim 1, characterized in that, The node uses a field selection mask derived from the session key, frame sequence count value, and synchronization timestamp, including: Using a concatenated bit string of session key, frame sequence count value and synchronization timestamp as input, a field selection mask is generated by keyed hash operation; According to the communication protocol specification, the field boundaries are parsed from the frame payload, and the frame payload is divided into a continuous set of data fields. The length of the field selection mask is equal to the total number of encryptable fields in the data field set.

4. The method for encrypted data transmission of low-voltage electrical equipment according to claim 1, characterized in that, The process of filling the field with the second value of the mask bit with decoy data constructed according to the statistical distribution of real data includes: Obtain the set of values ​​for a field in historical real data and the probability of each value, and construct a cumulative probability distribution; Generate uniformly distributed random numbers, and fill in the decoy data with the values ​​that the random numbers hit in the cumulative probability distribution.

5. The method for encrypted data transmission of low-voltage electrical equipment according to claim 1, characterized in that, When the round multiplier adjustment coefficient is at the lower limit and the delay budget margin is still insufficient, the actual number of encrypted rounds is adjusted in reverse according to the number of fields taking the first value, including: When the round multiplier adjustment coefficient is at its minimum value and the delay budget margin is still lower than the preset low threshold of the mapping interval, obtain the basic number of encryption rounds, the total number of encryptable fields in the frame payload, and the number of fields that take the first value in the current period field selection mask. The actual number of encryption rounds is obtained by multiplying the minimum value, the basic number of encryption rounds, and the total number of encryptable fields, dividing by the number of fields that take the first value, and rounding up.

6. The method for encrypted data transmission of low-voltage electrical equipment according to claim 1, characterized in that, The anomaly detection performed on the statistical feature deviation of the decoy field includes: The empirical value distribution of the decoy field is periodically statistically analyzed, and the relative entropy of the empirical value distribution relative to the preset distribution of the real field is calculated. The statistical mean, variance, and transition probability between adjacent fields of the decoy field are checked synchronously. If any of the verification values, such as relative entropy, statistical mean, variance, or transition probability, exceeds the corresponding preset alarm threshold, an anomaly is determined and an alarm and frame are triggered and dropped.

7. A data encryption transmission system for low-voltage electrical equipment, characterized in that, include: A processor and a memory, wherein the memory stores computer program instructions that, when executed by the processor, implement a method for encrypted transmission of data in low-voltage electrical equipment according to any one of claims 1-6.