Multi-protocol compatibility and edge computing method for digital controller of heating and ventilation equipment
By loading protocol bytecode to parse device spatiotemporal metadata, calculating data validity weights, constructing a circular buffer, and generating fault snapshots, the problem of protocol adaptation rigidity and data timing jitter in edge controllers when facing heterogeneous devices is solved, realizing the system's flexibility and stability, and providing fault diagnosis support.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING YOUDA YUANHENG TECH CO LTD
- Filing Date
- 2026-05-11
- Publication Date
- 2026-06-26
AI Technical Summary
Existing edge controllers suffer from rigid protocol adaptation when dealing with heterogeneous devices, making it difficult to cope with timing drift caused by device aging and data timing jitter caused by strong electromagnetic interference. Furthermore, fault monitoring lacks process trend and underlying original message evidence.
By loading protocol bytecode, parsing the spatiotemporal metadata of the target device, establishing an instruction distribution table, calculating data validity weights, constructing a circular buffer, and using recursive algorithms and direct memory access technology to generate fault snapshots, multi-protocol compatibility and edge computing are achieved.
It improves the controller's compatibility with heterogeneous devices and the flexibility of field deployment, ensures the physical fidelity of data and system stability, and provides data support for fault diagnosis.
Smart Images

Figure CN122293767A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of HVAC equipment control technology, specifically to a multi-protocol compatibility and edge computing method for HVAC equipment digital controllers. Background Technology
[0002] Modern building HVAC systems are evolving towards greater precision and intelligence. These controllers need to connect to a wide variety of electromechanical equipment in the field, including chillers, variable frequency pumps, and various environmental sensors. Although most of these devices adhere to common industrial communication standards, significant differences exist at the physical level between different brands and even different batches in timing characteristics such as response latency and bus idle intervals. Edge controllers need to precisely adapt to these differences to ensure accurate issuance of control commands and real-time acquisition of status data.
[0003] In existing technologies, edge controller communication adaptation typically employs firmware hard-coding. Developers write dedicated drivers for specific device models and tightly bind the protocol parsing logic to the underlying operating system. In the data processing stage, the system primarily relies on cyclic redundancy check (CRC) at the link layer to determine the validity of data packets. Once a data packet passes CRC, its load value is considered reliable and directly input into subsequent PID control loops or logic judgment modules. For fault monitoring, a transient over-limit alarm mechanism is mainly used. When the collected value exceeds a preset threshold, an alarm is triggered, and the register value at that moment is recorded as a fault log. However, existing edge controllers suffer from a lack of system flexibility due to the deep coupling between firmware and drivers. Replacing equipment in the field often requires reprogramming the controller firmware, making it difficult to cope with timing drift caused by equipment aging. Mechanisms relying solely on checksums ignore the health of communication timing, allowing data that passes checksums but has severe timing jitter to enter the control loop, easily causing unnecessary oscillations in the actuators. Furthermore, the strict filtering strategies employed to combat interference can easily lead to prolonged data stream interruptions in high-frequency noise environments. The controller, lacking new data, retains the values from the previous moment, thus falling into a monitoring blind spot. Therefore, this invention proposes a multi-protocol compatibility and edge computing method for HVAC equipment digital controllers to address the shortcomings of existing technologies. Summary of the Invention
[0004] To address the shortcomings of existing technologies, this invention provides a multi-protocol compatibility and edge computing method for digital controllers of HVAC equipment. This method solves the problems of existing edge controllers, such as rigid protocol adaptation when facing heterogeneous devices, difficulty in effectively dealing with data timing jitter and monitoring blind spots caused by strong electromagnetic interference on site, and lack of process trend and underlying original message evidence during fault diagnosis.
[0005] To achieve the above objectives, the present invention provides the following technical solution: The first aspect of this invention provides a multi-protocol compatibility and edge computing method for digital controllers of HVAC equipment, comprising the following steps: S1. Load and parse the protocol bytecode for the target HVAC equipment, extract the spatiotemporal metadata defining the physical layer characteristics of the target HVAC equipment from the protocol bytecode, and establish an instruction distribution table for the edge controller based on the protocol bytecode. S2. Execute the instructions in the protocol bytecode, obtain the original signal from the physical interface of the edge controller and parse it to obtain the service value, calculate the validity weight of the current sampled data based on the deviation between the actual physical response time and the spatiotemporal metadata, and update the virtual machine status word that maps micro-communication errors. S3. Selectively store the business data according to the validity weight. When the validity weight meets the preset storage threshold, write it into the ring buffer of the edge controller to build a valid time-series dataset. When the validity weight is lower than the preset storage threshold, discard the business data and count the number of consecutive discards to generate a data loss alarm flag. S4. Based on the established effective time series dataset, use a recursive algorithm to calculate the rolling variance representing the degree of data fluctuation; S5. Perform logical operations on the rolling variance, the virtual machine status word, and the data loss alarm flag. When the preset abnormal conditions are met, generate a freeze trigger signal. Based on the freeze trigger signal, lock the valid time-series dataset in the circular buffer and generate a fault snapshot by combining the timestamp and status information of the trigger time.
[0006] Preferably, in step S1, the protocol bytecode includes a metadata segment and an instruction segment: Parse the metadata segment of the protocol bytecode and extract the minimum response time benchmark, timing jitter tolerance, and basic sampling weight coefficient as the spatiotemporal metadata; The instruction segment of the protocol bytecode is parsed, and the opcodes in the instruction segment are mapped to the entry addresses of firmware functions inside the virtual machine engine to establish an instruction dispatch table.
[0007] Preferably, in step S2, the calculation of the validity weight of the current sampled data based on the deviation between the actual physical response time and the spatiotemporal metadata further includes: An interrupt-driven mechanism is adopted to record the request time when the physical interface sends a completed interrupt trigger and the response time when it receives a completed interrupt trigger. The difference between the response time and the request time is calculated as the actual physical response time. Calculate the absolute deviation between the actual physical response time and the minimum response time benchmark; When the absolute deviation is less than or equal to the timing jitter tolerance, the validity weight is linearly reduced based on the magnitude of the absolute deviation and the base sampling weight coefficient. If the absolute deviation is greater than the timing jitter tolerance, then the validity weight is set to zero.
[0008] Preferably, step S3 further includes: The total storage length of the circular buffer is configured to be strictly greater than the length of the sliding window; The generated data loss alarm flag is set by determining whether the number of consecutive drops exceeds a preset consecutive drop limit. When the number of consecutive drops exceeds the preset consecutive drop limit, the data loss alarm flag is set to indicate that the data stream is interrupted due to continuous high-frequency interference.
[0009] Preferably, step S4 further includes: When a new business value is written to the circular buffer at the current moment, the currently written business value is read, and the historical business values that slide out of the sliding window at the same time are read according to the length of the sliding window. Using the currently written business values and the historical business values, the maintained window summation and window sum of squares are incrementally updated, and the rolling variance at the current moment is calculated. If no new business data is written at the current moment, no update operation is performed, and the rolling variance calculated at the previous moment is directly output.
[0010] Preferably, in step S5, the preset abnormal conditions specifically include: In the numerical domain dimension, the rolling variance is greater than a preset oscillation threshold; At the protocol domain level, the result of a bitwise AND operation between the virtual machine status word and the preset error mask is non-zero. In terms of integrity, the data loss alarm flag is set.
[0011] Preferably, in step S5, the step of generating a fault snapshot further includes: Identify the specific abnormal conditions that led to the generation of the freeze trigger signal; If the abnormal condition is one of the following: the virtual machine status word matching error mask, the data loss alarm flag being set, or the system being pre-configured to full capture mode, then the direct memory access mechanism is activated. By using the direct memory access mechanism to trace back to the receive buffer at the underlying physical interface, the original hexadecimal byte sequence before and after the trigger moment is extracted as the original message fragment, and the original message fragment is packaged into the fault snapshot.
[0012] Preferably, the original message fragment includes dirty data packets or incomplete frame fragments that retain link layer error characteristics; During the parsing process, when the virtual machine engine detects a cyclic redundancy check error or a byte gap timeout, it writes the corresponding error bit into the virtual machine status word, which is then encapsulated into the fault snapshot.
[0013] Preferably, the data structure of the fault snapshot includes: The system timestamp at the trigger time, the valid time-series dataset in the locked circular buffer, the virtual machine status word at the trigger time, and the original message fragment obtained through backtracking.
[0014] A second aspect of the present invention provides a multi-protocol compatible edge computing system for digital controllers of HVAC equipment, comprising: The protocol configuration module is used to load and parse the protocol bytecode, extract spatiotemporal metadata, and establish an instruction distribution table. The virtual machine engine is used to execute instructions in the protocol bytecode, parse the raw signals obtained from the physical interface of the edge controller to obtain service values, and calculate validity weights and update virtual machine status words. The buffer management module is used to perform selective storage, maintain a circular buffer, and generate data loss alarm flags. The feature extraction module is used to calculate the rolling variance based on the effective time-series dataset within the circular buffer. The trigger determination module is used to perform logical operations on the rolling variance, the virtual machine status word, and the data loss alarm flag to generate a freeze trigger signal; The snapshot generation module is used to lock the data and generate a fault snapshot in response to the freeze trigger signal.
[0015] This invention provides a multi-protocol compatibility and edge computing method for digital controllers of HVAC equipment. It has the following beneficial effects: 1. This invention decouples the device communication protocol from the controller's underlying firmware by loading protocol bytecode containing spatiotemporal metadata and using a virtual machine engine for interpretation and execution. This allows the edge controller to adapt to HVAC equipment with different physical layer response characteristics and timing requirements without modifying the underlying code or recompiling the firmware. This improves the controller's compatibility with heterogeneous devices and the flexibility of field deployment. 2. This invention establishes an effectiveness weight calculation and continuous discard monitoring mechanism based on physical response time deviation. It can automatically filter low-quality data that is interfered with according to the degree of time-series jitter, ensuring the physical fidelity of data in the circular buffer. Furthermore, by monitoring the continuous discard counter and generating a data loss alarm, it solves the problem of monitoring failure caused by the lack of input to the feature extraction module due to continuous data cleaning in a strong interference environment, thus ensuring the stability of the system in harsh communication environments. 3. This invention combines edge-side recursive variance calculation with direct memory access backtracking technology to construct a multi-dimensional fault capture system that includes numerical fluctuations, protocol errors, and data integrity. It utilizes a recursive algorithm to quantify the device's operating trend in real time under low computing power conditions. Combined with heterogeneous triggering logic, it can accurately identify mechanical oscillations and communication anomalies. By locking the circular buffer and backtracking the original message fragments at the underlying level, the generated fault snapshot completely preserves the application layer trend and link layer on-site evidence at the time of the fault, providing data support for subsequent fault diagnosis. Attached Figure Description
[0016] Figure 1 This is a system architecture diagram of the present invention; Figure 2 This is a flowchart of the method steps of the present invention; Figure 3 This is a flowchart illustrating the buffer management and selective storage process of the present invention. Detailed Implementation
[0017] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] See attached document Figure 1 , Figure 1 This is a system architecture diagram according to an embodiment of the present invention. The present invention provides a multi-protocol compatibility and edge computing method for a digital controller of HVAC equipment, which is applied to an edge controller. The edge controller logically includes: a protocol configuration module, a virtual machine engine, a buffer management module, a feature extraction module, a trigger determination module, and a snapshot generation module. Each module interacts with data through an internal bus and shared memory.
[0019] The protocol configuration module loads and parses the protocol bytecode for the target HVAC equipment. The protocol bytecode is a pre-compiled binary file containing an instruction segment and a metadata segment. The metadata segment defines the spatiotemporal metadata of the target HVAC equipment at the physical layer. This spatiotemporal metadata includes at least the minimum response time baseline, timing jitter tolerance, and basic sampling weight coefficients. The protocol configuration module then passes the parsed instruction sequence and metadata parameters to the virtual machine engine.
[0020] The virtual machine engine is a register-based instruction interpretation unit used to repeatedly execute protocol bytecode to complete the transmission, reception, and parsing of raw messages from the physical interface. During execution, the virtual machine engine monitors the response time and instruction execution status of the physical interface in real time. Based on the deviation between the actual physical response time and the spatiotemporal metadata, it calculates the validity weight of the currently sampled data and generates a virtual machine status word containing micro-error information. The virtual machine engine outputs the parsed business values, validity weights, and virtual machine status word to the buffer management module.
[0021] The buffer management module maintains the circular buffer and controls data writing behavior based on validity weights. It filters input data according to a preset entry threshold, discarding data with a validity weight below the threshold and writing service values to the circular buffer when the validity weight is above it. By implementing a weight-based selective writing strategy, the buffer management module ensures that the storage density within the circular buffer matches the physical channel quality.
[0022] The feature extraction module is used to perform statistical analysis on the time-series data within the circular buffer. It reads the data from the current sliding window within the circular buffer and uses a recursive algorithm to calculate statistical features such as the rolling variance in real time. The rolling variance quantifies the degree of data fluctuation over time. The feature extraction module then passes the calculated rolling variance to the trigger decision module.
[0023] The trigger determination module monitors the system's operating status and generates a freeze trigger signal. This module simultaneously receives the rolling variance from the feature extraction module and the virtual machine status word from the virtual machine engine. It determines whether the rolling variance exceeds a preset oscillation threshold and whether the virtual machine status word matches a preset error mask. When the rolling variance exceeds the oscillation threshold or the virtual machine status word matches the error mask, the trigger determination module outputs a valid freeze trigger signal to the snapshot generation module.
[0024] The snapshot generation module is used to lock the field data upon receiving a freeze trigger signal. In response to the freeze trigger signal, the snapshot generation module immediately stops the write operations of the buffer management module and locks the data in the current circular buffer. If the trigger source contains a virtual machine status word anomaly, the snapshot generation module uses a direct memory access mechanism to backtrack the physical interface's receive buffer and extract the original message fragment. The snapshot generation module packages the timestamp of the trigger moment, the locked circular buffer data, the virtual machine status word, and the original message fragment to generate a fault snapshot file.
[0025] See attached document Figure 2 , Figure 2 This is a flowchart of method steps according to an embodiment of the present invention. The present invention provides a multi-protocol compatibility and edge computing method for a digital controller of HVAC equipment, comprising the following steps: S1, the protocol configuration module loads the protocol bytecode containing spatiotemporal metadata, completes the initialization configuration for the specific HVAC equipment, and passes the parsed instructions and parameters to the virtual machine engine; S2, the virtual machine engine reads the raw data stream from the physical interface, executes the protocol bytecode instructions one by one for parsing, calculates the validity weight of the current data in the process, and updates the virtual machine status word; S3, the buffer management module receives the parsed data and weights, performs a weight-based selective write operation, cleans or downsamples the data, updates the valid data to the circular buffer, and regardless of whether the current data has been written, the system control flow continues to be passed down and the virtual machine status word is passed through to the subsequent steps. S4. If new data is written in step S3, perform statistical calculations on the latest data window in the circular buffer to obtain statistical characteristic values such as rolling variance. If no new data is written, maintain the statistical characteristic values from the previous time step.
[0026] S5, perform a logical OR operation on the rolling variance and the virtual machine status word to determine whether the result is false. If the result is false, return to step S2. If the result is true, trigger the determination module to activate the snapshot generation module. The snapshot generation module locks the current buffer and generates a fault snapshot containing application layer trend data and physical layer communication status.
[0027] In step S1, the protocol configuration module loads the protocol bytecode for a specific HVAC device and completes the initial configuration of the system. This process forms the basis for the interpretation and operation environment based on spatiotemporal metadata.
[0028] The protocol bytecode loaded by the protocol configuration module is stored in a compact binary format to accommodate the limited storage resources of the edge controller. This binary file is logically divided into a metadata segment and an instruction segment. The metadata segment, located in the file header, stores static parameters describing the physical layer communication characteristics of the target HVAC equipment; the instruction segment, located in the file body, stores the specific operation sequences executed by the control virtual machine. This design, which encapsulates physical characteristic parameters and logical operation instructions in the same independent file, achieves complete decoupling between the device protocol logic and the controller firmware.
[0029] The metadata segment defines a set of spatiotemporal metadata used to quantify the physical layer communication characteristics of the target HVAC equipment. It contains three core physical parameters, whose mathematical expressions are as follows: ; In the formula: This parameter represents the minimum response time baseline. It defines the theoretically shortest physical time required for the target HVAC equipment to travel from receiving the last stop bit of the master station's request frame to sending the first start bit of the response frame. This value is determined by the hardware processing capability of the target HVAC equipment's communication chip and serves as the zero-point baseline for subsequent calculations of response latency.
[0030] This parameter represents the timing jitter tolerance, defining the allowable range of response time deviation for the system under the current industrial electromagnetic environment. This value serves as the physical boundary for determining whether abnormal fluctuations exist in communication.
[0031] This represents the basic sampling weight coefficient. This parameter defines the initial confidence value of the data point under ideal communication conditions (i.e., when the actual response time equals the minimum response time baseline). It is usually normalized to 1.0.
[0032] When parsing the metadata segment, the protocol configuration module extracts the above parameters and writes them into the virtual machine engine's dedicated configuration register. These parameters will not be modified in subsequent operation and will serve as global constants for the virtual machine to calculate dynamic weights.
[0033] The instruction segment consists of a series of sequentially arranged virtual machine opcodes and their operands. The opcodes are used to instruct the virtual machine engine to execute specific bus operations and data parsing logic, including: Bus interaction instructions, such as register read instructions, are used to drive the physical interface to send a read request for a specific address to the target HVAC equipment; Logical calculation instructions, such as cyclic redundancy check calculation instructions, are used to perform polynomial calculations on the data in the receive buffer to verify data integrity. Status determination instructions, such as bitmask check instructions, are used to extract specific positions in the status register and compare them with preset values.
[0034] The protocol configuration module reads the binary file byte by byte, loads the instruction segment content into the instruction storage area, and establishes an instruction distribution table. This table maps the opcodes in the bytecode to the specific firmware function entry addresses within the virtual machine engine. For operands following the opcode, such as register addresses and read lengths, the protocol configuration module maintains them in the instruction stream for subsequent runtime reading. This step aims to complete the static runtime environment construction, rather than performing instruction pre-execution or translation. For common file reading and memory copy operations, those skilled in the art can use conventional file system interfaces and memory management functions, which are well-known technologies in the field and will not be elaborated upon here.
[0035] Through the loading process described above, the protocol configuration module converts static binary bytecode into a sequence of memory instructions and physical characteristic parameters that can be directly invoked by the virtual machine engine. This mechanism ensures that the edge controller can adapt to heterogeneous HVAC equipment with different timing characteristics by replacing the bytecode file, without recompiling the underlying firmware.
[0036] In step S2, the virtual machine engine performs active parsing and quality quantification of the raw data stream of the physical interface by executing the instruction sequence in the protocol bytecode.
[0037] After the virtual machine engine starts, it enters a loop state of instruction fetching and execution. Internally, the virtual machine engine maintains a program counter, pointing to the address of the instruction to be executed. Based on the program counter, the virtual machine engine reads the current opcode from the instruction storage area, queries the instruction dispatch table established in step S2, jumps to the corresponding internal processing function, and parses the subsequent operands according to the opcode definition. When executing bus interaction instructions, the virtual machine engine does not block and wait using polling; instead, it uses an interrupt-driven mechanism to obtain a precise timestamp. The virtual machine engine responds to the physical interface's transmit completion interrupt, recording the interrupt trigger time as the request time. The virtual machine engine responds to the physical interface's receive completion interrupt, recording the moment when the response frame is received and the frame tail check is completed as the response moment. The capture of the aforementioned interrupt signal and the acquisition of the microsecond-level timestamp can be accomplished by those skilled in the art using the input capture function of the microcontroller, or by using the microcontroller's peripheral interrupt controller in conjunction with a high-precision hardware timer. These are well-known technologies in the field and will not be elaborated upon here.
[0038] The virtual machine engine calculates the actual physical response time of the current communication cycle based on the captured timestamp. The validity weight of the current sampled data is calculated by combining the preloaded spatiotemporal metadata. This calculation process aims to quantify the current communication quality, distinguishing between normal data fluctuations and communication timing anomalies caused by electromagnetic interference, and assigning effectiveness weights. The calculation model is as follows: ; In the formula, Indicates the validity weight of the currently sampled data; Indicates the actual physical response time; This represents the minimum response time baseline, derived from the metadata segment of the protocol bytecode; This indicates the timing jitter tolerance, derived from the metadata segment of the protocol bytecode; This represents the base sampling weight coefficient, which comes from the metadata segment of the protocol bytecode.
[0039] The virtual machine engine executes the above computational logic: when the actual physical response time... Falling to Centered on When the deviation is within the allowable radius, the communication is considered valid. However, as the deviation increases, the weight of the data decreases linearly, indicating that the data has been affected by physical layer interference to some extent, and its confidence level decreases. When the actual physical response time... When the data packet exceeds this allowed range, regardless of whether the received data packet content verification passes, the virtual machine engine determines that the communication has suffered severe physical layer timing distortion (such as retransmission delay or noise pulse caused by bus collision), and directly reduces the validity weight. Reset to zero.
[0040] Meanwhile, the virtual machine engine updates the virtual machine status word in real time during the parsing process. The virtual machine status word maps registers that indicate operational anomalies within the virtual machine. When the virtual machine engine executes a cyclic redundancy check instruction, if the calculated checksum does not match the received checksum, the virtual machine engine sets the checksum error bit in the virtual machine status word. When the virtual machine engine executes a byte read instruction, if the interval between receiving adjacent bytes exceeds a preset timeout threshold, the virtual machine engine sets the timeout error bit in the virtual machine status word. This virtual machine status word, along with the calculated validity weight and the parsed service value, serves as the output of this step and is passed to the subsequent buffer management module.
[0041] See attached document Figure 3 In step S3, the buffer management module performs selective storage on the parsed business values based on the validity weight calculated in step S2.
[0042] The buffer management module allocates a contiguous storage space in memory as a circular buffer to temporarily store the cleaned device status time-series data. To ensure the availability of historical data during subsequent feature extraction, the buffer management module configures the total storage length of the circular buffer. Strictly larger than the sliding window length required for subsequent steps (Right now The buffer management module has a preset validity threshold parameter, denoted as... This parameter defines the system's maximum tolerance for physical layer timing jitter, used to intercept low-confidence data caused by unstable communication links. Simultaneously, the buffer management module internally maintains a continuous drop counter. It is used to monitor the continuity and integrity of data streams.
[0043] The buffer management module receives data pairs from the virtual machine engine, i.e., business values. With validity weight The buffer management module executes the weight discrimination logic and applies the validity weights calculated in real time. Compared with the preset validity threshold Perform numerical comparisons.
[0044] When validity weight Less than the validity threshold At this point, the buffer management module determines that although the current data frame passes verification, its physical layer response timing has been severely distorted, making it low-quality data subject to interference. The buffer management module then performs data cleaning and discards the data. This maintains the current write pointer position of the circular buffer unchanged. This ensures that data with transmission delays or timing jitter cannot enter subsequent calculation stages, thus avoiding false alarms caused by communication noise.
[0045] The buffer management module will continuously discard the counter. Increment by one, and check if the current count value exceeds the preset continuous discard limit. If the limit is exceeded (e.g., 10 consecutive frames), the buffer management module will issue a data loss alarm. This setting prevents blind spots in system monitoring caused by continuous data cleaning due to low weights in extremely high-vibration environments, even if the data passes verification, resulting in no new data input to the feature extraction module.
[0046] It should be noted that even if the data cleaning operation is performed, the system control flow will not be interrupted. Instead, it will continue to the subsequent step S5. The virtual machine status word and the data loss alarm flag will carry the abnormal information of this communication (such as verification error, timeout, etc.) directly to the trigger judgment module to ensure that the fault triggering mechanism based on protocol error is not shielded by the data cleaning logic.
[0047] When validity weight Greater than or equal to the validity threshold At that time, the buffer management module will first set the continuous discard counter. Clear to zero and set data loss alarm flag. Reset. The buffer management module will reset the business values. Write to the memory location currently pointed to by the write pointer in the circular buffer. This write operation overwrites the memory location pointed to by the write pointer. The data is stale data from several previous cycles, not the historical data needed by the current sliding window. After the write operation is completed, the buffer management module updates the write pointer to point to the next memory unit to be written.
[0048] For updating the write pointer, the buffer management module uses modulo operations to achieve circular reuse of addresses. The update logic for the write pointer is as follows: ; In the formula, Indicates the updated write pointer position index; This indicates the current write pointer position index; This represents the total storage length of the circular buffer, i.e., the total number of data points the buffer can hold; Indicates to Perform the modulo operation.
[0049] In harsh communication environments with frequent interference, the system automatically reduces the frequency of valid data entry, implementing a downsampling strategy to prevent invalid jitter data from filling the buffer. In favorable communication environments, the system records detailed changes in device status at full speed. This mechanism ensures that the data sequence within the circular buffer maintains high physical fidelity, providing a clean data source for the subsequent edge computing module to extract rolling variance features. Routine operations such as memory allocation and pointer bounds checks for the circular buffer can be implemented by those skilled in the art based on general data structure principles; these are well-known techniques in the field and will not be elaborated upon here.
[0050] In step S4, the feature extraction module performs real-time statistical analysis on the valid time-series data within the annular buffer to capture the non-steady-state characteristics of HVAC equipment during operation. This step utilizes the limited computing power of the edge controller to achieve real-time quantification of data volatility through a recursive algorithm, thereby identifying mechanical and control-level anomalies such as valve oscillation, sensor drift, or control loop divergence.
[0051] The feature extraction module has a fixed sliding window length parameter, denoted as . This parameter defines the historical data span involved in a single statistical calculation. The feature extraction module maintains two persistent state variables in memory: the cumulative sum of the current window's data. Sum of squares of the current window data These two state variables are updated in real time as new data is written, avoiding the need to update all data within the window in each sampling period. Repeatedly traverse and sum the data points.
[0052] When new valid data points are found in step S3 During writing, the feature extraction module determines the length of the circular buffer. With sliding window length Using the index relationship, locate and read the index before the current time. Old data points written at a given time but not yet overwritten. The feature extraction module utilizes new data points. Compared with old data points Incremental updates are performed on the state variables, and the current rolling variance is calculated accordingly. The calculation process follows the mathematical model below: ; In the formula, Indicates the current time The rolling variance value is used to represent the degree of dispersion of the data within the window range; This indicates the length of the sliding window, i.e., the number of samples. This represents the latest valid service value that has just been written to the circular buffer at the current moment; This represents the historical transaction values displayed in the current sliding window. Indicates the previous moment Window summation; Indicates the previous moment The sum of squares of the window.
[0053] The feature extraction module first performs update operations on the cumulative sum and sum of squares, replacing the old data statistics with the statistics of the new data. Then, it substitutes these statistics into the aforementioned formula to complete the variance calculation. This algorithm has a constant time complexity, ensuring that even with a sliding window length of [length missing], [the algorithm continues to perform the calculation]. Even with a large data set (e.g., covering thousands of sampling points), the edge controller can still complete the computation task within a very short control cycle. If no new data is written in step S3, the feature extraction module does not perform an update operation and directly outputs the rolling variance from the previous time step. Participate in subsequent judgments.
[0054] For system cold start or initial reset processing, the feature extraction module is equipped with a fill counter, ensuring that the number of valid data points in the circular buffer has not yet reached the sliding window length. Previously, the feature extraction module only performed cumulative summation and sum of squares operations, without outputting a valid variance value, or outputting a zero value, to prevent statistical bias caused by insufficient sample size from mistakenly triggering subsequent alarm logic. When the valid data volume reaches... Subsequently, the feature extraction module switches to rolling update mode and begins to continuously output the real-time calculated rolling variance to the trigger determination module. In this way, high-frequency monitoring of equipment operational stability is achieved at resource-constrained edge environments.
[0055] In step S5, the trigger determination module and the snapshot generation module work together to execute heterogeneous dual trigger logic and complete the full-dimensional data locking of the fault scene.
[0056] The trigger determination module receives the real-time rolling variance from the feature extraction module. Virtual machine status words of the virtual machine engine and data loss alarm flags in the buffer management module The triggering and judgment module has preset oscillation thresholds for specific device types. With error mask The trigger determination module executes parallel determination logic in each control cycle, which is independent of the data writing status in step S3.
[0057] In the numerical domain decision branch, the trigger decision module will roll over the variance. With oscillation threshold Comparison, if rolling variance Exceeding the oscillation threshold This indicates that the physical parameters of the controlled object have fluctuated drastically within a short period of time, such as control oscillations caused by mechanical jamming of a valve actuator or nonlinear drift of a sensor. At this time, the trigger determination module will set the numerical trigger flag... Set.
[0058] In the protocol domain decision branch, the trigger decision module will use the virtual machine status word. With error mask Perform bitwise AND operation, error mask This is used to define which types of communication errors should trigger a system freeze, such as consecutive CRC check failure bits or inter-frame timeout bits. If the calculation result is non-zero, it indicates that there is a specific type of severe interference or protocol parsing anomaly in the communication link, and that this anomaly is sufficient to affect the stability of the control system. The trigger determination module will then set the protocol trigger flag. Set.
[0059] The trigger determination module determines the numerical trigger flag. Protocol trigger flag and data loss alarm flags Perform a logical OR operation to generate the final freeze trigger signal. The logical decision-making process is as follows: ; In the formula, Indicates the Boolean state of the freeze trigger signal; This represents the rolling variance at the current moment; This indicates the preset oscillation threshold. This represents a virtual machine status word that contains micro-level error information; This represents the default error mask; Indicates a bitwise AND operation; Represents a logical OR operation.
[0060] Once the trigger signal is frozen If true, the system immediately performs a one-way locking operation. The snapshot generation module first sends a stop command to the buffer management module, preventing any new data from being written to the circular buffer and freezing the past data stored in the circular buffer. These historical data points fully preserve the parameter change trends before the failure occurred.
[0061] The snapshot generation module checks the trigger source type. If the trigger source contains a protocol domain exception (i.e., ... True), data loss alarm (i.e. If the system is configured for full capture mode (true), the snapshot generation module initiates a direct memory access (DMA) backtracking mechanism. The snapshot generation module reads the pointer to the circular receive buffer of the underlying communication driver to locate the address range in physical memory of the original message that triggered the anomaly. The module then directly copies the original hexadecimal byte sequence within that address range, with a length covering several communication frames before and after the fault. Although the microcontroller's UART controller automatically filters out some physical layer noise, the original byte stream obtained in this step still retains the error context of the link layer (such as dirty data packets with CRC check errors, truncated frame fragments, etc.). Combined with the hardware error flags recorded in the virtual machine status word (such as parity error bits, frame error bits), this provides a complete logical chain of evidence for subsequent analysis of the physical causes of the communication fault.
[0062] The snapshot generation module structures and packages the system timestamp at the trigger time, the timing data of the locked ring buffer, the virtual machine status word at this moment, and the original message fragment obtained by backtracking (this fragment can be configured as an option to save storage space when the trigger source is only a numerical field anomaly) to generate a fault snapshot file. This fault snapshot file is written to the controller's non-volatile memory and awaits uploading.
[0063] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A multi-protocol compatibility and edge computing method for digital controllers of HVAC equipment, characterized in that, Includes the following steps: S1. Load and parse the protocol bytecode for the target HVAC equipment, extract the spatiotemporal metadata defining the physical layer characteristics of the target HVAC equipment from the protocol bytecode, and establish an instruction distribution table for the edge controller based on the protocol bytecode. S2. Execute the instructions in the protocol bytecode, obtain the original signal from the physical interface of the edge controller and parse it to obtain the service value, calculate the validity weight of the current sampled data based on the deviation between the actual physical response time and the spatiotemporal metadata, and update the virtual machine status word that maps micro-communication errors. S3. Selectively store the business data according to the validity weight. When the validity weight meets the preset storage threshold, write it into the ring buffer of the edge controller to build a valid time-series dataset. When the validity weight is lower than the preset storage threshold, discard the business data and count the number of consecutive discards to generate a data loss alarm flag. S4. Based on the established effective time series dataset, use a recursive algorithm to calculate the rolling variance representing the degree of data fluctuation; S5. Perform logical operations on the rolling variance, the virtual machine status word, and the data loss alarm flag. When the preset abnormal conditions are met, generate a freeze trigger signal. Based on the freeze trigger signal, lock the valid time-series dataset in the circular buffer and generate a fault snapshot by combining the timestamp and status information of the trigger time.
2. The multi-protocol compatibility and edge computing method for HVAC equipment digital controllers according to claim 1, characterized in that, In step S1, the protocol bytecode includes a metadata segment and an instruction segment: Parse the metadata segment of the protocol bytecode and extract the minimum response time benchmark, timing jitter tolerance, and basic sampling weight coefficient as the spatiotemporal metadata; The instruction segment of the protocol bytecode is parsed, and the opcodes in the instruction segment are mapped to the entry addresses of firmware functions inside the virtual machine engine to establish an instruction dispatch table.
3. The multi-protocol compatibility and edge computing method for HVAC equipment digital controllers according to claim 1, characterized in that, In step S2, the calculation of the validity weight of the current sampled data based on the deviation between the actual physical response time and the spatiotemporal metadata further includes: An interrupt-driven mechanism is adopted to record the request time when the physical interface sends a completed interrupt trigger and the response time when it receives a completed interrupt trigger. The difference between the response time and the request time is calculated as the actual physical response time. Calculate the absolute deviation between the actual physical response time and the minimum response time benchmark; When the absolute deviation is less than or equal to the timing jitter tolerance, the validity weight is linearly reduced based on the magnitude of the absolute deviation and the base sampling weight coefficient. If the absolute deviation is greater than the timing jitter tolerance, then the validity weight is set to zero.
4. The multi-protocol compatibility and edge computing method for HVAC equipment digital controllers according to claim 1, characterized in that, Step S3 further includes: The total storage length of the circular buffer is configured to be strictly greater than the length of the sliding window; The generated data loss alarm flag is set by determining whether the number of consecutive drops exceeds a preset consecutive drop limit. When the number of consecutive drops exceeds the preset consecutive drop limit, the data loss alarm flag is set to indicate that the data stream is interrupted due to continuous high-frequency interference.
5. The multi-protocol compatibility and edge computing method for HVAC equipment digital controllers according to claim 1, characterized in that, Step S4 further includes: When a new business value is written to the circular buffer at the current moment, the currently written business value is read, and the historical business values that slide out of the sliding window at the same time are read according to the length of the sliding window. Using the currently written business values and the historical business values, the maintained window summation and window sum of squares are incrementally updated, and the rolling variance at the current moment is calculated. If no new business data is written at the current moment, no update operation is performed, and the rolling variance calculated at the previous moment is directly output.
6. The multi-protocol compatibility and edge computing method for HVAC equipment digital controllers according to claim 1, characterized in that, In step S5, the preset abnormal conditions specifically include: In the numerical domain dimension, the rolling variance is greater than a preset oscillation threshold; At the protocol domain level, the result of a bitwise AND operation between the virtual machine status word and the preset error mask is non-zero. In terms of integrity, the data loss alarm flag is set.
7. The multi-protocol compatibility and edge computing method for HVAC equipment digital controllers according to claim 1, characterized in that, In step S5, the step of generating a fault snapshot further includes: Identify the specific abnormal conditions that led to the generation of the freeze trigger signal; If the abnormal condition is one of the following: the virtual machine status word matching error mask, the data loss alarm flag being set, or the system being pre-configured to full capture mode, then the direct memory access mechanism is activated. By using the direct memory access mechanism to trace back to the receive buffer at the underlying physical interface, the original hexadecimal byte sequence before and after the trigger moment is extracted as the original message fragment, and the original message fragment is packaged into the fault snapshot.
8. The multi-protocol compatibility and edge computing method for HVAC equipment digital controllers according to claim 7, characterized in that, The original message fragments include dirty data packets or incomplete frame fragments that retain link layer error characteristics; During the parsing process, when the virtual machine engine detects a cyclic redundancy check error or a byte gap timeout, it writes the corresponding error bit into the virtual machine status word, which is then encapsulated into the fault snapshot.
9. The multi-protocol compatibility and edge computing method for HVAC equipment digital controllers according to claim 8, characterized in that, The data structure of the fault snapshot includes: The system timestamp at the trigger time, the valid time-series dataset in the locked circular buffer, the virtual machine status word at the trigger time, and the original message fragment obtained through backtracking.
10. A multi-protocol compatibility and edge computing system for a digital controller of HVAC equipment, applied to the multi-protocol compatibility and edge computing method for a digital controller of HVAC equipment as described in any one of claims 1-9, characterized in that, include: The protocol configuration module is used to load and parse the protocol bytecode, extract spatiotemporal metadata, and establish an instruction distribution table. The virtual machine engine is used to execute instructions in the protocol bytecode, parse the raw signals obtained from the physical interface of the edge controller to obtain service values, and calculate validity weights and update virtual machine status words. The buffer management module is used to perform selective storage, maintain a circular buffer, and generate data loss alarm flags. The feature extraction module is used to calculate the rolling variance based on the effective time-series dataset within the circular buffer. The trigger determination module is used to perform logical operations on the rolling variance, the virtual machine status word, and the data loss alarm flag to generate a freeze trigger signal; The snapshot generation module is used to lock the data and generate a fault snapshot in response to the freeze trigger signal.