Distributed IO bus expansion system and device
Through the combination of comprehensive signal I/O module, communication management module, fault detection and recovery module and cloud management module, the problems of module expansion number, data reporting method and unintelligent fault handling in the distributed IO bus expansion system are solved, and the problem is achieved Efficient module registration, data transmission and fault recovery improve the reliability and efficiency of the system.
Patent Information
- Application Number
- CN202410848670.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-10-29
AI Technical Summary
The existing distributed IO bus expansion system has limitations in the number of module expansions, data reporting methods and fault handling. It is difficult to support large-scale equipment interconnection and real-time dynamic data processing. Fault detection and recovery are not intelligent enough, which affects production efficiency.
Adopting comprehensive signal I/O module, communication management module, fault detection and recovery module and cloud management module, through dynamic module registration and priority adjustment algorithm, state machine model, adaptive data reporting and compression algorithm, fast fault location model and other technologies , realizing module registration automation, data transmission optimization, rapid fault location and intelligent recovery.
It improves module registration efficiency, supports large-scale module access, optimizes network bandwidth usage, realizes rapid fault location and automatic recovery, and improves system reliability and efficiency.
Smart Images

Figure SMS_1 
Figure SMS_2 
Figure SMS_3
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of industrial automation, and more specifically to a distributed IO bus expansion system and device. Background Art
[0002] With the rapid development of industrial automation and intelligent manufacturing, distributed IO bus expansion systems have become one of the core components in the field of modern industrial control. These systems meet the increasingly complex needs of industrial control through high modularity and flexible configuration. As a bridge between the physical world and the digital world, the scalability and reliability of the distributed IO system directly affect the performance of the entire industrial automation system.
[0003] Existing distributed IO bus expansion systems are widely used in the field of industrial automation. They are usually based on mature fieldbus technologies such as Profibus and Modbus. These systems achieve interconnection between devices through standardized communication protocols, providing a stable and reliable solution for industrial control. However, with the complexity and diversification of industrial application scenarios, existing systems have gradually shown some limitations.
[0004] First, the scalability of traditional systems is limited, and the communication capabilities between modules are limited, making it difficult to support large-scale equipment interconnection. Second, traditional systems are relatively rigid in data processing and reporting mechanisms, usually using periodic reporting and unable to achieve event-based dynamic reporting, which is inadequate when dealing with industrial scenarios with high real-time and dynamic requirements. Furthermore, the fault detection and recovery mechanism is not intelligent enough, often requiring manual intervention, and unable to quickly locate and solve problems, affecting the continuity and efficiency of production. Summary of the invention
[0005] In view of the deficiencies in the prior art, the present invention discloses a distributed IO bus expansion system and device, which solves the shortcomings of the prior art devices, such as limited number of module expansions, insufficient intelligence in data reporting methods and fault handling.
[0006] The present invention adopts the following technical solutions:
[0007] A distributed IO bus expansion system, wherein the expansion management unit includes an integrated signal I / O module, a communication management module, a fault detection and recovery module and a cloud management module;
[0008] The main control module is used to manage the module registration, parameter configuration and data scheduling of the extended management unit; the main control module optimizes the module registration process through a dynamic module registration and priority adjustment algorithm, and dynamically adjusts the communication priority on the CAN bus; the dynamic module registration and priority adjustment algorithm realizes the automatic management of the module registration process through a state machine model, and realizes data communication and transmission through the CAN bus communication protocol CAN2.0B;
[0009] The integrated signal I / O module is used to collect digital and analog signals in real time and send the collected signals to the communication management module; the integrated signal I / O module optimizes network bandwidth usage and response time through adaptive data reporting and compression algorithms; the integrated signal I / O module includes a digital I / O unit and an analog I / O unit;
[0010] The communication management module is used to encapsulate the signal sent by the integrated signal I / O module and upload it to the main control module, and receive the communication priority adjustment instruction of the main control module; the communication management module ensures data integrity and correctness through data packet encapsulation and decapsulation methods, and enhances the reliability of data transmission through error detection and correction mechanisms;
[0011] The fault detection and recovery module is used to monitor the faults of the main control unit and the extended management unit in real time and respond and recover in real time; the fault detection and recovery module monitors the module status in real time through periodic status check and timeout retransmission mechanism, locates the cause of the fault through a fast fault location model and executes a recovery strategy;
[0012] The cloud management module is used to remotely configure and update the distributed IO bus expansion system. The cloud management module performs cross-network configuration updates through a remote configuration protocol and ensures configuration consistency and traceability through a version control mechanism.
[0013] As a further technical solution of the present invention, the state machine model manages the module registration status through state transition logic and event triggering mechanism; the state machine model includes a registration management module, an event processing module, a state transition module and a communication coordination module; the registration management module maintains the module registration information and status through a registration information storage unit and a registration status verification unit, and the registration information storage unit stores and manages the module registration information through a database management method; the registration status verification unit verifies the module registration status through a status verification and data synchronization method; the event processing module monitors module registration requests and other system events in real time through an event-driven programming mechanism, and triggers corresponding state transitions or data transmission through a mapping table and a priority scheduling method; the event-driven programming mechanism triggers corresponding state transitions or data transmission through a callback function The event response behavior is defined by the number, and the order of receiving and processing events is managed through the event queue; the state transition module includes a state transition logic unit and a state transition trigger unit; the state transition logic unit defines and manages the transition rules between states through a finite state automaton; the state transition trigger unit detects whether the conditions for state transition are met through a conditional judgment mechanism, and triggers the state transition when the conditions are met; the finite state automaton defines the transition relationship between states through a state table, and determines the next state according to the current state and input events through a transition function; the communication coordination module encapsulates the data exchange between modules into a format suitable for network transmission through format definition and encoding and decoding, and realizes reliable data transmission through the frame structure and error detection mechanism of the CAN2.0B protocol.
[0014] As a further technical solution of the present invention, the working method of the dynamic module registration and priority adjustment algorithm is:
[0015] Step 1: Module registration score calculation;
[0016] A comprehensive score is calculated for each module through a module registration scoring function to evaluate the module's demand for system resources and its impact on performance; the formula expression of the module registration scoring function is:
[0017]
[0018] In formula (1), X reg represents the module registration score, which is a comprehensive indicator reflecting the module's impact on system resource requirements and performance. K represents the capacity requirement of module i, which is used to measure the module's occupation of system resources. n represents the number of parameter types considered. τ represents the data requirement of module i, which is used to measure the module's demand for data transmission and storage. P represents the performance index of module i, which includes response time, processing speed, throughput, resource utilization and fault tolerance. i , b i and c iThey represent the adjustment coefficients of capacity, performance, and data requirements, respectively; d represents the weight coefficient, which is used to measure the importance of different parameters;
[0019] Step 2: Initialize dynamic priority;
[0020] The initial communication priority of the module is dynamically calculated through the priority initialization function according to the module's registration score and system status; the system status includes system load, response time, throughput and network delay; the formula expression of the priority initialization function is:
[0021]
[0022] In formula (2), P init Indicates the initial priority; X reg represents the module registration score; β represents the system stability adjustment coefficient; α1 represents the system bus load; α2 represents the system error rate;
[0023] Step 3: Dynamically adjust the priority;
[0024] The communication priority of the module is adjusted in real time through the priority dynamic adjustment function to respond to changes in system load and module performance; the formula expression of the priority dynamic adjustment function is:
[0025]
[0026] In formula (3), P dyn Indicates the priority after dynamic adjustment; s i Indicates the change in system load, which is used to measure the change in system resource requirements; β i represents the change in module performance; σ and ρ represent the load adjustment coefficient and performance adjustment coefficient, respectively, which are used to control the impact of load and performance changes on priority adjustment; P init Indicates the initial priority;
[0027] Step 4: Communication scheduling and priority optimization;
[0028] According to the dynamic priority of the module, the urgency of the task and the number of modules in the system, the priorities between different modules are balanced through the communication scheduling optimization function; the formula expression of the communication scheduling optimization function is:
[0029]
[0030] In formula (4), S sched is the scheduling score, i.e., the communication priority of the module in the current scheduling cycle; Y represents the task urgency coefficient; M represents the number of modules; P dyn Indicates dynamic priority;
[0031] Step 5: Feedback correction and adaptive learning;
[0032] According to historical scheduling data and system performance feedback, the coefficients σ and ρ in step 3 are automatically adjusted through the reinforcement learning algorithm, and the adjusted coefficients are applied to the priority dynamic adjustment function for real-time monitoring. If the performance improves, the current coefficients are retained; if the performance does not improve or decreases, the learning process is re-entered to further adjust the coefficients.
[0033] As a further technical solution of the present invention, the fast fault location model includes a perception layer, a preprocessing layer, a fault feature extraction layer, an intelligent diagnosis layer, a decision layer, an execution layer and an optimization layer. The operation of the fast fault location model includes the following steps:
[0034] Step 1: Data input and collection: The perception layer monitors and collects the status information and performance indicators of each module in real time; the perception layer realizes the real-time collection of sensor data through the embedded system and realizes the efficient transmission of data through the field bus protocol; the status information and performance indicators include the module's voltage, current, temperature, response time, communication status and firmware version;
[0035] Step 2: Data preprocessing and standardization: the raw data is cleaned, denoised and standardized through the preprocessing layer; the preprocessing layer processes the collected data through digital signal processing and data encoding;
[0036] Step 3: Fault feature extraction: extract key fault features from the preprocessed data through a fault feature extraction layer; the fault feature extraction layer realizes effective identification of fault features by strengthening principal component analysis PCA and machine learning classifier; the strengthened principal component analysis PCA enhances the recognition effect of outliers by introducing regularization terms and iterative optimization strategies; the machine learning classifier improves classification accuracy and system generalization ability by stacking generalization method;
[0037] Step 4: Intelligent fault diagnosis: The intelligent diagnosis layer conducts in-depth analysis on the extracted fault features to identify the fault type and location; the intelligent diagnosis layer realizes intelligent identification and classification of faults through convolutional neural networks and fault diagnosis rule bases; the fault diagnosis rule bases are dynamically updated and evolved according to new fault cases and feedback through online learning methods;
[0038] Step 5: Recovery strategy formulation: According to the diagnosis results, a fault recovery strategy is formulated through the decision layer; the decision layer implements personalized and adaptive recovery strategy formulation through the expert system and decision tree algorithm; in the process of node splitting of the decision tree, the decision tree algorithm dynamically adjusts the threshold of decision tree splitting through fuzzy logic to enhance the interpretability of the decision tree;
[0039] Step 6: Fault recovery execution: execute the fault recovery strategy through the execution layer and monitor the recovery process in real time;
[0040] Step 7: Feedback and continuous learning: feedback information of fault handling is collected through the optimization layer and used to continuously optimize the fault location model; the optimization layer realizes continuous improvement and adaptability enhancement of the fault location algorithm through a feedback loop mechanism and an incremental learning algorithm.
[0041] As a further technical solution of the present invention, the working method of the adaptive data reporting and compression algorithm is:
[0042] 501. Signal trend prediction is performed through a Kalman filter to achieve intelligent adjustment of data reporting frequency; the formula for updating the Kalman filter is expressed as:
[0043]
[0044] In formula (5), F k|k is the optimal estimate of the current state, indicating that at the kth moment, according to the observed data y k Updated state estimate; F k|k-1 is the predicted value of the previous state, indicating the state predicted based on the previous state and the system model at the kth moment; y k is the observed data at the kth moment, used to represent the actual measurement value; H is the observation model matrix, used to describe the statistical characteristics of the measurement error; K k is the Kalman gain, which is used to measure the observed data y k the degree of revision of the state estimate;
[0045] 502. Dynamically adjust the coding strategy according to the signal characteristics through a variational coding algorithm based on a self-attention mechanism; the formula expression of the variational coding algorithm based on the self-attention mechanism is:
[0046]
[0047] In formula (6), μ is the activation function; q is the weight matrix; W v is the probability of signal v appearing; Attention(Q,K,V) is the attention mechanism, and the attention weight is calculated by querying the Q, key K, value V matrix; Formula (6) allows the algorithm to dynamically adjust the compression ratio and encoding parameters according to the importance of the signal; For digital signals, the variational coding algorithm based on the self-attention mechanism compresses through Huffman coding, and the Huffman coding optimizes the coding table through frequency statistics to assign short code words to frequently occurring signals; For analog signals; The variational coding algorithm based on the self-attention mechanism separates the details and trends of the signal through wavelet transform and removes high-frequency redundant information;
[0048] 503. Ensure continuous adjustment and optimization of data reporting and compression strategies through comprehensive optimization strategies and feedback control mechanisms; the comprehensive optimization strategies process nonlinear relationships through intelligent decision functions; the intelligent decision functions map reporting frequency T, compression ratio L, and system response time B to control decisions through fuzzy logic controllers, and make comprehensive decisions through deep reinforcement learning strategies; the formula expression of the intelligent decision function is:
[0049]
[0050] In formula (7), B is the system response time; L is the compression ratio; T is the reporting frequency; a is the adjustment coefficient of the fuzzy output; b is the basic reward; and u is the network load, which is used to measure the usage of network resources.
[0051] As a further technical solution of the present invention, the data packet encapsulation and decapsulation method ensures the consistency of data encapsulation and parsing through a custom data structure and a serialization / deserialization mechanism; the custom data structure creates a data model through class definition and structure definition, and improves data access efficiency and storage efficiency through memory alignment and packaging methods; the serialization / deserialization mechanism converts complex data types in the custom data structure into binary format through data encoding; the error detection and correction mechanism ensures the accuracy and fault tolerance of data transmission through a cyclic redundancy check and a forward error correction method.
[0052] As a further technical solution of the present invention, the digital I / O unit reports data through an event-driven reporting mechanism; the event-driven reporting mechanism reports data when the input state changes through state monitoring logic and conditional triggers, thereby reducing the communication load; the analog I / O unit dynamically adjusts the sampling frequency through signal change detection and frequency adjustment strategy, and reduces the analog signal data transmission volume through differential encoding and quantization step adjustment methods.
[0053] As a further technical solution of the present invention, the cloud management module includes a remote configuration unit, a version control unit, a communication coordination unit and a security verification unit; the remote configuration unit parses and identifies configuration parameters through the JSON data format, and issues and applies parameter settings through a remote procedure call method; the version control unit records the current configuration version through a timestamp, and updates the changed part through a differential update algorithm; the communication coordination unit performs communication scheduling and data transmission through the transmission control protocol TCP and the file transfer protocol SFTP; the security verification unit authenticates the remote user or system that initiates the configuration update through a public key infrastructure.
[0054] As a further technical solution of the present invention, a distributed IO bus expansion device includes:
[0055] A central processing unit, wherein the central processing unit uses a microcontroller to perform system management and coordination tasks, process module identification, data synchronization and communication scheduling; the central processing unit is connected to the input / output processing module, the data exchange protocol unit, the system monitoring and maintenance unit, the interactive operation interface and the power supply and signal conditioning unit through an internal bus, and is connected to the remote configuration interface through an external communication interface;
[0056] The input / output processing module includes a digital input / output interface, an analog input / output interface and a signal conditioning circuit; the digital input / output interface is electrically isolated by a photoelectric isolator, and the signal is shaped by a Schmitt trigger; the analog input / output interface converts the signal by an analog-to-digital converter and a digital-to-analog converter; the signal conditioning circuit processes the input signal by an amplifier and a filter; and provides a voltage reference for the analog-to-digital converter and the digital-to-analog converter by a reference voltage source;
[0057] The data exchange protocol unit manages the encapsulation, transmission and decoding of data frames through the CAN controller, CAN transceiver and protocol stack;
[0058] The system monitoring and maintenance unit monitors the system status in real time through the monitoring circuit and fault diagnosis logic, and performs fault detection, alarm and automatic recovery; the monitoring circuit includes a watchdog timer and a status monitoring sensor;
[0059] The remote configuration interface allows users to remotely modify module configuration and system parameters through the network through the Ethernet PHY chip and the security protocol TLS / SSL;
[0060] The interactive operation interface communicates with the remote configuration interface via a wireless communication network;
[0061] The power supply provides a stable power supply to the system through a power regulator.
[0062] As a further technical solution of the present invention, a distributed IO bus expansion device also includes: a bus arbitration mechanism, which is integrated in the CAN bus and manages the data transmission between the central processing unit and the IO processing module through a conflict detection circuit and an arbitration logic; the conflict detection circuit detects the signal state on the bus through a comparator logic, and when it is detected that two or more IO processing modules are trying to transmit data at the same time, the conflict detection circuit generates a conflict signal through a trigger; the arbitration logic determines the data transmission priority through a priority encoder, and manages the timing of data transmission through a timing control logic; the timing control logic tracks the timing of data transmission through a synchronization counter, and manages the module request status, authorization status and data transmission status through a state machine management module.
[0063] Positive beneficial effects
[0064] The present invention discloses a distributed IO bus expansion system. The present invention automatically manages the module registration process through a state machine model, which not only improves the efficiency of module registration, but also greatly simplifies the process of module expansion. The system can quickly respond to the increase or decrease of modules without manual intervention, thereby supporting the access and management of large-scale modules. And through dynamic module registration and priority adjustment algorithms, the system can dynamically adjust the communication priority of the module according to the real-time system load and performance indicators. This intelligent adjustment mechanism ensures that the system can maintain efficient communication and data processing capabilities even when the number of modules increases significantly.
[0065] The integrated signal I / O module optimizes the use of network bandwidth, reduces delays in data transmission, and improves the system's response speed through adaptive data reporting and compression algorithms. This algorithm can intelligently adjust the frequency and format of data reporting according to network conditions and data characteristics to achieve more efficient data transmission. The combination of digital I / O units and analog I / O units enables the system to process digital and analog signals at the same time, providing a wider range of signal processing capabilities to meet data reporting requirements in different scenarios.
[0066] The fault detection and recovery module realizes real-time monitoring of module status through periodic status check and timeout retransmission mechanism, and can quickly discover and respond to potential faults. This active fault detection mechanism greatly improves the reliability of the system. The fast fault location model combines advanced diagnostic algorithms to accurately locate the cause of the fault in a short time and automatically execute the recovery strategy, reducing system downtime and improving the efficiency of fault recovery. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 This is a schematic diagram of the overall architecture of a distributed IO bus expansion system of the present invention;
[0068] Figure 2 It is a schematic diagram of the principle of the rapid fault location model of the present invention;
[0069] Figure 3 A schematic diagram of the working method of the dynamic module registration and priority adjustment algorithm of the present invention;
[0070] Figure 4 It is a schematic diagram of the principle of the state machine model of the present invention;
[0071] Figure 5 A working step diagram of the rapid fault location model of the present invention;
[0072] Figure 6 It is a schematic diagram of the principle of the fault location model framework of the present invention;
[0073] Figure 7 It is a schematic diagram of the implementation process of the state machine model of the present invention. DETAILED DESCRIPTION
[0074] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0075] In the above embodiment, if Figure 1-Figure 7 As shown: a distributed IO bus expansion system, the expansion management unit includes an integrated signal I / O module, a communication management module, a fault detection and recovery module and a cloud management module;
[0076] The main control module is used to manage the module registration, parameter configuration and data scheduling of the extended management unit; the main control module optimizes the module registration process through a dynamic module registration and priority adjustment algorithm, and dynamically adjusts the communication priority on the CAN bus; the dynamic module registration and priority adjustment algorithm realizes the automatic management of the module registration process through a state machine model, and realizes data communication and transmission through the CAN bus communication protocol CAN2.0B;
[0077] The integrated signal I / O module is used to collect digital and analog signals in real time and send the collected signals to the communication management module; the integrated signal I / O module optimizes network bandwidth usage and response time through adaptive data reporting and compression algorithms; the integrated signal I / O module includes a digital I / O unit and an analog I / O unit;
[0078] The communication management module is used to encapsulate the signal sent by the integrated signal I / O module and upload it to the main control module, and receive the communication priority adjustment instruction of the main control module; the communication management module ensures data integrity and correctness through data packet encapsulation and decapsulation methods, and enhances the reliability of data transmission through error detection and correction mechanisms;
[0079] The fault detection and recovery module is used to monitor the faults of the main control unit and the extended management unit in real time and respond and recover in real time; the fault detection and recovery module monitors the module status in real time through periodic status check and timeout retransmission mechanism, locates the cause of the fault through a fast fault location model and executes a recovery strategy;
[0080] The cloud management module is used to remotely configure and update the distributed IO bus expansion system. The cloud management module performs cross-network configuration updates through a remote configuration protocol and ensures configuration consistency and traceability through a version control mechanism.
[0081] In a specific embodiment, the I / O module continuously monitors and collects signal changes at the input port, whether it is an analog signal or a logic signal from a sensor. The collected signals are uploaded to the main control module via the CAN bus, which manages the data flow according to the preset configuration and priority, and determines the direction of the data flow, including whether further processing or direct output is required. In this process, the communication management module ensures the reliable transmission of data on the CAN bus and performs data packet encapsulation and verification. The fault detection and recovery module continuously monitors the system status and takes recovery measures immediately once a fault is found to ensure stable operation of the system. The cloud management module adjusts system parameters according to remote instructions to ensure system adaptability and upgrade requirements. It also displays real-time data and provides a control interface to complete the closed loop of signal processing. Users issue instructions to the system through the interface, or view real-time data. At this point, the entire signal processing process reaches the final user interaction link, forming a complete working closed loop;
[0082] Specifically, the output end of the main control module is connected to the input end of the integrated signal I / O module, which is responsible for issuing control instructions to the I / O module, starting or stopping the signal collection and output tasks, and also transmitting configuration information to adapt to different signal processing requirements. The integrated signal I / O module encodes the collected digital and analog signals through the communication management module according to the preset protocol (such as CAN2.0B), prepares to transmit them to the network, and receives instructions from the communication management module to adjust the I / O operation. The output end of the communication management module is connected to the input end of the fault detection and recovery module to transmit communication status information, including data packet errors, packet loss rate, etc., so that the fault detection and recovery module can monitor the network health in real time and automatically execute recovery measures when an abnormality is detected, such as retransmitting packets and switching communication paths. The output end of the fault detection and recovery module is connected to the fault reporting end of the main control module to feedback fault events and recovery operation results, so that the main control module can record logs and intervene manually or adjust system strategies when necessary. The cloud management module allows operators to input configuration instructions through the user interface. After these configuration information are processed by the cloud management module, they are output to the configuration interface of the main control module for global setting adjustment. On the other hand, they synchronize configuration information to other devices in the network directly or indirectly through the configuration port of the communication management module to ensure system consistency. It also provides an intuitive graphical or command line interface to receive user modification instructions for system configuration, such as parameter adjustment of I / O modules, communication protocol settings, etc., to achieve human-computer interaction. The overall workflow is as follows: after the system is powered on, the main control module starts first, and uses the state machine model to automatically identify and initialize all predetermined sub-modules in the system, adding them to the system architecture to ensure that they can communicate with each other and work together; the registration process includes but is not limited to assigning a unique address, setting initial parameters, establishing a communication link, and verifying functional integrity; the integrated signal I / O module starts to collect external digital and analog signals in real time, and optimizes data processing through adaptive data reporting and compression algorithms. The collected signals are encapsulated by the communication management module, and the CAN2.0B protocol is used to ensure data integrity and correctness, and then uploaded to the main control module. After receiving the data, the main control module analyzes and processes it according to the configuration, dynamically adjusts the communication priority on the CAN bus when necessary, and makes corresponding control decisions. The decision instructions of the main control module are returned to the integrated signal I / O module through the CAN bus and the communication management module to perform corresponding control actions, such as outputting control signals. The fault detection and recovery module and the cloud management module work continuously. The former monitors the system status, detects and handles faults in a timely manner, and the latter adjusts system parameters according to remote instructions to ensure long-term stable operation of the system.
[0083] In the above embodiment, the state machine model manages the module registration status through state transition logic and event triggering mechanism; the state machine model includes a registration management module, an event processing module, a state transition module and a communication coordination module; the registration management module maintains the module registration information and status through a registration information storage unit and a registration status verification unit, and the registration information storage unit stores and manages the module registration information through a database management method; the registration status verification unit verifies the module registration status through a status verification and data synchronization method; the event processing module monitors module registration requests and other system events in real time through an event-driven programming mechanism, and triggers corresponding state transitions or data transmission through a mapping table and a priority scheduling method; the event-driven programming mechanism is defined through a callback function Event response behavior, and manages the reception and processing order of events through an event queue; the state transition module includes a state transition logic unit and a state transition trigger unit; the state transition logic unit defines and manages the transition rules between states through a finite state automaton; the state transition trigger unit detects whether the conditions for state transition are met through a conditional judgment mechanism, and triggers the state transition when met; the finite state automaton defines the transition relationship between states through a state table, and determines the next state according to the current state and input events through a transition function; the communication coordination module encapsulates the data exchange between modules into a format suitable for network transmission through format definition and encoding and decoding, and realizes reliable data transmission through the frame structure and error detection mechanism of the CAN2.0B protocol.
[0084] In a specific embodiment, the state machine model is based on the concept of finite state machine (FSM), and manages the registration and communication process of the modules by defining a series of states and transition rules between these states. Each state represents the specific operation of the system at a certain moment, and the state transition is triggered by a specific event.
[0085] In the distributed IO bus expansion system, the state machine model maintains the module registration information through the registration management module, including the module's identification, type, version, etc. It is also responsible for processing the module's registration request and deregistration request. The event processing module listens to and responds to external events, such as module joining, exiting, communication requests, etc. It converts these events into internal events that the state machine can understand. According to the current state and the received events, the state transition module determines the next state. It contains a series of transition rules that define under what conditions to transition from the current state to another state. The communication coordination module coordinates the communication between modules during the state transition process to ensure the correct transmission and reception of data. The specific implementation process is: when the system starts, the state machine is initialized to a specific starting state, and the registration management module clears all registration information. Then, the module sends a registration request, the event processing module receives the request and triggers the state transition, and the state transition module updates the system state to "module registration" according to the rules. The state transition module checks the validity of the registration request, such as whether the module identification is unique, whether the module type is supported, etc. If the registration request is valid, the registration management module updates the registration information and converts the system state to "module registered". The communication coordination module coordinates the communication between modules based on the registration information to ensure the correct transmission of data. During the operation of the system, the event processing module continuously monitors events and triggers corresponding state transitions. Finally, the system continuously monitors the current state to ensure that all modules are operating normally and respond to any abnormal events.
[0086] In the specific implementation, the state machine model realizes the automation of the module registration process, reduces manual intervention, and improves the reliability and efficiency of the system.
[0087] In the above embodiment, the working method of the dynamic module registration and priority adjustment algorithm is:
[0088] Step 1: Calculate module registration score: Calculate a comprehensive score for each module through the module registration score function to evaluate the module's demand for system resources and its impact on performance; the formula expression of the module registration score function is:
[0089]
[0090] In formula (1), X reg represents the module registration score, which is a comprehensive indicator reflecting the module's impact on system resource requirements and performance. K represents the capacity requirement of module i, which is used to measure the module's occupation of system resources. n represents the number of parameter types considered. τ represents the data requirement of module i, which is used to measure the module's demand for data transmission and storage. P represents the performance index of module i, which includes response time, processing speed, throughput, resource utilization and fault tolerance. i , b i and ci They represent the adjustment coefficients of capacity, performance, and data requirements, respectively; d represents the weight coefficient, which is used to measure the importance of different parameters;
[0091] Step 2: Dynamic priority initialization: According to the module's registration score and system status, the module's initial communication priority is dynamically calculated through a priority initialization function; the system status includes system load, response time, throughput and network delay; the formula expression of the priority initialization function is:
[0092]
[0093] In formula (2), P init Indicates the initial priority; X reg represents the module registration score; β represents the system stability adjustment coefficient; α1 represents the system bus load; α2 represents the system error rate;
[0094] Step 3: Dynamically adjust the priority; adjust the communication priority of the module in real time through the priority dynamic adjustment function, responding to changes in system load and module performance; the formula expression of the priority dynamic adjustment function is:
[0095]
[0096] In formula (3), P dyn Indicates the priority after dynamic adjustment; s i Indicates the change in system load, which is used to measure the change in system resource requirements; β i represents the change in module performance; σ and ρ represent the load adjustment coefficient and performance adjustment coefficient, respectively, which are used to control the impact of load and performance changes on priority adjustment; P init Indicates the initial priority;
[0097] Step 4: Communication scheduling and priority optimization: According to the dynamic priority of the module, the urgency of the task and the number of modules in the system, the priorities between different modules are balanced through the communication scheduling optimization function; the formula expression of the communication scheduling optimization function is:
[0098]
[0099] In formula (4), S sched is the scheduling score, i.e., the communication priority of the module in the current scheduling cycle; Y represents the task urgency coefficient; M represents the number of modules; P dyn Indicates dynamic priority;
[0100] Step 5: Feedback correction and adaptive learning: Based on historical scheduling data and system performance feedback, the coefficients σ and ρ in step 3 are automatically adjusted through the reinforcement learning algorithm, and the adjusted coefficients are applied to the priority dynamic adjustment function for real-time monitoring. If the performance improves, the current coefficients are retained; if the performance does not improve or decreases, the learning process is re-entered to further adjust the coefficients.
[0101] In a specific embodiment, the main control module uses a state machine model to manage the registration status of the module and automatically processes the joining, running and deregistration of the module. The algorithm regularly evaluates the performance indicators of each module, such as response time, processing speed, etc. Based on the module performance and system status, the algorithm calculates and assigns the communication priority of each module. When the module communication conflicts, the conflict is quickly resolved according to the priority to ensure the communication needs of the high-priority module. The specific implementation process is: when the system starts, the main control module initializes the state machine model and the CAN communication protocol. When the module tries to join the system, the main control module processes it through a dynamic registration mechanism. The algorithm continuously monitors the module performance and system status and collects necessary data. According to the monitoring results, the algorithm dynamically calculates and assigns the communication priority of the module. Then, the main control module performs communication scheduling according to the priority of the module to ensure the orderliness of data transmission. During the operation of the system, the algorithm continuously adjusts the registration status and communication priority of the module to adapt to changes in the system.
[0102] In the specific implementation, the dynamic registration mechanism reduces unnecessary module registration and improves the operating efficiency of the system. Priority adjustment ensures that key modules can obtain sufficient communication resources. In addition, the fast conflict resolution mechanism ensures the rapid response of high-priority tasks. Through priority adjustment, the timely transmission of key data is ensured and the reliability of the system is improved. Specifically, Experiment 1 is designed to verify the effectiveness of the algorithm under different system loads and module performance indicators, and evaluate its impact on communication efficiency and system responsiveness. The experimental hardware environment includes multiple sensors, actuators and controller modules. The software environment includes a state machine model, a CAN2.0B communication protocol stack, and a dynamic module registration and priority adjustment algorithm. The network environment is a CAN bus-based network architecture for data communication and transmission between modules. It also includes a performance monitoring tool for collecting data such as CPU load, memory usage, and network bandwidth. The experiment uses a quantitative analysis method to record the operation process and results of the dynamic module registration and priority adjustment algorithm by simulating different system loads and module performance indicators. The experimental data record table is shown in Table 1:
[0103] Table 1 Algorithm experimental test data table
[0104]
[0105] Experiments show that the dynamic module registration and priority adjustment algorithm effectively allocates communication priorities, reduces the number of communication conflicts, and reduces data transmission delays by real-time monitoring of module performance and system load.
[0106] Another experiment 2 is designed to verify the superiority of the dynamic module registration and priority adjustment algorithm over the traditional static priority algorithm in the distributed IO bus expansion system. The test indicators include: Average communication delay (ms): the average time from sending to receiving a data packet. Packet loss rate (%): the proportion of data packets that failed to be successfully transmitted to the total data packets. System response time (ms): the time from the module sending a registration request to the system completing the registration and starting normal communication. Module registration success rate (%): the proportion of successfully registered modules to the total number of attempted registrations. Maximum system throughput (Mb / s): the maximum data processing speed of the system without packet loss. Network congestion handling capability: the ability to maintain normal communication under high load conditions. Module compatibility: the adaptability and plug-and-play when new modules are added to the system. System stability: the failure rate of the system under long-term operation. The specific experimental data are shown in Table 2:
[0107] Table 2 Experimental test data comparison table
[0108]
[0109] From the above comparison data, it can be seen that the dynamic module registration and priority adjustment algorithm has shown obvious advantages in all key indicators, especially in improving system response speed, reducing data packet loss rate, increasing maximum throughput, and enhancing network congestion handling capabilities. In addition, the algorithm significantly improves module compatibility and system stability and reduces maintenance costs. In summary, the dynamic algorithm has brought significant performance improvement and reliability enhancement to the distributed IO bus expansion system.
[0110] In the above embodiment, the fast fault location model includes a perception layer, a preprocessing layer, a fault feature extraction layer, an intelligent diagnosis layer, a decision layer, an execution layer and an optimization layer. The operation of the fast fault location model includes the following steps:
[0111] Step 1: Data input and collection: The perception layer monitors and collects the status information and performance indicators of each module in real time; the perception layer realizes the real-time collection of sensor data through the embedded system and realizes the efficient transmission of data through the field bus protocol; the status information and performance indicators include the module's voltage, current, temperature, response time, communication status and firmware version;
[0112] Step 2: Data preprocessing and standardization: the raw data is cleaned, denoised and standardized through the preprocessing layer; the preprocessing layer processes the collected data through digital signal processing and data encoding;
[0113] Step 3: Fault feature extraction: extract key fault features from the preprocessed data through a fault feature extraction layer; the fault feature extraction layer realizes effective identification of fault features by strengthening principal component analysis PCA and machine learning classifier; the strengthened principal component analysis PCA enhances the recognition effect of outliers by introducing regularization terms and iterative optimization strategies; the machine learning classifier improves classification accuracy and system generalization ability by stacking generalization method;
[0114] Step 4: Intelligent fault diagnosis: The intelligent diagnosis layer conducts in-depth analysis on the extracted fault features to identify the fault type and location; the intelligent diagnosis layer realizes intelligent identification and classification of faults through convolutional neural networks and fault diagnosis rule bases; the fault diagnosis rule bases are dynamically updated and evolved according to new fault cases and feedback through online learning methods;
[0115] Step 5: Recovery strategy formulation: According to the diagnosis results, a fault recovery strategy is formulated through the decision layer; the decision layer implements personalized and adaptive recovery strategy formulation through the expert system and decision tree algorithm; in the process of node splitting of the decision tree, the decision tree algorithm dynamically adjusts the threshold of decision tree splitting through fuzzy logic to enhance the interpretability of the decision tree;
[0116] Step 6: Fault recovery execution: execute the fault recovery strategy through the execution layer and monitor the recovery process in real time;
[0117] Step 7: Feedback and continuous learning: feedback information of fault handling is collected through the optimization layer and used to continuously optimize the fault location model; the optimization layer realizes continuous improvement and adaptability enhancement of the fault location algorithm through a feedback loop mechanism and an incremental learning algorithm.
[0118] In a specific embodiment, the fast fault detection and recovery module plays a vital role. It not only needs to monitor the operating status of the system in real time, but also needs to respond and take measures to recover module failures in the first time to ensure the continuous stable operation and efficiency of the system. Specifically, the fast fault location model is implemented as follows:
[0119] In this system, the fast fault location model first collects the operating status information from each module in real time through the embedded system of the perception layer, including key performance indicators such as voltage fluctuation, current change, temperature fluctuation, communication delay and firmware version status. These data are efficiently transmitted to the central processing through the fieldbus protocol. Then, the pre-processing layer performs fine processing on the original data, including filtering out noise, filling in missing values, standardization, etc., to ensure data quality and improve data accuracy and availability through digital signal processing technology.
[0120] Subsequently, the fault feature extraction layer uses PCA (principal component analysis) and advanced machine learning algorithms. By introducing regularization terms and iterative strategy optimization, it not only strengthens the ability to identify abnormal data, but also improves the recognition accuracy of fault features through machine learning classifiers, especially the superposition generalization method, making the fault mode more significant and laying the foundation for subsequent diagnosis. In the intelligent diagnosis stage, with the help of deep learning technologies such as convolutional neural networks, combined with the continuously updated fault diagnosis rule base, the extracted features are deeply analyzed to quickly identify the fault type and specific location. The rule base continuously absorbs new cases through online learning mechanisms, self-evolves, and improves the accuracy and coverage of diagnosis. On this basis, the decision layer uses expert systems and decision tree algorithms, combined with fuzzy logic dynamic adjustment, to customize recovery strategies for each fault to ensure the pertinence and effectiveness of the recovery process. The dynamic threshold adjustment of the decision tree algorithm enhances the flexibility and pertinence of strategy formulation and improves the rationality of decision-making. The execution layer responds quickly to decision instructions, executes recovery operations, and monitors the recovery process in real time to ensure the smooth progress of the recovery process. Finally, the optimization layer collects recovery feedback information and continuously iterates and optimizes the model through feedback loops and incremental learning algorithms, making fault location more accurate and more adaptable, thereby improving the system's self-healing capabilities.
[0121] In the distributed IO bus expansion system, the specific working method is as follows: when the system starts, the fault detection and recovery module is initialized, and the monitoring parameters and recovery strategies are configured. Then, the periodic status check and timeout retransmission mechanism are started, and real-time monitoring begins. If no abnormality is detected, the periodic check continues; when an abnormality is detected, the fast fault location model is triggered. The model begins to analyze the abnormal data to determine the type and location of the fault. Then, based on the analysis results, the recovery strategy is automatically executed, such as restart or switch. Then, the system status is updated to ensure that all modules are operating normally. Finally, the fault and recovery process are recorded for future analysis and optimization.
[0122] Specifically, an experiment was designed to evaluate and compare the application effects of the fast fault location model and the traditional fault model in the distributed IO bus expansion system. The experiment adopted the control variable method to ensure that other experimental conditions remained consistent except for the different fault location models. Each group of experiments simulated the same type of faults and recorded indicators: Fault detection time: the time from the occurrence of the fault to the system detecting the fault. Fault identification accuracy: the accuracy of the system in identifying the type and location of the fault. Fault recovery time: the time from fault detection to the system resuming normal operation. System stability: a comprehensive evaluation through indicators such as system operation interruption time and error rate. The experimental data recorded data is shown in Table 3:
[0123] Table 3 Comparison of experimental data between fast fault location model and traditional model
[0124]
[0125] Through the comparison of the above experimental test data, it can be clearly seen that the fast fault location model is superior to the traditional model in terms of fault detection time, fault identification accuracy, recovery time and system stability.
[0126] In the above embodiment, the working method of the adaptive data reporting and compression algorithm is:
[0127] 501. Signal trend prediction is performed through a Kalman filter to achieve intelligent adjustment of data reporting frequency; the formula for updating the Kalman filter is expressed as:
[0128]
[0129] In formula (5), F k|k is the optimal estimate of the current state, indicating that at the kth moment, according to the observed data y k Updated state estimate; F k|k-1 is the predicted value of the previous state, indicating the state predicted based on the previous state and the system model at the kth moment; y k is the observation data at the kth moment, which is used to represent the actual measurement value; H is the observation model matrix, which is used to describe the statistical characteristics of the measurement error; K k is the Kalman gain, which is used to measure the observed data y k the degree of revision of the state estimate;
[0130] 502. Dynamically adjust the coding strategy according to the signal characteristics through a variational coding algorithm based on a self-attention mechanism; the formula expression of the variational coding algorithm based on the self-attention mechanism is:
[0131]
[0132] In formula (6), μ is the activation function; q is the weight matrix; W v is the probability of signal v appearing; Attention(Q,K,V) is the attention mechanism, and the attention weight is calculated by querying the Q, key K, value V matrix; Formula (6) allows the algorithm to dynamically adjust the compression ratio and encoding parameters according to the importance of the signal; For digital signals, the variational coding algorithm based on the self-attention mechanism compresses through Huffman coding, and the Huffman coding optimizes the coding table through frequency statistics to assign short code words to frequently occurring signals; For analog signals; The variational coding algorithm based on the self-attention mechanism separates the details and trends of the signal through wavelet transform and removes high-frequency redundant information;
[0133] 503. Ensure continuous adjustment and optimization of data reporting and compression strategies through comprehensive optimization strategies and feedback control mechanisms; the comprehensive optimization strategies process nonlinear relationships through intelligent decision functions; the intelligent decision functions map reporting frequency T, compression ratio L, and system response time B to control decisions through fuzzy logic controllers, and make comprehensive decisions through deep reinforcement learning strategies; the formula expression of the intelligent decision function is:
[0134]
[0135] In formula (7), B is the system response time; L is the compression ratio; T is the reporting frequency; a is the adjustment coefficient of the fuzzy output; b is the basic reward; and u is the network load, which is used to measure the usage of network resources.
[0136] In a specific embodiment, through the Kalman filter, the algorithm can predict the trend of the signal and intelligently adjust the frequency of data reporting. When the signal changes smoothly, the reporting frequency is reduced to save bandwidth; when a significant change is detected, the reporting frequency is increased to ensure timely response to the system status. Through the self-attention mechanism, the algorithm can identify the important parts of the signal and give different coding weights. For digital signals, Huffman coding is used to optimize the coding table according to the frequency, and short codes are assigned to frequent signals to reduce the amount of transmitted data; for analog signals, wavelet transform separates the details and trends of the signal, removes high-frequency redundant information, and further compresses the data. The intelligent decision function provides a flexible and intelligent decision-making mechanism through the combination of fuzzy logic controller and deep reinforcement learning, which can dynamically adjust the strategy according to the real-time status of the system to achieve the optimal balance between resource utilization and response speed. This comprehensive optimization strategy enables the system to maintain efficient and stable operation under different working conditions, and improves the adaptability and efficiency of the entire distributed IO system. The core of the adaptive data reporting and compression algorithm lies in the intelligent identification and processing of real-time data collected by the integrated signal I / O module, and reduces network bandwidth consumption and optimizes response time by dynamically adjusting the data reporting frequency, selectively reporting important data, and adopting efficient compression technology. The algorithm consists of the following steps:
[0137] Data importance assessment: The algorithm first analyzes the change rate and threshold of the input signal. Data that changes slowly or is below the set threshold is not reported frequently, while data that changes dramatically or exceeds the threshold is reported first to ensure the timely delivery of key information.
[0138] Dynamic frequency adjustment: Dynamically adjust the data reporting frequency according to the historical change pattern of the signal and the real-time network status. For example, reduce the reporting frequency during the signal stability period to save bandwidth, and increase the frequency during the active change period to ensure the real-time nature of the data.
[0139] Data compression technology: Apply efficient compression algorithms, such as Huffman coding, differential coding or predictive coding, to the data to be reported, to reduce the data volume without losing key information. Especially for analog signals, the continuity of the signal can be used to transmit only the increment or difference value.
[0140] Feedback and adaptive adjustment: The algorithm continuously optimizes the reporting strategy and compression parameters according to network feedback (such as packet loss rate, delay, etc.) to achieve self-optimization. The specific implementation process is: First, set the initial data reporting frequency, compression algorithm parameters, and importance threshold. Monitor the I / O signal in real time, evaluate the importance of the data through the algorithm and perform preprocessing. Next, dynamically adjust the reporting frequency according to the signal characteristics and network status, and perform compression processing on the data. Then, report the compressed data to the main control module through the CAN bus, and collect network feedback information. Finally, adjust the algorithm parameters based on the feedback information, and continuously optimize the data processing and transmission strategy. In the specific implementation, design experimental tests to verify the effect of the algorithm. The test plan is as follows:
[0141] First, the system was benchmarked using the traditional fixed reporting frequency and no compression algorithm, and various performance indicators were recorded. Then, the adaptive data reporting and compression algorithm was deployed to the I / O module, and reasonable initial parameters were set. Under various simulated working conditions (such as signal stability period, active period, and network congestion state), the frequency, delay, packet loss rate, and resource usage of data reporting were collected. The data records are shown in Table 4:
[0142] Table 4 Algorithm effect comparison table
[0143] Test indicators Traditional fixed reporting algorithm Adaptive data reporting and compression algorithm Average network bandwidth usage (kbps) 450 280 Data reporting delay (ms) 22 15 Data packet loss rate (%) 3.5 1.2 Timely reporting rate of key signals (%) 92 98.5 System resource saving rate (CPU / memory usage) - About 20%
[0144] It can be seen that the adaptive algorithm significantly reduces bandwidth usage through dynamic adjustment and data compression. In addition, the optimized data processing process shortens the time from data collection to reporting. Secondly, adaptive adjustment improves the stability of network transmission and reduces data loss. In addition, the algorithm ensures the priority transmission of key data and improves the timeliness of information. Although it is not a direct measurement indicator, it shows the indirect benefit of the adaptive algorithm in reducing the system burden. Write out the formula and derivation, function and effect
[0145] In specific implementation, the algorithm significantly reduces network bandwidth usage and improves the overall communication efficiency of the system. It reduces response time and ensures real-time transmission of key data. It enhances system stability and reduces network congestion and packet loss through adaptive adjustment. It optimizes resource utilization so that limited network resources can serve more or more important data transmission needs.
[0146] In the above embodiment, the data packet encapsulation and decapsulation method ensures the consistency of data encapsulation and parsing through a custom data structure and a serialization / deserialization mechanism; the custom data structure creates a data model through class definition and structure definition, and improves data access efficiency and storage efficiency through memory alignment and packaging methods; the serialization / deserialization mechanism converts complex data types in the custom data structure into binary format through data encoding; the error detection and correction mechanism ensures the accuracy and fault tolerance of data transmission through cyclic redundancy check and forward error correction methods.
[0147] In a specific embodiment, the communication management module implements data encapsulation, transmission, parsing and error handling in a distributed IO bus expansion system through a series of technical essences. First, the module ensures the consistency of data encapsulation and parsing through custom data structures and serialization / deserialization mechanisms. Custom data structures use data abstraction technology essences to create data models through class definitions and structure definitions. These models define data fields and their relationships, and improve data access efficiency and storage efficiency through memory layout optimization technology essences, such as memory alignment and packaging. At the same time, the data encapsulation technology essence ensures the security and encapsulation of data, so that data can only be accessed and modified through predefined interfaces.
[0148] Secondly, the serialization / deserialization mechanism converts the complex data types in the custom data structure into the binary format required for network transmission through data encoding technology, ensuring the compatibility of data between different platforms. Type conversion technology essentially ensures the accuracy and consistency of data types during the serialization process, while byte order processing technology essentially solves the problem of data exchange between different hardware architectures. In addition, the serialization protocol definition technology essentially provides standardization for the serialization format and rules of data, and the compression algorithm technology essentially compresses the data before serialization to reduce the size of the transmitted data and improve transmission efficiency.
[0149] In the data transmission stage, the communication management module actually realizes the sending and receiving of data frames through network interface programming technology, and interacts with the physical network medium using socket programming or hardware interface drivers. The network data capture technology actually realizes the instant capture and processing of incoming data frames through interrupt service routines and buffer reading.
[0150] In order to ensure the reliability of data transmission, the communication management module adopts an error detection and correction mechanism. Cyclic redundancy check (CRC) as the technical essence of error detection algorithm provides an effective error detection method for data packets, while forward error correction (FEC) method as the technical essence of error correction allows the receiving end to correct errors under certain conditions, thus enhancing the fault tolerance of data transmission.
[0151] Finally, the communication management module splits the received data frame into the protocol header and the payload through the frame parsing technology, uses the protocol analysis technology to understand the structure of the data frame, and restores the parsed data to the original data object through the object deserialization technology, completing the encapsulation and unpacking process of the entire data packet. Through the comprehensive application of these technical essences, the communication management module ensures the efficient, secure and reliable transmission of data in the distributed system.
[0152] In the above embodiment, the digital I / O unit reports data through an event-driven reporting mechanism; the event-driven reporting mechanism reports data when the input state changes through state monitoring logic and conditional triggers, thereby reducing the communication load; the analog I / O unit dynamically adjusts the sampling frequency through signal change detection and frequency adjustment strategy, and reduces the analog signal data transmission volume through differential encoding and quantization step adjustment methods.
[0153] In a specific embodiment, in a distributed IO bus expansion system, the digital I / O unit is responsible for collecting digital signals, such as switch status, binary output of sensors, etc. The event-driven reporting mechanism allows the unit to report data only when a change in input status is detected, rather than continuously sending data. The working method of the digital I / O unit is: first, continuously monitor the status of the input port. When the input status changes and meets the preset conditions, a reporting event is triggered. Finally, the changed status is reported to the system as event data. The specific implementation process is:
[0154] Initialization monitoring: The digital I / O unit starts and begins monitoring the input status.
[0155] State change detection: After a state change is detected, an event is triggered.
[0156] Data encapsulation: Encapsulate the changing status information into data packets.
[0157] Data transmission: Send data packets to the main control module or data processing unit through the bus.
[0158] In the specific implementation, because data is reported only when the state changes, unnecessary communication is reduced and the network load is reduced. In addition, the event-driven mechanism enables the system to respond quickly to state changes.
[0159] The analog I / O unit is responsible for collecting analog signals, such as continuously changing signals such as temperature and pressure. The unit dynamically adjusts the sampling frequency through signal change detection and frequency adjustment strategy, and reduces the amount of data transmission through differential encoding and quantization step adjustment method. In a specific embodiment, the working method of the analog I / O unit is: first monitor the changes in the analog signal and evaluate whether the sampling frequency needs to be adjusted. Then, dynamically adjust the sampling frequency according to the size and speed of the signal change. Then, differentially encode the continuously sampled data to reduce the amount of data change. Finally, adjust the quantization step according to the accuracy requirements of the signal. The specific implementation process is:
[0160] Initialization settings: The analog I / O unit sets the initial sampling frequency and quantization step size.
[0161] Continuous monitoring: monitor analog signals in real time and perform sampling.
[0162] Change Assessment: Evaluate signal changes to determine if the sampling strategy needs to be adjusted.
[0163] Data encoding: Differential encoding and quantization of sampled data.
[0164] Data transmission: The encoded data is transmitted through the bus.
[0165] In the specific implementation, the analog I / O unit dynamically adjusts the sampling frequency according to the signal changes, balancing the real-time performance and transmission efficiency of the data. In addition, differential coding and quantization step adjustment reduce the amount of data transmission and reduce bandwidth requirements. Through quantization step adjustment, the accuracy of data transmission is ensured to meet application requirements. Secondly, it can adapt to different signal characteristics and changes, improving the adaptability and flexibility of the system.
[0166] In the above embodiment, the cloud management module includes a remote configuration unit, a version control unit, a communication coordination unit and a security verification unit; the remote configuration unit parses and identifies the configuration parameters through the JSON data format, and issues and applies the parameter settings through the remote procedure call method; the version control unit records the current configuration version through a timestamp, and updates the changed part through a differential update algorithm; the communication coordination unit performs communication scheduling and data transmission through the transmission control protocol TCP and the file transfer protocol SFTP; the security verification unit authenticates the remote user or system that initiates the configuration update through a public key infrastructure.
[0167] In a specific embodiment, the remote configuration unit of the cloud management module is responsible for processing configuration requests from remote users, parsing configuration parameters, and passing these parameters to the corresponding modules in the system. The version control unit uses a version control system to track the change history of the configuration to ensure that each configuration update can be recorded and traced back. The communication coordination unit manages data communication during the configuration update process to ensure that the transmission of configuration data in the network is orderly and reliable. The remote configuration request is authenticated and authorized by the security verification unit to ensure that only legitimate users can modify the system configuration.
[0168] The specific working method is: receive configuration update requests from users or automation systems through the remote configuration unit. Next, parse the parameters in the request through the remote configuration unit to verify the correctness of its format and range. Third, the version control unit creates a new version record for the new configuration and associates it with the old version. Fourth, the security verification unit authenticates and authorizes the request to ensure the legitimacy of the operation. Fifth, the communication coordination unit is responsible for data transmission during the configuration update process to ensure the correct sending and receiving of data packets. Sixth, apply the verified and authorized configuration parameters to the target module, and notify the module to perform necessary restarts or status updates. Finally, the configuration update operation is recorded by the version control unit, the security verification unit records the access log, the communication coordination unit confirms the completion of the update operation, and feeds back the results to the user. The specific implementation process steps are as follows:
[0169] System initialization: The cloud management module starts with the system, initializes each unit, and loads the current configuration status.
[0170] Remote request reception: The remote configuration unit listens for and receives remote configuration requests.
[0171] Parameter parsing and validation: The remote configuration unit parses the request parameters and performs syntax and semantic validation.
[0172] Authentication: The security verification unit authenticates the received request.
[0173] Version Control: A version control unit creates new configuration versions and records changes.
[0174] Data transmission: The communication coordination unit is responsible for transmitting the configuration data to the target module safely and reliably.
[0175] Configuration update: The target module receives new configuration parameters and updates them.
[0176] State synchronization: After the module updates its configuration, it synchronizes state information to ensure that other parts of the system are aware of the changes.
[0177] Logging feedback: All changes are logged and users receive feedback that the configuration was updated successfully.
[0178] In specific implementation, the remote configuration capability allows the system to update parameters without stopping, which improves the flexibility of operation. Through the security verification unit, it is ensured that only authorized users can change the configuration, which enhances the security of the system. In addition, the version control unit ensures the consistency of the configuration and avoids configuration confusion or errors.
[0179] In the above embodiment, a distributed IO bus expansion device includes:
[0180] A central processing unit, wherein the central processing unit uses a microcontroller to perform system management and coordination tasks, process module identification, data synchronization and communication scheduling; the central processing unit is connected to the input / output processing module, the data exchange protocol unit, the system monitoring and maintenance unit, the interactive operation interface and the power supply and signal conditioning unit through an internal bus, and is connected to the remote configuration interface through an external communication interface;
[0181] The input / output processing module includes a digital input / output interface, an analog input / output interface and a signal conditioning circuit; the digital input / output interface is electrically isolated by a photoelectric isolator, and the signal is shaped by a Schmitt trigger; the analog input / output interface converts the signal by an analog-to-digital converter and a digital-to-analog converter; the signal conditioning circuit processes the input signal by an amplifier and a filter; and provides a voltage reference for the analog-to-digital converter and the digital-to-analog converter by a reference voltage source;
[0182] The data exchange protocol unit manages the encapsulation, transmission and decoding of data frames through the CAN controller, CAN transceiver and protocol stack;
[0183] The system monitoring and maintenance unit monitors the system status in real time through the monitoring circuit and fault diagnosis logic, and performs fault detection, alarm and automatic recovery; the monitoring circuit includes a watchdog timer and a status monitoring sensor;
[0184] The remote configuration interface allows users to remotely modify module configuration and system parameters through the network through the Ethernet PHY chip and the security protocol TLS / SSL;
[0185] The interactive operation interface communicates with the remote configuration interface via a wireless communication network;
[0186] The power supply provides a stable power supply to the system through a power regulator.
[0187] In a specific embodiment, the distributed IO bus expansion device is based on a modular and hierarchical design concept, using a microcontroller as a central processing unit to perform core tasks. The device is connected to multiple key modules through an internal bus to achieve high-speed data processing and communication. At the same time, the connection with the remote configuration interface is achieved through an external communication interface, allowing remote management and control. In a specific implementation, the working method of the distributed IO bus expansion device is:
[0188] m1. System initialization: After the device is powered on, the microcontroller initializes the system and configures the internal bus and external communication interface.
[0189] m2. Module identification and registration: The central processing unit identifies the connected input / output modules and registers them into the system.
[0190] m3. Signal acquisition and conditioning: The input / output processing module acquires signals, the digital interface performs photoelectric isolation and signal shaping, and the analog interface performs signal conditioning and conversion.
[0191] m4. Data encapsulation and transmission: The data exchange protocol unit encapsulates the processed data into frames and transmits them through the CAN bus.
[0192] m5. Remote management and user interaction: Users configure and monitor the system through the remote configuration interface or interactive operation interface.
[0193] m6. System monitoring and fault handling: The system monitoring and maintenance unit monitors the system status in real time and triggers fault diagnosis logic and recovery measures when an abnormality is found.
[0194] In the specific implementation, the anti-interference ability of the system and the stability of the signal are enhanced through electrical isolation and signal conditioning technology. The efficient processing capability of the microcontroller and the reliable data transmission of the CAN bus improve the speed and accuracy of data processing. At the same time, the use of remote configuration interface and wireless communication network makes system configuration and monitoring more flexible and convenient. Secondly, the real-time monitoring and automatic fault recovery functions of the system monitoring and maintenance unit reduce system downtime and improve maintenance efficiency. In addition, the use of photoelectric isolation and security protocol TLS / SSL enhances the security of the system and prevents potential network attacks. At the same time, the intelligent design of the device allows the automatic execution of multiple tasks, reduces manual intervention, and improves the automation level of the entire system.
[0195] In the above embodiment, a distributed IO bus expansion device also includes: a bus arbitration mechanism, which is integrated in the CAN bus, and manages the data transmission between the central processing unit and the IO processing module through a conflict detection circuit and an arbitration logic; the conflict detection circuit detects the signal state on the bus through a comparator logic, and when it is detected that two or more IO processing modules are trying to transmit data at the same time, the conflict detection circuit generates a conflict signal through a trigger; the arbitration logic determines the data transmission priority through a priority encoder, and manages the timing of data transmission through a timing control logic; the timing control logic tracks the timing of data transmission through a synchronization counter, and manages the module request status, authorization status and data transmission status through a state machine.
[0196] In a specific embodiment, when two or more IO processing modules attempt to transmit data at the same time, the conflict detection circuit detects the signal state on the bus through the comparator logic, thereby identifying the bus conflict. Once a conflict is detected, the arbitration logic determines which IO processing module has a higher data transmission priority through the priority encoder. This is usually based on the module's identifier or a preset priority rule. After the arbitration logic determines the priority, the timing control logic is responsible for managing the timing of data transmission to ensure that the data can be transmitted in the correct order and time interval. Specifically: Each IO processing module is assigned a unique identifier and priority. When multiple modules attempt to transmit at the same time, the arbitration logic determines which module has the right to transmit data first based on these priorities. When the conflict detection circuit detects a bus conflict, it immediately triggers a conflict signal, and the arbitration logic intervenes and resolves the conflict based on the priority. The synchronization counter tracks the timing of data transmission to ensure that the data is transmitted in the correct time interval. The state machine manages the module's request status, authorization status, and data transmission status to ensure smooth and orderly data transmission. The specific implementation process steps are: when the IO processing module has data to transmit, it sends a request to the CAN bus. The conflict detection circuit monitors the bus in real time and immediately triggers a conflict signal once it detects that two or more modules are requesting at the same time. Next, the arbitration logic makes a decision based on the module priority to determine which module gets bus access. The module that gets access starts data transfer under the management of the timing control logic. The state machine tracks the entire data transfer process, from module request to data transfer completion. After the data transfer is completed, the state machine updates the state, and the bus arbitration mechanism is ready to process the next transfer request.
[0197] In the specific implementation, through conflict detection and arbitration logic, conflicts that may occur when multiple modules transmit data at the same time are effectively avoided. In addition, priority coding and timing control ensure the rapid transmission of high-priority data, improving the utilization and efficiency of the bus. Secondly, through precise timing control and state management, the integrity and accuracy of data during transmission are ensured. At the same time, the bus arbitration mechanism supports concurrent communication between multiple IO processing modules and the central processing unit, which is suitable for distributed systems with many nodes.
[0198] Although the specific embodiments of the present invention are described above, it should be understood by those skilled in the art that these specific embodiments are only illustrative, and those skilled in the art may omit, replace, and change the details of the above methods and systems in various ways without departing from the principles and essence of the present invention. For example, merging the above method steps so as to perform substantially the same functions in substantially the same manner to achieve substantially the same results is within the scope of the present invention. Therefore, the scope of the present invention is limited only by the appended claims.
Claims
1. A distributed IO bus expansion system, characterized in that: The system includes a main control unit and an extended management unit; the extended management unit includes an integrated signal I / O module, a communication management module, a fault detection and recovery module and a cloud management module; The main control module is used to manage the module registration, parameter configuration and data scheduling of the extended management unit; the main control module optimizes the module registration process through a dynamic module registration and priority adjustment algorithm, and dynamically adjusts the communication priority on the CAN bus; the dynamic module registration and priority adjustment algorithm realizes the automatic management of the module registration process through a state machine model, and realizes data communication and transmission through the CAN bus communication protocol CAN2.0B; The integrated signal I / O module is used to collect digital and analog signals in real time and send the collected signals to the communication management module; the integrated signal I / O module optimizes network bandwidth usage and response time through adaptive data reporting and compression algorithms; the integrated signal I / O module includes a digital I / O unit and an analog I / O unit; The communication management module is used to encapsulate the signal sent by the integrated signal I / O module and upload it to the main control module, and receive the communication priority adjustment instruction of the main control module; the communication management module ensures data integrity and correctness through data packet encapsulation and decapsulation methods, and enhances the reliability of data transmission through error detection and correction mechanisms; The fault detection and recovery module is used to monitor the faults of the main control unit and the extended management unit in real time and respond and recover in real time; the fault detection and recovery module monitors the module status in real time through periodic status check and timeout retransmission mechanism, locates the cause of the fault through a fast fault location model and executes a recovery strategy; The cloud management module is used to remotely configure and update the distributed IO bus expansion system. The cloud management module performs cross-network configuration updates through a remote configuration protocol and ensures configuration consistency and traceability through a version control mechanism.
2. A distributed IO bus expansion system according to claim 1, characterized in that: The state machine model manages the module registration status through state transition logic and event trigger mechanism; the state machine model includes a registration management module, an event processing module, a state transition module and a communication coordination module; the registration management module maintains the module registration information and status through a registration information storage unit and a registration status verification unit, and the registration information storage unit stores and manages the module registration information through a database management method; The registration status verification unit verifies the module registration status through status verification and data synchronization methods; the event processing module monitors module registration requests and other system events in real time through an event-driven programming mechanism, and triggers corresponding state transitions or data transmissions through a mapping table and a priority scheduling method; the event-driven programming mechanism defines event response behaviors through callback functions, and manages the order of event reception and processing through event queues; the state transition module includes a state transition logic unit and a state transition trigger unit; the state transition logic unit defines and manages transition rules between states through a finite state automaton; the state transition trigger unit detects whether the conditions for state transition are met through a conditional judgment mechanism, and triggers state transition when the conditions are met; The finite state automaton defines the transition relationship between states through a state table, and determines the next state according to the current state and input events through a transition function; the communication coordination module encapsulates the data exchange between modules into a format suitable for network transmission through format definition and encoding and decoding, and realizes reliable data transmission through the frame structure and error detection mechanism of the CAN2.0B protocol.
3. A distributed IO bus expansion system according to claim 1, characterized in that: The working method of the dynamic module registration and priority adjustment algorithm is as follows: Step 1: Module registration score calculation; A comprehensive score is calculated for each module through a module registration scoring function to evaluate the module's demand for system resources and its impact on performance; the formula expression of the module registration scoring function is: In formula (1), X reg represents the module registration score, which is a comprehensive indicator reflecting the module's impact on system resource requirements and performance. K represents the capacity requirement of module i, which is used to measure the module's occupation of system resources. n represents the number of parameter types considered. τ represents the data requirement of module i, which is used to measure the module's demand for data transmission and storage. P represents the performance index of module i, which includes response time, processing speed, throughput, resource utilization and fault tolerance. i , b i and c i They represent the adjustment factors for capacity, performance, and data requirements, respectively; d represents the weight coefficient, which is used to measure the importance of different parameters; Step 2: Initialize dynamic priority; The initial communication priority of the module is dynamically calculated through the priority initialization function according to the module's registration score and system status; the system status includes system load, response time, throughput and network delay; the formula expression of the priority initialization function is: In formula (2), P init Indicates the initial priority; X reg represents the module registration score; β represents the system stability adjustment coefficient; α1 represents the system bus load; α2 represents the system error rate; Step 3: Dynamically adjust the priority; The communication priority of the module is adjusted in real time through the priority dynamic adjustment function to respond to changes in system load and module performance; the formula expression of the priority dynamic adjustment function is: In formula (3), P dyn Indicates the priority after dynamic adjustment; s i Indicates the change in system load, which is used to measure the change in system resource requirements; β i represents the change in module performance; σ and ρ represent the load adjustment coefficient and performance adjustment coefficient, respectively, which are used to control the impact of load and performance changes on priority adjustment; P init Indicates the initial priority; Step 4: Communication scheduling and priority optimization; According to the dynamic priority of the module, the urgency of the task and the number of modules in the system, the priorities between different modules are balanced through the communication scheduling optimization function; the formula expression of the communication scheduling optimization function is: In formula (4), S sched is the scheduling score, i.e., the communication priority of the module in the current scheduling cycle; Y represents the task urgency coefficient; M represents the number of modules; P dyn Indicates dynamic priority; Step 5: Feedback correction and adaptive learning; According to historical scheduling data and system performance feedback, the coefficients σ and ρ in step 3 are automatically adjusted through the reinforcement learning algorithm, and the adjusted coefficients are applied to the priority dynamic adjustment function for real-time monitoring. If the performance improves, the current coefficients are retained; if the performance does not improve or decreases, the learning process is re-entered to further adjust the coefficients.
4. A distributed IO bus expansion system according to claim 1, characterized in that: The fast fault location model includes a perception layer, a preprocessing layer, a fault feature extraction layer, an intelligent diagnosis layer, a decision layer, an execution layer and an optimization layer. The work of the fast fault location model includes the following steps: Step 1: Data input and collection: The perception layer monitors and collects the status information and performance indicators of each module in real time; the perception layer realizes the real-time collection of sensor data through the embedded system and realizes the efficient transmission of data through the field bus protocol; the status information and performance indicators include the module's voltage, current, temperature, response time, communication status and firmware version; Step 2: Data preprocessing and standardization: the raw data is cleaned, denoised and standardized through the preprocessing layer; the preprocessing layer processes the collected data through digital signal processing and data encoding; Step 3: Fault feature extraction: extract key fault features from the preprocessed data through a fault feature extraction layer; the fault feature extraction layer realizes effective identification of fault features by strengthening principal component analysis PCA and machine learning classifier; the strengthened principal component analysis PCA enhances the recognition effect of outliers by introducing regularization terms and iterative optimization strategies; the machine learning classifier improves classification accuracy and system generalization ability by stacking generalization method; Step 4: Intelligent fault diagnosis: The intelligent diagnosis layer conducts in-depth analysis on the extracted fault features to identify the fault type and location; the intelligent diagnosis layer realizes intelligent identification and classification of faults through convolutional neural networks and fault diagnosis rule bases; the fault diagnosis rule bases are dynamically updated and evolved according to new fault cases and feedback through online learning methods; Step 5: Recovery strategy formulation: According to the diagnosis results, a fault recovery strategy is formulated through the decision layer; the decision layer implements personalized and adaptive recovery strategy formulation through the expert system and decision tree algorithm; in the process of node splitting of the decision tree, the decision tree algorithm dynamically adjusts the threshold of decision tree splitting through fuzzy logic to enhance the interpretability of the decision tree; Step 6: Fault recovery execution: execute the fault recovery strategy through the execution layer and monitor the recovery process in real time; Step 7: Feedback and continuous learning: feedback information of fault handling is collected through the optimization layer and used to continuously optimize the fault location model; the optimization layer realizes continuous improvement and adaptability enhancement of the fault location algorithm through a feedback loop mechanism and an incremental learning algorithm.
5. A distributed IO bus expansion system according to claim 1, characterized in that: The working method of the adaptive data reporting and compression algorithm is:
501. Signal trend prediction is performed through a Kalman filter to achieve intelligent adjustment of data reporting frequency; the formula for updating the Kalman filter is expressed as: In formula (5), F k|k is the optimal estimate of the current state, indicating that at the kth moment, according to the observed data y k Updated state estimate; F k|k-1 is the predicted value of the previous state, indicating the state predicted based on the previous state and the system model at the kth moment; y k is the observed data at the kth moment, used to represent the actual measurement value; H is the observation model matrix, used to describe the statistical characteristics of the measurement error; K k is the Kalman gain, which is used to measure the observed data y k the degree of revision of the state estimate; 502. Dynamically adjust the coding strategy according to the signal characteristics through a variational coding algorithm based on a self-attention mechanism; the formula expression of the variational coding algorithm based on the self-attention mechanism is: In formula (6), μ is the activation function; q is the weight matrix; W v is the probability of signal v appearing; Attention(Q,K,V) is the attention mechanism, and the attention weight is calculated by querying the Q, key K, value V matrix; Formula (6) allows the algorithm to dynamically adjust the compression ratio and encoding parameters according to the importance of the signal; For digital signals, the variational coding algorithm based on the self-attention mechanism compresses through Huffman coding, and the Huffman coding optimizes the coding table through frequency statistics to assign short code words to frequently occurring signals; For analog signals; The variational coding algorithm based on the self-attention mechanism separates the details and trends of the signal through wavelet transform and removes high-frequency redundant information; 503. Ensure continuous adjustment and optimization of data reporting and compression strategies through comprehensive optimization strategies and feedback control mechanisms; The comprehensive optimization strategy processes nonlinear relationships through an intelligent decision function; the intelligent decision function maps the reporting frequency T, compression ratio L and system response time B to the control decision through a fuzzy logic controller, and makes a comprehensive decision through a deep reinforcement learning strategy; the formula expression of the intelligent decision function is: In formula (7), B is the system response time; L is the compression ratio; T is the reporting frequency; a is the adjustment coefficient of the fuzzy output; b is the basic reward; and u is the network load, which is used to measure the usage of network resources.
6. A distributed IO bus expansion system according to claim 1, characterized in that: The data packet encapsulation and decapsulation method ensures the consistency of data encapsulation and parsing through a custom data structure and a serialization / deserialization mechanism; the custom data structure creates a data model through class definition and structure definition, and improves data access efficiency and storage efficiency through memory alignment and packaging methods; the serialization / deserialization mechanism converts complex data types in the custom data structure into binary format through data encoding; the error detection and correction mechanism ensures the accuracy and fault tolerance of data transmission through a cyclic redundancy check and forward error correction method.
7. A distributed IO bus expansion system according to claim 1, characterized in that: The digital I / O unit reports data through an event-driven reporting mechanism; the event-driven reporting mechanism reports data when the input state changes through state monitoring logic and conditional triggers, thereby reducing the communication load; the analog I / O unit dynamically adjusts the sampling frequency through signal change detection and frequency adjustment strategy, and reduces the amount of analog signal data transmission through differential encoding and quantization step adjustment methods.
8. A distributed IO bus expansion system according to claim 1, characterized in that: The cloud management module includes a remote configuration unit, a version control unit, a communication coordination unit, a security verification unit and a user interaction unit; the remote configuration unit parses and identifies configuration parameters through the JSON data format, and issues and applies parameter settings through the remote procedure call method; the version control unit records the current configuration version through a timestamp, and updates the changed part through a differential update algorithm; the communication coordination unit performs communication scheduling and data transmission through the transmission control protocol TCP and the file transfer protocol SFTP; the security verification unit authenticates the remote user or system that initiates the configuration update through the public key infrastructure; the user interaction unit provides an operation interface through the MVC architecture and responsive layout, and realizes real-time push and display of data through a full-duplex communication protocol and a dynamic data binding method.
9. A distributed IO bus expansion device, characterized in that: A distributed IO bus expansion system as claimed in any one of claims 1 to 8, comprising: A central processing unit, wherein the central processing unit uses a microcontroller to perform system management and coordination tasks, process module identification, data synchronization and communication scheduling; the central processing unit is connected to the input / output processing module, the data exchange protocol unit, the system monitoring and maintenance unit, the interactive operation interface and the power supply and signal conditioning unit through an internal bus, and is connected to the remote configuration interface through an external communication interface; The input / output processing module includes a digital input / output interface, an analog input / output interface and a signal conditioning circuit; the digital input / output interface is electrically isolated by a photoelectric isolator, and the signal is shaped by a Schmitt trigger; the analog input / output interface converts the signal by an analog-to-digital converter and a digital-to-analog converter; the signal conditioning circuit processes the input signal by an amplifier and a filter; and provides a voltage reference for the analog-to-digital converter and the digital-to-analog converter by a reference voltage source; The data exchange protocol unit manages the encapsulation, transmission and decoding of data frames through the CAN controller, CAN transceiver and protocol stack; The system monitoring and maintenance unit monitors the system status in real time through the monitoring circuit and fault diagnosis logic, and performs fault detection, alarm and automatic recovery; the monitoring circuit includes a watchdog timer and a status monitoring sensor; The remote configuration interface allows users to remotely modify module configuration and system parameters through the network through the Ethernet PHY chip and the security protocol TLS / SSL; The interactive operation interface communicates with the remote configuration interface via a wireless communication network; The power supply provides a stable power supply to the system through a power regulator.
10. A distributed IO bus expansion device according to claim 9, characterized in that: Also includes: A bus arbitration mechanism, which is integrated in the CAN bus and manages data transmission between the central processing unit and the IO processing module through a conflict detection circuit and arbitration logic; The conflict detection circuit detects the signal state on the bus through comparator logic, and when it detects that two or more IO processing modules attempt to transmit data at the same time, the conflict detection circuit generates a conflict signal through a trigger; The arbitration logic determines the data transmission priority through a priority encoder and manages the timing of data transmission through a timing control logic; The timing control logic tracks the timing of data transmission through a synchronous counter, and manages the module request status, authorization status, and data transmission status through a state machine.
Citation Information
Cited By
MECHATROLINK-III-based coupler system and communication method
CN119299265A
Method for preventing crash of ECAT bus system
CN120743636A
A method to prevent crashes in an ECAT bus system
CN120743636B
Industrial data mapping conversion system and method based on OPC UA protocol
CN120973848A
