A multi-channel intelligent acquisition controller channel cascading and expansion method, system, medium and device
By using a cascading and expansion method for multi-channel intelligent acquisition controllers, and connecting multiple controllers through RS485 interface modules and a tree structure, the problems of non-scalable channels and idle resources in existing technologies are solved, achieving low-cost and efficient data transmission and processing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CCCC FOURTH HARBOR ENG INST CO LTD
- Filing Date
- 2023-05-31
- Publication Date
- 2026-04-24
AI Technical Summary
Existing multi-channel intelligent acquisition controllers cannot expand or reduce acquisition channels according to actual needs, resulting in idle resources and increased power consumption. Furthermore, data between multiple controllers cannot be integrated, affecting transmission efficiency and the number of identification measurement points.
By designing a method for channel cascading and expansion of a multi-channel intelligent data acquisition controller, multi-level hardware connection and communication are realized using an RS485 interface module. Multiple controllers are connected in a tree structure, and data is integrated through a communication protocol with cascading identifiers. Only one host is required to configure a network module and a SIM card.
It enables low-cost channel expansion and cascading, reduces power consumption, improves the adaptability and transmission efficiency of multi-channel intelligent acquisition controllers, and simplifies the data processing flow.
Smart Images

Figure CN116991093B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of structural health monitoring information acquisition, specifically, it relates to a method, system, medium and device for channel cascading and expansion of a multi-channel intelligent acquisition controller. Background Technology
[0002] In recent years, the nation has accelerated urbanization and the construction of supporting infrastructure. Buildings across land, sea, and air have sprung up like mushrooms after rain, including numerous tunnels, long-span bridges, high-speed railways, highways, dams, and super high-rise buildings. This has placed new demands on the structural safety and stability of these structures for safe production. To prevent collapses and the occurrence of dangerous buildings, various high-precision sensors are being used to measure and monitor these buildings in real time, both during construction and use. This allows for feedback on their structural health status and early warning of abnormal conditions, and also provides sensing terminals and a foundation for big data analysis for future smart city construction. Currently, multi-channel intelligent data acquisition controllers can only have a fixed number of channels and cannot expand the number of data acquisition channels according to actual needs. When the number and type of sensors exceed the number of channels of the multi-channel intelligent data acquisition controller, only a new multi-channel intelligent data acquisition controller can be installed. Each multi-channel intelligent data acquisition controller has an independent network module and a SIM card (mobile phone card). The measurement data between multiple multi-channel intelligent data acquisition controllers are transmitted to the server independently, making data fusion impossible. Furthermore, the server cannot easily identify the number of measurement points. When the number of connected sensors is less than half the number of channels of the multi-channel intelligent data acquisition controller, the multi-channel intelligent data acquisition controller's resources are idle, increasing power consumption. If the number of acquisition channels of the multi-channel intelligent data acquisition controller could be expanded or reduced according to the number of sensors connected on site, the adaptability of the multi-channel intelligent data acquisition controller would be greatly improved. Summary of the Invention
[0003] The primary objective of this invention is to overcome the shortcomings and deficiencies of existing technologies and provide a method for channel cascading and expansion of multi-channel intelligent acquisition controllers. This method enables low-cost cascading and channel expansion of multiple multi-channel intelligent acquisition controllers, thereby improving the adaptability of multi-channel intelligent acquisition controllers.
[0004] The second objective of this invention is to provide a multi-channel intelligent acquisition controller channel cascading and expansion system.
[0005] A third objective of this invention is to provide a storage medium.
[0006] A fourth objective of this invention is to provide a computing device.
[0007] The first objective of this invention is achieved through the following technical solution: a method for channel cascading and expansion of a multi-channel intelligent acquisition controller, comprising the following steps:
[0008] S1. Based on the number of channels M, following the channel expansion order from horizontal to vertical, cascade multiple multi-channel intelligent acquisition controllers into N levels, where N≥2. The relationship between M and N satisfies formula: 8 N-1 +1≤M≤8 N ;
[0009] There is only one multi-channel intelligent data acquisition controller in the first tier, which acts as the master, i.e., the first-level master. This first-level master connects to the server via the "DTU" communication mode. All subsequent multi-channel intelligent data acquisition controllers in the second tier act as slaves, i.e., each level of slave is the second-level slave…the Nth-level slave, with the number of slaves in the nth level being m∈1…8. n-1 , n∈N;
[0010] The first-level master and the second-level slave, as well as the two adjacent slaves, are connected via the "485" communication mode.
[0011] S2. The host computer sends a command to the host computer, and the host computer parses the command to determine the number of channels M:
[0012] When the number of channels M≤8, the host directly processes the data packets and feeds back the processing results to the host computer;
[0013] When the number of channels M > 8, the host determines the number of cascades N based on the number of channels M, stores it in the cascade flag to form an interactive instruction data packet, and sends out this interactive instruction data packet.
[0014] S3. The second-level slave device receives and parses the interactive command data packet to determine whether the result of subtracting 1 from the cascade number N is equal to 1:
[0015] If so, the second-level slave device executes the interactive instruction data packet command;
[0016] If not, the second-level slave device sends interactive instruction data packets down to the Nth-level slave device, and each slave device executes the commands in the interactive instruction data packets.
[0017] S4. Each slave device processes the data and uploads the processed data packets to the host device level by level. The host device processes the data and sends the results back to the host computer.
[0018] Preferably, in step S2, the host determines the number of cascades N based on the number of channels M, stores it in the cascade flag to form an interactive instruction data packet, and sends this interactive instruction data packet. Specific steps include:
[0019] S21. The host determines the number of cascaded connections N based on the number of channels M;
[0020] S22. The host changes the communication direction of the data packet sent by the host computer to downlink "0x10" and the concatenation flag to "0xFF, 0xN", forming an interactive command data packet;
[0021] S23. The host sends a handshake data packet;
[0022] S24. When the host receives the confirmation handshake data packet returned by the second-level slave, the connection is successful;
[0023] S25. The host sends the interactive instruction data packet from step S22 to the successfully connected second-level slave device.
[0024] Preferably, in step S3, the second-level slave device sends interactive instruction data packets level by level up to the Nth-level slave device. The specific steps include:
[0025] S31. Establish a communication channel between the second-level slave and the third-level slave: The second-level slave sends a handshake data packet to the third-level slave. When the second-level slave receives the confirmation handshake data packet returned by the third-level slave, the connection is successful.
[0026] S32. The second-level slave updates the received interactive instruction data packet. The update includes storing the result of subtracting 1 from the cascade number N as the new cascade number, forming a new interactive instruction data packet, and sending this data packet to the successfully connected third-level slave.
[0027] S33. Establish a communication channel between the third-level slave and the fourth-level slave according to the method in step S31. The third-level slave updates the interactive instruction data packet according to the method in step S32 and sends this data packet to the successfully connected fourth-level slave, until a communication channel between the (N-1)th-level slave and the Nth-level slave are established, and the (N-1)th-level slave sends an interactive instruction data packet to the Nth-level slave; the cascading flag bit corresponding to the nth-level slave is "0xFF, 0x(N-1*(n-1))".
[0028] Preferably, step S4 specifically includes the following steps:
[0029] S41. After each slave device executes the command, it stores the sensor data collected by the acquisition module in the data field of the data packet, changes the communication direction of the data packet to uplink "0x01" and the cascading flag to "0xFF, 0xFF", forming a new data packet;
[0030] S42. Each slave device uploads the new data packet to the corresponding slave device above it, level by level, until the master device is reached.
[0031] S43. The host receives and parses the new data packet to determine if there is a concatenation flag "0xFF, 0xFF". If so, the data is extracted; otherwise, the data packet is discarded. Finally, the result is fed back to the host computer.
[0032] Preferably, in step S21, the handshake data packet includes: a downlink transmission direction of "0x10", a concatenation flag of "0xFF, 0x01", and a data field of "AT Connet" requesting a connection.
[0033] Preferably, in step S22, the confirmed handshake data packet includes: transmission direction of uplink "0x01", concatenation flag bits of "0xFF, 0x02", and data field of "AT ok" requesting connection.
[0034] The second objective of this invention is achieved by the following technical solution: a multi-channel intelligent acquisition controller channel cascading and expansion system, comprising a host computer, a server, and at least two multi-channel intelligent acquisition controllers. The multi-channel intelligent acquisition controllers are connected to the host computer via an RS232 interface module. Both the multi-channel intelligent acquisition controllers and the host computer are connected to the server via TCP / IP protocol. The server is used to forward instructions from the host computer to the multi-channel intelligent acquisition controllers and upload data packets from the multi-channel intelligent acquisition controllers to the host computer.
[0035] Preferably, the multi-channel intelligent acquisition controller includes a main control chip, a public network communication module, an RS232 interface module, an RS485 interface module, an acquisition module, a storage module, a programmable switch array, and a power management module;
[0036] The main control chip is used to control the operation and data interaction of the entire system.
[0037] The public network communication module is used to establish a wireless communication connection between the main control chip and the server via GPRS.
[0038] The RS232 interface module is used to establish a wired communication connection between the main control chip and the host computer via a USB-to-serial cable.
[0039] The RS485 interface module is used for channel expansion cascading, communication and power supply connection between various multi-channel intelligent acquisition controllers;
[0040] The acquisition module is used to receive instructions from the main control chip and is connected to a designated channel through the programmable switch array;
[0041] The storage module is used to store data, which includes the instrument parameters of the multi-channel intelligent acquisition controller, the operating parameters of the multi-channel intelligent acquisition controller, and the data packets of the acquisition module.
[0042] The power management module is used to supply power to the main control chip and the public network communication module.
[0043] The third objective of this invention is achieved by the following technical solution: a storage medium storing a program, which, when executed by a processor, implements the multi-channel intelligent acquisition controller channel cascading and expansion method described in the first objective of this invention.
[0044] The fourth objective of this invention is achieved by the following technical solution: a computing device, including a processor and a memory for storing processor-executable programs, wherein when the processor executes the program stored in the memory, it implements the multi-channel intelligent acquisition controller channel cascading and expansion method described in the first objective of this invention.
[0045] The present invention has the following advantages and effects compared with the prior art:
[0046] (1) The present invention is designed to control multiple similar multi-channel intelligent acquisition controllers to acquire sensor data by one multi-channel intelligent acquisition controller. The total number of channels can be added or subtracted according to the needs of the site. This design realizes the communication between the cascaded multi-channel intelligent acquisition controllers by identifying the communication protocol with the cascading identifier, and realizes the hardware connection and communication between the multi-level multi-channel intelligent acquisition controllers by using the RS485 interface module. There is no need to redesign the circuit and change the product hardware. It realizes low-cost channel expansion and multi-channel intelligent acquisition controller cascading, which can reduce power consumption and improve the adaptability of multi-channel intelligent acquisition controllers.
[0047] (2) The present invention provides a multi-channel intelligent acquisition controller channel cascading and expansion system, which can establish a tree structure connection between two or more multi-channel intelligent acquisition controllers. Only one network module and SIM card need to be configured on the host at the top of the tree. All cascaded slaves integrate data through the host and send it to the server. That is, the server only needs to identify and process the data of one measurement point, which improves the transmission efficiency and processing speed of the multi-channel intelligent acquisition controller. Attached Figure Description
[0048] Figure 1 This is a flowchart of the multi-channel intelligent acquisition controller cascading and expansion method of the present invention.
[0049] Figure 2 This is a tree topology diagram of a two-level cascaded multi-channel intelligent acquisition controller according to the present invention.
[0050] Figure 3 This is a schematic diagram of the cascaded and expanded system structure of two multi-channel intelligent acquisition controllers according to the present invention.
[0051] Figure 4 This is a block diagram illustrating the composition principle of the multi-channel intelligent acquisition controller of the present invention. Detailed Implementation
[0052] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0053] Example 1
[0054] like Figure 1 The diagram shows a workflow for a multi-channel intelligent data acquisition controller channel cascading and expansion method, including the following steps:
[0055] S1. Based on the number of channels M, following the channel expansion order from horizontal to vertical, cascade multiple multi-channel intelligent acquisition controllers into N levels, where N≥2. The relationship between M and N satisfies formula: 8 N-1 +1≤M≤8 N ;
[0056] There is only one multi-channel intelligent data acquisition controller in the first tier, which acts as the master, i.e., the first-level master. This first-level master connects to the server via the "DTU" communication mode. All subsequent multi-channel intelligent data acquisition controllers in the second tier act as slaves, i.e., each level of slave is the second-level slave…the Nth-level slave, with the number of slaves in the nth level being m∈1…8. n-1 , n∈N;
[0057] The first-level master and the second-level slave, as well as the two adjacent slaves, are connected via the "485" communication mode.
[0058] S2. The host computer sends a command to the host computer, and the host computer parses the command to determine the number of channels M:
[0059] When the number of channels M≤8, the host directly processes the data packets and feeds back the processing results to the host computer;
[0060] When the number of channels M > 8, the host determines the number of cascades N based on the number of channels M, stores it in the cascade flag to form an interactive instruction data packet, and sends out this interactive instruction data packet.
[0061] S3. The second-level slave device receives and parses the interactive command data packet to determine whether the result of subtracting 1 from the cascade number N is equal to 1:
[0062] If so, the second-level slave device executes the interactive instruction data packet command;
[0063] If not, the second-level slave device sends interactive instruction data packets down to the Nth-level slave device, and each slave device executes the commands in the interactive instruction data packets.
[0064] S4. Each slave device processes the data and uploads the processed data packets to the host device level by level. The host device processes the data and sends the results back to the host computer.
[0065] Specifically, such as Figure 2As shown, each multi-channel intelligent acquisition controller has a fixed number of 8 channels. When cascading these multi-channel intelligent acquisition controllers, the number of channels M is prepared according to the actual required number of channels: following the principle of first expanding the channels horizontally and then vertically, the channels are expanded sequentially from left to right, with the vertical channel value being less than the horizontal channel value. The cascading number N is calculated based on the channel number M, and M and N satisfy the following relationship: 8 N-1 +1≤M≤8 N The number of channels M and the number of multi-channel intelligent acquisition controllers x satisfy the following relationship: 7*(x-1)+1<M≤7x+1. After manually obtaining the number of cascaded controllers N and the number of multi-channel intelligent acquisition controllers x, connect the required multi-channel intelligent acquisition controllers.
[0066] By configuring parameters on the host computer and inputting the number of channels M, one of the multi-channel intelligent acquisition controllers is designated as the master and the first-level multi-channel intelligent acquisition controller in the cascade structure, while the rest are slaves; the number of slaves corresponding to the nth level is m∈1…8. n-1 , n∈N, where N represents a series and N is a natural number greater than or equal to 2;
[0067] After the public network communication module of the multi-channel intelligent acquisition controller is powered on, the computer program determines whether the current working mode is "485" communication mode or "DTU" communication mode. If it is "DTU" communication mode, the computer program sends an instruction to the public network communication module to configure the IP address and port number, so that the public network communication module can connect to the designated server, enabling the server to perform remote data interaction and control of the multi-channel intelligent acquisition controller.
[0068] The data packets sent from the host computer to the master computer use the following communication protocol format: FE 01 00 00 00 11 1007 0029 01 91 00 00 00 01 00 00 00 01 40 0D 0A. This communication protocol uses hexadecimal data encoding, consisting of, from left to right: a 2-bit preamble, a 4-bit data packet length, a 6-bit header, a 4-bit total packet count, a 4-bit sequence number, an N-bit data field, a 1-bit checksum, and a 2-bit terminator. The header includes the transmission direction, communication method, data acquisition status, command bytes, and the multi-channel intelligent acquisition controller ID. After the master computer powers on, it listens for data packets sent from the host computer. Upon receiving a data packet, it compares it with the data packets in the storage module. The computer program first checks the checksum, then compares the preamble, and finally processes the information and commands carried in the data packet. After processing, the data packet is sent to the host computer or the cascaded second-level slave device.
[0069] When the host determines that the number of channels M in the data packet from the host computer is greater than 8, it enters the extended cascading working mode. At this time, the host calculates the cascading number N based on the number of channels M, stores N in the cascading flag bit, forms an interactive instruction data packet, and then sends this interactive instruction data packet to the second-level slave. When the second-level slave determines that the result of subtracting 1 from the cascading number N in the cascading flag bit of the data packet is equal to 1, it updates the cascading flag bit with the result and forwards the updated data packet to the next level of cascading slave. The next level of cascading slave repeats the judgment and calculation steps of the second level until it forwards to the Nth level slave.
[0070] This invention designs a multi-channel intelligent data acquisition controller that controls multiple similar multi-channel intelligent data acquisition controllers to acquire sensor data. The total number of channels can be added or subtracted according to on-site requirements. This design achieves communication between cascaded multi-channel intelligent data acquisition controllers by identifying communication protocols with cascading identifiers, and uses an RS485 interface module to realize hardware connection and communication between multiple levels of multi-channel intelligent data acquisition controllers. Without redesigning the circuit or changing the product hardware, it realizes low-cost channel expansion and cascading of multi-channel intelligent data acquisition controllers, which can reduce power consumption and improve the adaptability of multi-channel intelligent data acquisition controllers.
[0071] In step S2, the host determines the number of cascades N based on the number of channels M, stores it in the cascade flag to form an interactive instruction data packet, and sends this interactive instruction data packet. The specific steps include:
[0072] S21. The host determines the number of cascaded connections N based on the number of channels M. Specifically, the relationship between M and N satisfies the formula: 8 N-1 +1≤M≤8 N The judgment procedure is as follows:
[0073] Step A: Determine if M≤8 is true.
[0074] If so, there is no need to enter the channel extension mode; in this case, N = n0 = 1.
[0075] If not, the multi-channel intelligent acquisition controller enters extended mode, first calculating x = M / 8. N =M / 8 1 ,
[0076] Step B: Determine if x≤8 is true.
[0077] If so, then N = n0 + 1 = 2, and the calculation is terminated;
[0078] If not, first update N = n0 + 1 = 2, then calculate x = M / 8. N =M / 8 2 Repeat step B to enter the loop judgment, thereby obtaining the number N of cascaded multi-channel intelligent acquisition controllers;
[0079] S22. The host changes the communication direction of the data packet sent by the host computer to downlink "0x10" and the concatenation flag to "0xFF, 0xN", forming an interactive command data packet;
[0080] S23. The host sends a handshake data packet;
[0081] S24. When the host receives the confirmation handshake data packet returned by the second-level slave, the connection is successful;
[0082] S25. The host sends the interactive instruction data packet from step S22 to the successfully connected second-level slave device.
[0083] In step S3, the second-level slave device sends interactive instruction data packets down to the Nth-level slave device, and the specific steps include:
[0084] S31. Establish a communication channel between the second-level slave and the third-level slave: The second-level slave sends a handshake data packet to the third-level slave. When the second-level slave receives the confirmation handshake data packet returned by the third-level slave, the connection is successful.
[0085] S32. The second-level slave updates the received interactive instruction data packet. The update includes storing the result of subtracting 1 from the cascade number N as the new cascade number, forming a new interactive instruction data packet, and sending this data packet to the successfully connected third-level slave.
[0086] S33. Establish a communication channel between the third-level slave and the fourth-level slave according to the method in step S31. The third-level slave updates the interactive instruction data packet according to the method in step S32 and sends this data packet to the successfully connected fourth-level slave, until a communication channel between the (N-1)th-level slave and the Nth-level slave are established, and the (N-1)th-level slave sends an interactive instruction data packet to the Nth-level slave; the cascading flag bit corresponding to the nth-level slave is "0xFF, 0x(N-1*(n-1))".
[0087] Specifically, when the computer program determines that the cascade number N-1 ≠ 1, it indicates that the current slave device has a next-level slave device in the cascade. The current slave device sends a handshake data packet (i.e., a connection request data packet) and waits. If the wait times out, the current slave device sends a connection error message. If, within the waiting time, the current slave device receives an acknowledgment handshake data packet (i.e., a connection confirmation data packet) returned by the next-level slave device, then the current slave device has successfully established a communication channel with the cascaded next-level slave device. After a communication channel is successfully established between any two adjacent multi-channel intelligent acquisition controllers, the current multi-channel intelligent acquisition controller then sends an interactive command data packet (i.e., an acquisition communication data packet) to the cascaded next-level multi-channel intelligent acquisition controller. The cascade number N in the cascade flag bit of the interactive command data packet sent by the master device is the maximum number of actual cascades. Starting from the second-level slave device, the cascade number N is decremented by 1 at each level, and the result is saved to the new cascade flag bit. The new interactive command is then sent down level by level, forwarded N-1 times until the bottom layer of the cascade structure, i.e., the Nth-level slave device.
[0088] Step S4 specifically includes the following steps:
[0089] S41. After each slave device executes the command, it stores the sensor data collected by the acquisition module in the data field of the data packet, changes the communication direction of the data packet to uplink "0x01" and the cascading flag to "0xFF, 0xFF", forming a new data packet;
[0090] S42. Each slave device uploads the new data packet to the corresponding slave device above it, level by level, until the master device is reached.
[0091] S43. The host receives and parses the new data packet to determine if there is a concatenation flag "0xFF, 0xFF". If so, the data is extracted; otherwise, the data packet is discarded. Finally, the result is fed back to the host computer.
[0092] Specifically, after receiving a data packet from the next cascaded slave device, each slave device determines that the transmission direction flag in the communication packet is uplink and then sends the data packet to its cascaded parent slave device, until it reaches the master device. Before the current slave device uploads the data packet, it modifies the flag to "0xFF, 0xFF" so that when the data packet returns to the master device, the master device can use this specific flag to determine the integrity of the corresponding data packet and confirm that the data packet was sent after the slave device performed the data acquisition action. If data is lost during data packet transmission, if the data bits are incorrect, or if the data packet returned by the slave multi-channel intelligent acquisition controller itself is faulty, the master multi-channel intelligent acquisition controller will discard it.
[0093] In step S21, the handshake data packet includes: a downlink transmission direction of "0x10", a concatenation flag of "0xFF, 0x01", and a data field of "AT Connet" requesting a connection.
[0094] In step S22, the confirmed handshake data packet includes: the transmission direction is uplink "0x01", the concatenation flag is "0xFF, 0x02", and the data field is "AT ok" which requests a connection.
[0095] Example 2
[0096] like Figure 3 The system illustrates a multi-channel intelligent data acquisition controller channel cascading and expansion system, comprising a host computer, a server, and at least two multi-channel intelligent data acquisition controllers. The multi-channel intelligent data acquisition controllers are connected to the host computer via an RS232 interface module. Both the multi-channel intelligent data acquisition controllers and the host computer are connected to the server via TCP / IP protocol. The server is used to forward instructions from the host computer to the multi-channel intelligent data acquisition controllers and to upload data packets from the multi-channel intelligent data acquisition controllers to the host computer.
[0097] like Figure 4 As shown, the multi-channel intelligent acquisition controller includes a main control chip, a public network communication module, an RS232 interface module, an RS485 interface module, an acquisition module, a storage module, a programmable switch array, and a power management module.
[0098] The main control chip is used to control the operation and data interaction of the entire system.
[0099] The public network communication module is used to establish a wireless communication connection between the main control chip and the server via GPRS; specifically, the public network communication module is used to transmit commands from the server to the main control chip and send data from the main control chip to the server.
[0100] The RS232 interface module is used to establish a wired communication connection between the main control chip and the host computer via a USB-to-serial cable; specifically, the RS232 interface module is used to transmit data from the main control chip to the host computer via the USB-to-serial cable.
[0101] The RS485 interface module is used for channel expansion cascading, communication and power supply connection between various multi-channel intelligent acquisition controllers;
[0102] The acquisition module is used to receive instructions from the main control chip and is connected to a designated channel through the programmable switch array;
[0103] The storage module is used to store data, including instrument parameters of the multi-channel intelligent acquisition controller, operating parameters of the multi-channel intelligent acquisition controller, and data packets of the acquisition module. Specifically, the storage unit uses high-speed flash memory, which has the characteristics of fast data reading, large capacity, and no data loss when power is off, and can be stored for a long time.
[0104] The power management module is used to supply power to the main control chip and the public network communication module. Specifically, the power management module supports a 9V-15V regulated DC power supply, which is converted by a DC voltage regulator circuit to output +5V and +3.9V DC voltages. The +5V output is then converted by the DC voltage regulator circuit to output +3.3V. The 3.3V voltage supplies the main control chip, and the 3.9V voltage supplies the public network communication module.
[0105] Specifically, the connection process of the multi-channel intelligent acquisition controller in cascade mode is as follows: Prepare a multi-channel intelligent acquisition controller according to the actual number of channels M required, select 1 as the master and the rest as slaves;
[0106] First, configure the parameters of the multi-channel intelligent acquisition controller. Set the communication mode of the host to "DTU" and the communication mode of the slave to "485" via PC, and set the number of channels M.
[0107] Next, connect the channels that need to be expanded on the host to the RS485 interface modules of the corresponding slave devices in the second level using cables. Each channel corresponds to one slave device. The cables include a positive power line, a negative power line, an RS485 A+ line, and an RS485 B- line. The positive and negative power lines provide DC power to the slave devices, and the RS485 A+ and RS485 B- lines enable communication between the two connected multi-channel intelligent acquisition controllers. The same steps are used to connect the slave devices in other adjacent levels starting from the second level slave device.
[0108] After the host and slave devices at all levels are powered on and running normally, the host PC is connected to the RS232 interface module of the host via a USB to RS232 serial cable. The host constantly listens for communication data packets sent by the host computer.
[0109] After receiving the acquisition command from the host computer or reaching the set automatic acquisition time, the main control chip controls the programmable switch array unit to connect to the designated channel through the acquisition module. Data interaction with the connected sensor occurs through this channel. After executing the data acquisition command, the corresponding sensor returns the data via the original path, completing one sensor data acquisition cycle. The acquisition commands include those for vibrating wire sensors and Class 485 sensors. When acquiring data from a vibrating wire sensor, the computer program outputs a square wave through the main control chip to excite the connected vibrating wire sensor. The vibrating wire sensor generates a sine wave, which, after processing by the conversion circuit, outputs a square wave that the computer program can recognize, representing the sensor's natural frequency value. When acquiring data from a Class 485 sensor, the computer program sends the communication protocol of the designated sensor through the acquisition channel to the connected sensor. After receiving the command, the sensor executes the command and returns the result via the original path. After receiving the acquisition data packet from the slave device, the host chip processes it before uploading it to the host computer.
[0110] like Figure 3 As shown, in cascaded mode, the public network communication module is only enabled at the first-level host. From the second level onwards, the public network communication module is disabled. The second-level multi-channel intelligent acquisition controller transmits data to the first-level multi-channel intelligent acquisition controller via the RS485 interface module. This invention enables the establishment of a tree-structured connection between two or more multi-channel intelligent acquisition controllers. Only one network module and SIM card need to be configured on the host at the top of the tree. All cascaded slave devices integrate data through the host and send it to the server. That is, the server only needs to identify and process the data of one measurement point, improving the transmission efficiency and processing speed of the multi-channel intelligent acquisition controller.
[0111] Example 3
[0112] A storage medium storing a program, which, when executed by a processor, implements the channel cascading expansion method for a multi-channel intelligent acquisition controller as described in Embodiment 1, as follows:
[0113] S1. Based on the number of channels M, following the channel expansion order from horizontal to vertical, cascade multiple multi-channel intelligent acquisition controllers into N levels, where N≥2. The relationship between M and N satisfies formula: 8 N-1 +1≤M≤8 N ;
[0114] There is only one multi-channel intelligent data acquisition controller in the first tier, which acts as the master, i.e., the first-level master. This first-level master connects to the server via the "DTU" communication mode. All subsequent multi-channel intelligent data acquisition controllers in the second tier act as slaves, i.e., each level of slave is the second-level slave…the Nth-level slave, with the number of slaves in the nth level being m∈1…8. n-1 , n∈N;
[0115] The first-level master and the second-level slave, as well as the two adjacent slaves, are connected via the "485" communication mode.
[0116] S2. The host computer sends a command to the host computer, and the host computer parses the command to determine the number of channels M:
[0117] When the number of channels M≤8, the host directly processes the data packets and feeds back the processing results to the host computer;
[0118] When the number of channels M > 8, the host determines the number of cascades N based on the number of channels M, stores it in the cascade flag to form an interactive instruction data packet, and sends out this interactive instruction data packet.
[0119] S3. The second-level slave device receives and parses the interactive command data packet to determine whether the result of subtracting 1 from the cascade number N is equal to 1:
[0120] If so, the second-level slave device executes the interactive instruction data packet command;
[0121] If not, the second-level slave device sends interactive instruction data packets down to the Nth-level slave device, and each slave device executes the commands in the interactive instruction data packets.
[0122] S4. Each slave device processes the data and uploads the processed data packets to the host device level by level. The host device processes the data and sends the results back to the host computer.
[0123] The specific processing steps described above are as in Example 1 and will not be repeated here.
[0124] In this embodiment, the storage medium may be a disk, optical disk, computer memory, read-only memory, random access memory, USB flash drive, portable hard drive, or other media.
[0125] Example 4
[0126] A computing device includes a processor and a memory for storing processor-executable programs. When the processor executes the program stored in the memory, it implements the channel cascading expansion method for a multi-channel intelligent acquisition controller described in Embodiment 1, as follows:
[0127] S1. Based on the number of channels M, following the channel expansion order from horizontal to vertical, cascade multiple multi-channel intelligent acquisition controllers into N levels, where N≥2. The relationship between M and N satisfies formula: 8 N-1 +1≤M≤8 N ;
[0128] There is only one multi-channel intelligent data acquisition controller in the first tier, which acts as the master, i.e., the first-level master. This first-level master connects to the server via the "DTU" communication mode. All subsequent multi-channel intelligent data acquisition controllers in the second tier act as slaves, i.e., each level of slave is the second-level slave…the Nth-level slave, with the number of slaves in the nth level being m∈1…8. n-1 , n∈N;
[0129] The first-level master and the second-level slave, as well as the two adjacent slaves, are connected via the "485" communication mode.
[0130] S2. The host computer sends a command to the host computer, and the host computer parses the command to determine the number of channels M:
[0131] When the number of channels M≤8, the host directly processes the data packets and feeds back the processing results to the host computer;
[0132] When the number of channels M > 8, the host determines the number of cascades N based on the number of channels M, stores it in the cascade flag to form an interactive instruction data packet, and sends out this interactive instruction data packet.
[0133] S3. The second-level slave device receives and parses the interactive command data packet to determine whether the result of subtracting 1 from the cascade number N is equal to 1:
[0134] If so, the second-level slave device executes the interactive instruction data packet command;
[0135] If not, the second-level slave device sends interactive instruction data packets down to the Nth-level slave device, and each slave device executes the commands in the interactive instruction data packets.
[0136] S4. Each slave device processes the data and uploads the processed data packets to the host device level by level. The host device processes the data and sends the results back to the host computer.
[0137] The specific processing steps described above are as in Example 1 and will not be repeated here.
[0138] In this embodiment, the computing device can be a desktop computer, a laptop computer, a PDA handheld terminal, a tablet computer, or other terminal devices.
[0139] The above embodiments are preferred embodiments of the present invention and are not intended to limit the present invention. Any changes or other equivalent substitutions made without departing from the technical solution of the present invention are included within the protection scope of the present invention.
Claims
1. A method for channel cascading and expansion of a multi-channel intelligent data acquisition controller, characterized in that, Including the following steps: S1. Based on the number of channels M, following the channel expansion order from horizontal to vertical, cascade multiple multi-channel intelligent acquisition controllers into N levels, where N≥2, and the relationship between M and N satisfies the formula: ; There is only one multi-channel intelligent data acquisition controller in the first cascade, which acts as the master, i.e., the first-level master. This first-level master connects to the server via "DTU" communication mode. All subsequent multi-channel intelligent data acquisition controllers in the second cascade act as slaves, i.e., each level of slave is the second-level slave…the Nth-level slave, with the number of slaves in the nth level being m∈1…8. n-1 , n∈N; The first-level master and the second-level slave, as well as the two adjacent slaves, are connected via the "485" communication mode. S2. The host computer sends a command to the host computer, and the host computer parses the command to determine the number of channels M: When the number of channels M≤8, the host directly processes the data packets and feeds back the processing results to the host computer; When the number of channels M > 8, the host determines the number of cascades N based on the number of channels M, stores it in the cascade flag to form an interactive instruction data packet, and sends out this interactive instruction data packet. S3. The second-level slave device receives and parses the interactive command data packet to determine whether the result of subtracting 1 from the cascade number N is equal to 1: If so, the second-level slave device executes the interactive instruction data packet command; If not, the second-level slave device sends interactive instruction data packets down to the Nth-level slave device, and each slave device executes the commands in the interactive instruction data packets. S4. Each slave device processes the data and uploads the processed data packets to the host device level by level. The host device processes the data and sends the results back to the host computer.
2. The method for channel cascading and expansion of a multi-channel intelligent acquisition controller according to claim 1, characterized in that, In step S2, the host determines the number of cascades N based on the number of channels M, stores it in the cascade flag to form an interactive instruction data packet, and sends this interactive instruction data packet. The specific steps include: S21. The host determines the number of cascaded connections N based on the number of channels M; S22. The host changes the communication direction of the data packet sent by the host computer to downlink "0x10" and the concatenation flag to "0xFF, 0xN", forming an interactive command data packet; S23. The host sends a handshake data packet; S24. When the host receives the confirmation handshake data packet returned by the second-level slave, the connection is successful; S25. The host sends the interactive instruction data packet from step S22 to the successfully connected second-level slave device.
3. The method for channel cascading and expansion of a multi-channel intelligent acquisition controller according to claim 1, characterized in that, In step S3, the second-level slave device sends interactive instruction data packets down to the Nth-level slave device, and the specific steps include: S31. Establish a communication channel between the second-level slave and the third-level slave: The second-level slave sends a handshake data packet to the third-level slave. When the second-level slave receives the confirmation handshake data packet returned by the third-level slave, the connection is successful. S32. The second-level slave device updates the received interactive instruction data packet. The update includes storing the result of subtracting 1 from the cascade number N as the new cascade number, forming a new interactive instruction data packet, and sending this data packet to the successfully connected third-level slave device. S33. Establish a communication channel between the third-level slave and the fourth-level slave according to the method in step S31. The third-level slave updates the interactive instruction data packet according to the method in step S32 and sends this data packet to the successfully connected fourth-level slave until a communication channel between the (N-1)th-level slave and the Nth-level slave are established, and the (N-1)th-level slave sends an interactive instruction data packet to the Nth-level slave. The cascading flag bit corresponding to the nth-level slave is "0xFF, 0x(N-1*(n-1))".
4. The method for channel cascading and expansion of a multi-channel intelligent acquisition controller according to claim 1, characterized in that, Step S4 specifically includes the following steps: S41. After each slave device executes the command, it stores the sensor data collected by the acquisition module in the data field of the data packet, changes the communication direction of the data packet to uplink "0x01" and changes the concatenation flag to "0xFF, 0xFF", forming a new data packet; S42. Each slave device uploads the new data packet to the corresponding slave device above it, level by level, until the master device is reached. S43. The host receives and parses the new data packet to determine if there is a concatenation flag "0xFF, 0xFF". If so, the data is extracted; otherwise, the data packet is discarded. Finally, the result is fed back to the host computer.
5. The method for channel cascading and expansion of a multi-channel intelligent acquisition controller according to claim 2, characterized in that, In step S21, the handshake data packet includes: a downlink transmission direction of "0x10", a concatenation flag of "0xFF, 0x01", and a data field of "AT Connet" requesting a connection.
6. The method for channel cascading and expansion of a multi-channel intelligent acquisition controller according to claim 2, characterized in that, In step S22, the confirmed handshake data packet includes: the transmission direction is uplink "0x01", the concatenation flag is "0xFF, 0x02", and the data field is "AT ok" which requests a connection.
7. A storage medium, characterized in that, The system stores a program that, when executed by a processor, implements a method for channel cascading and expansion of a multi-channel intelligent acquisition controller as described in any one of claims 1-6.
8. A computing device, characterized in that, It includes a processor and a memory for storing processor-executable programs. When the processor executes the program stored in the memory, it implements the channel cascading and expansion method of a multi-channel intelligent acquisition controller according to any one of claims 1-6.
Citation Information
Patent Citations
A general master-slave controller system with cascaded communication
CN114935904A